Create Payment
Request Method and Request Path
POST /payment/payin/v1/createPayment
Request Header
Field | Data Type | Mandatory | Description |
---|---|---|---|
content-type | string | Yes | Hard code with application/json |
x-api-key | string | Yes | Provided by Paydify , equals to appId |
x-api-timestamp | string | Yes | Current timestamp with millisecond |
x-api-signature | string | Yes | See Signature Mechanism |
Request Body
Field | Data Type | Mandatory | Description |
---|---|---|---|
appId | string(20) | Yes | Merchant app ID, Provided by Paydify |
mchTxnId | string(60) | Yes | Merchant order ID, a unique ID that is generated by the merchant |
txnAmount | string(20) | Yes | Order amount, 1 USDC can be transferred as 1 or 1.00 |
currency | string(8) | Yes | Payment currency, see Supported Chain and Currency |
checkoutMode | int | Yes | Checkout mode, hard code with 1 |
payMethod1 | string(20) | No | Wallet code, see Supported Wallet |
payMethod2 | string(20) | No | Payment chain, see Supported Chain and Currency |
notificationUrl | string(120) | No | Merchant's URL to receive status via Webhook Notification, http and https supported only |
successReturnUrl | string(120) | No | Merchant's URL to redirect users back to the merchant's page upon successful payment |
failReturnUrl | string(120) | No | Merchant's URL to redirect users back to the merchant's page upon failed payment |
pendingReturnUrl | string(120) | No | Merchant's URL to redirect users back to the merchant's page when the payment is payment |
source | string(20) | No | Origination location of the user |
txnTitle | string(30) | No | Product name that user is purchasing, the default value is App's name |
txnDesc | string(60) | No | Additional payment description |
accountInfo | object | No | Merchant's wallet address, e.g. {"address":"0xttttttt22222"} |
payerInfo | object | No | Payer's description, e.g. {"ip":"127.0.0.1","uid":123456} |
mchExtInfo | string(512) | No | Additional extended information, it will be passed back in the webhook without parsing (as-is) |
lifetime | int | No | Payment expiry time with millisecond, defaults to 30 mins if not provided |
Response Header
Field | Data Type | Mandatory | Description |
---|---|---|---|
x-api-key | string | Yes | Provided by Paydify , equals to appId |
x-api-timestamp | string | Yes | Current timestamp with millisecond |
x-api-signature | string | Yes | See Signature Mechanism |
Response Body
Field | Data Type | Description |
---|---|---|
status | int | Error status, 0 indicates success, non-0 indicates failure, see Error Status |
msg | string | Error description |
data.txnId | string | Order ID, a unique ID that is generated by Paydify |
data.mchTxnId | string | Merchant order ID |
data.state | string | Payment status, see Payment Status |
data.errorMsg | string | Reason of failure |
data.qrCode | string | Base64 encoded string, which is QR code data generated using payment link |
data.deeplink | string | Deeplink for payment |
data.httplink | string | HTTP URL for payment |
Examples
shell
# CURL
# Response Example of Success
{
"status": 0,
"msg": "success",
"data": {
"txnId": "2209141130105863014",
"mchTxnId": "220914xxx",
"state": "pending",
"errorMsg": "xxx",
"qrCode":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAL4AAACoCAYAAABe+//hGBxxxxxxxxxx",
"deeplink": "deeplink://x/pay?txnId=xyz",
"httplink": "https://x.x.com/pay.html?txnId=xyz"
}
}
# Response Example of Failure
{
"status": 9999,
"msg": "system error",
"data": null
}
# CURL
# Response Example of Success
{
"status": 0,
"msg": "success",
"data": {
"txnId": "2209141130105863014",
"mchTxnId": "220914xxx",
"state": "pending",
"errorMsg": "xxx",
"qrCode":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAL4AAACoCAYAAABe+//hGBxxxxxxxxxx",
"deeplink": "deeplink://x/pay?txnId=xyz",
"httplink": "https://x.x.com/pay.html?txnId=xyz"
}
}
# Response Example of Failure
{
"status": 9999,
"msg": "system error",
"data": null
}