Skip to main content

Order Status Transition

POST /papi/v1/ramp/connect/sandbox/order-status-transition

The Order Status Transition API allows merchants to manually transition order statuses in the sandbox environment for testing purposes. This API simulates various order state changes without requiring actual payment processing or blockchain transactions. Refer to the order status list 7.order-status.md

Request Body​

FieldTypeMandatoryRemarks
externalOrderIdstringYesThe unique order id from the partner side. Supports only letters and numbers.
targetStatusintYesThe target status to transition to. Must be a positive integer.

Response Body​

FieldTypeRemarks
successbooleanIndicates if the request succeeded
codestringResponse code
messagestringResponse message

The API supports different status transitions based on the order type and business type. Below are the supported transitions:

1. BUY Orders (FIAT/P2P Business Type)​

For Regular Withdraw Orders:​

Target Status CodeStatus NameDescription
2ON_RAMP_COMPLETEDpurchase crypto completed successfully
11WITHDRAW_PROCESSINGWithdrawal is being processed
96WITHDRAW_ABANDONEDWithdrawal was abandoned
97ON_RAMP_FAILEDpurchase crypto failed
98WITHDRAW_FAILEDWithdrawal failed
20COMPLETEDOrder fully completed

For Swap Orders (Buy Any Token):​

Target Status CodeStatus NameDescription
2ON_RAMP_COMPLETEDpurchase crypto completed successfully
15SWAP_PROCESSINGToken swap is being processed
93SWAP_ABANDONEDToken swap was abandoned
94SWAP_FAILEDToken swap failed
97ON_RAMP_FAILEDpurchase crypto failed
20COMPLETEDOrder fully completed

2. BUY Orders (CONVERT Business Type)​

Target Status CodeStatus NameDescription
4CONVERT_COMPLETEDCrypto conversion completed successfully
11WITHDRAW_PROCESSINGWithdrawal is being processed
92CONVERT_FAILEDCrypto conversion failed
96WITHDRAW_ABANDONEDWithdrawal was abandoned
98WITHDRAW_FAILEDWithdrawal failed
20COMPLETEDOrder fully completed

3. SEND Orders (Send Crypto)​

Target Status CodeStatus NameDescription
20COMPLETEDCrypto sent successfully
98WITHDRAW_FAILEDCrypto send failed

Status Transition Flow​

BUY Order (FIAT/P2P) - Regular Flow​

INIT(0) → ON_RAMP_PROCESSING(1) → ON_RAMP_COMPLETED(2) → WITHDRAW_PROCESSING(11) → COMPLETED(20)

BUY Order (FIAT/P2P) - Swap Flow​

INIT(0) → ON_RAMP_PROCESSING(1) → ON_RAMP_COMPLETED(2) → SWAP_PROCESSING(15) → COMPLETED(20)

BUY Order (CONVERT) Flow​

INIT(0) → CONVERT_PROCESSING(3) → CONVERT_COMPLETED(4) → WITHDRAW_PROCESSING(11) → COMPLETED(20)

SEND Order Flow​

INIT(0) → WITHDRAW_PROCESSING(11) → COMPLETED(20)

Example 1: Transition order to completed status​

Request Parameters:

{
"externalOrderId": "946972922319",
"targetStatus": 11
}

Response:

{
"success": true,
"code": "000000",
"message": "success",
"data": null
}

Example 2: Transition order to pending status​

Request Parameters:

{
"externalOrderId": "946972922320",
"targetStatus": 20
}

Response:

{
"success": true,
"code": "000000",
"message": "success",
"data": null
}

Example 3: Transition order to failed status​

Request Parameters:

{
"externalOrderId": "946972922321",
"targetStatus": 40
}

Response:

{
"success": true,
"code": "000000",
"message": "success",
"data": null
}