Receive FX forward deal notification
WorldFirst uses this interface to notify the Partner about the forward deal results. The Partner needs to process the result and response to WorldFirst indicating the reception of the given notification.
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
Result processing logic
WorldFirst indicates the result of the forward deal in the dealResult.resultStatus
field. For more information, refer to the result codes section.
After receiving the notification, you need to send a response message to acknowledge the receipt of the notification.
The Partner needs to properly sign the message before making the response. For details, refer to the Sign a request and validate the signature chapter.
The response header observes the following structure:
- Signature: Required. Example:
Signature: algorithm=RSA256, keyVersion=2, signature=*****
- Content-Type: Required. Example:
Content-Type: application/json; charset=UTF-8
- Client-Id: Required. Example:
Client-Id: *****
- Response-Time: Required. Example:
Response-Time: 2019-04-04T12:08:56+08:00
For more details about the response message, refer to the API overview chapter.
The response body has the following fixed value:
{
"result":{
"resultStatus":"S",
"resultCode":"SUCCESS",
"resultMessage":"success"
}
}
In the absense of an ackowledgement reponse from the Partner, WorldFirst will resend the result.
The following policy represents how WorldFirst makes retry attempts:
- WorldFirst retries notifications 7 times.
- Intervals between notifications: 2m, 10m, 10m, 1h, 2h, 6h, and 15h.
Response parameters
Field | Data type | Required | Description |
result | Result object | Yes | Indicates whether this API is called successfully. |
Result codes
dealResult
.resultCode
resultCode | resultStatus | resultMessage | Further action |
SUCCESS | S | The deal is successfully completed. | |
PROCESSING | S | The forward deal is being processed. | |
CANCELLED | F | The forward deal is canceled. | |
FAIL | F | The forward deal has failed. |
result.resultCode
System-related result codes
resultCode | resultStatus | resultMessage | Further action |
SUCCESS | S | Success | |
PARAM_ILLEGAL | F | Illegal 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_FAIL | F | A 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_EXCEPTION | U | API failed due to unknown reason. | The service might be down, retry later. If the issue persists, contact our Technical Support Team. |
REQUEST_TRAFFIC_EXCEED_LIMIT | U | The request traffic exceeds the limit. | Call the interface again to resolve the issue. If the issue persists, contact our Technical Support Team. |
INVALID_API | F | The called API is invalid or not active. | Check whether the correct API is being called. |
INVALID_CLIENT | F | The client is invalid. | The Client ID does not exist or is invalid. |
INVALID_SIGNATURE | F | The signature is invalid. | Make sure the request is properly signed with a valid signature. |
METHOD_NOT_SUPPORTED | F | The server does not implement the requested HTTP method. | Ensure the HTTP method is |
Business-related result codes
resultCode | resultStatus | resultMessage | Further action |
UN_SUPPORT_BUSINESS | F | Unsupported business. | Invalid parameters are used e.g. currency is incorrect. Retry with the correct information. |
INVALID_ACCESS_TOKEN | F | Invalid access token | Check whether the |
CONTRACT_CHECK_FAIL | F | The contract check has failed. | Check the contract status before retrying. |
Samples
Request
Request body sample
{
"deal": {
"buy": {
"currency": "USD",
"value": 1183
},
"creditLine": {
"currency": "USD",
"value": 0
},
"creditLineBase": {
"currency": "GBP",
"value": 0
},
"dealId": "*****",
"dealRequestId": "*****",
"expiredTime": "*****",
"forwardType": "FLEXIBLE",
"margin": {
"currency": "USD",
"value": 0
},
"quote": {
"quoteCurrencyPair": "EUR/USD",
"quoteExpiryTime": "2022-07-26T05:48:16Z",
"quoteId": "*****",
"quotePrice": "1.18325",
"quoteStartTime": "2022-07-26T05:47:46Z"
},
"sell": {
"currency": "EUR",
"value": 1000
},
"settledTime": "2022-07-26T06:48:47Z",
"windowStartTime": "20220729"
},
"dealResult": {
"resultCode": "SUCCESS",
"resultMessage": "success.",
"resultStatus": "S"
}
}
Response
Response header sample
{
"headers": {
"Content-Type": "application/json",
"client-id": "*****",
"response-time": "2022-03-07T07:49:27Z",
"signature": "algorithm=RSA256,keyVersion=1,signature=VelVji6jp8UJVrBUvZrwij8uPmjc//hfmVJqCCW0x+Yh/HEs5pz9wiMyYLRjykTOii+f5EznxcFIUxPae5KITe3fChufJzFhJ4iku5U/w6exmBWVR5vrvQZSYO0vG5aJKwUQW/jjgaUWg1d+ySmaJ0VZ0pniQRtwYRGCvzdey+gI0+jMFbChIQDemZ0uLCExRQ0SBKAjEH/Vq14KlY88Wr2bR829tqsxaECSq2M5eeDC7j6FGPMazfX1W+EGqa2go2Hif6BnodwXzNsEAfQlUrbwCi9Ey/uNO4ScTX6FVG1nb+q8/k09wTkCz/nHnwTQolDrLRndZqZfz79a344*****"
}
}
Response body sample
{
"result": {
"resultCode": "SUCCESS",
"resultMessage": "success.",
"resultStatus": "S"
}
}