Skip to content

Query Payment Status

Request Method and Request Path

POST /payment/payin/v1/getPaymentStatus

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
appIdstringYesMerchant app ID, provided by Paydify
mchTxnIdstring(60)NoMerchant order ID, either mchTxnId or txnId must be provided
txnIdstring(30)NoOrder ID, generated by Paydify. either mchTxnId or txnId must be 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[i].txnIdstringOrder ID, a unique ID that is generated by Paydify
data[i].mchTxnIdstringMerchant order ID
data[i].txnHashstringTransaction hash on-chain
data[i].txnAmountstringPayment order amount, e.g. 1.23
data[i].paidAmountstringPaid amount
data[i].mchReceivedAmountstringMerchant received amount
data[i].mchFeestringPaydify received amount
data[i].mchFeeRatestringRate of Paydify service fee, 0.01 indicates 0.01%
data[i].currencystringPayment currency
data[i].gasFeestringGas fee on-chain
data[i].gasFeeCurrencystringCurrency of gas fee
data[i].payMethod1stringWallet code, see Supported Network and Currency
data[i].payMethod2stringNetwork code, see Supported Network and Currency
data[i].appIdstringProvided by Paydify
data[i].statestringPayment status, see Payment Status
data[i].refundStateintRefund tag, different from Refund Status
data[i].mchExtInfostringAdditional extended information
data[i].errorMsgstringReason of failure
data[i].envTypestringlive or test
data[i].fromAddressstringPayer's address
data[i].checkoutModeintCheckout mode, hard code with 1
data[i].paidTimeintDefault value is 0, a millisecond value is present only when the payment is successful
data[i].failedTimeintDefault value is 0, a millisecond value is present only when the payment is failed
data[i].expiredTimeintA millisecond value indicates the expiration of payment
data[i].createdTimeintPayment order created Time in millisecond

Examples

shell
# CURL 

# Response Example of Success
{
  "status": 0,
  "msg": "success",
  "data": [{
    "txnId": "2209141130105863014",
    "mchTxnId": "220914xxx",
    "txnHash": "0xzzzz",
    "txnAmount": "1.00",
    "paidAmount": "1.00",
    "mchReceivedAmount": "0.8",
    "mchFee": "0.1",
    "mchFeeRate": "0.01",
    "currency": "USDC",
    "gasFee": "0.1",
    "gasFeeCurrency": "BNB",
    "payMethod1": "CRYPTO",
    "payMethod2": "bnb",
    "appId": "A1111",
    "state": "pending",
    "refundState": "1",
    "mchExtInfo": "{JSON}",
    "errorMsg": "error message",
    "envType": "live",
    "fromAddress": "0xfghjkrty67xxxxxx",
    "checkoutMode": 1,
    "paidTime": 2222222,
    "failedTime": 2222222, 
    "expiredTime": 2222222,
    "createdTime": 2222222
  }]
}


# 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",
    "txnHash": "0xzzzz",
    "txnAmount": "1.00",
    "paidAmount": "1.00",
    "mchReceivedAmount": "0.8",
    "mchFee": "0.1",
    "mchFeeRate": "0.01",
    "currency": "USDC",
    "gasFee": "0.1",
    "gasFeeCurrency": "BNB",
    "payMethod1": "CRYPTO",
    "payMethod2": "bnb",
    "appId": "A1111",
    "state": "pending",
    "refundState": "1",
    "mchExtInfo": "{JSON}",
    "errorMsg": "error message",
    "envType": "live",
    "fromAddress": "0xfghjkrty67xxxxxx",
    "checkoutMode": 1,
    "paidTime": 2222222,
    "failedTime": 2222222, 
    "expiredTime": 2222222,
    "createdTime": 2222222
  }]
}


# Response Example of Failure
{
  "status": 9999,
  "msg": "system error",
  "data": null
}