NAV Navigation
JSON

ACE API Spec v1.0.5

This document provides specifications for connecting to the Archax Complete Ecosystem (ACE) API endpoints. We provide two APIs - HTTP REST and WebSockets. For detailed information about each API visit the REST API and WebSocket API sections.

REST API

The Archax REST API allows developers to retrieve authentication tokens and instrument information. All resources are defined under the following URL:

https://ace-auth.archax.com/api/1.0

All responses from the REST API are wrapped inside this response wrapper

Login

Sample Request

{
"email": "user@archax.com",
"password": "password"
}

200 Response

{
"status": "OK",
"data": {
"status": "OK",
"jwt": "valid-token",
"mfa": false,
"timestamp": "2021-05-25T04:21:38.057Z"
},
"timestamp": "2021-05-25T04:21:38.058Z"
}

401 Response

{
"status": "ERROR",
"error": [
{
"msg": "Email and password combination are incorrect"
}
],
"timestamp": "2021-06-07T06:39:21.413Z"
}

POST /login

An endpoint that allows developers to submit an email and a password in exchange for a JWT.

Request Schema

NameTypeRequiredDescription
emailstringtrueEmail address registered in the system
passwordstringtruePassword registered with email address

Response Schema

NameTypeDescription
statusstatusOK for success, ERROR otherwise
jwtstringA JSON web token that expires after 30 minutes
mfaboolA flag indicating whether multi-factor authentication is enabled
timestamptimestampThe response timestamp

Renew-jwt

Request to

https://ace-auth.archax.com/api/1.0/renew-jwt

200 Response

{
"status": "OK",
"data": {
"jwt": "valid-token"
},
"timestamp": "2021-05-25T04:21:38.058Z"
}

401 Response

{
"status": "ERROR",
"error": [
{
"msg": "Too many requests"
}
],
"timestamp": "2021-06-07T06:39:21.413Z"
}

POST /renew-jwt

An endpoint that provides an updated JWT. Old JWT must be included as bearer token.

Response Schema

NameTypeDescription
jwtstringA JSON web token that expires after 30 minutes

Payment Provider details

Request to

https://ace-account.archax.com/api/1.0/fiat-account/1/regulated

200 Response

{
"status": "OK",
"data": {
"accountId": 1,
"accountName": "Archax Client Money C",
"accountNumber": "00000058",
"paymentProvider": {
"address1": "4th Floor, Prologue Works",
"address2": "25 Marsh Street",
"address3": "Bristol, BS1 4AX",
"name": "ClearBank Limited"
},
"sortCode": "04-05-78"
},
"timestamp": "2023-03-10T10:02:09.398Z"
}

401 Response

{
"status": "ERROR",
"error": [
{
"msg": "Fiat account is not available for currencyId 5"
}
],
"timestamp": "2023-03-10T10:04:57.392Z"
}

GET https://ace-account.archax.com/api/1.0/fiat-account/:currencyId/:regType

An endpoint that provides account details for use when depositing cash with Archax. Must include bearer token with JWT that has appropriate permissions.

Url path parameters

NameTypeDescription
currencyIdnumberInstrument id of cash to be deposited
regTypestringIndicates if payment is to CASS protected accounts (for regulated activity) or the non-CASS account (for unregulated activity). Value is either regulated or unregulated

Response Schema

NameTypeDescription
accountIdnumberInternal identifier for Archax
accountNamestringName to be used as beneficiary in payment
accountNumberstringAccount number to be used for beneficiary in payment
paymentProviderPayment ProviderBeneficiary bank name and address
sortCodestringPayment routing code for beneficiary bank. This field can include either a sort code, a bank identifier code or a FEDABA depending on the currency of the account

Payment Provider Schema

NameTypeDescription
namestringBeneficiary bank name
address1string1st line of address for beneficiary bank
address2string2nd line of address for beneficiary bank
address3string3rd line of address for beneficiary bank

Instrument Details

Request to

https://ace-reporting.archax.com/api/1.0/instrument/6

200 Response

{
"status": "OK",
"data": {
"id": 6,
"name": "Apple inc.",
"symbol": "APPa",
"currency": "USD",
"description": "Apple inc.",
"status": "Trading",
"type": "security",
"quantityDecimalPlaces": 0,
"priceDecimalPlaces": 2,
"externalId": 3
},
"meta": {
"category": "Exchange",
"firstTradeDate": "2020-09-02",
"fullName": "APPLE INC COM STK NPV (CDI)",
"initialPrice": "680.25",
"isin": "US0378331005",
"lei": "HWUPKR0MPOU8FGXBT394",
"mic": "ARCH",
"minimumOrderValue": "0.01",
"tickSize": "0.01",
"tokeniser": "Securitize",
"website": "www.apple.com"
},
"timestamp": "2023-03-09T13:08:34.282Z"
}

401 Response

{
"status": "ERROR",
"error": [
{
"msg": "Instrument not found"
}
],
"timestamp": "2021-06-07T06:39:21.413Z"
}

GET https://ace-reporting.archax.com/api/1.0/instrument/:instrumentId

An endpoint that provides details of an asset. Must include bearer token with JWT that has appropriate permissions to get all fields. Submitting a request with no bearer token will result in a response with a subset of the below listed fields.

Url path parameters

NameTypeDescription
instrumentIdnumberUnique identifier of the asset

Response Schema

NameTypeDescription
idnumberUnique identifier of the asset
namestringName of the asset
symbolstringTicker symbol of the asset
currencystringSymbol of the currency in which the asset is priced for trading
descriptionstringAdditional details about the asset
statusstringCurrent status of the asset with regards to trading
typestringAsset type (can be “security”, “crypto” or “cash”)
quantityDecimalPlacesnumberNumber of decimal places available for use with any field that accepts a quantity for the asset
priceDecimalPlacesnumberNumber of decimal places used by the system when accepting a price for the asset
externalIdnumberInternal use only
createdstringInternal use only
updatedstringInternal use only
metaMetaAdditional static data about the asset
closenumberClose price of the asset
opennumberOpen price of the asset

Meta Schema

