Alipay+ DocsAlipay+ Docs

initiateRetrievalMPP Alipay+

POST /aps/api/v1/disputes/initiateRetrieval

The initiateRetrieval API is used by the Mobile Payment Provider (MPP) to send a retrieval request to Alipay+. When using this API, the MPP needs to take the following things into consideration:

  • For each transaction, a maximum of 5 retrieval requests can be initiated (excluding those that are canceled), while a transaction can have only 1 ongoing retrieval request.
  • The MPP can only initiate retrieval requests within 360 days from the day when the transaction occurs.

When receiving the initiateRetrieval request, Alipay+ sends a synchronous response to indicate the request acceptance result, and then uses the responseRetrieval API to send the required information to the MPP. 

Structure

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

Note: 

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

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

2. For optional parameters that are not required in your case, you can take one of the following actions:

  • Exclude the parameters from the request body. 
  • Set the parameter values as null (without the double quotation marks). 

Do NOT leave the optional parameters empty by setting their values as ""; otherwise, an error might occur.  

Request parameters

disputeRequestId String  REQUIRED

The unique ID that is assigned by the MPP to identify a retrieval request.

Important: If two requests specify the same value for disputeRequestId but different values for paymentRequestId, Alipay+ returns the REPEAT_REQ_INCONSISTENT for the second request. 

More information about this field

  • This field is an API idempotency field.For requests that are initiated with the same disputeRequestId, Alipay+ regards the requests as repeated and processes the requests only once. Alipay+ checks the consistency of the paymentRequestId parameter. If its value is different from that in the previous request, Alipay+ returns the REPEAT_REQ_INCONSISTENT result code.
  • Maximum length: 64 characters

paymentRequestId String  REQUIRED

The unique ID that is assigned by Alipay+ to identify a payment where the retrieval request occurs. 

More information about this field

  • Maximum length: 64 characters

disputeOccurTime Datetime  

The date and time when the retrieval request occurs. For MPPs, this parameter refers to the date and time when the MPP sends the retrieval request to Alipay+

More information about this field

  • The value follows the ISO 8601 standard format. For example, "2019-11-27T12:01:01+08:00".

disputeReasonCode String  REQUIRED

The code that reflects the dispute reason. Valid values are: 

  • 6801: The code for risk-related reasons, which is used for a retrieval request. For more information, see Operations Guide.
  • 6802: The code for non-risk-related reasons, which is used for a retrieval request. 

requestInformationTypes Array<String>  REQUIRED

The list of information that the MPP requires the Acquiring Service Provider to provide in the retrieval request. Valid values are:

  • TRANSACTION_RECEIPT: indicates that the MPP wants to retrieve the transaction receipt.
  • PROOF_OF_DELIVERY: indicates that the MPP wants to retrieve the proof of delivery.
  • MERCHANT_INFORMATION: indicates that the MPP wants to retrieve the merchant information.
  • END_USER_INFORMATION: indicates that the MPP wants to retrieve the information of the end-user, also called the buyer.
  • OTHER_DOCUMENTATION: indicates that the MPP wants to retrieve other documents. 

remarks String  

Supplementary information.

It is recommended to specify this parameter if the MPP has any additional information that needs to be remarked. 

More information about this field

  • Maximum length: 1024 characters

Response parameters

result Result object REQUIRED

The result of the business processing, including the result status, result code and the result message. This parameter only indicates the request result, but does not indicate whether the retrieval request is processed. 

Show child parameters

disputeId String  

The unique ID that is assigned by Alipay+ to identify a retrievel request.

This parameter is returned by Alipay+ if result.resultStatus is S

More information about this field

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

Request

URL
Request Body

Response

Response Body

More information

How to handle the result

You might receive different results from Alipay+. Follow the instructions below to handle the result.

result.resultStatus

result.resultCode

Dispute status

Actions

S

SUCCESS

The Retrieval Request is initiated successfully.

Wait for the response to the Retrieval Request from Alipay+ via the responseRetrieval API.

F

Multiple possible values exist, such as

ACCESS_DENIED,

KEY_NOT_FOUND, etc.

The Retrieval Request fails to be initiated.

Take actions according to the result code (specified in the result.resultCode parameter). For more information, see the Result codes section below.

U

Multiple possible values exist, such as

UNKNOWN_EXCEPTION,

REQUEST_TRAFFIC_EXCEED_LIMIT, etc.

Unknown

Use the same parameters to retry the initiateRetrieval request. If you keep receiving the same result indicating the unknown status, contact connect_support@service.alipay.com.

No result received

Unknown

Use the same parameters to retry the initiateRetrieval request. If you keep receiving no result, contact connect_support@service.alipay.com.

Result/Error codes

CodeValueMessageFurther action
SUCCESSSSuccess

ACCESS_DENIEDFAccess is denied.

It is recommended that you contact connect_support@service.alipay.com to troubleshoot the issue. 

EXCEEDS_RETRIEVAL_REQUEST_TIME_LIMITFThe time limit of the dispute retrieval request for the transaction is exceeded.

Ensure the retrieval request is initiated within 360 days from the day when the transaction occurs. 

INVALID_CLIENTFThe client is invalid.

It is recommended that you contact connect_support@service.alipay.com to troubleshoot the issue. 

INVALID_SIGNATUREFThe key is not found.

It is recommended that you contact connect_support@service.alipay.com to troubleshoot the issue. 

KEY_NOT_FOUNDFThe key is not found.

It is recommended that you contact connect_support@service.alipay.com to troubleshoot the issue. 

MEDIA_TYPE_NOT_ACCEPTABLEFThe server does not implement the media type that is acceptable to the client.

Use a media type that is accepted by Alipay+. 

METHOD_NOT_SUPPORTEDFThe server does not implement the requested HTTPS method.

Ensure the HTTP method is POST. 

NO_INTERFACE_DEFFAPI is not defined.

Check whether the request URL is correct. Ensure that the endpoint of the called API is correct. 

ORDER_NOT_EXISTFThe order does not exist.

Ensure the value of paymentRequestId is correct. 

PARAM_ILLEGALFIllegal parameters. For example, non-numeric input, invalid date.

Check whether the request parameters, including the header parameters and body parameters, are correct and valid. For more information about the parameters of each API, see the Structure section of the specific API reference topic. 

PROCESS_FAILFA general business failure occurred. Do not retry.

It is recommended that you contact connect_support@service.alipay.com to troubleshoot the issue. 

TRANSACTION_HAS_ONGOING_RETRIEVAL_REQUESTFOngoing dispute retrieval request exists for the transaction.

Wait until the existing dispute retrieval is completed. 

REQUEST_TRAFFIC_EXCEED_LIMITUThe request traffic exceeds the limit.

Reduce the frequency of API calls. 

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

Try to recall the API.