APIs Deposit
I. Create a deposit order
POST /v1/api/order/create
HTTP Body Request
Attribute | Madatory | Data Type | Description |
---|---|---|---|
requestId | ✔️ | String | Merchant's request identifying string |
requestTime | ✔️ | Long | Time of sending request. Miliseconds |
requestType | ✔️ | String | Identify request type. Value: createOrder |
orderId | ✔️ | String | Merchant's order ID |
accountId | ✔️ | String | Customer's ID of merchant |
amount | ✔️ | Double | Deposit amount in USDT as default. Notice: This just Suggest amount and maybe not match with customer's deposit amount. |
type | ✔️ | String | Command code. Value deposit |
network | String | Network: Current supported value BSC (default) | |
redirectUrl | String | URL is structured by partner. FastPay uses this URL to navigate from FastPay's website to partner's buying page after customer finishes payment processing. View detail | |
ipnUrl | String | URL is structured by partner. FastPay uses this URL to notify to merchant's server when order process. View detail | |
signature | ✔️ | String | Checksum signature. View detail |
Request Example:
{
"requestId": "3c4025f7-ad5f-4738-a28b-1d679b1a0807",
"requestType": "createOrder",
"requestTime": 1721718821,
"orderId": "deposit:spot:1721718821",
"accountId": "demouser",
"network": "BSC",
"type": "deposit",
"redirectUrl": "https://webhook.site/cd178d6d-17b8-4394-af9b-a9d58b1de161",
"lang": "vi",
"signature": "32d0076d74517f33daad1dbc42ba51718016d3416dda534224d84f867832f3fdfd7e57e9aa544ff526708e6b4e6a5d41441980d79040e99fbfb1b3d7d6b3dde3"
}
HTTP Body Response of Json 'detail'
View Order Response Object for detail
II. Proceed deposit
User use crypto wallet to scan qr code or navigate to wallet address to deposit.
III. Deposit result processing
After customer deposits, we will notify the payment result to merchant with body as below via two methods: Redirect and IPN.
Notify General Response
Attribute | Mandatory | Data Type | Description |
---|---|---|---|
fpTxnId | ✔️ | String | FastPay's code order |
orderId | ✔️ | String | Merchant's order ID. This is correspond with orderId from request |
originalAmount | ✔️ | Double | Customer's amount |
totalAmount | ✔️ | Double | Customer's net amount |
feeAmount | ✔️ | Double | Amount Fee is paid by user. Calculate by fee |
fee | ✔️ | Double | Percent Fee is paid by user (%) |
status | ✔️ | String | Order status. - init: Initial - processing: Processing - completed : Completed - cancelled: Cancelled |
txid | String | Blockchain transaction ID when order status is completed | |
transactionTime | Long | Time of txid that show the transaction has been success (Timestamp Milliseconds) | |
responseTime | ✔️ | Long | Time FastPay sent Request (Timestamp Milliseconds) |
type | ✔️ | String | Command type from request. Value: deposit or withdraw |
ticker | ✔️ | String | Ticker pair |
exchangeRate | String | Exchange rate | |
exchangeAmount | String | Exchange amount | |
exchangeUnit | String | Exchange unit | |
signature | ✔️ | String | Checksum signature. View detail |
1. Interface (Redirect)
Customer will be navigated from FastPay payment page to partner buying page automatically base on attribute redirectURL, which was transmitted by merchant while creating order more over the attribute is attached to redirectUrl
which have params type:
Method: GET
Example:
{YOUR_REDIRECT_URL}?originalAmount=1.0&refOrderId=1721744838064&signature=1c4ddd2660cd04050b13a3052cd40eeb5816300cdd96589dabbfc3999781837a30721f98a91548acf7c2e6627e0f9954d610ad9a92da04c3aba7b1a8557be39e&status=cancelled&ticker=USDT&totalAmount=0.9986&type=deposit
2. Server to Server
Table below describes information that FastPay respond to partner using ipnUrl
Method: POST
HTTP Header
Attribute | Mandatory | Data Type | Description |
---|---|---|---|
Content-Type | ✔️ | String | application/json;charset=UTF-8 |
Example:
{
"fpTxnId": "11718132",
"responseTime": 1721718881532,
"transactionTime": 1721718881532,
"txid": "0xad1sxet456dgdcfhn56786gn",
"totalAmount": 0.001997,
"originalAmount": 0.002,
"feeAmount": 0.000003,
"fee": 0.0015,
"type": "deposit",
"orderId": "deposit:spot:1721718821",
"exchangeRate": "1",
"exchangeAmount": "0.001997",
"exchangeUnit": "bUSDC",
"ticker": "USDT/VND",
"status": "completed",
"signature": "3c7db8ca15d9875f16e14672b8d4bacde615551a48c71fa3e85d819bfaa37c60ddfebc883aa68b653ee8aea1335ae335e8e3f32a6055cb58c4b7de53c6657b00"
}
Important notice!
-
Make sure that merchant already checked merchant's signature and order status before update transaction status.
-
Always handle transaction by Server-To-Server method to avoid payment with closing browser error or can not navigate from Momo to buying page.
In case can not process with Server-To-Server method, merchant can use FastPay's APIs query to check order status.