NameTypeDescription
accidentsstringNot in use
addressstringAddress of the issuer
advisersstringNot in use
affiliationsstringNot in use
approvalDatestringDate and time the issuer has approved admission to trading or trading in its financial instruments on the Archax exchange
archaxMarketstringNot in use
associationArticlesstringNot in use
auditReportsstringNot in use
availabilityOfCapitalstringNot in use
availabilityOfPersonnelstringNot in use
benefitsOnTerminationstringNot in use
blockchainProtocolstringBlockchain on which the asset was issued as a token or equivalent
bondBasePointSpreadstringNumber of basis points above or below the index used to calculate accrued interest
bondFixedRatestringThe fixed rate percentage of a return on a debt instrument when held until maturity date expressed as a percentage (i.e. 7.0 means 7%)
bondIdentifierstringISIN of the index/benchmark used to set the floating rate of a return on a debt instrument
bondIndexstringAlias name of the index/benchmark used to set the floating rate of a return on a debt instrument
bondMaturityDatestringThe maturity date of a debt instrument
bondNamestringName of the index/benchmark used to set the floating rate of a return on a debt instrument
bondSenioritystringIdentifies the type of bond
bondTermUnitstringThe unit used for the term of the index or benchmark or a floating rate debt instrument (DAYS, WEEK, MNTH or YEAR)
bondTermValuestring3 digit integer indicating the number of units of the term of the index or benchmark of a floating rate debt instrument
bondTotalIssuedstringTotal issued nominal amount in monetary value (expressed in currency reported in currency field)
bondTypestringThe type of bond: senior, debt, mezzanine, subordinated debt or junior debt
brexitImpactstringNot in use
categorystringCategory of the asset
cfiCodeThe instrument classification expressed using the full (6 character) ISO 10962 CFI code that defines the type of instrument
companyRisksstringNot in use
competitionstringNot in use
contactInfostringContact information of the issuer of the asset
contractAddressstringAddress on the blockchain of the smart contract that manages the asset
corporateAdviserstringNot in use
dependenciesstringNot in use
directorsstringNot in use
dividendsstringNot in use
domicilestringNot in use
environmentalstringNot in use
envRatingstringEnvironmental rating provided as part of ESG rating
epsstringNot in use
esgDescriptionstringDetails of the ESG rating provided
esgLogostringLogo of the provider of the ESG rating
estimatednetAmountPrincipalUsestringNot in use
excessPaymentstringNot in use
exchangeRatestringNot in use
financialInformationstringNot in use
financialInformationStatementstringNot in use
firstIssuanceDatestringDate on which a debt instrument was issued and began to accrue interest
firstTradeDatestringDate and time of the admission to trading on the trading venue or the date and time when the instrument was first traded or an order/quote was first received by Archax exchange
fullNamestringFull name of the instrument as registered to the ISIN
fullNameAndFunctionstringNot in use
generalMeetingsstringNot in use
governanceRatingstringGovernance rating provided as part of ESG rating
highlightsstringNot in use
historyOfIssuestringNot in use
incomeTaxParticularsstringNot in use
incorporationDatestringDate of incorporation of the issuer of the asset
initialPricestringInitial price of the asset when first admitted to the exchange
instrumentNewsstringNot in use
interestRatesstringNot in use
introVideoUrlstringNot in use
investorsstringNot in use
isinstringInternational securities identification number as provided by a national numbering agency
issuanceSizestringIssuance size of the certificate expressed in Euros. Also used for bonds to show total bond size
jurisdictionsstringNot in use
lastYearRumunerationPaidstringNot in use
leistringLegal entity identifier registered with the issuer of the asset
liquidityRisksstringNot in use
litigationstringNot in use
locationsDeniedstringNot in use
lockInstringNot in use
managementstringNot in use
marketOverviewstringNot in use
marketRisksstringNot in use
micstringMarket identifier code of the exchange on which the asset is traded
minimumOrderValuestringLowest value (price * quantity) the exchange will accept for an order to buy or sell the asset
missionstringNot in use
nominalValueUnitstringNominal value of each unit of debt instrument as priced in the associated currency
oldInstrumentIdstringNot in use
ongoingPrincipalInvestmentsstringNot in use
operationalstringNot in use
operationalRisksstringNot in use
partnersstringNot in use
personalBankruptciesstringNot in use
personsResponsiblestringNot in use
placeOfRegistrationstringNot in use
platformstringInternal use only
priceMultiplierstringNot in use
pricipalActivitystringNot in use
primaryIssuancePlatformstringNot in use
proceedsOfOfferstringNot in use
profitForecastsstringNot in use
projectDescriptionstringNot in use
publicSanctionsstringNot in use
recentInsolvenciesstringNot in use
recentPartnershipsstringNot in use
regulationstringNot in use
regulatoryBodiesstringNot in use
relatedIsinstringNot in use
relatedPartyTransactionsstringNot in use
requestDatestringDate and time of the request for admission to trading on the trading venue
researchPolicystringNot in use
securitiesClassAndTypesstringNot in use
securitiesLegislationstringNot in use
securitiesTradeRestrictionsstringNot in use
sedolstringNot in use
segmentstringNot in use
settlementDatestringDate expressed in T+n value of when settlement occurs n days after a trade (Same Day (T) for most assets in Archax exchange)
shareClassstringNot in use
shareholderRightsstringNot in use
shareholdingsstringNot in use
shareNumberstringFor shares and depositary receipts: The total number of outstanding instruments. For ETFs: Number of units issued for trading
shareNumberExceedingstringThe total number of shares corresponding to holdings exceeding 5% of total voting rights of the issuer
shareRegisterCountrystringNot in use
shortDescriptionstringNot in use
shortNamestringShort name registered to the ISIN in accordance with ISO 18774 (Financial Instrument Short Name)
significantDatesstringNot in use
socialMediastringNot in use
socialRatingstringSocial rating provided as part of ESG rating
statementOfCompliancestringNot in use
statutoryAuditorstringNot in use
taxationstringNot in use
technologystringNot in use
terminationDatestringDate and time of when asset will cease to trade on Archax exchange
termsstringNot in use
termsAndConditionsstringNot in use
terrorismstringNot in use
tickSizestringSmallest price variation allowed when submitting an order for the asset
tokeniserstringEntity that created the token smart contract used to issue the asset
transferStatusstringNot in use
trendInformationstringNot in use
underlyingInstrumentIdstringNot in use
unpriSignatorystringIndicator if issuer of asset is a signatory to the United Nations Principles for Responsible Investment
unspentConvictionsstringNot in use
useOfProceedsstringNot in use
vwapstringNot in use
websitestringWebsite associated with the asset and/or issuer
yieldstringNot in use

Open Orders

Request to

https://ace-auth.archax.com/api/1.0/open-orders

200 Response

{
"status": "OK",

"data": [
{
"quantity": "1",
"untradedQuantity": "1",
"limitPrice": "27185",
"created": "1681456445562335",
"instrumentId": 5,
"executions": [],
"id": "1681456445562335",
"side": "sell",
"userReference": "user_reference_1234"
},
{
"quantity": "1",
"untradedQuantity": "1",
"limitPrice": "24185",
"created": "1681456418146386",
"instrumentId": 5,
"executions": [],
"id": "1681456418146386",
"side": "buy",
"userReference": "user_reference_12345"
}
],

"timestamp": "2023-04-14T07:14:10.666Z"
}

GET /open-orders

An endpoint that returns a list of all open orders for the user’s organisation. JWT must be included as bearer token.

Response Schema

NameTypeDescription
idstringUnique order identifier
quantitystringOrder quantity without consideration of decimal places values (decimal places defined in quantityDecimalPlaces from Instruments Schema)
untradedQuantitystringQuantity of unfilled portion of order without consideration of decimal places values (decimal places defined in quantityDecimalPlaces from Instruments Schema)
limitPricestringOrder limit price
createdstringTimestamp on when the trade was executed (ms)
instrumentIdstringUnique identifier of the asset
executionsempty arrayNot used
sidestringOrder side, possible values: buy, sell
userReferencestringValue provided as actionRef in original submission of order

WebSocket API

The Archax WebSocket API allows developers to subscribe to real-time market data feeds.

Additionally, the API accepts commands for the creation and cancellation of orders.

Connection

Login command

{
"action": "login",
"service": "core",
"token": "valid-token"
}

Successful login event

{
"action": "user-login-success",
"data": [],
"description": "Authorisation successful",
"status": "OK",
"type": "user-login"
}

Failed login event

{
"action": "user-login-failed",
"data": [],
"description": "Authorisation failed",
"status": "ERROR",
"type": "user-login"
}

The public WebSocket endpoint is wss://ace-auth.archax.com/api/1.0/gateway.

To login to the API you must obtain a JWT token from the REST login endpoint. In combination with the JWT, you must specify the login action and the core service.

Once your login credentials have been verified, you will receive a user-login-success event. Otherwise you will receive a user-login-failed event and you will then be disconnected.

Market Data

Subscribe to Instruments

Subscribe to Instruments command

{
"action": "subscribe-instruments"
}

Set Instruments event

{
"status": "OK",
"action": "set-instruments",
"data": {
"4": {
"currency": "EUR",
"decimals": 2,
"description": "Fake AG SHRS",
"id": 4,
"marketStatus": "open",
"name": "FAKE SHRS",
"quantityDecimalPlaces": 0,
"regulatedStatus": "eligible",
"symbol": "FAKe",
"tradingStatus": "Trading",
"type": "security",
"venueId": "ARCHAX",
"tickSize": "0.01"
},
"5": {
"currency": "EUR",
"decimals": 2,
"description": "Fake Swiss Property",
"id": 5,
"marketStatus": "open",
"name": "FKE Swiss Property",
"quantityDecimalPlaces": 0,
"regulatedStatus": "eligible",
"symbol": "FAKa",
"tradingStatus": "Trading",
"type": "security",
"venueId": "ARCHAX",
"tickSize": "1.00"
},
"9": {
"currency": "USD",
"decimals": 4,
"description": "Fake BTC Ticker",
"id": 9,
"marketStatus": "closed",
"name": "FKE BTC",
"quantityDecimalPlaces": 8,
"regulatedStatus": "eligible",
"symbol": "FBTC",
"tradingStatus": "Suspended",
"type": "crypto",
"venueId": "ARCHAX",
"tickSize": "0.1"
}
},
"type": "instruments",
"timestamp": "2021-07-08T07:00:20.190Z"
}

Send a subscribe-instruments command to subscribe to instrument updates. It will initially return a set-instruments event that contains all assets available on the exchange while subsequent set-instruments events will only include assets and properties that have since been updated. The data property is an object keyed by instrumentId, with the following details:

Set Instruments Event Schema

NameTypeDescription
[key]Identifier of the asset
currencystring3-letter currency code for the asset
decimalsnumberThe number of significant decimal places for the asset’s price
descriptionstringThe full name of the asset
idnumberUnique identifier of the asset
marketStatusstringCurrent market status for the asset. Possible values are: open, closed and closing auction
namestringThe short name for the asset
quantityDecimalPlacesnumberThe number of significant decimal places for the asset’s quantity
regulatedStatusstringThe regulated status of the asset. Possible values are: eligible and ineligible
symbolstringTicker symbol for the asset
tradingStatusstringCurrent trading status for the asset. Possible values are: Created, Pre-Live, Trading, Suspended and Terminated
typestringThe asset type. Possible values are: security and crypto
venueIdstringDefault value: ARCHAX
tickSizestringMinimum price amount an instrument can move

Subscribe to Market Quotes

Subscribe to Market Quotes command

{
"action": "subscribe-market-quotes"
}

Set Market Quotes event (initial)

