Authentication
How your server signs its requests with the shop's API key.
Every request carries the shop's API key as a bearer token:
GET /shop/pulls HTTP/1.1
Host: api-stg.grailnetwork.com
Authorization: Bearer grail_shop_<your key>- A user of your shop makes the key in the shop back office. Grail Network shows it once, and keeps only its hash.
- A new key stops the old key at once. Put the new key into your server right after you make it.
- The key belongs to the shop. Every route reads the shop from the key, so a route never takes a shop's id.
- A request with no key, or with a key that is not valid, gets 401. A route that a shop may not call gets 403.
Keep the key on your server. Never put it into a page or an app that a buyer can read.