/v2/payments/notifyVoid

POST /v2/payments/notifyVoid

The notifyVoid  API is used to send notifications to merchants after voiding a payment.

Note: Follow the specifications below when the merchant develops this API.

Message structure

A message consists of a header and body. The following sections are focused on the body structure. For the header structure, see:

Request

Property

Data Type

Required

Description

voidResult

Result

Yes

A void result.

voidRequestId

String

Yes

The unique ID of a void generated by a merchant or the wallet.

Max. length: 64 characters.

voidId

String

No

The unique ID of a void request generated by the wallet.

Max. length: 64 characters.

paymentId

String

Yes

The payment ID of the original authorization to be voided.

Max. length: 64 characters.

voidAmount

Amount

No

The payment amount to be voided.

voidTime

Datetime

No

The processing time for a void request. The value follows the ISO 8601 standard.

voidSource

String

No

Void source。

extendInfo

String

No

The extension information that wallets and merchants want to describe。

Max. length: 4096 characters.

Response

Property

Data Type

Required

Description

result

Result

Yes

The request result, which contains information such as result status and error codes.

Result process logic

In the response, the result.resultStatus field indicates the result of processing a request. The following table describes each result status:

resultStatus

Description 

S

The notification is successful.

The corresponding result.resultCodeis "SUCCESS" and the 

result.resultMessage is "Success".

U

The status of the notification 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

The notification fails. The corresponding result.resultCode  and

result.resultMessage may vary based on different situations. For details, see the Error codes section.

Error codes

Error codes are usually classified into the following categories:

  • Common error codes are common across all mini program's APIs.  
  • API-specific error codes: are listed in the following table.

resultCode

resultStatus

resultMessage

SUCCESS

S

Success

SYSTEM_ERROR

U

The receiver has some unknown exceptions when processing this notice. When a sender gets this error code, the sender will retry to deliver.

Samples

Request

copy
{
 "voidResult": {
    "resultCode":"SUCCESS",
    "resultStatus":"S"
 },
 "voidId":"20191127190741010007013213190",
 "voidRequestId":"201231231313123124",
 "voidAmount": {
    "value":"1000",
    "currency":"USD"
 },
 "paymentId":"20191127190741010007013213121",
 "voidTime":"2021-06-08T12:12:12+08:00"
}

Response

copy
{
 "result": {
    "resultCode":"SUCCESS",
    "resultStatus":"S"
 }
}