{
"status": "OK",
"action": "set-market-quotes",
"data": {
"1": {
"askPrice": "",
"askQty": "",
"bidPrice": "",
"bidQty": "",
"changePercent": "-38.60",
"changePrice": "-6408",
"closePrice": "16600",
"cumulativeUnits": "",
"cumulativeValue": "",
"highPrice": "10192",
"instrumentId": 1,
"lastPrice": "10192",
"lastQty": "1",
"lowPrice": "10192",
"openPrice": "10192",
"sevenDayChange": "1068",
"sevenDayChangePercentage": "11.71",
"sevenDayClosePrice": "9124"
},
"2": {
"askPrice": "",
"askQty": "",
"bidPrice": "",
"bidQty": "",
"changePercent": "-24.19",
"changePrice": "-4112",
"closePrice": "17000",
"cumulativeUnits": "",
"cumulativeValue": "",
"highPrice": "13809",
"instrumentId": 2,
"lastPrice": "12888",
"lastQty": "1",
"lowPrice": "12967",
"openPrice": "12888",
"sevenDayChange": "867",
"sevenDayChangePercentage": "7.21",
"sevenDayClosePrice": "12021"
},
"3": {
"askPrice": "",
"askQty": "",
"bidPrice": "",
"bidQty": "",
"changePercent": "0.00",
"changePrice": "",
"closePrice": "36900",
"cumulativeUnits": "178",
"cumulativeValue": "6723900",
"highPrice": "39740",
"instrumentId": 3,
"lastPrice": "36900",
"lastQty": "1287",
"lowPrice": "36500",
"openPrice": "36000",
"sevenDayChange": "-3100",
"sevenDayChangePercentage": "-7.75",
"sevenDayClosePrice": "40000"
}
},
"type": "market-quotes",
"timestamp": "2021-10-05T10:53:59.201Z"
}

Set Market Quotes event (update)

{
"status": "OK",
"action": "set-market-quotes",
"data": {
"3": {
"askPrice": "36555",
"askQty": "250"
}
}
}

Set Market Quotes event (reset specified properties)

{
"status": "OK",
"action": "set-market-quotes",
"data": {
"3": {
"bidPrice": "",
"bidQty": "",
"openPrice": ""
}
}
}

Send a subscribe-market-quotes command to subscribe to real-time pricing updates for all instruments available in the market. It initially returns a set-market-quotes event that includes the market quotes for each instrument. Subsequent events only contain updates for the included fields.

Each value in the data property is keyed by instrumentId.

Set Market Quotes Event Schema

NameTypeDescription
[key]Identifier of the asset
askPricestringBest asking price for the asset
askQtystringNumber of units on offer at the askPrice
bidPricestringBest bid price for the asset
bidQtystringNumber of units requested at the bidPrice
changePercentstringThe percentage difference between the lastPrice and closePrice
changePricestringThe difference between the lastPrice and closePrice
closePricestringThe asset’s last traded price from the previous trading session
cumulativeUnitsstringThe cumulative volume of units traded within the current trading session
cumulativeValuestringThe cumulative value of all trades on the asset for the current trading session
instrumentIdnumberUnique identifier of the asset
lastPricestringLast traded price for the asset
highPricestringHighest trade price for the asset during the current trading session
lowPricestringLowest trade price for the asset during the current trading session
lastQtystringLast traded quantity for the asset
openPricestringPrice at which the first execution of the day for the asset occurred
sevenDayChangestringThe difference between closePrice and sevenDayClosePrice
sevenDayChangePercentagestringThe percentage difference between the closePrice and sevenDayClosePrice
sevenDayClosePricestringThe asset’s close price 7 days prior

If the value returned for askPrice is 2356 and the asset’s decimals property is 3. The actual askPrice is then obtained by evaluating: 2356 / (10 ^ 3) which gives 2.356. The same goes for all properties that end with Price.

The set-market-quotes event would be returned each time there’s a change on any of the fields listed in the preceding table. The data property would only contain the fields that have changed. So, if you have an instrument with the following state:

"2": { "askPrice": "", "askQty": "", "bidPrice": "", "bidQty": "", "changePercent": "-24.19", "changePrice": "-4112.00", "closePrice": "17000", "cumulativeUnits": "", "cumulativeValue": "", "highPrice": "12888", "instrumentId": 2, "lastPrice": "12888", "lastQty": "3", "lowPrice": "12888", "openPrice": "", "sevenDayChange": "867.00", "sevenDayChangePercentage": "7.21", "sevenDayClosePrice": "12021" }

and you receive an update with following data:

{ "2": { "askQty": "35", } }

the expected state of instrumentId 2 is:

"2": { "askPrice": "", "askQty": "35", "bidPrice": "", "bidQty": "", "changePercent": "-24.19", "changePrice": "-4112.00", "closePrice": "17000", "cumulativeUnits": "", "cumulativeValue": "", "highPrice": "12888", "instrumentId": 2, "lastPrice": "12888", "lastQty": "3", "lowPrice": "12888", "openPrice": "", "sevenDayChange": "867.00", "sevenDayChangePercentage": "7.21", "sevenDayClosePrice": "12021" }

At the start of a trading session, a set-market-quotes event would be returned and the content of its data property would be similar to:

"2": { "askPrice": "", "askQty": "", "bidPrice": "", "bidQty": "", "changePercent": "0.00", "changePrice": "0", "cumulativeUnits": "", "cumulativeValue": "", "highPrice": "", "lowPrice": "", "openPrice": "" }

the expected state of instrumentId 2 would then be:

"2": { "askPrice": "", "askQty": "", "bidPrice": "", "bidQty": "", "changePercent": "0.00", "changePrice": "0", "closePrice": "17000", "cumulativeUnits": "", "cumulativeValue": "", "highPrice": "", "instrumentId": 2, "lastPrice": "12888", "lastQty": "3", "lowPrice": "", "openPrice": "", "sevenDayChange": "867.00", "sevenDayChangePercentage": "7.21", "sevenDayClosePrice": "12021" }

Subscribe to Cash

Subscribe to Cash command

{
"action": "subscribe-cash"
}

Set Cash event

{
"status": "OK",
"action": "set-cash",
"data": {
"1": {
"currency": "GBP",
"decimals": 2,
"description": "British pound sterling",
"id": 1,
"marketStatus": "closed",
"name": "GBP",
"priceDecimalPlaces": 2,
"quantityDecimalPlaces": 2,
"regulatedStatus": "eligible",
"symbol": "GBP",
"tickSize": "",
"tradingStatus": "Created",
"type": "cash",
"venueId": "ARCHAX",
""
},
"2": {
"currency": "USD",
"decimals": 2,
"description": "U.S. Dollar",
"id": 2,
"marketStatus": "closed",
"name": "USD",
"priceDecimalPlaces": 2,
"quantityDecimalPlaces": 2,
"regulatedStatus": "eligible",
"symbol": "USD",
"tickSize": "",
"tradingStatus": "Created",
"type": "cash",
"venueId": "ARCHAX"
},
"27": {
"currency": "NGN",
"decimals": 2,
"description": "Electronic Naira",
"id": 27,
"marketStatus": "closed",
"name": "eNaira",
"priceDecimalPlaces": 2,
"quantityDecimalPlaces": 2,
"regulatedStatus": "eligible",
"symbol": "eNGN",
"tickSize": "",
"tradingStatus": "Created",
"type": "cash",
"venueId": "ARCHAX"
},
"28": {
"currency": "MNY",
"decimals": 2,
"description": "MONEY",
"id": 28,
"marketStatus": "closed",
"name": "MONEY",
"priceDecimalPlaces": 2,
"quantityDecimalPlaces": 2,
"regulatedStatus": "eligible",
"symbol": "MNY",
"tickSize": "",
"tradingStatus": "Created",
"type": "cash",
"venueId": "ARCHAX"
},
"29": {
"currency": "PHP",
"decimals": 2,
"description": "Philippine Fiat Currency",
"id": 29,
"marketStatus": "closed",
"name": "Philippine Peso",
"priceDecimalPlaces": 2,
"quantityDecimalPlaces": 2,
"regulatedStatus": "eligible",
"symbol": "PHP",
"tickSize": "",
"tradingStatus": "Created",
"type": "cash",
"venueId": "ARCHAX"
}
},
"type": "cash",
"timestamp": "2023-03-10T07:28:31.028Z"
}

Send a subscribe-cash command to subscribe to cash details. It will initially return a set-cash event that contains all cash assets available on the exchange as quote currencies. Subsequent set-cash events will only include assets and properties that have since been updated

Set Cash Event Schema

