POST /v1/payments/merchantAccept is used in escrow payment scenarios. After the mini-app merchant reviews the customer's order and verifies that the items are in stock and everything is fine (conditions are satisfied, etc.), the merchant may call this OpenAPI to accept the order.
All monetary amounts in requests and responses must be expressed in the smallest currency unit (IQD fils). For example, 100 IQD equals 100000.
51051000101000100008) can use this API.
my.getAuthCode JSAPI with specific scopes(USER_ID) to request an authorization code.authCode and returns.authCode to the Mini Program.authCode to the merchant backend.authCode to apply the accessToken.accessToken information to the merchant backend, such as customerId, accessToken, refreshToken, etc.customerId.customerId as referenceBuyerId, paymentNotifyUrl(optional), etc.redirectionUrl.my.tradePay JSAPI with redirectionUrl to conduct the payment.merchantAccept API to accept this order.| Method | Path |
|---|---|
POST | /v1/payments/merchantAccept |
A message consists of a header and body. The following sections are focused on the body structure. For the header structure, see: OpenAPIs Overview.
| Field | Type | Required | Description | Example |
|---|---|---|---|---|
paymentId | string | Yes | The unique ID that is assigned by the wallet to identify a payment. Max. length: 64 characters. | "202312061112128001016" |
{
"paymentId": "2024071911121280010016601720002644"
}
| Field | Type | Required | Description | Example |
|---|---|---|---|---|
result | object | Yes | The request result, which contains information such as result status and error codes. | { "resultCode": "SUCCESS", "resultStatus": "S", "resultMessage": "Success." } |
{
"result": {
"resultCode": "SUCCESS",
"resultStatus": "S",
"resultMessage": "Success."
}
}
In the response, the result.resultStatus field indicates the result of processing a request. The following table describes each result status:
| resultStatus | Description |
|---|---|
S | It means that the merchant accept is successful. The corresponding result.resultCode is "SUCCESS", and the result.resultMessage is "Success.". |
U | It means that the status of the merchant accept result is unknown. The corresponding result.resultCode is UNKNOWN_EXCEPTION, and result.resultMessage is "An API calling is failed, which is caused by unknown reasons". For details, see the Common error codes section. |
F | It means that the merchant accept fails. The corresponding result.resultCode and result.resultMessage may vary based on different situations. For details, see the Error codes section. |
Error codes are usually classified into the following categories:
| resultStatus | resultCode | resultMessage |
|---|---|---|
F | ORDER_UNSUPPORTED_OPERATION | The order not supported the operation. |
F | ORDER_STATUS_INVALID | The order status is invalid. |
F | ORDER_NOT_EXIST | The order does not exist. |
F | ORDER_IS_FROZEN | The order is frozen. |
F | ORDER_IS_MERCHANT_ACCEPTED | The order has been accepted by merchant. |
F | CURRENCY_NOT_SUPPORT | The currency of a user's payment is not supported by the merchant. |
F | USER_NOT_EXIST | The user does not exist. |
F | USER_STATUS_ABNORMAL | The user status is abnormal. |
F | PARTNER_NOT_EXIST | The partner does not exist. |
F | PARTNER_STATUS_ABNORMAL | The partner status is abnormal. |