Skip to main content
Defined in the Base Account SDK
The getPaymentStatus function allows you to check the status of a payment transaction after it has been submitted. Use this to track whether a payment has been completed, is still pending, or has failed.Try it out: Test the getPaymentStatus function interactively in our Base Pay SDK Playground.

Parameters

id
string
required
Transaction hash from the pay result that you want to check the status of.Pattern: ^0x[0-9a-fA-F]{64}$
testnet
boolean
Must match the testnet setting used in the original pay call. Default: false

Returns

result
PaymentStatus
Payment status information including current state and details.

Error Handling

The getPaymentStatus function can throw errors for:
  • Invalid transaction ID format
  • Network connection issues
  • Transaction not found
Always wrap calls to getPaymentStatus in a try-catch block to handle these errors gracefully.