NameTypeDescription
[key]Identifier of the asset
currencystring3-letter currency code for the asset
decimalsnumberThe number of significant decimal places for the asset’s price
descriptionstringThe full name of the asset
idnumberUnique identifier of the asset
marketStatusstringCurrent market status for the asset. Possible values are: open, closed and closing auction
namestringThe short name for the asset
quantityDecimalPlacesnumberThe number of significant decimal places for the asset’s quantity
regulatedStatusstringThe regulated status of the asset. Possible values are: eligible and ineligible
symbolstringTicker symbol for the asset
tradingStatusstringCurrent trading status for the asset. Possible values are: Created, Pre-Live, Trading, Suspended and Terminated
typestringThe asset type. Possible values are: security and crypto
venueIdstringDefault value: ARCHAX
tickSizestringMinimum price amount an instrument can move
priceDecimalPlacesnumberThe number of decimal places for the asset’s price

Balances

Fetch Balances

Fetch Balances command

{
"action": "fetch-balances"
}

Fetch Balances event

{
"action": "fetch-balances",
"data": {
"2786123094": {
"accountId": 2786123094,
"accountType": "accountSecurity",
"available": "1000000400",
"instrumentId": 1,
"regulatoryEligibility": "eligible",
"total": "1000000400"
},
"2786123904": {
"accountId": 2786123904,
"accountType": "accountSecurity",
"available": "1000000400",
"regulatoryEligibility": "eligible",
"instrumentId": 2,
"total": "1000000400"
},
"2786123095": {
"accountId": 2786123095,
"accountType": "accountCrypto",
"available": "1000000400",
"regulatoryEligibility": "eligible",
"instrumentId": 3,
"total": "1000000400"
},
"2786123398": {
"accountId": 2786123398,
"accountType": "accountCash",
"available": "1000000400",
"regulatoryEligibility": "eligible",
"instrumentId": 4,
"total": "1000000400"
},
"2786122842": {
"accountId": 2786122842,
"accountType": "accountUnregulatedCash",
"available": "1000000400",
"regulatoryEligibility": "eligible",
"instrumentId": 5,
"total": "1000000400"
},
"2786122894": {
"accountId": 2786122894,
"accountType": "accountCash",
"available": "1000000400",
"regulatoryEligibility": "eligible",
"instrumentId": 6,
"total": "1000000400"
}
},
"timestamp": "2021-07-01T04:30:06.127Z"
}

Send a fetch-balances command to retrieve all account balances for the organisation to which you belong. The response is a fetch-balances event that includes a data property where the object is keyed by accountId. The fetch-balances event includes the following details:

Fetch Balances Event Schema

NameTypeDescription
[key]Identifier of the account
accountIdnumberUnique identifier for the account
accountTypestringType of account. The possible values are: accountCash, accountUnregulatedCash, accountSecurity and accountCrypto
availablestringAvailable balance of account (for cash accounts, the last two digits are decimal places)
regulatoryEligibilitystringIndicates regulatory eligibility. Possible values are: eligible and ineligible
instrumentIdnumberIdentifier of the account asset
totalstringTotal balance of account (for cash accounts, the last two digits are decimal places)

Subscribe to Balances

Subscribe to Balances command

{
"action": "subscribe-balances"
}

Set Balances event

{
"status": "OK",
"action": "set-balances",
"data": {
"2786123094": {
"accountId": 2786123094,
"accountType": "accountCash",
"available": "1000000400",
"instrumentId": 1,
"regulatoryEligibility": "eligible",
"total": "1000000400"
},
"2786123095": {
"accountId": 2786123095,
"accountType": "accountSecurity",
"available": "1000000400",
"instrumentId": 2,
"regulatoryEligibility": "eligible",
"total": "1000000400"
},
"2786122842": {
"accountId": 2786122842,
"accountType": "accountCrypto",
"available": "1000180131",
"instrumentId": 3,
"regulatoryEligibility": "eligible",
"total": "1000180207"
}
},
"type": "balances",
"timestamp": "2021-07-01T04:30:06.408Z"
}

Send a subscribe-balances command to subscribe to account balance updates. It will initially return a set-balances event that contains all account balances while subsequent set-balances events will only include account balances that have since been updated. The data property is an object keyed by accountId, with the following details:

Set Balances Event Schema

NameTypeDescription
[key]Identifier of the asset
accountIdnumberUnique identifier for the account
accountTypestringType of account. The possible values are: accountCash, accountUnregulatedCash, accountSecurity and accountCrypto
availablestringAvailable balance of account (for cash accounts, the last two digits are decimal places)
instrumentIdnumberUnique identifier of the asset
regulatoryEligibilitystringIndicates regulatory eligibility. Possible values are: eligible and ineligible
totalstringTotal balance of account (for cash accounts, the last two digits are decimal places)

Orders

Submit an Order

Submit Order command

{
"action": "order-submit",
"data": {
"actionRef": "user_reference_1234",
"instrumentId": 3,
"limitPrice": "356.99",
"orderType": 0,
"quantity": 100,
"side": 0
}
}

Order Updated event

{
"status": "OK",
"action": "order-updated",
"data": {
"actionRef": "user_reference_1234",
"orderId": "1625642744032536",
"organisationId": 1,
"status": "open"
},
"type": "notifications",
"timestamp": "2021-07-07T07:25:45.140Z"
}

Order Updated event with status ERROR (order rejected)

{
"status": "ERROR",
"action": "order-updated",
"data": {
"actionRef": "user_reference_1234",
"error": "Dynamic Price Collar",
"orderId": "1626062904341855",
"organisationId": 1,
"status": "rejected"
},
"type": "notifications",
"timestamp": "2021-07-07T07:25:45.140Z"
}

Order Submitted event with status ERROR

{
"status": "ERROR",
"action": "order-submitted",
"data": {
"error": "No instrument selected",
"actionRef": "user_reference_1234"
},
"type": "notifications",
"timestamp": "2021-07-07T07:45:04.231Z"
}

Send an order-submit command to submit an order. The response is either an order-updated event for a successfully received order or an order-submitted event with a status of ERROR.

Order Submit Command Schema

NameTypeDescription
actionRefstringUser-specified identifier; it will be included the response
instrumentIdnumberUnique identifier of the asset
limitPricestringLimit Price for the order
orderTypenumberType of order, possible values: 0 = Limit Order
quantitynumberQuantity
sidenumberMarket side of order, possible values: 0 = Buy, 1 = Sell

Order Updated Event Schema

NameTypeDescription
actionRefstringIf the order status is open or rejected, it will be the actionRef that was included in the submitted order. If the order status is cancelled, it will be the orderId. Otherwise it will not be included for other status values.
errorstringDescription of error that was identified, will not be included if there is no error.
orderIdstringUnique identifier for the order
organisationIdnumberUnique identifier for the organisation that placed the order
statusstringStatus of order, possible values: pending, open, cancelled, expired, rejected, completed

Order Submitted (Error) Event Schema

NameTypeDescription
errorstringDescription of error that was identified
actionRefstringUser-specified identifier that was included in the submitted order

Subscribe to Orders

Subscribe to Orders command

{
"action": "subscribe-orders"
}

Set Orders event (initial)

{
"status": "OK",
"action": "set-orders",
"data": {
"1623217157444399": {
"averagePrice": "1000",
"created": "1623217157444",
"commission": "10",
"currency": "EUR",
"decimals": 2,
"executions": {
"1623217158966156": {
"created": "1623217158966",
"commission": "10",
"grossExecutionAmount": "17000",
"price": "1000",
"id": "1623217158966156",
"quantity": "17",
"tax": "0"
}
},
"filledPercent": "100.00",
"filledQty": "17",
"filledStatus": "filled",
"id": "1623217157444399",
"instrumentId": 24,
"limitPrice": "1000",
"orderStatus": "completed",
"quantity": "17",
"side": "buy",
"symbol": "OASa",
"type": "limit",
"tax": "0",
"userId": 1
},
"1623217157504910": {
"averagePrice": "1000",
"created": "1623217157504",
"commission": "20",
"currency": "GBX",
"decimals": 2,
"executions": {
"1623217159226194": {
"created": "1623217159226",
"commission": "20",
"grossExecutionAmount": "14000",
"price": "1000",
"id": "1623217159226194",
"quantity": "14",
"tax": "0"
}
},
"filledPercent": "100.00",
"filledQty": "14",
"filledStatus": "filled",
"id": "1623217157504910",
"instrumentId": 25,
"limitPrice": "1000",
"orderStatus": "completed",
"quantity": "14",
"side": "sell",
"symbol": "OADa",
"type": "limit",
"tax": "0",
"userId": 2
}
},
"type": "orders",
"timestamp": "2021-07-06T08:04:40.837Z"
}

Set Orders event (update)

{
"status": "OK",
"action": "set-orders",
"data": {
"1626077181607120": {
"orderStatus": "open"
}
},
"type": "orders",
"timestamp": "2021-07-12T08:06:21.613Z"
}

Send a subscribe-orders command to subscribe to order updates for the organisation you belong to. It initially returns a set-orders event that includes all orders. Subsequent set-orders events will only contain orders that have since been updated. The data property will be an object keyed by order id, with the following details:

Set Orders Event Schema

