Skip to main content

APIs Deposit

I. Create a deposit order

POST /v1/api/order/create

HTTP Body Request

AttributeMadatoryData TypeDescription
requestId✔️StringMerchant's request identifying string
requestTime✔️LongTime of sending request. Miliseconds
requestType✔️StringIdentify request type. Value: createOrder
orderId✔️StringMerchant's order ID
accountId✔️StringCustomer's ID of merchant
amount✔️DoubleDeposit amount in USDT as default.
Notice: This just Suggest amount and maybe not match with customer's deposit amount.
type✔️StringCommand code. Value deposit
networkStringNetwork: Current supported value BSC (default)
redirectUrlStringURL 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
ipnUrlStringURL is structured by partner. FastPay uses this URL to notify to merchant's server when order process. View detail
signature✔️StringChecksum 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

AttributeMandatoryData TypeDescription
fpTxnId✔️StringFastPay's code order
orderId✔️StringMerchant's order ID. This is correspond with orderId from request
originalAmount✔️DoubleCustomer's amount
totalAmount✔️DoubleCustomer's net amount
feeAmount✔️DoubleAmount Fee is paid by user. Calculate by fee
fee✔️DoublePercent Fee is paid by user (%)
status✔️StringOrder status.
- init: Initial
- processing: Processing
- completed : Completed
- cancelled: Cancelled
txidStringBlockchain transaction ID when order status is completed
transactionTimeLongTime of txid that show the transaction has been success (Timestamp Milliseconds)
responseTime✔️LongTime FastPay sent Request (Timestamp Milliseconds)
type✔️StringCommand type from request. Value: deposit or withdraw
ticker✔️StringTicker pair
exchangeRateStringExchange rate
exchangeAmountStringExchange amount
exchangeUnitStringExchange unit
signature✔️StringChecksum 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

AttributeMandatoryData TypeDescription
Content-Type✔️Stringapplication/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.