Skip to main content

Create Book FX by account

Create Book FX for given accounts.

Definition

URL
POST https://api-test.instarem.com:4803/api/v1/bookfx/account/create

Header Parameters

ParameterDescriptionTypeRequired
authorizationauth tokenStringYes
content-typeThe Content-Type entity header is used to indicate the media type of the resource. Expected value is application/json.StringYes
X-CLIENT-IDUnique id for client generated by Nium, Required only in case of partner based model (E.g. 593feb7c7c52bb2357b2df6c).StringNo

Example Request

curl --request post \\
--url "https://api-test.instarem.com:4803/api/v1/bookfx/account/create" \\
--data {
"sell_amount": 3478.7,
"request_id": "1XkQkI34DA",
"description": "Low balance in account.",
"from_account": 101760138799,
"to_account": 101760782169,
"book_fx_type": "",
"fx_hold_id": "bf07da86-d6d5-47a4-b3c6-b77203b298e1"
}
--header 'authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE0OTgxMzQ4OTQsImRhdGEiOnsic3ViIjoiNTk0MjNmMzZjZWEyMTQ2OTI2ODczOWE1IiwiY2xpZW50IjoiNTk0MjNmMzZjZWEyMTQ2OTI2ODczOWExIn0sImlhdCI6MTQ5ODA0ODQ5NH0.pevwSDpk-JDNtVIpqFu_m0Xu1UnDVumrAYStcrxf8sM' \\
--header 'content-type: application/json' \\

Body Parameters

ParameterDescriptionTypeRequired
buy_amountCurrency amount that the client buys. Must be specified if sell_amount is not specified.Numberconditional
sell_amountCurrency amount that the client sells. Must be specified if buyamount is not specified. Otherwise this is the amount sold by buying the exact buy amount as specified in the request.Numberconditional
request_idA unique request ID specified by the client in the requestStringYes
descriptionnarration for this bookfx requestStringYes
from_accountAccount from which the client buysNumberYes
to_accountAccount to which the client sellsNumberYes
book__fx__typeOne of ["", PREFUNDING, SCHEDULED1, SCHEDULED2]. Defaults to the client's default FX type if left empty.StringNo
value_dateCustom time for trade execution in UTC. If specified, it must be less than 24 hours from the current time for Scheduled1 and between 24 and 48 hours for Scheduled2. For ex: 2022-04-14 10:10:10StringNo
fx___hold__id_Lock & Hold Id with schedule as SCHEDULE1 or SCHEDULE2StringNo

Example Response

{
"confirmation_id": "USD-MYR-SJtfvAOQb",
"buy_amount": 14921.71,
"sell_amount": 3478.7,
"from_account": 101950173983,
"to_account": 101950173170,
"buy_currency": "MYR",
"sell_currency": "USD",
"instarem_fx_rate": 4.2556,
"fx_rate": 4.277,
"margin_percent": 0.5,
"margin_value": 0.17323,
"created_at": "2017-06-22T05:35:13.387Z",
"expiry_at": "2017-04-12T06:33:30.887Z"
}

Response Parameters

ParameterDescriptionType
confirmation_idReturns the unique confirmation ID generated by Instarem for successful Book Fx.String
buy_amountReturns a requested amount or a computed amount.Number
sell_amountReturns a requested amount or a computed amount.
from_accountAccount from which the client buysNumber
to_accountAccount to which the client sellsNumber
buy_currencyReturn buy currency (3-letter ISO-4217 code).String
sell_currencyReturn sell currency (3-letter ISO-4217 code).String
instarem_fx_rateReturns Instarem FX rate.Number
fx_rateReturns real time FX provider rateNumber
margin_percentReturns margin percent as specified in the agreement for the book FX pair.Number
margin_valueReturns computed margin value for the book FX pair.Number
created_atDate and time (UTC) of book FX.String
expiry_atDate and time (UTC) when book FX expires.String