Skip to main content

Order

You can create orders of one of the following types:

  • deposit - deposit
  • deposit_exchange - deposit with exchange
  • deposit_exchange_withdraw - deposit with exchange and withdrawal
  • exchange - exchange
  • exchange_withdraw - exchange with withdrawal
  • withdraw - withdrawal
Note

The request to create an order differs depending on the order type. However, the created orders have the same set of fields.

Request

POST /v2/order/deposit
POST /v2/order/deposit HTTP/1.1
Content-Type: application/json
Accept: application/json; charset=utf-8
Api-key: {publicApiKey}
Signature: {signature}
{
"order_id": "merchant_unique_order_id",
"currency": "usdt",
"network": "trc20", // card, btc, erc20 ...
"amount": 10,
"callback_url": "", //optional
"description": "order for ...", //optional
"client_info": { //optional
"client_id": "id1234",
"client_ip": "127.0.0.1",
"client_email": "[email protected]"
}
}

Description of parameters in the request:

  • order_id – Unique payment identifier in the merchant system
  • currency – Order currency
  • network – Deposit network, card for fiat currencies, blockchain name for cryptocurrencies
  • amount – Deposit amount
  • description – Order description (optional)
  • callback_url – URL address for server-to-server message about order execution result
  • client_info – customer data in the merchant system: identifier, IP, email

Response

warning

You should consider any non 200 or 400 HTTP status response as unexpected behavior. For example, if you are getting 5xx http status during withdrawal create request, you should treat this withdrawal as possibly created. You must check the status of this withdrawal by calling /v2/order/status

The success response object will contain a set of fields structured as follows:

RESPONSE
HTTP/1.1 200 OK
Content-Type: application/json

{
/* The overall status of the request, not the order status */
"status": "success",
"data": {
"order_uuid": "99c7f491-62ea-47fa-89c8-6043720374bf",
"order_type": "deposit",
"user_order_id": "merchant_unique_order_id",
"description": null,
"expected_amount_from": "10",
"amount_from": null,
"currency_from": "usdt",
"network_from": "trc20",
"deposit_from_user": null | "fpid-e03682a76e65",
"wallet_from": null,
"wallet_memo_from": null,
"expected_amount_to": "9.9",
"amount_to": null,
"strict_withdrawal_amount": false,
"currency_to": "usdt",
"network_to": "trc20",
"withdraw_to_user": null,
"wallet_to": null,
"wallet_memo_to": null,
"wallet_to_details": null,
"wallet_to_transactions": [],
"amount_from_fee": "0.1",
"amount_to_fee": null,
"deposit_url": null,
"deposit_address": "TT8y4xoTZ9yUL7FTqnC5z1Gb9ZTCvQDhHz",
"deposit_memo": null,
"deposit_address_title": null,
"deposit_address_initial_order_uuid": null,
"blockchain_deposit_hash": null,
"blockchain_withdrawal_hash": null,
"exchange_rate_initial": null,
"exchange_rate_actual": null,
"client_info": {
"client_id": "id1234",
"client_ip": "127.0.0.1",
"client_email": "[email protected]"
},
/* Order status */
"status": "new",
"error_code": 0,
"error_message": "",
"created_at": "1970-01-01 14:48:53",
"updated_at": "1970-01-01 14:48:54",
"finalized_at": null,
"start_order_at": null,
"currency_from_precision": 2,
"currency_to_precision": 2
}
}

Description of parameters in the response:

  • order_uuid – Order ID in the FlyPay system
  • order_type – Order type
  • user_order_id – Unique payment identifier in the merchant system
  • description – Order description
  • expected_amount_from – Expected deposit amount
  • amount_from – Actual deposit amount
  • currency_from – Deposit currency
  • network_from – Deposit network
  • deposit_from_user – User ID in the system FlyPay, if the replenishment is a result of a transfer, otherwise null
  • wallet_from – Wallet from which the deposit was made (card number or blockchain address)
  • wallet_memo_from – tag/memo of the address in the blockchain from which the deposit was made
  • expected_amount_to – Expected amount credited to the merchant balance
  • amount_to – Actual amount added to the merchant's balance
  • strict_withdrawal_amount – Used for exchanges with withdrawals
  • currency_to – Currency of crediting to the merchant balance
  • network_to – Payment network
  • withdraw_to_user – User ID in the system FlyPay, if the withdrawal is a result of a transfer, otherwise null
  • wallet_to – null
  • wallet_memo_to – null
  • wallet_to_details – Can only be used in withdrawal orders
  • wallet_to_transactions – Can only be used in withdrawal orders
  • amount_from_fee – Commission amount
  • amount_to_fee – null
  • deposit_url – The URL to which the client should be redirected to make a deposit
  • deposit_address – The address on the blockchain to which the deposit should be sent
  • deposit_memo – tag/memo of the address in the blockchain to which the deposit should be sent
  • deposit_address_title – The name of the deposit address, if it is a permanent deposit address, a name has been created for it
  • deposit_address_initial_order_uuid – order_uuid of the first order in the system where this deposit address was used, if any
  • blockchain_deposit_hash – Blockchain transaction hash for a completed cryptocurrency deposit
  • blockchain_withdrawal_hash – null
  • exchange_rate_initial – Expected exchange rate when creating an order (for orders with exchange)
  • exchange_rate_actual – Actual exchange rate (for orders with exchange)
  • statusOrder status (new)
  • error_code – Error code
  • error_message – Error message text
  • created_at – Date and time of order creation in the format "Y-m-d H:i:s"
  • updated_at – Date and time of order update in the format "Y-m-d H:i:s"
  • finalized_at – Date and time of order finalization in the format "Y-m-d H:i:s"
  • start_order_at – Used only for withdrawals, order execution start date and time in the format "Y-m-d H:i:s" | null
  • currency_from_precision – Deposit or exchange currency precision, number of decimal places
  • currency_to_precision – Withdrawal currency precision, number of decimal places