Ask the merchant for a key and a store token
They issue both from their dashboard, under Settings → Developer. Ask for the narrowest set of scopes your integration actually needs — you can always ask for more later, and a key that can only read is a key that cannot break their shop.
Note that the key is shown once
It is stored hashed, so there is no "show it again". If it is lost the merchant rotates it and hands you a new one. Put it straight into your secret store, not into a config file you will commit.
Make one authenticated request
Every call is a POST to the same endpoint, carrying both headers. Start with something harmless that proves the key and token are both right.
Read something real
Fetch the store’s most recent orders. If this returns data, your credentials and scopes are correct and you can start building.
Receive an event instead of polling
Register an HTTPS endpoint, verify the signature on what arrives, and stop asking the API whether anything changed.
The first request
curl https://api.ematjarak.example/admin-api \
-H 'content-type: application/json' \
-H 'ms-api-key: YOUR_KEY' \
-H 'ms-store-token: STORE_TOKEN' \
-d '{"query":"{ activeChannel { code } }"}'- ms-api-key — the merchant’s key. Send it on every request.
- ms-store-token — the store’s token, which the merchant gives you alongside the key. Both are required; a key without a token does not identify a store.
Reading orders
query {
orders(options: { take: 5, sort: { orderPlacedAt: DESC } }) {
totalItems
items {
id
code # show this to people, not the id
state
orderPlacedAt # ISO 8601, UTC
totalWithTax # integer, minor units
currencyCode
customer { emailAddress }
}
}
}Two things in that response catch people out on day one: money is an integer in minor units, not a decimal, and every date is UTC. Both are covered on the conventions page, and getting them wrong produces totals that are off by a hundred and shipments that appear to happen on the wrong day.
Your first webhook
The merchant registers your HTTPS URL and picks which events they want. We POST a signed JSON body to it and retry on failure. Verify the signature before you trust anything in the body, and reply quickly — do your real work after you have acknowledged.