Skip to main content
This page is part of the REST API Guides. Using the JavaScript library instead? See Payments Library Guides.
Prerequisites: API key, Payment Gateway Account, and an existing transaction ID. Query the status of a previously submitted charge or authorization. Useful for reconciliation and handling timeout scenarios. Endpoint: POST /PaymentGateway/status

Check by Transaction ID

Look up a transaction using the gateway’s transaction ID (returned from charge/authorize):
const response = await fetch('https://api.orchestrasolutions.com/PaymentGateway/status', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'X-Api-Key': 'YOUR_API_KEY'
  },
  body: JSON.stringify({
    refTransId: 'txn_abc123',
    paymentGatewayAccountName: 'stripe-production'
  })
});

const result = await response.json();

Check by Your Reference

Look up a transaction using your custom reference (myRef from the original request):
const response = await fetch('https://api.orchestrasolutions.com/PaymentGateway/status', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'X-Api-Key': 'YOUR_API_KEY'
  },
  body: JSON.stringify({
    myRef: 'order-12345',
    paymentGatewayAccountName: 'stripe-production'
  })
});
Using myRef requires that you passed a custom reference when creating the original transaction.

Status API Reference

Complete parameter reference for status requests

Response

{
  "operationType": "Status",
  "operationResultCode": "Success",
  "operationResultDescription": "Transaction found",
  "gatewayName": "Stripe",
  "gatewayReference": "txn_abc123",
  "gatewayResultCode": "succeeded",
  "gatewayResultDescription": "Payment completed",
  "amount": 25.00,
  "currency": "USD"
}

Use Cases

Handling Timeouts

If a charge request times out, check the status before retrying to avoid duplicate charges:
async function chargeWithRetry(chargeData) {
  try {
    const response = await fetch('https://api.orchestrasolutions.com/PaymentGateway/charge', {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
        'X-Api-Key': 'YOUR_API_KEY'
      },
      body: JSON.stringify({
        ...chargeData,
        myRef: `order-${Date.now()}`  // Always include a reference
      }),
      signal: AbortSignal.timeout(30000)
    });
    return await response.json();
  } catch (error) {
    if (error.name === 'TimeoutError') {
      // Check if the transaction went through
      const status = await fetch('https://api.orchestrasolutions.com/PaymentGateway/status', {
        method: 'POST',
        headers: {
          'Content-Type': 'application/json',
          'X-Api-Key': 'YOUR_API_KEY'
        },
        body: JSON.stringify({
          myRef: chargeData.myRef,
          paymentGatewayAccountName: chargeData.paymentGatewayAccountName
        })
      });
      return await status.json();
    }
    throw error;
  }
}

Daily Reconciliation

Verify transaction statuses against your records:
async function verifyTransaction(transactionId, gatewayAccount) {
  const response = await fetch('https://api.orchestrasolutions.com/PaymentGateway/status', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'X-Api-Key': 'YOUR_API_KEY'
    },
    body: JSON.stringify({
      refTransId: transactionId,
      paymentGatewayAccountName: gatewayAccount
    })
  });

  const result = await response.json();
  return {
    found: result.operationResultCode === 'Success',
    status: result.gatewayResultCode,
    amount: result.amount
  };
}