01API
Rollmark API
The Rollmark API lets a store's website, a plugin or an inventory system work with the store's own Rollmark data: the products as the store lists them, the orders a shopper makes with a chosen FFL, the store's orders to distributors, the stock the store keeps by hand, and a call to your server when any of that changes.
Everything is under one address:
There is no second host. FFL Checkout (find an FFL near a shopper, send the order made with it) is the same API and lives under /checkout. The reference is made from the API's own definition, openapi.yaml, which you can load into any tool that reads OpenAPI 3.1.
You build against version 1. New endpoints and fields may be added; nothing is removed or changed in meaning, and a change that would break you is announced at least six months ahead. Read the promise.
What you can do
| You want to | Use | Key |
|---|---|---|
| Show the store's products in a web page | Catalog | a public key (safe in a browser) |
| Read prices, cost and distributor offers from your server | Catalog, /staff/products | a private key |
| Search FFLs and send the order made with a chosen FFL | FFL Checkout | a checkout key |
| Create orders, match them to your store's order, change lines, cancel, mark shipped with tracking | Orders | a private key with orders:read and orders:write |
| Read and draft the store's orders to distributors | Distributor orders | a private key with the distributor_orders permissions |
| Keep hand-managed stock in step with an inventory system | Inventory | a private key with inventory:read and inventory:write |
| Be told when an order ships or a distributor order changes | Webhooks | a private key with webhooks:manage |
Some things are deliberately not in the API: sending a distributor order, anything that spends the store's money, FastBound items (FastBound stays the record for guns), the store's cost and pricing rules. They are for the store's staff in Rollmark. Why.
Quickstart
You need a store on Rollmark and an owner or manager to make you a key.
1. Make a key. In the dealer app: Settings, API keys. Name it ("Order plugin"), choose Catalog, then Private, and tick only what the key needs. Nothing is ticked by default. Press Make key. The key is shown once; copy it into your server's secrets. Rollmark stores only a hash of it and cannot show it again.
2. Call the API. Put the key in an Authorization header and ask who you are:
The answer names the store, the key and what the key may do, so a plugin can check a pasted key when it is installed:
3. Read something. With orders:read:
The answer is { "data": [ … ], "next_cursor": "…" }. Pass next_cursor back as cursor for the next page: Pagination.
4. Change something, safely. Every write takes an Idempotency-Key, so a request that timed out can be sent again without doing the thing twice: Idempotency.
5. Be told instead of asking. Register a webhook and Rollmark calls your server when an order ships: Webhooks.
Where to go next
- Authentication and permissions: the four kinds of key, and what each permission allows.
- Errors: one envelope, stable codes, a request id to quote to support.
- Rate limits: headers on every answer.
- Build your own platform integration: a store system Rollmark has no plugin for.
- Reference: every endpoint.