Payment status

Query the final or in-progress state of a payment with:
GET /pay/api/payment/{checkoutSessionId}
Requires Bearer authentication with role VpayTerminal.

Response fields

FieldTypeDescription
totalTransactionAmountstringCharged amount
currencyCodestringISO currency code
transactionReferenceNumberstringYour merchant reference
authorizationCodestringProcessor authorization code (when approved)
stateintegerTransaction state enum value

Transaction states (state)

ValueNameMeaning
0NoneNo meaningful state yet
1SuccessfulPayment completed successfully
2FailedPayment failed or was declined
4ReviewedPaymentSessionSession reviewed
8InProcessProcessing in progress
16ApprovedTransactionTransaction approved
32ThreeDsFingerprintRequired3DS fingerprint step (in hosted UI)
64ThreeDsChallengeRequired3DS challenge step (in hosted UI)
128OnvoAuthenticationRequiredONVO authentication redirect (in hosted UI)

Interpreting results

For order fulfillment, treat these as success:
  • state: 1 (Successful)
  • state: 16 (ApprovedTransaction)
Treat as failure:
  • state: 2 (Failed)
While state is 8 (InProcess) or a 3DS-related value (32, 64, 128), the payer may still be on the hosted checkout. Retry the GET after a short delay or after your callback fires.

Example

curl -X GET "{sandboxBaseUrl}/pay/api/payment/a1b2c3d4-e5f6-7890-abcd-ef1234567890" \
  -H "Authorization: Bearer YOUR_TOKEN"
{
  "totalTransactionAmount": "1500.00",
  "currencyCode": "CRC",
  "transactionReferenceNumber": "ORDER-2026-001",
  "authorizationCode": "ABC123",
  "state": 1
}

Errors

HTTPCodeWhen
404VPAY_007Unknown checkoutSessionId
401Invalid or missing token
422VPAY_002Session does not exist in current context

Get payment API