Get started
Authentication
Every API request is made with one of your secret keys, sent in the Authorization header.
Authorization: Bearer sk_live_••••••••••••••••••••••••••••••••••••••••Requests without a valid key get 401 with code INVALID_API_KEY. If your Selligate account isn’t active, you get 403 MERCHANT_NOT_ACTIVE.
Test and live keys
| Test | Live | |
|---|---|---|
| Create keys at | sandbox.selligate.com → Developers | app.selligate.com → Developers |
| Key starts with | sk_test_ | sk_live_ |
| Base URL | https://sandbox-api.selligate.com/v1 | https://api-developers.selligate.com/v1 |
| Orders | Sandbox: nothing is delivered or paid. Move orders along with Simulate. Deleted after 3 days | Real deliveries |
The two environments are completely separate: they have different accounts, and a test key doesn’t work on the live URL.
The sandbox
The sandbox at sandbox.selligate.com runs the same code as live, so it behaves the same way, with a few differences that make testing easy:
- Every order finds an agent. A test agent in each state holds whatever stock your orders need.
- You move orders along yourself. Use Simulate on the Orders From API page, or
POST /orders/{id}/simulate, to mark an order out for delivery, delivered, failed or returned. Each change sends the real webhook. - Nothing is real. No one delivers anything, no money moves, and no SMS is sent.
- Orders are deleted after 3 days. Your account, keys and settings stay.
Creating and revoking keys
- Only the account owner can manage keys, on the Developers page.
- A key is shown once, when you create it. We only store a fingerprint of it, so we can’t show it to you again.
- You can have up to 5 active keys, for example one per system. The Developers page shows when each was last used.
- Revoke a key to stop it working immediately.
Keep keys safe
!
A secret key can create and cancel orders on your account. Treat it like a password.
- Only use keys from your server. Never put them in website JavaScript, a mobile app or anything a customer can download.
- Store them in environment variables or a secrets manager, not in your code repository.
- If a key may have leaked, create a new one, switch your system to it, then revoke the old one.
Want orders from a website without a server? Use the order form. It uses a public pk_… key that’s safe to put on a web page.