Get Transaction
Returns a transaction and its challenge key by transaction_id. Use it when the Firebase push carrying the challenge key did not arrive.
Endpoint
http
POST /api/v1/saas-sotp/get-transaction
Content-Type: application/jsonjson
{
"partner_id": "{{partner_id}}",
"partner_key": "{{partner_key}}",
"token": "{{token}}",
"app_id": "{{app_id}}",
"transaction_id": "{{transaction_id}}"
}Parameters:
| Param | Type | Required | Default | Description |
|---|---|---|---|---|
partner_id | string | Yes | — | The partner id. |
partner_key | string | Yes | — | The partner key. |
token | string | Yes | — | The registration token generated by Register. |
app_id | string | Yes | — | The app name the transaction was created under. |
transaction_id | string | Yes | — | The unique transaction id on the partner side. |
Returns: GetTransactionResponse
Sample Request
bash
curl --location --request POST '<BASE_URL>/saas-sotp/get-transaction' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data-raw '{
"partner_id": "{{partner_id}}",
"partner_key": "{{partner_key}}",
"token": "{{token}}",
"app_id": "{{app_id}}",
"transaction_id": "{{transaction_id}}"
}'Response
json
{
"success": true,
"code": 1,
"message": "Success",
"challenge_key": "fake_challenge_key",
"transaction": {
"app_id": "app_00000001",
"transaction_id": "txn_00000001",
"transaction_desc": "Bank transfer",
"transaction_amount": "1000000",
"receiver_account": "190xxxxxxx",
"sender_account": "190xxxxxxx",
"currency": "VND",
"type": "transfer",
"transaction_date": "2022-10-04 12:00:00",
"created_at": "2023-03-03T10:49:50+07:00",
"transaction_metadata": "{\"test\":\"abc\"}"
}
}| Field | Type | Description |
|---|---|---|
success | bool | Request status. |
code | int | The status code — 1 on success. |
message | string | The status or error message. |
challenge_key | string | The challenge key used to generate an advance OTP. |
transaction.app_id | string | The app name the transaction was created under. |
transaction.transaction_id | string | The unique transaction id on the partner side. |
transaction.transaction_desc | string | The transaction description. |
transaction.transaction_amount | string | The transaction amount. |
transaction.transaction_date | string | The date the transaction was created. |
transaction.receiver_account | string | The receiver account id. |
transaction.sender_account | string | The sender account id. |
transaction.currency | string | The currency used to perform the transaction. |
transaction.type | string | The type of transaction, defined on the partner side. |
transaction.created_at | string | The time the transaction was stored in the database. |
transaction.transaction_metadata | string | Additional transaction information. |
Errors
| Code | Description |
|---|---|
3 | Parameter invalid |
103 | Thông tin Partner không chính xác — Partner details are incorrect. |
126 | Có lỗi xảy ra vui lòng thử lại — An error occurred, please retry. |
129 | Token không hợp lệ — Invalid token. |
190108 | Tài khoản chưa hoạt động — Account not activated. |
190203 | Không tìm thấy transaction — Transaction not found. |
Next Steps
- Get Latest Transaction — read the most recent transaction without knowing its id
- Validate OTP — verify the advance OTP