Build an integration with the shop API
An integration is your own program calling the REST API of one shop, with a key the shop owner creates and limits to the scopes it needs.
On this page
The model
- One key belongs to one shop. It can never read another shop.
- The shop owner creates the key and ticks its scopes. Each endpoint needs one scope.
- The plan is checked on every request. If the owner's account moves to Free, every call answers 401 until they are on Pro or Enterprise again.
Start with Your first request in the reference. API keys and scopes covers the key, the header and the scopes.
How your program learns about changes
It asks. The shop API sends no webhooks: Shoplio never calls your server.
Poll the order list for new and changed orders. Follow a shop's orders by polling shows the loop and the one change it has to read again.
What you can build
| Job | What your program does | Where to start |
|---|---|---|
| Follow orders | Reads new and changed orders on a schedule | Follow orders |
| Restock from a supplier | Pushes stock lines from your own system as they arrive | Restock |
| Deliver from your own system | Hands out goods that are made at the moment of sale | Deliver orders |
| Read balances | Reads the crypto balance per gateway | Get the balance |
Connecting a merchant
The merchant creates a key under Developer in the dashboard and pastes it into your tool. Give them these rules with your setup steps.
- Make one key per tool, named after the tool.
- Tick only the scopes the tool needs.
- Adjust customer balances is ticked on a new key. Untick it unless the tool credits or debits store balance.
- Never tick Edit stock, Delete stock or Deliver orders unless the tool needs it.
- The full key is shown once. Keep it where the tool keeps its other secrets.
- A key keeps working after a password change. Deleting the key cuts the tool off at once.
- A tool never needs the merchant's Shoplio password.
What an integration cannot do
- Add code, styles or markup to a storefront or to the dashboard.
- Receive a call from Shoplio. Your program always makes the request.
- Withdraw a balance, change payment settings, manage the team or manage keys. No shop API route does any of them.
Testing
There is no test mode. Test against a shop on Pro or Enterprise that you own, with products and stock you create for the test.
Related
- Shoplio REST API: the base URL, the response envelope and the endpoint index
- API errors, rate limits and retries