WorldFirst DocsWorldFirst Docs

Apply for refundSignature required

POST /amsin/api/v1/business/worldtrade/applyRefund

After a payment is completed, Partner can call this API to initiate a refund request. WorldTrade currently only supports refunds for single transactions.

Note:

  • Before applying for a refund, please call the queryTradeOrder API to obtain the paymentResultList.paymentOrderId parameter required for calling this API;  
  • If the refund request is successful, you will receive the refund within an estimated seven working days, depending on the processing time of the original payment method.

Structure

Messages consist of a header and body. The following sections focus on the body structure. For the header structure, see:

Request parameters

requestId String  REQUIRED

The unique refund request ID specified by the Partner.

More information:

  • This field is an API idempotency field.
  • Maximum length: 64 characters

tradeId String  REQUIRED

The unique trade ID assigned by WorldTrade.

More information:

  • Maximum length: 64 characters

paymentOrderId String  REQUIRED

The payment ID.

Call the queryTradeOrder API to obtain this parameter.

More information:

  • Maximum length: 64 characters

refundAmount Amount  REQUIRED

The refund amount.

WorldTrade currently only supports full refunds. This parameter should be set to the total order amount.

Show child parameters

remark String  

The refund remark.

More information:

  • Maximum length: 256 characters

Response parameters

result Result  REQUIRED

The result of the API call.

Show child parameters

refundOrderId String  REQUIRED

The refund order ID.

This parameter is returned on demand only when result.resultStatus = S.

paymentOrderId String  

The payment ID.

More information:

  • Maximum length: 64 characters
API Explorer

Request

URL
Request Body

Response

Response Body

Result processing logic

After calling the API, a response is returned. Possible values for result.resultStatus are:

Result status

Description

S

Indicates that the API call succeeded.

F

Indicates that the API call failed. For details, refer to result.resultCode.

U

Indicates that the API call result is unknown. If this status is returned, the Partner may implement the following query strategy:

  • Maximum 7 queries are allowed. 
  • Intervals between queries: 5 min, 10 min, 20 min, 40 min, 80 min, 160 min, and 320 min.

If no queries succeed, contact our Technical Support Team.

result.resultCode: System-related result codes

CodeValueMessageFurther action
SUCCESSSSuccess
PROCESS_FAILFA general business failure occurred. Do Not retry.

Human intervention is usually needed. It is recommended that you contact our Technical Support Team to resolve the issue.

PARAM_ILLEGALFIllegal parameters exist. For example, a non-numeric input, or an invalid date.

Check and verify whether the request fields, including the header fields and body fields, are correct and valid. For details on the fields of each API, see the specific API Structure section.

INVALID_SIGNATUREFThe signature is invalid.

Make sure the request is properly signed with a valid signature.

REPEAT_REQ_INCONSISTENT FRepeated requests are inconsistent.

Ensure all the fields in the requests are the same and try again.

UNKNOWN_EXCEPTIONFAPI failed due to unknown reason.

The service might be down, retry later. If the issue persists, contact our Technical Support Team.

FILE_SIZE_EXCEED_LIMITFThe file size has exceeded the limit.

Limit the file size to the allowable range.

CONTRACT_CHECK_FAILFThe contract check has failed.

Contact our Technical Support Team to check the status of your API contract. Make sure it is still valid and try again.

result.resultCode: Business-related result codes

CodeValueMessageFurther action
SYSTEM_EXCEPTIONFSystem exception.

Contact the WorldTrade customer service manager for help.

ORDER_NOT_EXISTFThe order does not exist.

Modify the tradeId parameter and try again

REFUND_FAILED_DUE_TO_CHARGEBACKFThe refund order failed because chargeback exists.

The order has a chargeback, and this refund request has failed. Please ensure the order's fund status is normal before retrying.

REFUND_PERIOD_EXPIREDFThis payment is no longer eligible for refunds as the refund period for this transaction has ended.

The order has exceeded the refund period and refunds are no longer supported.

REFUND_FAILED_TRY_AGAIN_LATERFRefund failed, please try again later

This refund failed. Please try again later.