Skip to content
scango.ch
Esc
↑↓navigate↵open⌘Jpreview
On this page

Quickstart

Create an API key and make your first requests to the scango.ch API.

Create an API key

In the dashboard, open Settings → Organization → API Keys and create a key. Choose Read to only fetch data, or Write to also change it. Creating keys requires the Admin role.

List products

Fetch the first five products:

curl -sS \
  -H "Authorization: Bearer $SCANGO_API_KEY" \
  "https://dashboard.scango.ch/api/v1/products?limit=5"
const response = await fetch("https://dashboard.scango.ch/api/v1/products?limit=5", {
  headers: { Authorization: `Bearer ${process.env.SCANGO_API_KEY}` },
});
const { data, meta } = await response.json();
import os
import requests

response = requests.get(
    "https://dashboard.scango.ch/api/v1/products",
    params={"limit": 5},
    headers={"Authorization": f"Bearer {os.environ['SCANGO_API_KEY']}"},
)
data = response.json()["data"]

Prices are in cents (120 = CHF 1.20):

{
  "data": [{ "id": "a1b2c3", "name": "Mineral water 50cl", "price": 120 }],
  "meta": { "total": 5, "returned": 5, "limit": 5, "nextCursor": "a1b2c3" }
}

Fetch the next page

Pass meta.nextCursor as cursor, and repeat until the response has no nextCursor:

curl -sS \
  -H "Authorization: Bearer $SCANGO_API_KEY" \
  "https://dashboard.scango.ch/api/v1/products?limit=5&cursor=a1b2c3"

List orders

start and end are required (UTC with Z); paymentState is optional:

curl -sS \
  -H "Authorization: Bearer $SCANGO_API_KEY" \
  "https://dashboard.scango.ch/api/v1/orders?start=2024-01-01T00:00:00.000Z&end=2024-01-31T23:59:59.999Z&paymentState=successful"

Next steps

  • Read the conventions for money, dates, errors and soft deletes.
  • Browse the endpoints in the sidebar. Each page shows code samples in cURL, JavaScript, Python and PHP.

Was this page helpful?