Alipay, China's leading third-party online payment solutionAlipay, China's leading third-party online payment solution

settle

POST /v1/payments/settle

The settle API is used by the marketplace to settle and split the funds for a successful payment.

Structure

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

Note: Set the data type of each field (except array) as String. This means that you must use double quotation marks (" ") to enclose the field value. Examples:

  • If the data type of a field is Integer and its value is 20, set it as "20".
  • If the data type of a field is Boolean and its value is true, set it as "true".  

Request parameters

settlementRequestId String  REQUIRED

The unique ID that is assigned by the marketplace to identify a settlement request. Antom uses this field for idempotence control. 

More information:

  • This field is an API idempotency field.For registration requests that are initiated with the same value of settlementRequestId and reach a final status (resultStatus = S or F), the same result is to be returned for the request.
  • Maximum length: 64 characters

paymentId String  REQUIRED

The unique ID that is assigned by Antom to identify a payment. The value of this parameter is returned through the same parameter in the pay (Cashier Payment) API.  

More information:

  • Maximum length: 64 characters

settlementDetails Array <SettlementDetail>  REQUIRED

The settlement details for a payment.  

More information:

  • Maximum length: 20 characters
Show child parameters

Response parameters

result Result  

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

Show child parameters

settlementRequestId String  REQUIRED

The unique ID that is assigned by the marketplace to identify a settlement request.  

More information:

  • Maximum length: 64 characters

settlementId String  REQUIRED

The unique ID that is assigned by Antom to identify a settlement.  

More information:

  • Maximum length: 64 characters
API Explorer
Sample CodesRun in Sandbox

Request

URL
Request Body

Response

Response Body

Result processing logic  

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

result.resultStatus

result.resultCode

Description

S

SUCCESS

The settlement for the payment is initiated successfully.

Antom will notify you of the settlement result of the funds transfer through the notifySettlement API.

U

UNKNOWN_EXCEPTION

The status of the settlement is unknown.

Check Result/Error codes for further actions.

F

Multiple possible values exist, such as INVALID_SETTLEMENT_TIME.

The settlement for the payment failed.

Check the reason and further action suggestions in Result/Error codes.

Result/Error codes

CodeValueMessageFurther action
SUCCESSSSuccess

The application for the settlement information update is successful. Get the settlement information update result from the notifyUpdate and inquireUpdate interfaces.  

UNKNOWN_EXCEPTIONUAn API call has failed, which is caused by unknown reasons.

Call this interface again to resolve the issue. If the issue is not resolved, contact Alipay Technical Support.  

INVALID_SETTLEMENT_TIMEFThe time that you initiated the settlement is earlier than the earliest time that you can settle.

Check earliestSettlementTime from the notifyPayment or inquiryPayment interfaces.  

ORDER_FROZENFThe order is frozen.

Contact Antom Technical Support for detailed reasons.  

SETTLEMENT_AMOUNT_EXCEEDS_LIMITFThe total settlement amount you initiated is greater than the payment amount.

Use a lower settlement amount to try again. If the issue persists, contact Antom Technical Support for detailed reasons.