NameTypeDescription
[key]Unique order identifier
averagePricestringAverage execution price for the order
createdstringTimestamp on when the order was placed (ms)
currencystringCurrency code
commissionstringTotal commission value of the order
decimalsnumberNumber of decimal places of price figures of order instrument
executionsExecutionDetails of executed trades, keyed by id (where id is a unique reference to the execution)
filledPercentstringFilled percent
filledQtystringFilled quantity without consideration of decimal places value (decimal places defined in quantityDecimalPlaces from Instruments Schema)
filledStatusstringFill status, possible values: unfilled, partiallyFilled, filled
idstringUnique order identifier
instrumentIdnumberUnique identifier of the asset
limitPricestringOrder limit price
orderStatusstringOrder status, possible values: pending, open, cancelled, expired, rejected, completed
quantitystringOrder quantity without consideration of decimal places value (decimal places defined in quantityDecimalPlaces from Instruments Schema)
sidestringOrder side, possible values: buy, sell
symbolstringTicker symbol of instrument
typestringOrder type, possible values: limit
taxstringTotal tax value of the order
userIdnumberUnique identifier of the user

Execution Schema

NameTypeDescription
commissionstringTotal commission value of the execution
createdstringTimestamp on when the trade was executed (ms)
grossExecutionAmountstringProduct of executed price and quantity
pricestringExecuted price
idstringUnique identifier to execution
quantitystringExecuted quantity without consideration of decimal places value (decimal places defined in quantityDecimalPlaces from Instruments Schema)
taxstringTotal tax value of the order

set-orders updates must be deeply merged from the previous state. For example, if an order has the following state:

{ "1626077181607120": { "orderStatus": "pending", "decimals": 2, "instrumentId": 3, "filledPercent": "0.00", "created": 1626077181607.12, "quantity": 100, "averagePrice": 0, "limitPrice": "35699", "currency": "USD", "filledQty": "0", "filledStatus": "unfilled", "side": "buy", "symbol": "FAKe", "type": "limit", "executions": {}, "id": "1626077181607120" } }

and you receive an update with following data:

{ "1626077181607120": { "orderStatus": "open" } }

the expected state of order 1626077181607120 is:

{ "1626077181607120": { "orderStatus": "open", "decimals": 2, "instrumentId": 3, "filledPercent": "0.00", "created": 1626077181607.12, "quantity": 100, "averagePrice": 0, "limitPrice": "35699", "currency": "USD", "filledQty": 0, "filledStatus": "unfilled", "side": "buy", "symbol": "FAKe", "type": "limit", "executions": {}, "id": "1626077181607120" } }

Cancel an Order

Cancel Order Command

{
"action": "order-cancel",
"data": {
"actionRef": "user_reference_1234",
"orderId": "1625642744032536"
}
}

Order Cancelled Event

{
"status": "OK",
"action": "order-cancelled",
"data": {
"actionRef": "1625642744032536",
"orderId": "1625642744032536",
"organisationId": 1,
"status": "cancelled"
},
"type": "notifications",
"timestamp": "2021-07-07T18:57:04.231Z"
}

Cancellation Rejected Event

{
"status": "ERROR",
"action": "cancel-rejected",
"data": {
"actionRef": "1625642744032536",
"error": "Order cannot be cancelled",
"orderId": "1625642744032536",
"organisationId": 1,
"reason": "marketClosed",
"status": "completed",
"userId": 12
},
"type": "notifications",
"timestamp": "2021-07-07T18:57:04.231Z"
}

Cancel Failed Event with ERROR status

{
"status": "ERROR",
"action": "cancel-failed",
"data": {
"error": "No order id provided",
"actionRef": "user_reference_1234"
},
"type": "notifications",
"timestamp": "2021-07-07T18:57:04.231Z"
}

Send an order-cancel command to cancel an order.

Order cancellation is only available for orders submitted by users within that organisation with a status of open. If the status of an order is one of cancelled, completed, expired or rejected, sending the order-cancel command would result in a cancel-rejected event being returned.

The successful cancellation of an order would cause an order-cancelled event to be returned while a cancel-failed event is returned when there are errors in the submitted order-cancel command.

Cancel Order Command Schema

NameTypeDescription
actionRefstringOptional field for client to include a unique identifier
orderIdstringUnique identifier for the order

Order Cancelled Event Schema

NameTypeDescription
actionRefstringUnique identifier provided by client
orderIdstringUnique identifier for the order
organisationIdnumberUnique identifier for the organisation that placed the order
statusstringThe status of the order

Cancellation Rejected Event Schema

NameTypeDescription
actionRefstringUnique identifier provided by client
errorstringError message
orderIdstringUnique identifier for the order
organisationIdnumberUnique identifier for the organisation that placed the order
reasonstringThe reason for the rejection
statusstringThe status of the order
userIdstringUnique identifier of the user that requested the cancellation

Cancellation Failed Event Schema

NameTypeDescription
actionRefstringUser-specified identifier
errorstringError message; would contain the reason for the failure

Order Book

Subscribe to Market Depths

Subscribe to Market Depths command

{
"action": "subscribe-market-depths"
}

Set Market Depths event (initial)

{
"status": "OK",
"action": "set-market-depths",
"data": {
"1": {
"buy": {
"1200": 100,
"1300": 50
},
"indicativePrice": "",
"indicativeVolume": "",
"instrumentId": 1,
"sell": {
"1310": 20,
"1320": 50
}
},
"2": {
"buy": {
"2300": 10,
"2400": 10
},
"indicativePrice": "",
"indicativeVolume": "",
"instrumentId": 2,
"sell": {
"2500": 15,
"2510": 100
}
},
"3": {
"buy": {
"10000": 20,
"9900": 30
},
"indicativePrice": "",
"indicativeVolume": "",
"instrumentId": 1,
"sell": {
"10100": 30,
"10110": 50
}
}
},
"type": "market-depths",
"timestamp": "2021-07-01T05:17:00.691Z"
}

Set Market Depths event (update)

{
"status": "OK",
"action": "set-market-depths",
"data": {
"1": {
"instrumentId": 1,
"buy": {
"1200": 120
},
"sell": {}
}
},
"type": "market-depths",
"timestamp": "2021-07-01T05:17:00.691Z"
}

Set Market Depths event (update, depth removed from Order Book)

{
"status": "OK",
"action": "set-market-depths",
"data": {
"1": {
"instrumentId": 1,
"buy": {
"1200": 0
},
"sell": {
"1199": 0
}
}
},
"type": "market-depths",
"timestamp": "2021-07-01T05:17:00.691Z"
}

Send a subscribe-market-depths command to subscribe to Order Book updates for all instruments available in the market. It initially returns a set-market-depths event that includes Order Book information for each instrument available in the market. Subsequent events only contain updates for affected sides and depths of an instrument. Each value in the data property is keyed by instrumentId, and values under each side of the market (buy or sell) are keyed by market depth (prices). Note that the two right most digits in all prices represent decimal places.

Set Market Depths Event Schema

NameTypeDescription
[key]Identifier of the asset
buystringMarket depth (price) for the buy side of the market
indicativePricestring(Provided during auction phase) The price at which the most executions would occur if the auction ended at the current time. Also referred to as the uncrossing price
indicativeVolumestring(Provided during auction phase) The number of units that would exchange hands if the auction ended at the current time
instrumentIdnumberIdentifier of the asset
sellstringMarket depth (price) for the sell side of the market

Market Depth Schema (Buy or Sell)

NameTypeDescription
[key]Market depth (price without consideration of decimal places value, decimal places defined in decimals from Instruments Schema)
[value]numberVolume (quantity without consideration of decimal places value, decimal places defined in quantityDecimalPlaces from Instruments Schema)

set-market-depths updates must be deeply merged from the previous state. For example, if an instrument has the following state:

{ "1": { "buy": { "1200": 100, "1300": 50 }, "indicativePrice": "", "indicativeVolume": "", "instrumentId": 1, "sell": { "1310": 20, "1320": 50 } } }

and you receive an update with following data:

{ "1": { "buy": { "1100": 500 }, "instrumentId": 1, "sell": {} } }

the expected state of instrumentId 1 is:

{ "1": { "buy": { "1100": 500, "1200": 100, "1300": 50 }, "indicativePrice": "", "indicativeVolume": "", "instrumentId": 1, "sell": { "1310": 20, "1320": 50 } } }


set-market-depths updates with a quantity value of 0 are sent to clear a particular depth. For example, if an instrument has the following state:

{ "1": { "buy": { "1200": 100, "1300": 50 }, "indicativePrice": "", "indicativeVolume": "", "instrumentId": 1, "sell": { "1310": 20, "1320": 50 } } }

and you receive an update with following data:

{ "1": { "buy": { "1300": 0 }, "instrumentId": 1, "sell": {} } }

the expected state of instrumentId 1 is:

{ "1": { "buy": { "1200": 100 }, "indicativePrice": "", "indicativeVolume": "", "instrumentId": 1, "sell": { "1310": 20, "1320": 50 } } }

