Przejdź do głównej zawartości

Get Payment Status

POST
/payments/status

Retrieves detailed information about a specific payment by its ID. This endpoint automatically checks for updates from the payment processor for pending or processing payments before responding.

Request Parameters

ParameterTypeDescription
transaction_id requiredstringThe unique identifier of the transaction to retrieve

Example Request

POST /payments/status
Content-Type: application/json
X-API-Key: your_api_key_here

{
"transaction_id": "550e8400-e29b-41d4-a716-446655440000"
}

Response Parameters

ParameterTypeDescription
transaction_idstringUnique identifier for the transaction
statusstringCurrent status of the payment (see Status Values table below)
payment_typestringType of payment based on amount received: "full", "partial", or "overpayment"
amount_usdnumberThe payment amount in USD
amount_cryptonumberThe payment amount in cryptocurrency
blockchainstringThe blockchain network used for the payment
tokenstringThe cryptocurrency token used for payment
addressstringThe cryptocurrency address for the payment
tx_hashstringThe blockchain transaction hash (if payment is confirming, confirmed, or completed)
created_atstringISO 8601 timestamp of when the payment was created
updated_atstringISO 8601 timestamp of when the payment was last updated
expiry_timestringISO 8601 timestamp of when the payment request expires
custom_idstringYour custom identifier for the payment (if provided)
customer_emailstringEmail address of the customer (if provided)
callback_urlstringURL for callback notifications (if provided)
callback_sentbooleanIndicates whether a callback notification has been sent
notesstringAdditional notes about the payment (if provided)

Example Response

{
"transaction_id": "550e8400-e29b-41d4-a716-446655440000",
"status": "completed",
"payment_type": "full",
"amount_usd": 100.00,
"amount_crypto": 0.05,
"blockchain": "ETH",
"token": "USDT",
"address": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
"tx_hash": "0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890",
"created_at": "2025-04-16T13:30:25.123Z",
"updated_at": "2025-04-16T14:45:30.456Z",
"expiry_time": "2025-04-16T14:30:25.123Z",
"custom_id": "ORDER-12345",
"customer_email": "customer@example.com",
"callback_url": "https://your-site.com/payment/callback",
"callback_sent": true,
"notes": null
}

Status Values

StatusDescription
pendingInitial state, waiting for payment
partially_paidSome funds received, but less than expected amount
confirmingFull payment received, waiting for blockchain confirmations
confirmedPayment has received the required number of confirmations
completedPayment has been fully confirmed and processed
failedPayment failed due to technical issues
expiredPayment time window has elapsed without receiving full payment

Payment Type Values

Payment TypeDescription
fullThe received amount matches the expected amount exactly
partialThe received amount is less than the expected amount
overpaymentThe received amount exceeds the expected amount

Webhook Events

When a payment status changes, a webhook notification is sent to your callback URL with the standardized event type payment_status_update. See our Implementing Webhook Callbacks guide for details.

Error Codes

Status CodeError CodeDescription
400invalid_requestThe request was malformed or missing required parameters
401authentication_failedAuthentication failed. Check your API key or OAuth 2.0 access token
403insufficient_permissionsYour API key does not have permission to view this payment
404transaction_not_foundTransaction with the specified ID was not found
429rate_limit_exceededYou have exceeded the rate limit for this endpoint
500payment_provider_errorAn error occurred when checking the payment status with the payment processor

Notes

  • This endpoint replaces the previous GET /payments/:paymentId endpoint.
  • When checking a payment with status pending, partially_paid, or confirming, this endpoint will automatically check for updates from the payment processor before responding.
  • The tx_hash field is only populated once a transaction has been identified on the blockchain.
  • The payment_type field helps identify whether the customer sent the exact amount, less than expected (partial payment), or more than expected (overpayment).
  • For completed payments, you can view the blockchain transaction details directly using a blockchain explorer by following the tx_hash.
  • Payments typically remain in the system for at least 30 days after completion or expiration.
  • The status values match those used in webhook notifications, providing a consistent status lifecycle across the API.

iGaming Integration Note

This endpoint is essential for online casino platforms to verify deposit confirmations. After a player initiates a deposit, periodically poll this endpoint to check the payment status and update the player's balance once the status becomes completed.