contractCloseNotify

URL: {{contractCloseNotifyUrl}}

ContractCloseNotifyURL is a notification URL provided by the merchant and filled in when signing the agreement payment contract. If this parameter is not configured in the contract, the superapp backend will not notify the merchant.

Request Method: POST

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 Body

Field Name

Data Type

Length

Required

Description

Example

accessToken

String

128

Yes

The access token is used to access user information. For the specific information that can be accessed, see the my.call("signContract") JSAPI.

· Maximum length: 128 characters

· Characters not allowed: special characters such as @ # ?

Note: Obtained this field via the

/v1/authorizations/applyToken API.

"281010033AB2F588D14B43238637264FCA5AAF35xxxx"

contractStatus

String

-

Yes

INVALID : as the contract is invalid

"INVALID"

modifyTime

Long

10

Yes

timestamp - 10 digits

1749634508

 "1749634508"

 

Response Body

Field Name

Data Type

Length

Required

Description

Example

result

Result

-

Yes

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

 {

        "resultCode": "SUCCESS",

        "resultStatus": "S",

        "resultMessage": "success"

    }

 

Result Code

#

Result code

Result status

Result message

Further action

1

SUCCESS

S

success.

change user's accessToken of auto-debit contract to invalid

Note: If merchant return any other result code, A+ will retry.

Sample

The user closes the contract in the merchant's mini program

image.png

Step1: The user opens the mini program and cancels the contract of agreement pay.

Step2~3: The mini program requests the merchant backend to close the contract, and the merchant backend requests the superapp server to cancel the Token.

Step4~8: After the successful cancellation of the superapp server, the result is returned to the merchant backend. The merchant backend change user's accessToken of auto-debit contract to invalid and then returns the result to the mini program, which prompts the user that the cancellation was successful.

In step 7: After successfully canceling the contract, the superapp server will asynchronously notify the merchant backend of the contract cancellation result.

The notification URL of close contracts is obtains from the auto-debit contract in the merchant information of back office. If not configured, the superapp server will not asynchronously notify merchants.

Step8: Superapp server notifies users of contract cancellation messages