Skip to main content
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.

Request Parameters

ParameterTypeRequiredDescription
refTransIdstringConditionalTransaction ID from gateway (use this or myRef)
myRefstringConditionalYour custom reference (use this or refTransId)
paymentGatewayAccountNamestringConditionalStored gateway account name
paymentGatewayAccountobjectConditionalInline gateway credentials
certificateNamestringNoClient certificate if required
networkTokenBrandstringNoFor network tokens: Visa, MasterCard, or Amex

Response

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

Result Codes

operationResultCodeMeaning
SuccessTransaction found and status retrieved
RejectedTransaction not found or invalid reference
TemporaryFailureGateway temporarily unavailable
FatalFailureUnrecoverable error

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
  };
}

Response Codes

CodeDescription
200Status retrieved successfully
400Bad request - invalid parameters
401Not authenticated
409Transaction not found or rejected