Trades

Subscribe to Trade History

Subscribe to a single instruments Trade History command. Where 1 denotes an example instrumentId.

{
"action": "subscribe-trade-histories/1"
}

Subscribe to all Trade History.

{
"action": "subscribe-trade-histories"
}

Response JSON returned example -

Initial Set Trade History event

{
"status": "OK",
"action": "set-trade-histories/1",
"data": {
"1": [
{
"amount": "81",
"created": "1619080206756725504",
"price": "9124",
"side": "sell"
},
{
"amount": "4",
"created": "1619080141466397184",
"price": "10875",
"side": "buy"
},
{
"amount": "48",
"created": "1619080099647654400",
"price": "9059",
"side": "buy"
}
]
},
"type": "trade-histories",
"timestamp": "2021-08-27T14:39:46.820Z"
}

Set Trade History event (update)

{
"status": "OK",
"action": "append-trade-histories/1",
"data": {
"1": [
{
"amount": "45",
"created": "1619080206756725534",
"price": "9127",
"side": "sell"
}
]
},
"type": "trade-histories",
"timestamp": "2021-08-27T15:35:59.147Z"
}

To subscribe to all trade histories, send a subscribe-trade-histories command. To subscribe to trade history for a specific instrumentId send a subscribe-trade-histories/[instrumentId] command to subscribe to trade history updates. It will initially return a set-trade-histories/[instrumentId] event that contains the most recently executed trades for the requested instrumentId. An append-trade-histories/[instrumentId] event will then be returned for each additional trade executes while the subscription is active.

Note that a maximum of the latest twenty orders only is returned for the requested instrumentId or the latest 20 for all trade history.

The data property is an object keyed by instrumentId, with the following details:

Set trade history Event Schema

NameTypeDescription
[key]Unique identifier of the instrument
amountstringQuantity traded
createdstringTime of trade
pricestringExecuted price, the last 2 digits are decimal places
sidestringAggressive side of order (buy or sell). auction is returned as value when trade is a result of an auction

Transactions

Subscribe to Transactions

Subscribe to Transactions command

{
"action": "subscribe-transactions"
}

Set Transaction event

{
"status": "OK",
"action": "set-transactions",
"data": {
"entries": [
{
"id": "1631023590277781",
"organisationId": 3,
"userId": 12,
"accountId": 2786122875,
"amount": "10",
"referenceId": "1631023590277580",
"created": "1631023590272836",
"ledgerType": "debit",
"reportType": "execution",
"commissionReference": "0",
"instrumentId": "3"
},
{
"id": "1631023590278240",
"organisationId": 3,
"userId": 12,
"accountId": 2786122905,
"amount": "409500",
"referenceId": "1631023590277580",
"created": "1631023590272872",
"ledgerType": "credit",
"reportType": "execution",
"commissionReference": "0",
"instrumentId": "33"
},
{
"id": "1631016154737596",
"organisationId": 3,
"userId": 5,
"accountId": 2786123148,
"amount": "109",
"referenceId": "1631016154736971",
"created": "1631016154725876",
"ledgerType": "debit",
"reportType": "commission",
"commissionReference": "1631016099181019",
"instrumentId": "7"
},
{
"id": "1631016154737159",
"organisationId": 3,
"userId": 5,
"accountId": 2786123148,
"amount": "1090",
"referenceId": "1631016154736971",
"created": "1631016154725882",
"ledgerType": "debit",
"reportType": "execution",
"commissionReference": "0",
"instrumentId": "32"
},
{
"id": "1631016154738149",
"organisationId": 3,
"userId": 5,
"accountId": 2786123124,
"amount": "109",
"referenceId": "1631016154736971",
"created": "1631016154725886",
"ledgerType": "credit",
"reportType": "execution",
"commissionReference": "0",
"instrumentId": "7"
},
{
"id": "1631014364506141",
"organisationId": 3,
"userId": 5,
"accountId": 2786123148,
"amount": "109",
"referenceId": "1631014364505500",
"created": "1631014364499891",
"ledgerType": "debit",
"reportType": "commission",
"commissionReference": "1631014308958295",
"instrumentId": "7"
},
{
"id": "1631014364505723",
"organisationId": 3,
"userId": 5,
"accountId": 2786123148,
"amount": "1090",
"referenceId": "1631014364505500",
"created": "1631014364499895",
"ledgerType": "debit",
"reportType": "execution",
"commissionReference": "0",
"instrumentId": "32"
},
{
"id": "1631014364507061",
"organisationId": 3,
"userId": 5,
"accountId": 2786123124,
"amount": "109",
"referenceId": "1631014364505500",
"created": "1631014364499900",
"ledgerType": "credit",
"reportType": "execution",
"commissionReference": "0",
"instrumentId": "7"
},
{
"id": "1631014099470021",
"organisationId": 3,
"userId": 5,
"accountId": 2786123124,
"amount": "1234",
"referenceId": "1631014099467372",
"created": "1631014099463903",
"ledgerType": "credit",
"reportType": "execution",
"commissionReference": "0",
"instrumentId": "7"
},
{
"id": "1631014099468016",
"organisationId": 3,
"userId": 5,
"accountId": 2786123148,
"amount": "121",
"referenceId": "1631014099467372",
"created": "1631014099463907",
"ledgerType": "debit",
"reportType": "commission",
"commissionReference": "1631014043667348",
"instrumentId": "7"
}
]
},
"type": "transactions",
"timestamp": "2021-09-08T00:46:23.587Z"
}

Send a subscribe-transactions command to subscribe to transaction updates. It will return a set-transactions event that contains the last 1000 transactions for the organisation you belong to. Subsequent transactions would also cause a set-transactions event to be returned which will maintain the same data structure and the list of entries would include the new transactions.

The data property is an object with a single key entries which in turn is an array of transaction objects. Each transaction object has the following details:

Set Transaction Event Schema

NameTypeDescription
idstringUnique identifier of the transaction
organisationIdnumberUnique identifier for the organisation associated with the transaction
userIdnumberUnique identifier of the user associated with the transaction
accountIdnumberUnique identifier for the account
amountstringFor cash accounts - actual monetary value of the transaction where the last two digits are decimal places
For security accounts - quantity involved in the transaction
referenceIdstringUnique reference to event (where event can be an execution or a notification for a deposit etc.)
createdstringTime of transaction
ledgerTypestringValue is one of credit or debit
reportTypestringValue can be one of - commission, execution, deposit, fee, coupon, manualCorrection, interest, dividend, withdrawal or tax
commissionReferencestringUnique identifier of the commission if applicable
instrumentIdstringUnique identifier of the asset

set-transactions event updates must completely replace the previous state. For example, if your transactions list has the following state:

[ { "id": "1631014099470021", "organisationId": 3, "userId": 5, "accountId": 2786123124, "amount": "1234", "referenceId": "1631014099467372", "created": "1631014099463903", "ledgerType": "credit", "reportType": "execution", "commissionReference": "0", "instrumentId": "7" }, { "id": "1631014099468016", "organisationId": 3, "userId": 5, "accountId": 2786123148, "amount": "121", "referenceId": "1631014099467372", "created": "1631014099463907", "ledgerType": "debit", "reportType": "commission", "commissionReference": "1631014043667348", "instrumentId": "7" } ]

an event to update the list of transactions you have would be in the form:

{ "status": "OK", "action": "set-transactions", "data": { "entries": [ { "id": "1631014364507061", "organisationId": 3, "userId": 5, "accountId": 2786123124, "amount": "109", "referenceId": "1631014364505500", "created": "1631014364499900", "ledgerType": "credit", "reportType": "execution", "commissionReference": "0", "instrumentId": "7" }, { "id": "1631014099470021", "organisationId": 3, "userId": 5, "accountId": 2786123124, "amount": "1234", "referenceId": "1631014099467372", "created": "1631014099463903", "ledgerType": "credit", "reportType": "execution", "commissionReference": "0", "instrumentId": "7" }, { "id": "1631014099468016", "organisationId": 3, "userId": 5, "accountId": 2786123148, "amount": "121", "referenceId": "1631014099467372", "created": "1631014099463907", "ledgerType": "debit", "reportType": "commission", "commissionReference": "1631014043667348", "instrumentId": "7" } ] } }

and the resulting transactions state will be:

[ { "id": "1631014364507061", "organisationId": 3, "userId": 5, "accountId": 2786123124, "amount": "109", "referenceId": "1631014364505500", "created": "1631014364499900", "ledgerType": "credit", "reportType": "execution", "commissionReference": "0", "instrumentId": "7" }, { "id": "1631014099470021", "organisationId": 3, "userId": 5, "accountId": 2786123124, "amount": "1234", "referenceId": "1631014099467372", "created": "1631014099463903", "ledgerType": "credit", "reportType": "execution", "commissionReference": "0", "instrumentId": "7" }, { "id": "1631014099468016", "organisationId": 3, "userId": 5, "accountId": 2786123148, "amount": "121", "referenceId": "1631014099467372", "created": "1631014099463907", "ledgerType": "debit", "reportType": "commission", "commissionReference": "1631014043667348", "instrumentId": "7" } ]



