Skip to main content
{
  "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"
}
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

method
string
GET
url
string
/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

transactionId
string
required
The transaction ID returned when creating the payment intent
Example: "txn_01HZXK8M9N2P3Q4R5S6T7U8V9W"

Transaction Statuses

The API returns one of the following status values:
StatusDescription
AWAITING_FUNDSPayment intent created, waiting for funds to be deposited
IN_REVIEWTransaction is being reviewed for compliance or fraud prevention
FUNDS_RECEIVEDFunds have been successfully received
PAYMENT_SUBMITTEDPayment has been submitted for processing on the blockchain or banking network
PAYMENT_PROCESSEDPayment has been successfully processed and completed
UNDELIVERABLEPayment could not be delivered to the destination
RETURNEDPayment was returned (e.g., invalid destination address)
REFUNDEDPayment has been refunded to the sender
CANCELEDTransaction was canceled before completion
ERRORAn error occurred during processing
DISPUTEDTransaction is under dispute or investigation

Request Examples

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"

Response Format

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

id
string
Unique transaction identifier in our database
bridge_transfer_id
string
External bridge service transfer ID for tracking
status
string
Current transaction status (see status table above)
amount
string
Payment amount in the source currency
source
object
Source payment details
destination
object
Destination payment details
customer
object
Customer information (if provided during payment intent creation)
created_at
string
Transaction creation timestamp (ISO 8601 format)
updated_at
string
Last update timestamp (ISO 8601 format)

Error Responses

{
  "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:
  1. Check our API status page for known issues
  2. Review the error codes and messages in your responses
  3. Contact our support team with your transaction ID for specific issues
  4. Use our testing environment to validate integrations before going live
I