Order and User status simulation
The TransFi Sandbox includes a set of Simulation APIs that let you drive your integration end-to-end without waiting for real-world events. Instead of waiting for a user to complete a bank transfer or a KYC provider to return a decision, you can call a simulation endpoint to instantly move an order or a user to any target status — and have the corresponding webhook fired automatically.
Note: All simulation endpoints are strictly for the Sandbox environment and require a valid MID header in every request.
Simulate Order Status Update
Use this endpoint to move an existing order (or prefund) to a target status. The update is accepted asynchronously — your request returns immediately with a 202 Accepted, and the status transitions (including any intermediate states) are applied in the background with webhooks fired at each step.
Request
curl --location 'https://sandbox-api.transfi.com/v3/simulation/order' \
--header 'MID: YOUR_MID' \
--header 'Content-Type: application/json' \
--header 'Authorization: ******' \
--data '{
"orderId": "OR-2603130504320558904",
"status": "fund_settled"
}'Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
orderId | String | Yes | The ID of the order or prefund to update. Prefund IDs begin with PF-; order IDs begin with OR-. |
status | String | Yes | The target status to simulate. See the table below for allowed values per order type. |
errorCode | String | No | An optional error code to attach when simulating a failure or review status. See error code table. |
Allowed Statuses by Order Type
The statuses you can simulate depend on the order's type and fund flow. The simulation engine automatically fires all intermediate status events to reach the target state.
| Order Type | Fund Flow | Allowed Target Statuses |
|---|---|---|
payin | fiat | fund_settled, fund_failed, manual_review, expired |
payout | fiat | fund_settled, fund_failed, manual_review |
fiat_prefund | — | fund_settled, completed, fund_failed, manual_review, expired |
payin | crypto | asset_settled, expired |
payout | crypto | asset_deposited |
crypto_prefund | — | completed, expired |
buy | fiat_to_crypto | fund_deposited, fund_deposit_failed, manual_review, asset_settled, asset_settle_failed, expired |
sell | crypto_to_fiat | asset_deposited, fund_settled, fund_failed, manual_review, expired |
swap | fiat_to_fiat | fund_deposited, fund_deposit_failed, manual_review, fund_settled, fund_failed, expired |
swap | crypto_to_crypto | asset_deposited, asset_settled, asset_settle_failed, expired |
Gaming order types are not supported for simulation.
Allowed Error Codes
Error codes are only valid for certain failure and review statuses. Passing errorCode for any other status will return a 400 error. If you omit errorCode for a status that supports one, the default code listed below is used.
| Error Code | Applicable Status | Description |
|---|---|---|
PAYMENT_NOT_COMPLETED | fund_deposit_failed, fund_failed | User cancelled the payment or did not complete within the session. |
NAME_NOT_MATCHED | fund_deposit_failed, fund_failed | User name on the sender's bank account did not match TransFi records. |
BEHAVIORAL_CHECK_FAILED | fund_deposit_failed, fund_failed | Biometric check of the user's device failed. |
AMOUNT_MISMATCH | fund_deposit_failed, fund_failed | The payment amount does not match the expected amount. |
AUTHENTICATION_FAILED | fund_deposit_failed, fund_failed | User authentication failed. |
BANK_ACCOUNT_ALREADY_IN_USE | fund_deposit_failed, fund_failed | This bank account is already linked to another user. |
BANK_UNDER_MAINTENANCE | fund_deposit_failed, fund_failed | There was a technical issue with the bank. |
DECLINED_BY_BANK | fund_deposit_failed, fund_failed | Bank declined the transaction. |
INVALID_ACCOUNT_DETAILS | fund_deposit_failed, fund_failed | The provided account details are invalid. |
OTHERS | fund_deposit_failed, fund_failed | An unexpected error occurred. |
TRANSACTION_FAILED | asset_settle_failed | Transaction has failed. |
VALIDATION_FAILED | asset_settle_failed | Validation has failed for the transaction. |
OTHERS | asset_settle_failed | An unexpected error occurred. |
BEHAVIORAL_CHECK_IN_REVIEW | manual_review | Biometric check of the user's device is under review. |
NAME_NOT_MATCHED | manual_review | User name on the sender's bank account did not match TransFi records. |
TRANSACTION_EXPIRED | expired | Payment was not completed within the time limit. |
Response
{
"status": "success",
"data": {
"message": "Order status update accepted for processing",
"code": "ORDER_STATUS_UPDATE_ACCEPTED"
}
}For the full API specification, see Simulate Order Status Update.
Simulate User Status Update
Use this endpoint to move an existing user to a target KYC or KYB status. This immediately updates the user's record and fires the corresponding webhook — useful for testing downstream flows that depend on a specific verification outcome.
Request
curl --location 'https://sandbox-api.transfi.com/v3/simulation/user' \
--header 'MID: YOUR_MID' \
--header 'Content-Type: application/json' \
--header 'Authorization: ******' \
--data '{
"userId": "UX-260108160852530",
"status": "kyc_success"
}'Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
userId | String | Yes | The ID of the user to update. Must begin with UX-. |
status | String | Yes | The target status to simulate. See the tables below for allowed values per user type. |
Allowed Statuses — Individual Users
| Status | Description |
|---|---|
user_created | User account has been created in TransFi. |
user_approved | User account has been approved at basic screening level. |
user_rejected | User account has been rejected. |
kyc_initiated | KYC process has been initiated for the user. |
kyc_pending | KYC submission is pending verification. |
kyc_success | User has been successfully verified. |
kyc_failed | User was unable to verify their KYC documents. |
kyc_manual_review | KYC is under manual compliance review. |
kyc_rejected | KYC has been rejected; user cannot transact. |
kyc_blocked | KYC has been blocked; user cannot transact. |
kyc_expired | User's KYC document has expired and requires renewal. |
Allowed Statuses — Business / Organization Users
| Status | Description |
|---|---|
user_created | Business user account has been created in TransFi. |
user_approved | Business user account has been approved at basic screening level. |
user_rejected | Business user account has been rejected. |
kyb_initiated | KYB process has been initiated for the business. |
kyb_pending | KYB submission is pending verification. |
kyb_success | Business has been successfully verified. |
kyb_failed | Business was unable to verify their KYB documents. |
kyb_manual_review | KYB is under manual compliance review. |
kyb_rejected | KYB has been rejected; business cannot transact. |
kyb_blocked | KYB has been blocked; business cannot transact. |
kyb_expired | Business's KYB documents have expired and require renewal. |
Response
{
"status": "success",
"message": "User status updated successfully"
}For the full API specification, see Simulate User Status Update.
Updated 2 days ago