Custody

Subscribe to Deposits

Subscribe To Deposits command

{
"action": "subscribe-deposits"
}

Set Deposits event

{
"status": "OK",
"action": "set-deposits",
"data": {
"1658732301686225": {
"accountId": "118",
"amount": "300000",
"created": "1658732301000000",
"id": "1658732301686225",
"instrumentId": 1,
"organisationId": 1,
"reason": "None",
"referenceId": "1658732301544438",
"status": "Pending",
"type": "Deposit",
"updated": "1658732301000000",
"userId": 13,
"walletAddress": ""
},
"1658730084256007": {
"accountId": "118",
"amount": "300000",
"created": "1658730084000000",
"id": "1658730084256007",
"instrumentId": 1,
"organisationId": 1,
"reason": "None",
"referenceId": "1658730084120637",
"status": "Pending",
"type": "Deposit",
"updated": "1658730084000000",
"userId": 13,
"walletAddress": ""
},
"1658730034966343": {
"accountId": "118",
"amount": "300000",
"created": "1658730034000000",
"id": "1658730034966343",
"instrumentId": 1,
"organisationId": 1,
"reason": "None",
"referenceId": "1658730034833466",
"status": "Pending",
"type": "Deposit",
"updated": "1658730034000000",
"userId": 13,
"walletAddress": ""
},
"1658729853582198": {
"accountId": "120",
"amount": "300000",
"created": "1658729853000000",
"id": "1658729853582198",
"instrumentId": 2,
"organisationId": 1,
"reason": "None",
"referenceId": "1658729853446574",
"status": "Pending",
"type": "Deposit",
"updated": "1658729853000000",
"userId": 13,
"walletAddress": ""
},
"1658729762673091": {
"accountId": "120",
"amount": "300000",
"created": "1658729762000000",
"id": "1658729762673091",
"instrumentId": 2,
"organisationId": 1,
"reason": "None",
"referenceId": "1658729762538762",
"status": "Pending",
"type": "Deposit",
"updated": "1658729762000000",
"userId": 13,
"walletAddress": ""
},
"1658729594686221": {
"accountId": "120",
"amount": "300000",
"created": "1658729594000000",
"id": "1658729594686221",
"instrumentId": 2,
"organisationId": 1,
"reason": "None",
"referenceId": "1658729594553480",
"status": "Pending",
"type": "Deposit",
"updated": "1658729594000000",
"userId": 13,
"walletAddress": ""
},
"1658728733406117": {
"accountId": "120",
"amount": "300000",
"created": "1658728733000000",
"id": "1658728733406117",
"instrumentId": 2,
"organisationId": 1,
"reason": "None",
"referenceId": "1658728733271718",
"status": "Pending",
"type": "Deposit",
"updated": "1658728733000000",
"userId": 13,
"walletAddress": ""
},
"1658728201164503": {
"accountId": "120",
"amount": "300000",
"created": "1658728201000000",
"id": "1658728201164503",
"instrumentId": 2,
"organisationId": 1,
"reason": "None",
"referenceId": "1658728201033042",
"status": "Pending",
"type": "Deposit",
"updated": "1658728201000000",
"userId": 13,
"walletAddress": ""
}
},
"type": "deposits",
"timestamp": "2023-03-10T07:31:20.908Z"
}

Send a subscribe-deposits command to subscribe to deposit updates. It will return a set-deposits event that contains the 1000 most recent deposit notifications for the organisation(s) of which you are permissioned. Subsequent deposits or updates to deposits will also cause a set-deposits event to be returned with only updated values; these updates must be deeply merged from the previous state.

The data property is an object with a single key entries which in turn is an array of deposit objects. Each deposit object has the following details:

Set Deposit Event Schema

NameTypeDescription
[key]Unique identifier of the deposit
accountIdstringUnique identifier of the ledger account
amountstringAmount of the deposit where the last n digits are decimal places corresponding to the quantity decimal place value assigned to the asset (ex. GBP has 2 decimal place value so an amount of “1000” would equate to £10.00)
createdstringTime of transaction
idstringUnique identifier of the deposit
instrumentIdnumberUnique identifier of the asset deposited
organisationIdnumberUnique identifier of the client
reasonstringAdditional details for deposits that do not successfully complete
referenceIdstringFor cash - unique identifier that needs to be included in the reference field of the payment. For security assets- wallet address assigned as recipient address for transfer
statusstringCurrent state of the transaction, can be submitted, pending, cancelled, rejected or completed
typestringOnly Deposit returned as value
updatedstringTime stamp of the last time an action occurred on the deposit notification
userIdnumberUnique identifier of the user who submitted the deposit notification
walletAddressstringDepreciated field that returns empty string

Subscribe to Withdrawals

Subscribe to Withdrawals command

{
"action": "subscribe-withdrawals"
}

Set Withdrawals event

{
"status": "OK",
"action": "set-withdrawals",
"data": {
"1660545047277119": {
"accountId": 118,
"amount": "100",
"created": "1660545047000000",
"id": "1660545047277119",
"instrumentId": 1,
"organisationId": 1,
"reason": "None",
"referenceId": "123456",
"status": "Pending",
"type": "Withdrawal",
"updated": "1660545047000000",
"userId": 27,
"walletAddress": ""
},
"1660542988806807": {
"accountId": 118,
"amount": "1000",
"created": "1660542988000000",
"id": "1660542988806807",
"instrumentId": 1,
"organisationId": 1,
"reason": "None",
"referenceId": "12345",
"status": "Pending",
"type": "Withdrawal",
"updated": "1660542988000000",
"userId": 27,
"walletAddress": ""
}
},
"type": "withdrawals",
"timestamp": "2023-03-10T07:36:31.616Z"
}

Send a subscribe-withdrawals command to subscribe to withdrawal updates. It will return a set-withdrawals event that contains the 1000 most recent withdrawal notifications for the organisation(s) of which you are permissioned. Subsequent withdrawals or updates to withdrawals will also cause a set-withdrawals event to be returned with only updated values; these updates must be deeply merged from the previous state.

The data property is an object with a single key entries which in turn is an array of withdrawal objects. Each withdrawal object has the following details:

Set Withdrawal Event Schema

NameTypeDescription
[key]Unique identifier of the withdrawal
accountIdstringUnique identifier of the ledger account
amountstringAmount of the withdrawal where the last n digits are decimal places corresponding to the quantity decimal place value assigned to the asset (ex. GBP has 2 decimal place value so an amount of “1000” would equate to £10.00)
createdstringTime of transaction
idstringUnique identifier of the withdrawal
instrumentIdnumberUnique identifier of the asset to be withdrawn
organisationIdnumberUnique identifier of the client
reasonstringAdditional details for withdrawals that do not successfully complete
referenceIdstringUnique reference for withdrawal
statusstringCurrent state of the transaction, can be submitted, pending, cancelled, rejected or completed
typestringOnly Withdrawal returned as value
updatedstringTime stamp of the last time an action occurred on the withdrawal notification
userIdnumberUnique identifier of the user who submitted the withdrawal notification
walletAddressstringDepreciated field that returns empty string

Submit Deposit

Submit Deposit command

{
"action": "submit-deposit",
"data": {
"amount": "10000",
"instrumentId": 5,
"referenceId": "1676615598286"
}
}

Submit Deposit Response event

{
"status": "OK",
"action": "submit-deposit-response",
"data": {
"accountId": 114,
"reference": "0x7b87864f860c84f811dc4cd197de7468edd93267",
"userId": 72,
"requestId": "1676615627210920",
"created": "1676615627210921",
"walletAddress": "0x7b87864f860c84f811dc4cd197de7468edd93267",
"whitelistedWalletAddress": ""
},
"type": "notifications",
"timestamp": "2023-02-17T06:33:50.253Z"
}

Send a submit-deposit command to submit a deposit notification. The response will be a submit-deposit-response event that will either return an error with an error reason or return an “OK” with the schema described below.

Submit Deposit Schema

NameTypeDescription
amountstringAmount of the deposit where the last n digits are decimal places corresponding to the quantity decimal place value assigned to the asset (ex. GBP has 2 decimal place value so an amount of “1000” would equate to £10.00)
instrumentIdnumberUnique identifier of the asset to be deposited
referenceIdstringUnique user reference for deposit

Submit Deposit Response Event Schema

NameTypeDescription
accountIdnumberUnique identifier of the ledger account
referenceIdstringFor cash - unique identifier that needs to be included in the reference field of the payment. For security assets- wallet address assigned as recipient address for transfer
userIdnumberUnique identifier of the user who submitted the deposit notification
requestIdstringUnique system identifier of the deposit (corresponds to id field in set-deposits events schema)
createdstringTime of transaction
walletAddressstringInternal use only
whitelistedWalletAddressstringUnique identifier of the user’s wallet address

