Alipay+ DocsAlipay+ Docs

confirmOriginalCredit

POST /aps/api/v1/funds/confirmOriginalCredit

The confirmOriginalCredit API is used by the Acquiring Service Provider (ACQP) to send a request to Alipay+ to confirm the success of an Original Credit Transaction (OCT) in case the OCT status is still unknown after polling the inquireOriginalCredit API for 1 minute.

After receiving the request, Alipay+ forwards the confirmation request to the MPP to ensure that the tax refund is successfully processed by the MPP. The ACQP can then update the OCT status based on the confirmation response from Alipay+.

Note: In the following sections, Mobile Payment Provider(MPP) is also known as Payment Service Provider. For example, the pspId parameter specifies the ID that identifies an 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".
  1. For optional parameters that are not required in your case, you can:
    • exclude them from the request body.
    • set the 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

Field

Data type

Required

Description

originalCreditRequestId

String

No

The unique ID that is assigned by the ACQP to identify an OCT.

Specify this parameter if the originalCreditId parameter is not specified.

More information about this field:

  • Maximum length: 64 characters

originalCreditId

String

No

The unique ID that is assigned by Alipay+ to identify an OCT.

Specify this parameter if the originalCreditRequestId parameter is not specified.

More information about this field:

  • Maximum length: 64 characters

Response parameters

Field

Data type

Required

Description

result

Result

Yes

The result of the OCT, including the result status, result code, and the result message.

For more information about how to handle the result of the confirmOriginalCredit API, see How to handle the result.

acquirerId

String

No

The unique ID that is assigned by Alipay+ to identify an ACQP.

This parameter is returned by Alipay+ if the value of the result.resultStatus parameter is S, which indicates that the OCT is successful.

More information about this field:

  • Maximum length: 64 characters

pspId

String

No

The unique ID that is assigned by Alipay+ to identify an MPP.

This parameter is returned by Alipay+ if the value of the result.resultStatus parameter is S, which indicates that the OCT is successful.

More information about this field:

  • Maximum length: 64 characters

How to handle the result

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

result.resultStatus

result.resultCode

Confirmation status

OCT status

Actions

S

SUCCESS

The confirmation is successful.

The OCT is successful.

Update the OCT status to success from your server side.

F

ORIGINAL_CREDIT_ALREADY_FAILED

The confirmation fails.

The OCT fails.

Update the OCT status to failure from your server side.

F

ORDER_NOT_EXIST

The confirmation fails.

The OCT is in unknown status.

For cases where the OCT does not exist, the reason might be that the originalCreditRequestId is incorrect. Use the correct ID to reinitiate the request.

If you still receive the same result code of ORDER_NOT_EXIST after retrying the confirmOriginalCredit request, contact connect_support@service.alipay.com.

F

Multiple possible values exist, such as

ACCESS_DENIED,

INVALID_CLIENT, etc.

The confirmation fails.

The OCT is in unknown status.

Take actions according to the error message in the result.resultMessage parameter.

U

Multiple possible values exist, such as

UNKNOWN_EXCEPTION,

REQUEST_TRAFFIC_EXCEED_LIMIT, etc.

The confirmation is in unknown status.

The OCT is in unknown status.

Use the same parameters to retry the confirmOriginalCredit request. It is recommended that you keep trying several times. If you keep receiving the same result indicating the unknown status, contact connect_support@service.alipay.com.

No result received after trying several times

The comfirmation is in unknown status.

The OCT is in unknown status.

Contact connect_support@service.alipay.com.

Result codes

Result code

Result status

Result message

Further action

SUCCESS

S

Success

Update the OCT status to success from your server side.

ACCESS_DENIED

F

Access is denied.

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

INVALID_CLIENT

F

The client is invalid.

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

INVALID_SIGNATURE

F

The signature is invalid.

Check whether the public key, signed message, and signature algorithm are as expected.

KEY_NOT_FOUND

F

The key is not found.

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

MEDIA_TYPE_NOT_ACCEPTABLE

F

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

Use a media type that is accepted by Alipay+.

METHOD_NOT_SUPPORTED

F

The server does not implement the requested HTTPS method.

Ensure that the HTTP method is POST.

NO_INTERFACE_DEF

F

API is not defined.

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

ORDER_NOT_EXIST

F

The order doesn't exist.

For cases where the OCT does not exist, the reason might be that the originalCreditRequestId is incorrect. Use the correct ID to reinitiate the request.

If you still receive the same result code of ORDER_NOT_EXIST after retrying the confirmOriginalCredit request, contact connect_support@service.alipay.com.

ORIGINAL_CREDIT_ALREADY_FAILED

F

The OCT failed already. <Reason>

Update the OCT status to failure from your server side.

The <Reason> placeholder indicates the reason of the OCT failure and is specified by Alipay+ if the MPP provides the reason.

PARAM_ILLEGAL

F

Illegal 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.

PROCESS_FAIL

F

A general business failure occurred. Do not retry.

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

REQUEST_TRAFFIC_EXCEED_LIMIT

U

The request traffic exceeds the limit.

Reduce the frequency of API calls.

UNKNOWN_EXCEPTION

U

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

Try to recall the API.

Samples

Request

copy
{
  "originalCreditRequestId": "gb_tax_1089760038715669_102775745070000"
}

Response

copy
{
  "acquirerId": "A10221XX000000000000",
  "pspId": "1022160000000000000",
  "result": {
    "resultCode": "SUCCESS",
    "resultStatus": "S",
    "resultMessage": "success"
  }
}