Pull Transaction Status API
API is used by the partner to pull the status of the transaction.
After customer scans QR code and approves payment in the Pyng app - transaction should be finalized within few seconds.
Suggested interval of calling API:
- every 5 seconds after the Create Payment Intent API call
URL path - /checkout/{siteId}/transaction-status
Method - GET
Request Headers
| Header Name | Header Value | Notes |
|---|---|---|
| Content-Type | application/json | |
| Authorization | Bearer access_token | Access token must have an appropriate scope to access resource |
Path Parameters
| Parameter Key | Parameter Data Type | Notes |
|---|---|---|
| siteId | string | Unique site id assigned to the Partner's site by Pyng |
Query parameters
| Parameter Key | Parameter Data Type | Required | Notes |
|---|---|---|---|
| paymentIntentId | string | Y | Unique id of the payment intent |
Response
Status Code - 200 OK
| Parameter Key | Parameter Data Type | Required | Notes |
|---|---|---|---|
| data | object | Y | object of TransactionStatusResponse type |
| traceId | string | Y | Unique identifier of the request |
TransactionStatusResponse
| Parameter Key | Parameter Data Type | Required | Notes |
|---|---|---|---|
| transactionId | string | N | Unique identifier of the transaction, assigned by Pyng. Available if customer has scanned QR code and started a payment. |
| transactionStatus | string | Y | One of TransactionStatusEnum |
| transactionStatusDescription | string | N | Additional information regarding the status of the transaction if available |
| transactionUpdated | integer | N | Unix timestamp indicating when transaction was last updated. Available if customer has scanned QR code and started a payment. |
| orderId | string | N | Available if partner passed orderId parameter to create payment intent |
TransactionStatusEnum
| Status | Final | Notes |
|---|---|---|
| Pending | N | Payment intent has been generated but customer hasn't scanned QR code. If QR Code has not been scanned in 60 seconds - Qr Code will expire |
| InProgress | N | Customer has scanned QR Code and started payment |
| Settled | Y | Transaction has been successfully settled with the retailer's financial institution |
| Declined | Y | Transaction has been declined or rejected by customer, customer financial institution or retailer financial institution |
| Expired | Y | QR code has not been scanned within 60 seconds and cannot be used anymore. New Qr Code has to be generated |
Examples
Request
GET /checkout/{siteId}/transaction-status?paymentIntentId={paymentIntentId} HTTP/1.1
Host: sample.pyng.com.au
Authorization: Bearer access_token
Response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
{
"data":
{
"transactionId": "bae2e821-7a31-7924-c030-de18a9abeea2",
"transactionStatus": "Settled",
"transactionUpdated": 1731821436160,
"transactionStatusDescription": "Insufficient Funds"
},
"traceId": "6b54f8d3-04eb-479b-9929-3645ce27dedc"
}