Submit Withdrawal

Submit Withdrawal command

{
"action": "submit-withdrawal",
"data": {
"amount": "10000",
"instrumentId": 5,
"referenceId": "1676615598286"
}
}

Submit Withdrawal Response event

{
"status": "OK",
"action": "submit-withdrawal-response",
"data": {
"accountId": 108,
"userId": 72,
"referenceId": "1676616969568760",
"requestId": "1676616969570956",
"created": "1676616969570957"
},
"type": "notifications",
"timestamp": "2023-02-17T06:56:10.613Z"
}

Send a submit-withdrawal command to submit a deposit notification. The response will be a submit-withdrawal-response event that will either return an error with an error reason or return an “OK” with the schema described below.

Submit Withdrawal Schema

NameTypeDescription
amountstringAmount of the withdrawal where the last n digits are decimal places corresponding to the quantity decimal place value assigned to the asset (ex. GBP has 2 decimal place value so an amount of “1000” would equate to £10.00)
instrumentIdnumberUnique identifier of the asset to be withdrawn
referenceIdstringUnique user reference for withdrawal

Submit Withdrawal Response Event Schema

NameTypeDescription
accountIdnumberUnique identifier of the ledger account
referenceIdstringUnique reference for withdrawal
userIdnumberUnique identifier of the user who submitted the withdrawal notification
requestIdstringUnique system identifier of the withdrawal (corresponds to id field in set-withdrawals events schema)
createdstringTime of transaction

Cancel Deposit

Cancel Deposit command

{
"action": "cancel-deposit",
"data": {
"requestId": "1676615627210920"
}
}

Cancel Deposit Response event

{
"status": "OK",
"action": "cancel-deposit-response",
"data": {
"userId": 72,
"status": "creditCancelled",
"reason": "creditUserCancelled",
"requestId": "1676615627210920",
"created": "1676616709917337"
},
"type": "notifications",
"timestamp": "2023-02-17T06:51:50.994Z"
}

Send a cancel-deposit command to cancel a deposit notification. The response will be a cancel-deposit-response event that will either return an error with an error reason or return an “OK” with the schema described below.

Cancel Deposit Schema

NameTypeDescription
requestIdstringUnique system identifier of the deposit (corresponds to id field in set-deposits events schema)

Cancel Deposit Response Event Schema

NameTypeDescription
userIdnumberUnique identifier of the user who submitted the deposit notification
statusstringCurrent status of the deposit notification, only value is creditCancelled
reasonstringReason for cancellation, only value is creditUserCancelled
requestIdstringUnique system identifier of the deposit (corresponds to id field in set-deposits events schema)
createdstringTime of transaction

Cancel Withdrawal

Cancel Withdrawal command

{
"action": "cancel-withdrawal",
"data": {
"requestId": "1676616969570956"
}
}

Cancel Withdrawal Response event

{
"status": "OK",
"action": "cancel-withdrawal-response",
"data": {
"userId": 72,
"status": "debitCancelled",
"reason": "debitUserCancelled",
"requestId": "1676616969570956",
"created": "1676618856703258"
},
"type": "notifications",
"timestamp": "2023-02-17T07:27:37.623Z"
}

Send a cancel-withdrawal command to cancel a deposit notification. The response will be a cancel-withdrawal-response event that will either return an error with an error reason or return an “OK” with the schema described below.

Cancel Withdrawal Schema

NameTypeDescription
requestIdstringUnique system identifier of the withdrawal (corresponds to id field in set-withdrawals events schema)

Cancel Withdrawal Response Event Schema

NameTypeDescription
userIdnumberUnique identifier of the user who submitted the withdrawal notification
statusstringCurrent status of the withdrawal notification, only value is debitCancelled
reasonstringReason for cancellation, only value is debitUserCancelled
requestIdstringUnique system identifier of the withdrawal (corresponds to id field in set-withdrawals events schema)
createdstringTime of transaction

Submit Transfer

Submit Transfer command

{
"action": "submit-transfer",
"data": {
"amount": "1",
"sourceAccountId": 105,
"targetAccountId": 106,
"referenceId": "1676619797797"
}
}

Submit Transfer Response event

{
"status": "OK",
"action": "submit-transfer-response",
"data": {
"requestId": "1676623261301525"
},
"type": "notifications",
"timestamp": "2023-02-17T07:43:42.769Z"
}

Send a submit-transfer command to transfer funds between two accounts. The system will reject a transfer if the two accounts provided do not share the same instrument id. The system will also reject a transfer if the two accounts provided are not for the same client. The response will be a submit-transfer-response event that will either return an error with an error reason or an “OK” with the schema described below.

Submit Transfer Schema

NameTypeDescription
amountnumberAmount of the withdrawal where the last n digits are decimal places corresponding to the quantity decimal place value assigned to the asset (ex. GBP has 2 decimal place value so an amount of “1000” would equate to £10.00)
sourceAccountIdnumberUnique identifier of the ledger account sending the amount
targetAccountIdnumberUnique identifier of the ledger account receiving the amount
referenceIdstringUnique reference for the transfer

Submit Transfer Response Event Schema

NameTypeDescription
requestIdstringUnique system identifier of the transfer (currently a known issue that this is sent as two numbers and a boolean instead of a string)

Schemas

Response Wrapper

NameType
statusstatus
datadata
timestamptimestamp
errorserrors

Status

NameTypeDescription
statusstringReturns OK if the request succeeded. Otherwise returns ERROR.

Data

NameTypeDescription
dataobjectWrapper for response data.

Timestamp

NameTypeDescription
timestampdateISO date/time the request completed.

Errors

NameTypeDescription
errorsarrayContains all error messages from processing a request.

Order Rejection Errors

Error textReasonResolution
NoneNoneContact support
System FailureInternal Archax issueContact support
Invalid PriceThe price is not formatted correctly and likely has too many decimal placesEnsure price submitted does not exceed the priceDecimalPlace value for the trading pair
Market ClosedMarket is closedCheck market hours (MTF only)
Market SuspendedMarket has been suspendedContact support for ETA on restoring market
An error was encountered. Please try again later or contact Support TeamInternal Archax issueContact support
Invalid PositionSell ticket submitted exceed available positionReduce quantity on sell ticket to less than available position and resubmit
Insufficient BalanceBuy ticket submitted exceeds available balanceReduce value (price * quantity + tax + commission) on buy ticket to less than available balance and resubmit
Dynamic Price CollarPrice submitted exceeds the last traded price by 10% (security) or 25% (crypto).The price submitted less the last traded price and then expressed as a percentage of last trade price (absolute value) should be under 10% for security instruments and under 25% for crypto
Ticket Limit ReachedTicket risk limit for client has been exceeded (for either cash based on value or asset based on quantity)Reduce the price and or quantity of the ticket or contact Archax to change your assigned ticket limit
Daily Limit ReachedDaily risk limit for client has been exceeded (for either cash based on value or asset based on quantity)Contact Archax to change your assigned daily limit or wait until the next day (currently only applied to securities trading)
Auction not in call phaseAuction order submitted when the auction is not runningCheck instrument status, order was likely submitted just as the closing auction ended (only securities)
Static Price CollarAn aggressive order has a price that is either 25% greater or less than the close price or a passive order has a price that is either 35% greater or less than the close price.Check RNS or document library bulletins for instrument updates. This is only applied to security instruments and not crypto.
Max Value ExceededThe value of the order exceeds the maximum value allowed.Contact Archax. This only applies to securities trading and not crypto.
Halted InstrumentInstrument trading has been halted.Check RNS or document library bulletins for instrument updates.
Suspended InstrumentInstrument trading has been suspended.Check RNS or document library bulletins for instrument updates.
Invalid Tick SizePrice submitted has incremented less than the defined tick size relative to last traded price.The price submitted divided by the tick size should have 0 remainder.
Order rejected as possible duplicateThe order parameters are identical to another order.Check that the action reference is unique.
Order value is below minimumThe value of the order is less than the minimumOrderValue for the instrument trading pair.Check the value for minimumOrderValue and ensure the submitted order is greater than this.
Instrument Not FoundThe instrument does not existConfirm the instrument id otherwise contact Archax support
Invalid QuantityThe quantity is not formatted correctly and likely has too many decimal placesEnsure quantity submitted does not exceed the quantityDecimalPlace value for the trading pair
No daily limit assignedThe client is missing a daily risk limit for the fiat currency or the instrumentContact Archax support
No ticket limit assignedThe client is missing a ticket risk limit for the fiat currency or the instrumentContact Archax support
Inactive InstrumentInstrument is not in an active stateCheck instrument id otherwise contact Archax support
Terminated InstrumentInstrument is in terminated and no longer trading on the exchangeCheck instrument id otherwise contact Archax support
Instrument Status Not FoundInternal Archax issueContact support
Order failed, please contact supportInternal Archax issueContact support