Webhooks
Introduction
The notify payloads AlchemyPay will be posted to the callbackUrl when on/off ramp
Http method
- POST merchant defined api
- Content-Type: application/json
On-ramp Callback
Element | Data Type | Remarks |
---|---|---|
appId | string | partner unique ID, once a merchant has been on-boarded with Alchemy Pay, the merchant will be provided with the credentials with appId and appSecret |
orderNo | string | Alchemy Pay order ID |
string | end user's email | |
crypto | string | crypto type |
cryptoPrice | string | crypto price |
cryptoQuantity | string | crypto amount |
payType | string | fiat payment method |
fiat | string | fiat type |
amount | string | fiat amount |
payTime | string | fiat payment time |
network | string | crypto network |
address | string | crypto address |
txTime | string | crypto received time |
txHash | string | crypto hash |
status | string | Order status:PAY_FAIL、PAY_SUCCESS、FINISHED Selling crypto status:Paying:request paying success, Pay Success:pay success |
message | string | fait payment failed cause |
merchantOrderNo | string | merchant order ID |
networkFee | string | crypto network fee |
rampFee | string | ramp fee |
signature | string | callback signature, the generated signature string is: getMersign(appId,appSecret, appId+orderNo+crypto+network+address) #getMersign is the sign function for Initiate API |
On-ramp Payload sample
{
"amount":"311.00000000",
"orderNo":"1004509256035020800",
"address":"0xdc8853549de541909cbedb8c55be4******eec5",
"payTime":"2022-08-04 06:30:03",
"txTime":"",
"networkFee":"",
"message":"Declined by 3-D Secure",
"merchantOrderNo":"",
"crypto":"USDC",
"network":"MATIC",
"cryptoPrice":"",
"payType":"CREDIT_CARD",
"rampFee":"12.89064997",
"cryptoQuantity":"",
"appId":"jcudotl1hwyvxhdp",
"fiat":"EUR",
"txHash":"",
"email":"[email protected]",
"status":"PAY_FAIL", //PAY_SUCCESS PAY_FAIL FINISHED
"signature":"ffaa29ee7f75cb52598fe460295caafa3ebcb549"
}
On-ramp callback status
Status | Description |
---|---|
PAY_SUCCESS | Fiat payment success |
PAY_FAIL | Fiat payment fail |
FINISHED | Transfered token, order complete |
Off-ramp Callback
Element | Data Type | Remark |
---|---|---|
orderNo | Alchemy Pay order ID | |
address | Order's crypto recipient address | |
payTime | The time when ACH starts to transfer fiat to user's account | |
completeTime | The time when this order receives the cryptos | |
merchantOrderNo | Merchant order No | |
crypto | Crypto name | |
network | Network of crypto | |
cryptoPrice | Crypto price in fiat type | |
cryptoAmount | Order's crypto amount | |
fiatAmount | The fiat amount user will receive, excluding ramp fee | |
appId | appID | |
fiat | fiat typr | |
txHash | Token transfered txHash | |
User's email | ||
signature | callback signature, the generated signature string is: getMersign(appId,appSecret, appId+orderNo+crypto+network+address) #getMersign is the sign function for Initiate API | |
status | Order status | |
orderAddress | Url to order detail page | |
cryptoacturalAmount | Actual received crypto amount | |
rampfee | Ramp fee, based on fiat type | |
receiptTime | Fiat arrived time | |
paymentType | card: transfer to user's card account: transfer to user's account | |
name | Name of the card/account | |
card | Card number: display 6 digit head and 4 digit tail 121321*1231 | |
account | 账户信息,展示后四位,****1231 Account number: display 4 digit tail *1231 | |
failReason | Fail reason |
Off-ramp Payload sample
{
"orderNo": "1080106145537236992",
"address": "dev03dc84dbfeb74853aa91154efa9b7a13", // wallet address user need to transfer
"payTime": "2023-02-28 20:44:46", // transfer fiat start time
"completeTime": "2023-02-28 20:41:08", // block confirm time
"merchantOrderNo": "kvhl6zvvrg",
"crypto": "USDT",
"network": "TRX",
"cryptoPrice": "1.0000000000", // fiat
"cryptoAmount": "100.0000000000",
"fiatAmount": "100.0000000000", //fiat amount user will receive
"appId": "ahzxh0klegv1fzol",
"fiat": "USD",
"txHash": "sdasdasdasdasdasdsad",
"email": "[email protected]",
"signature": "9aa9b34e950061f1bb1e9ccd6fadcedab8e354f6",
"status": "4", // 1:create order success 2:user trnasfered token 3:start to pay fiat to user 4:payment success 5:payment fail 6:refund success 7:order expired
"orderAddress": "https://ramp-dev.alchemytech.cc/#/sellOrder?sellOrderId\u003d1080106145537236992", // order detail page
"cryptoActualAmount": "100.0000000000", //
"rampFee": "1.7500000000", // fiat
"receiptTime": "2023-02-28 20:45:22", //transfer fiat success time
"paymentType": "10001", // 10001 banktransfer
"name": "asdfsfsd", // account name
"account": "******4567", // account number
"card": "", // card No
"failReason": "" // failReason
}
Off-ramp callback status
Status | Description |
---|---|
1 | Create order success |
2 | User trnasfered token |
3 | Start to pay fiat to user |
4 | Payment success |
5 | Payment fail |
6 | Refund success |
7 | Order expired |
Updated 23 days ago