Skip to content

Create Payment

Request Method and Request Path

POST /payment/payin/v1/createPayment

Request Header

FieldData TypeMandatoryDescription
content-typestringYesHard code with application/json
x-api-keystringYesProvided by Paydify, equals to appId
x-api-timestampstringYesCurrent timestamp with millisecond
x-api-signaturestringYesSee Signature Mechanism

Request Body

FieldData TypeMandatoryDescription
appIdstring(20)YesMerchant app ID, Provided by Paydify
mchTxnIdstring(60)YesMerchant order ID, a unique ID that is generated by the merchant
txnAmountstring(20)YesOrder amount, 1 USDC can be transferred as 1 or 1.00
currencystring(8)YesPayment currency, see Supported Chain and Currency
checkoutModeintYesCheckout mode, hard code with 1
payMethod1string(20)NoWallet code, see Supported Wallet
payMethod2string(20)NoPayment chain, see Supported Chain and Currency
notificationUrlstring(120)NoMerchant's URL to receive status via Webhook Notification, http and https supported only
successReturnUrlstring(120)NoMerchant's URL to redirect users back to the merchant's page upon successful payment
failReturnUrlstring(120)NoMerchant's URL to redirect users back to the merchant's page upon failed payment
pendingReturnUrlstring(120)NoMerchant's URL to redirect users back to the merchant's page when the payment is payment
sourcestring(20)NoOrigination location of the user
txnTitlestring(30)NoProduct name that user is purchasing, the default value is App's name
txnDescstring(60)NoAdditional payment description
accountInfoobjectNoMerchant's wallet address, e.g. {"address":"0xttttttt22222"}
payerInfoobjectNoPayer's description, e.g. {"ip":"127.0.0.1","uid":123456}
mchExtInfostring(512)NoAdditional extended information, it will be passed back in the webhook without parsing (as-is)
lifetimeintNoPayment expiry time with millisecond, defaults to 30 mins if not provided

Response Header

FieldData TypeMandatoryDescription
x-api-keystringYesProvided by Paydify, equals to appId
x-api-timestampstringYesCurrent timestamp with millisecond
x-api-signaturestringYesSee Signature Mechanism

Response Body

FieldData TypeDescription
statusintError status, 0 indicates success, non-0 indicates failure, see Error Status
msgstringError description
data.txnIdstringOrder ID, a unique ID that is generated by Paydify
data.mchTxnIdstringMerchant order ID
data.statestringPayment status, see Payment Status
data.errorMsgstringReason of failure
data.qrCodestringBase64 encoded string, which is QR code data generated using payment link
data.deeplinkstringDeeplink for payment
data.httplinkstringHTTP 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
}