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
| Parameter | Type | Required | Description |
|---|
refTransId | string | Conditional | Transaction ID from gateway (use this or myRef) |
myRef | string | Conditional | Your custom reference (use this or refTransId) |
paymentGatewayAccountName | string | Conditional | Stored gateway account name |
paymentGatewayAccount | object | Conditional | Inline gateway credentials |
certificateName | string | No | Client certificate if required |
networkTokenBrand | string | No | For 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
operationResultCode | Meaning |
|---|
Success | Transaction found and status retrieved |
Rejected | Transaction not found or invalid reference |
TemporaryFailure | Gateway temporarily unavailable |
FatalFailure | Unrecoverable 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
| Code | Description |
|---|
200 | Status retrieved successfully |
400 | Bad request - invalid parameters |
401 | Not authenticated |
409 | Transaction not found or rejected |