Create an FX dealSignature required

POST /amsin/api/v1/business/fund/createDeal

The Partner can use this API to create a forward deal. But before you call this API, make sure you have called the createQuote API and have received information on the exchange rate, quote ID and etc.  

The process of creating a forex deal is asynchronous. WorldFirst responds to the Partner that the forward deal is being processed, rather than the final result of the forward deal.

To query the forward deal result, the Partner can call the inquiryDeal interface.

WorldFirst sends the notification of the forward deal result with the notifyDeal interface.

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  REQUIRED

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

More information about this field

  • Maximum length: 64 characters

dealRequestId String  REQUIRED

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

More information about this field

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

sell Amount object REQUIRED

The amount to sell.

This parameter uses the same value of sell in the response message of createQuote API.  

Show child parameters

buy Amount object REQUIRED

The amount to buy.

This parameter uses the same value of buy in the response message of createQuote API.  

Show child parameters

exchangeTradeType String  

The exchange trade type. Valid values are:

  • FORWARD: indicates that the exchange trade type is unfunded forward.
  • UNFUNDED_SPOT: indicates that the exchange trade type is unfunded spot.

When unspecified, the value of this parameter is by default FORWARD.  

marginCurrency String  CONDITIONAL

3-character ISO 4217 currency code that represents the margin currency used. For example, USD. Specify this parameter is the value of the exchangeTradeType parameter is FORWARD.

More information about this field

  • Maximum length: 3 characters

quote Quote object REQUIRED

Information with regard to the quote, such as the currency pair used, the expiry time of the quote, etc.

Show child parameters

forwardType String  REQUIRED

The type of the forward quote. Specify this parameter if the value of the exchangeTradeType parameter is FORWARD.

Valid values are:

  • FIXED: Indicates a fixed date.
  • WINDOWED: indicates a windowed date.
  • FLEXIBLE: Indicates a flexible date.

windowStartTime DateTime  CONDITIONAL

Indicates the start time of the window.

Format: YYYYMMDD, for example, 20120212.

This field is required when forwardType is WINDOWED.

expiredTime DateTime  REQUIRED

The time when a forex deal expires.

Format: YYYYMMDD, for example, 20120215. 

Response parameters

result Result object REQUIRED

Indicates whether this API is called successfully.

Show child parameters

responseId String  REQUIRED

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

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

More information about this field

  • Maximum length: 32 characters

deal Deal object REQUIRED

Transaction details of the forward deal.

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

Show child parameters
API Explorer

Request

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

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

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 inquiryDeal API to check the deal status.

System-realted result codes

CodeValueMessageFurther action
PROCESSINGSRequest is processing.

The forward deal is created successfully and being processed. Call the inquiryDeal API for the forward deal result.

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_EXCEPTIONUThe API call is failed, which is caused by unknown reasons.

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.

OAUTH_FAILFOAuth process failed.

Contact WorldFirst Technical Support for detailed reasons.

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

REPEAT_REQ_INCONSISTENTFRepeated requests are inconsistent.

Ensure all the fields in the requests are the same.

CONTRACT_CHECK_FAILFThe contract check has failed.

Check the contract status before retrying.

@2024 WorldFirst