Create an FX settlementSignature required

POST /amsin/api/v1/business/fund/createExchange

The Partner can use this API to create a settlement.

The createExchange API supports the following currency settlement scenarios:

  • Create a settlement with forward rates:
    • For this scenario, the process is asynchronous. WorldFirst responds to the Partner that the settlement is being processed, rather than the final result of the settlement. To query the forward deal result, a Partner can utilize the inquiryExchange interface. WorldFirst sends the notification about the settlement result with the notifyExchange interface.
  • Create a settlement with spot rates
    • For this scenario, the process is synchronous. WorldFirst returns the result of the settlement in the response message.

Structure

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

Request parameters

customerId String  CONDITIONAL

The unique id that is assigned by WorldFirst to identify an account on WorldFirst.

customerId and accessToken cannot be both empty.

More information about this field

  • Maximum length: 64 characters

accessToken String  CONDITIONAL

The access token that is used for OAuth authorization.

customerId and accessToken cannot be both empty. 

More information about this field

  • Maximum length: 64 characters

exchangeRequestId String  REQUIRED

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

More information about this field

  • This field is an API idempotency field.For details about API idempotency, see the Idempotency chapter.
  • Maximum length: 128 characters

quote Quote object CONDITIONAL

The quote information.

This parameter is required when exchangeMode is APPOINTED and the value of this parameter must be consistent with the quote parameter in the response message of createQuote API. 

Show child parameters

sell QuoteAmount object REQUIRED

The amount and the currency to be sold.

Show child parameters

buy QuoteAmount object REQUIRED

The amount and the currency to be bought.

Show child parameters

exchangeMode String  REQUIRED

Defines the mode of the settlement request, which could be either in real-time, or at an appointed time.

Valid values are:

  • REALTIME
  • APPOINTED

exchangeTradeType String  REQUIRED

Defines the type that the settlement trades in.

Valid values are:

  • SPOT: Using spot rate.
  • FORWARD: Using forward rate.
  • UNFUNDED_SPOT: Using unfunded spot rate.

exchangeUnfundedInfo ExchangeForwardInfo object CONDITIONAL

Information about the forward exchange.

This field is required when exchangeTradeType is UNFUNDED_SPOT

Show child parameters

exchangeForwardInfo ExchangeForwardInfo object CONDITIONAL

Information about the forward exchange.

This field is required when exchangeTradeType is FORWARD

Show child parameters

exchangeOrderAddition ExchangeQuoteAddition object 

Additional information that is attached to the settlement request, such as the ID of the reference order.

Show child parameters

exchangeRequestTime String  

The time of the settlement request.

More information about this field

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

Response parameters

result Result object REQUIRED

Indicates whether this API is called successfully.

Show child parameters

exchangeId String  REQUIRED

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

This field is returned only when the value of result.resultStatus is S.  

More information about this field

  • Maximum length: 64 characters

exchangeRequestId String  REQUIRED

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

This field is returned only when the value of result.resultStatus is S.  

More information about this field

  • This field is an API idempotency field.For details about API idempotency, see the Idempotency chapter.
  • Maximum length: 128 characters

sell QuoteAmount object REQUIRED

The amount and the currency to be sold.

This field is returned only when the value of result.resultStatus is S.  

Show child parameters

buy QuoteAmount object REQUIRED

The amount and the currency to be bought.

This field is returned only when the value of result.resultStatus is S.  

Show child parameters

exchangeCreateTime DateTime  REQUIRED

The time that the settlement request is created.

This field is returned only when the value of result.resultStatus is S.  

More information about this field

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

exchangeFinishTime DateTime  

The time that the settlement request is completed.

This field is returned only when the value of result.resultStatus is S.  

More information about this field

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

quote Quote object REQUIRED

Transfer quote information.

This field is returned only when the value of result.resultStatus is S.  

Show child parameters

exchangeMode String  REQUIRED

Defines the mode of the settlement request, which could be either in real-time, or at an appointed time.

Valid values are:

  • REALTIME
  • APPOINTED

This field is returned only when the value of result.resultStatus is S.  

exchangeTradeType String  REQUIRED

Defines the type that the settlement trades in.

Valid values are:

  • SPOT: Using spot rate.
  • FORWARD: Using forward rate.
  • UNFUNDED_SPOT: Using unfunded spot rate.

This field is returned only when the value of result.resultStatus is S.  

exchangeUnfundedInfo ExchangeForwardInfo object CONDITIONAL

Information about the forward exchange.

This field is returned only when the value of result.resultStatus is S and the value of exchangeTradeType is UNFUNDED_SPOT. 

Show child parameters

exchangeForwardInfo ExchangeForwardInfo object CONDITIONAL

Information about the forward exchange. 

This field is returned only when the value of result.resultStatus is S and the value of exchangeTradeType is FORWARD

Show child parameters
API Explorer

Request

URL
Case
Unfunded spot scenario
Request Body

Response

Response Body

Result processing logic

After calling the API, a response is returned. The possible responses for result.resultStatus are:

Result status

Description

S

This indicates the API call succeeded.

For the settlements with forward rates:

  • If result.resultStatus is S, this result status indicates that WorldFirst accepts the request and is processing the settlement.
  • For the result of the settlement, the Partner can call the inquiryExchange interface or wait for the notification from the notifyExchange interface.

For the settlements with on-spot rates:

  • This indicates the settlement request succeeded.

F

This indicates the API call failed. For more information on why the call failed, see result.resultCode.

U

This indicates the API call result is unknown. Call the inquiryExchange API to check the exchange status.

System-realted result codes

CodeValueMessageFurther action
SUCCESSSSuccess

The spot settlement has been completed successfully.

PROCESSINGSThe settlement is being processed.

This result code is for the forward settlement only.

Call the inquiryExchange API for the settlement result or wait for notifications.

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.

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.

UNKNOWN_EXCEPTIONUAPI failed due to unknown reason.

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

REQUEST_TRAFFIC_EXCEED_LIMITUThe request traffic exceeds the limit.

Call the interface again to resolve the issue. If the issue persists, contact our Technical Support Team.

INVALID_APIFThe called API is invalid or not active.

Check whether the correct API is being called.

INVALID_CLIENTFThe client is invalid.

The Client ID does not exist or is invalid.

INVALID_SIGNATUREFThe signature is invalid.

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

METHOD_NOT_SUPPORTEDFThe server does not implement the requested HTTP method.

Ensure the HTTP method is POST.

Business-related result codes

CodeValueMessageFurther action
BALANCE_INSUFFICIENTFThe balance is insufficient for the exchange.

This result code is for settlements with on-spot rates only. Make sure the balance is sufficient and try again.

AUTHORIZATION_NOT_EXISTFThe authorization does not exist.

Make sure that the input is correct. If the issue persists, contact our Technical Support Team to verify the authorization status. 

UN_SUPPORT_BUSINESSFUnsupported business.

Invalid parameters are used e.g. currency is incorrect. Retry with the correct information.

QUOTE_EXPIREDFThe quote is expired.

Call the createQuote API to create a new quote. Retry creating a new settlement request with the new quote.

FX_RELATED_ORDER_NOT_EXISTFThe exchange order does not exist.

This result code is for forward settlements only. Make sure the dealId is correct and try again.

CURRENCY_NOT_SUPPORTFThe currency is not supported.

Make sure the currency input is correct and try again.

CONTRACT_CHECK_FAILFThe contract check has failed.

Check the contract status before retrying.

@2024 WorldFirst