Go-live checklist
Everything on this page is written somewhere else in these guides or in the reference. It is gathered here in the order you meet it, for the day your software moves from a sandbox key to a live one. Each line says what to check, and most link to the page that explains it.
Keys and access
- Live access is approved. You apply from Integrations with a sentence about what your software does, and an operator reads your account. Live keys need a second factor on the account and are minted behind a fresh code. See Getting started.
- Each live key has only the scopes its software uses. A key keeps the scopes it was minted with. A route whose scope the key lacks answers 403
insufficient_scopeand names the scope.disputes:writeis a scope of its own and is not part oforders:write, because it gives money back. See Keys, scopes and limits. - Each machine and tool has a key of its own. Up to twenty keys can be live at once, so one can be revoked without touching the rest, and a revoked key ends within seconds everywhere. A key can carry a list of addresses and an expiry from the moment it is minted. See Keys, scopes and limits.
- What is shown once has been kept. A key is shown when it is minted and never again. So is a signing secret. A webhook endpoint's secret is shown when the endpoint is created and again only when it is rotated.
- Signing is decided for each key. A bearer key is enough for most tools. If a key is switched to signed requests, every request with it must carry
Freeport-TimestampandFreeport-Signature, and an unsigned one is refused with 401signature_required. A signature is accepted once, inside a five-minute window. See Signing requests.
The sandbox and production
- The sandbox is running. It is switched on when a seller asks for API access, and until it is,
sandbox-api.freeport.ggdoes not answer. Write tosupport@freeport.ggto have it started. See The sandbox. - The whole path has run there. Prove the key with
GET /v1/ping, read the catalog, put a listing up, add a webhook endpoint, then buy from yourself withPOST /v1/sandbox/orders, accept, deliver and confirm as the buyer. If your software moves disputes, rehearse the buyer's half as well. The Postman collection has a request for every step. See Getting started and Disputes. - The host and the key are the only difference. The sandbox is
https://sandbox-api.freeport.gg/v1withfp_test_keys, and production ishttps://api.freeport.gg/v1withfp_live_keys. A key on the wrong host is refused before any lookup, with 401wrong_environment. - Nothing calls
/v1/sandbox/*on production. Those routes answer 404sandbox_onlyanywhere but the sandbox, and act only as the synthetic buyer. - Nothing depends on an id read once from the sandbox. The sandbox can be rebuilt at any time, without notice, and its catalog's ids change when it is while its slugs do not. Build a crosswalk of your own names once with
POST /v1/catalog/resolveand store the slugs. See Listings and stock sync. - You know what production does with money. The first table in Getting started says what each environment does with a payment, and so whether a live key receives orders yet. Read it on the day you go live; it is the one place that says.
Webhooks and their signatures
- The endpoint is an address we will deliver to. It is HTTPS, on port 443 or none. A URL with another port, with credentials or a fragment, that does not resolve, or that resolves to a private, loopback or link-local address is refused with 400
unsafe_url. You can have five endpoints. See Webhooks. - Every delivery is verified before it is trusted. Compute HMAC-SHA256 with the endpoint's secret over
${t}.${body}, wheretis the timestamp fromFreeport-Signatureandbodyis the raw bytes exactly as received, not re-serialised. Accept the delivery if anyv1value equals your result, compared in constant time, and refuse atmore than five minutes from now. - A secret rotation does not drop deliveries. For a day after
POST /v1/webhooks/{id}/rotate-secreteach delivery carries twov1values, one for each secret, so a handler that accepts any of them is switched over without a gap. - The handler answers quickly and works afterwards. Any 2xx will do. A delivery waits ten seconds for an answer and never follows a redirect, so a 3xx is a failed attempt.
- The handler deduplicates on
Freeport-Event-Id. The same event never arrives under another id. A failed attempt is retried after one minute, five, thirty, two hours, six, twelve, then daily, ten attempts in all. - The handler does not rely on order. Ordering across events is not guaranteed. An event that changes an order's state carries
seq, and the order is fetched on receipt rather than trusting the body's state to be the latest. - A disabled endpoint is a case you have planned for. An endpoint that has accepted nothing for three days is disabled at its next failed attempt, with an email to the account and a row in the audit log. Re-enable it from the console once it is fixed, and replay what it missed from the delivery log.
- You have decided what your software does when the platform acts on the account.
account.trading_status_changedsays the account was suspended or reinstated,account.selling_changedsays its listings were hidden from buyers or returned, andaccount.lane_selling_changedsays the same of one category. Resuming after missed orders is done by a person in the seller dashboard, never by a key. Each event's fields are under Events in the reference.
Idempotency
- Every write you might retry carries an
Idempotency-Key. Any string up to 200 characters that you will not reuse for a different request. A retry with the same key gets the first answer back withIdempotent-Replayed: true, for a day. See Keys, scopes and limits. - Your retry loop knows every answer a key can give. A 4xx refusal releases the key, so a corrected request under the same key runs. One refusal does change the order: a
409 payment_not_takenon an accept means the buyer's payment could not be taken and the order has ended, so there is nothing to send again. The other answers are these:
| Answer | What it means | What to do |
|---|---|---|
422 idempotency_key_reused | The same key on a different body or path. | Fix the retry loop. The API is telling you of the bug before it costs anything. |
400 idempotency_key_invalid | The key is empty or longer than 200 characters. | Fix how the key is made. The write did not run. |
409 idempotency_in_progress | The first request under that key is still being answered. | Retry in a moment and you get its response. |
Idempotent-Body: omitted, under the first answer's status | The first answer was too large to keep. | The write completed. Read the resource. |
409 idempotency_outcome_unknown | The first attempt ended in a 5xx, or never reported its outcome. | The write may have landed before the failure. Check whether it did, then use a new key. |
503 idempotency_unavailable | The key could not be checked. | Send the request again with the same key. |
Rate limits
- You know your budgets. They are per key, per minute, sliding, in four buckets:
reads,writes,bulk(syncs and code uploads) andchat. A new seller gets the base budget, and standard and trusted sellers get two and three times it. The base figures are under Conventions in the reference. - The client reads the budget and waits out a 429. Every response carries
RateLimit-Limit,RateLimit-RemainingandRateLimit-Reset, and a 429rate_limitedcarriesRetry-Afterin seconds. Retrying inside the window only spends more of the next one. - Nothing polls the order feed in a loop. Webhooks are the best way to hear about an order. Failing that, poll
GET /v1/orders/changeswithIf-None-Matchevery few seconds: a 304 costs nothing on either side, and a 200 means it is time to read the feed. See Orders and chat. - A sheet of stock goes as a sync. A stock sync lands up to a thousand lines a call and applies as one decision in the background, and its calls spend the
bulkbudget. See Listings and stock sync.
Errors
- The client switches on the code. Every refusal is
{ "error": { "code", "message", "requestId" } }. The code is stable, the message is for a person, and the request id is what to quote to support atsupport@freeport.gg, so keep it with every refusal you log. See Errors, limits and support. - The refusals that end a key are told apart from the rest. 401
key_revokedandkey_expiredmean the key is over and another has to be minted. 401signature_required,signature_invalid,signature_staleandsignature_replayedmean the key is set to signed requests and this request did not pass. 403account_suspendedmeans reads still work and writes that start something do not. - A refused order move is read, not guessed at. A move the order's state forbids is a 409
illegal_transitionwith the order's current state in the body, so a tool that raced a buyer's cancel learns what happened in one round trip. - A validation refusal is read field by field. A 400
validation_failedcarriesdetailsnaming each field and rule that failed.
Then go live
Mint the live key from Integrations behind a fresh code, put it and https://api.freeport.gg/v1 where your software reads its configuration, and call GET /v1/ping. The answer names your key, its scopes and its environment.