/v2/payments/notifyVoid

POST /v2/payments/notifyVoid

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

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

Example

voidResult

Result

Yes

A void result.

copy
{
    "resultCode": "SUCCESS",
    "resultStatus": "S",
    "resultMessage": "success"
}

voidRequestId

String

Yes

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

Max. length: 64 characters.

void_2089760038715669_202775745075671

voidId

String

No

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

Max. length: 64 characters.

2089760038715669_202775745075671

paymentId

String

Yes

The payment ID of the original authorization to be voided.

Max. length: 64 characters.

20190612114010800100188820200355883

voidAmount

Amount

No

The payment amount to be voided.

copy
{
    "currency": "USD", 
    "value": "50"
}

voidTime

Datetime

No

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

2019-06-12T14:07:05+08:00

voidSource

String

No

The merchant who submits a void.

MERCHANT

extendInfo

String

No

The extension information that wallets and merchants want to describe.

Max. length: 4096 characters.

copy
{
    "memo": "memo"
}

Response

Property

Data Type

Required

Description

Example

result

Result

Yes

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

copy
{
    "resultCode": "SUCCESS",
    "resultStatus": "S",
    "resultMessage": "success"
}

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

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"
 }
}