The Get Transaction Status API allows you to check the current status of a previously created payment intent. This endpoint is essential for tracking payment progress, monitoring transaction state changes, and providing real-time updates to your users.
Endpoint Details
/api/v0/payment-intents/:transactionId/status
Authentication : Required (API Key & Secret)
Rate Limiting : Standard rate limits apply
Authentication
All requests require API key authentication using the following headers:
x-client-key
: Your application’s client key
x-client-secret
: Your application’s client secret
Path Parameters
The transaction ID returned when creating the payment intent Example : "txn_01HZXK8M9N2P3Q4R5S6T7U8V9W"
Transaction Statuses
The API returns one of the following status values:
Status Description AWAITING_FUNDS Payment intent created, waiting for funds to be deposited IN_REVIEW Transaction is being reviewed for compliance or fraud prevention FUNDS_RECEIVED Funds have been successfully received PAYMENT_SUBMITTED Payment has been submitted for processing on the blockchain or banking network PAYMENT_PROCESSED Payment has been successfully processed and completed UNDELIVERABLE Payment could not be delivered to the destination RETURNED Payment was returned (e.g., invalid destination address) REFUNDED Payment has been refunded to the sender CANCELED Transaction was canceled before completion ERROR An error occurred during processing DISPUTED Transaction is under dispute or investigation
Request Examples
cURL
JavaScript/TypeScript
Python
PHP
curl -X GET "https://api.devdraft.ai/api/v0/payment-intents/txn_01HZXK8M9N2P3Q4R5S6T7U8V9W/status" \
-H "x-client-key: YOUR_CLIENT_KEY" \
-H "x-client-secret: YOUR_CLIENT_SECRET"
Success Response (200 OK)
{
"id" : "txn_01HZXK8M9N2P3Q4R5S6T7U8V9W" ,
"bridge_transfer_id" : "transfer_abc123xyz456" ,
"status" : "PAYMENT_PROCESSED" ,
"amount" : "100.00" ,
"source" : {
"payment_rail" : "ethereum" ,
"currency" : "usdc"
},
"destination" : {
"payment_rail" : "base" ,
"currency" : "eurc" ,
"to_address" : "0x742d35Cc6634C0532925a3b8D4C9db96c4b4d8e1"
},
"customer" : {
"first_name" : "John" ,
"last_name" : "Doe" ,
"email" : "john.doe@example.com" ,
"address" : "123 Main St, New York, NY 10001" ,
"phone_number" : "+1-555-123-4567"
},
"created_at" : "2023-07-01T12:00:00.000Z" ,
"updated_at" : "2023-07-01T12:30:00.000Z"
}
Response Fields
Unique transaction identifier in our database
External bridge service transfer ID for tracking
Current transaction status (see status table above)
Payment amount in the source currency
Source payment details Source payment rail or blockchain network
Destination payment details Destination payment rail or blockchain network
Destination currency code
Destination wallet address (if applicable)
Customer information (if provided during payment intent creation) Customer’s physical address
Transaction creation timestamp (ISO 8601 format)
Last update timestamp (ISO 8601 format)
Error Responses
401 Unauthorized
404 Not Found
{
"statusCode" : 401 ,
"message" : "Unauthorized - Invalid API credentials" ,
"error" : "Unauthorized"
}
Use Cases
Real-Time Status Updates
Implement polling or webhook-based status monitoring to provide real-time updates to your users:
class PaymentStatusMonitor {
constructor ( clientKey , clientSecret ) {
this . clientKey = clientKey ;
this . clientSecret = clientSecret ;
this . pollInterval = null ;
}
async pollStatus ( transactionId , callback , intervalMs = 5000 ) {
// Initial check
const initialStatus = await this . checkStatus ( transactionId );
callback ( initialStatus );
// Continue polling if not in terminal state
if ( ! this . isTerminalStatus ( initialStatus . status )) {
this . pollInterval = setInterval ( async () => {
const status = await this . checkStatus ( transactionId );
callback ( status );
if ( this . isTerminalStatus ( status . status )) {
this . stopPolling ();
}
}, intervalMs );
}
}
async checkStatus ( transactionId ) {
const response = await fetch (
`https://api.devdraft.ai/api/v0/payment-intents/ ${ transactionId } /status` ,
{
headers: {
'x-client-key' : this . clientKey ,
'x-client-secret' : this . clientSecret ,
},
}
);
if ( ! response . ok ) {
throw new Error ( `Failed to check status: ${ response . status } ` );
}
return response . json ();
}
isTerminalStatus ( status ) {
return [
'PAYMENT_PROCESSED' ,
'UNDELIVERABLE' ,
'RETURNED' ,
'REFUNDED' ,
'CANCELED' ,
'ERROR' ,
]. includes ( status );
}
stopPolling () {
if ( this . pollInterval ) {
clearInterval ( this . pollInterval );
this . pollInterval = null ;
}
}
}
// Usage
const monitor = new PaymentStatusMonitor ( 'your-key' , 'your-secret' );
monitor . pollStatus ( 'txn_01HZXK8M9N2P3Q4R5S6T7U8V9W' , ( status ) => {
console . log ( `Current status: ${ status . status } ` );
if ( status . status === 'PAYMENT_PROCESSED' ) {
console . log ( 'Payment completed successfully!' );
} else if ( status . status === 'ERROR' ) {
console . error ( 'Payment failed:' , status );
}
});
Best Practices
Polling Strategy
Recommended Polling Intervals: - Initial 5 minutes: Poll every 5 seconds -
After 5 minutes: Poll every 30 seconds - After 30 minutes: Poll every 2
minutes - Always stop polling when reaching a terminal status
Error Handling
Always implement robust error handling:
async function checkStatusWithRetry ( transactionId , maxRetries = 3 ) {
let lastError ;
for ( let i = 0 ; i < maxRetries ; i ++ ) {
try {
return await getTransactionStatus ( transactionId );
} catch ( error ) {
lastError = error ;
if ( error . status === 404 ) {
// Transaction not found - don't retry
throw error ;
}
// Wait before retry (exponential backoff)
await new Promise (( resolve ) =>
setTimeout ( resolve , 1000 * Math . pow ( 2 , i ))
);
}
}
throw lastError ;
}
Status Notifications
Notify users about important status changes:
const NOTIFY_STATUSES = [
"FUNDS_RECEIVED" ,
"PAYMENT_PROCESSED" ,
"ERROR" ,
"UNDELIVERABLE" ,
"RETURNED" ,
"REFUNDED" ,
];
function shouldNotifyUser ( status ) {
return NOTIFY_STATUSES . includes ( status );
}
async function monitorAndNotify ( transactionId , userEmail ) {
let previousStatus = null ;
const checkStatus = async () => {
const statusData = await getTransactionStatus ( transactionId );
if (
statusData . status !== previousStatus &&
shouldNotifyUser ( statusData . status )
) {
await sendNotification ( userEmail , statusData );
}
previousStatus = statusData . status ;
return statusData ;
};
return checkStatus ;
}
Support
For additional support or questions about the Get Transaction Status API:
Check our API status page for known issues
Review the error codes and messages in your responses
Contact our support team with your transaction ID for specific issues
Use our testing environment to validate integrations before going live