Check transaction status
Check transaction status API
Endpoint: GET
/api/v2/orders/transaction
Header Params
Params | Requirement | Data type | Description | Note |
---|---|---|---|---|
X-APPOTAPAY-AUTH | required | String | To create a JWT_TOKEN | |
Content-Type | required | String | Value: application/json | |
X-Request-ID | optional | String | Format is UUIDv4. Request ID for troubleshooting purposes | max:40 |
X-Language | optional | String | Value vi or en ,The value corresponding to the payment link can be in Vietnamese or English (default: vi ) | in:vi,en |
X-Account-Ref-ID | optional | String | Iidentifier of the sub account provided by AppotaPay. Mandatory be passed over when processing payment for transactions of owner-type sub account |
{
"X-APPOTAPAY-AUTH": "JWT_TOKEN",
"Content-Type": "application/json",
"X-Request-ID": "Your_Unique_id",
"X-Language": "vi",
"X-Account-Ref-ID": "9723f73b-9295-4acb-884b-ab6310c2e653"
}
HTTP Request:
Params | Requirement | Data type | Description | Note |
---|---|---|---|---|
referenceId | required | String | Transaction reference code | alphanumeric |
type | optional | String | Transaction reference type
Default: |
In the case where type='TRANSACTION_ID', referenceId is the transaction code returned by AppotaPay to the partner
In case type=
PARTNER_ORDER_ID
, referenceId is the orderId code transmitted by the partner when creating a transaction
HTTP Response:
Params | Requirement | Data type | Description |
---|---|---|---|
transaction | required | Object | Transaction information |
transaction.transactionId | required | String | The transaction code on AppotaPay's side |
transaction.reconciliationId | optional | String | he settlement transaction code when the transaction is successful |
transaction.partnerCode | required | String | Partnercode |
transaction.status | required | String | [Transaction status](#Status code table) |
transaction.errorCode | required | Integer | Error code table |
transaction.errorMessage | required | String | Error description |
transaction.orderAmount | required | Integer | Order amount |
transaction.amount | required | Integer | The payment amount to the provider |
transaction.discountAmount | required | Integer | Discount amount |
transaction.currency | required | String | Currency unit |
transaction.bankCode | optional | String | Bankcode Selected by the customern |
transaction.paymentMethod | required | String | Payment method](./payment-code.md#Payment method code tablen) |
transaction.action | required | String | Type of payment |
transaction.fee | optional | Object | Payment fee |
transaction.fee.customer_fee | optional | String | Payment fee charged to the custome |
transaction.createdAt | required | String | Transaction creation time. (in RFC-3339 standard format) |
transaction.updatedAt | required | String | TTransaction update time. (in RFC-3339 standard format) |
partnerReference.order.id | required | String | Partner's order code |
partnerReference.order.info | required | String | Order information |
partnerReference.order.extraData | required | String | Optional additional information |
promotionInfo | optional | String | Promotion code information |
promotionInfo.id | required | String | Promotion code identifier |
promotionInfo.code | required | String | Promotion code |
cardInfo | optional | Object | Returned when the transaction is successful and there is card information |
cardInfo.cardNumber | required | String | Card/ Account number |
cardInfo.cardName | optional | String | Card/ Account name |
cardInfo.cardMonth | required | String | The month recorded on the card in DD format, e.g., 07 |
cardInfo.cardYear | required | String | The year recorded on the card, in YY format, e.g., 23 |
cardInfo.countryCode | optional | String | The country code consists of 2 characters according to ISO 3166-2 standard |
cardInfo.type | required | String | Payment type (card/account) |
installmentInfo | optional | Object | Returned when the transaction is installment payment and there is installment information |
installmentInfo.installmentTransactionId | optional | String | Installment transaction code |
installmentInfo.status | optional | String | Installment transfer status |
installmentInfo.statusCancel | optional | String | Installment cancellation status |
installmentInfo.bankCode | optional | String | Installment bank |
installmentInfo.errorCode | optional | Integer | Error code (returned when status != success) |
installmentInfo.errorMessage | optional | String | Error description (returned when status != success) |
installmentInfo.paymentAmount | optional | String | Total installment amount |
installmentInfo.payPerMonth | optional | String | Monthly installment amount |
installmentInfo.gracePeriod | optional | String | Installment term |
installmentInfo.approvalCode | optional | String | Issue bank transaction code |
installmentInfo.createdAt | optional | String | Installment transaction creation time. (in RFC-3339 standard format) |
installmentInfo.updatedAt | optional | String | Installment transaction update time. (in RFC-3339 standard format) |
installmentInfo.completedAt | optional | String | Installment transaction completion time. (in RFC-3339 standard format) |
tokenInfo | optional | Object | Saved token information |
tokenInfo.token | optional | String | Token code |
tokenInfo.status | optional | String | Token status |
tokenInfo.type | optional | String | Token type (CARD / ACCOUNT) |
tokenInfo.number | optional | String | Card/account number |
tokenInfo.holder_name | optional | String | Cardholder/account name |
tokenInfo.card_month | optional | String | Validity/expiration month on card |
tokenInfo.card_year | optional | String | Validity/expiration year on the card |
Status code table
Status | Description |
---|---|
pending | The transaction is pending processing. |
processing | The transaction is currently being processed. |
success | The transaction is successful. |
error | The transaction has failed. |
Example Response
{
"transaction": {
"transactionId": "AP231442984535",
"reconciliationId": "AP231442984535",
"partnerCode": "TEST",
"status": "pending",
"errorCode": 35,
"errorMessage": "Transaction is being processed, please check it later",
"orderAmount": 50000,
"amount": 50000,
"discountAmount": 0,
"currency": "VND",
"bankCode": "",
"paymentMethod": "ALL",
"action": "PAY",
"fee": {
"customer_fee": 0
},
"createdAt": "2023-11-27T14:46:20.000",
"updatedAt": "2023-11-27T14:46:20.000"
},
"partnerReference": {
"order": {
"id": "N8kOP8edZ",
"info": "test thanh toan",
"extraData": ""
}
},
"tokenInfo": {
"token": "1814074501511385",
"status": "active",
"type": "CARD",
"number": "400000-1091",
"holder_name": "",
"card_month": "03",
"card_year": "07"
},
"promotionInfo": null,
"cardInfo": null,
"installmentInfo": null
}
Error
HTTP Status Code !=
200
With the returned errorCode, please refer to the error code table here
Error response params
Params | Requirement | Data type | Description |
---|---|---|---|
errorCode | required | Integer | Error code |
message | required | String | Error description |
errors | optional | Array of Object | Detailed error description of each field if available |
errors.field | required | Object | Field with error |
errors.reason | required | Object | Description of the field with error |
{
"errorCode": 1,
"message": "Invalid Params",
"errors": [
{
"field": "transaction.amount",
"reason": "Field amount is required"
},
{
"field": "transaction.currency",
"reason": "Field currency is required"
}
]
}
Error code table
error code | Description |
---|---|
1 | Missing or invalid request information |
36 | The transaction does not exist |
500 | The system encountered an error, please try again later |