Docs menu

Reference

REST API

Workspace

Check which workspace a key belongs to, and read its currency, timezone and tax wording.

Get the workspaceLink to this section#

GET/api/v1/workspace

Returns the workspace the key belongs to, plus the key’s own name and scope. Call it once when your integration starts, to check the key and pick up the currency.

No parameters.

bash
curl https://tradecatalog.app/api/v1/workspace \
  -H "Authorization: Bearer $TRADECATALOG_API_KEY"
js
const res = await fetch('https://tradecatalog.app/api/v1/workspace', {
  headers: { Authorization: `Bearer ${process.env.TRADECATALOG_API_KEY}` },
})
const { data: workspace } = await res.json()
json
{
  "data": {
    "id": "0b6c1f5e-6f7a-4a57-9a0c-2f4d4c1e8a11",
    "slug": "northgate",
    "name": "Northgate Fixings",
    "currency": "GBP",
    "timezone": "Europe/London",
    "taxLabel": "ex VAT",
    "key": { "name": "Sage stock sync", "scope": "write" }
  }
}
FieldTypeDescription
idstringThe workspace id.
slugstringThe workspace address. The trade portal is at https://tradecatalog.app/p/{slug}.
namestringThe name customers know the business by.
currencystringISO 4217 code. Every price is in minor units of this currency.
timezonestringIANA timezone, e.g. Europe/London. Dates in the API are UTC.
taxLabelstringWording shown next to prices, e.g. “ex VAT”. Prices are before tax.
key.namestringThe name the owner gave this key.
key.scopestringread or write.