import { getPaymentStatus } from '@base-org/account';

const status = await getPaymentStatus({
  id: "0xabcd1234...",
  testnet: false
});

console.log("Payment status:", status.status);
{
  status: "completed",
  id: "0xabcd1234...",
  message: "Payment completed successfully",
  sender: "0x742d35Cc4Bf53E0e6C42E5d9F0A8D2F6D8A8B7C9",
  amount: "10.50",
  recipient: "0x1234567890123456789012345678901234567890"
}
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.

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.
import { getPaymentStatus } from '@base-org/account';

const status = await getPaymentStatus({
  id: "0xabcd1234...",
  testnet: false
});

console.log("Payment status:", status.status);
{
  status: "completed",
  id: "0xabcd1234...",
  message: "Payment completed successfully",
  sender: "0x742d35Cc4Bf53E0e6C42E5d9F0A8D2F6D8A8B7C9",
  amount: "10.50",
  recipient: "0x1234567890123456789012345678901234567890"
}

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.