Alipay+ DocsAlipay+ Docs

sdkProxyMPP Alipay+

POST /aps/api/v1/mobile/sdkProxy

The Mobile Payment Provider (MPP) server uses the sdkProxy API to proxy the request from the Alipay+ NFC SDK to the Alipay+ server.

In the Alipay+ NFC scenario, the request proxy steps are listed below:

  1. When making a request, the Alipay+ NFC SDK first sends a request body to the MPP app.
  2. The MPP app constructs an HTTPS request body using the request body that the SDK provides and then sends the HTTPS request body to the MPP server.
  3. The MPP server obtains the customer ID and then constructs an HTTPS request by adding the request header and customer ID into the HTTPS request body provided by the MPP app. Then the MPP server sends the HTTPS request to the Alipay+ server.

When using this API, the MPP server needs to obtain only the customer ID and add it to the request body. Then, the MPP server sends the request to the Alipay+ server through this API.

Note: The expiry time of the sdkProxy API is 10 seconds. The MPP server needs to set the connection expiry time between Alipay+ and the MPP server to longer than 10 seconds.

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".
  1. 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

sdkRequestHeader String  REQUIRED

The SDK request header.

This parameter is encapsulated within the SDK and sent by the MPP client. The MPP server constructs HTTPS request with the content of this parameter. The MPP server should not modify the content.


sdkRequestData String  REQUIRED

The SDK request data body.

This parameter is encapsulated within the SDK and sent by the MPP client. The MPP server constructs HTTPS request with the content of this parameter. The MPP server should not modify the content.

customerId String  REQUIRED

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

Response parameters

result Result  REQUIRED

The result of the business processing, including the result status, result code, and result message. For more information about how to return the result, see How to return the result

Show child parameters

sdkResponseHeader String  CONDITIONAL

The SDK response header.
The parameter is mandatory when result.resultCode is SUCCESS.

sdkResponseData String  CONDITIONAL

The SDK response data body.

The parameter is mandatory when result.resultCode is SUCCESS.

API Explorer

Request

Request Body

Response

Response Body

Sample

The following sample code shows how the MPP server constructs and sends a HTTPS request by adding customer ID into the MPP client's request body.

Note: This sample code only provides a general implementation on how to add customerId into the request body, some unrelated steps are skipped.

Sample Code

Alipay+ server processes the request and returns the response to the MPP server.

Note: The reponse data must be returned to the SDK entirely. If the MPP app returns null data or no data is returned, the SDK will determine that the request has failed.

Result/Error codes

CodeValueMessage
SUCCESSSSuccess
ACCESS_DENIEDFAccess is denied.
INVALID_APIFThe called API is invalid or not active.
INVALID_CLIENTFThe client is invalid.
INVALID_SIGNATUREFThe signature is invalid.
KEY_NOT_FOUNDFThe key is not found.
MEDIA_TYPE_NOT_ACCEPTABLEFThe server does not implement the media type that is acceptable to the client.
METHOD_NOT_SUPPORTEDFThe server does not implement the requested HTTPS method.
PARAM_ILLEGALFIllegal parameters. For example, non-numeric input, invalid date.
PROCESS_FAILFA general business failure occurred. Do not retry.
REQUEST_TRAFFIC_EXCEED_LIMITUThe request traffic exceeds the limit.
UNKNOWN_EXCEPTIONUAn API call failed, which is caused by unknown reasons.