02API guides
Build your own platform integration
Rollmark has plugins for BigCommerce, WooCommerce and Adobe Commerce / Magento. For anything else (Shopify, a custom cart, an ERP or a POS) you build the integration yourself, with the same API the plugins use. This is the whole shape of one, for a store system that sells guns shipped through an FFL.
What you need
A store on Rollmark whose plan includes what you use, and one scoped private key with orders:read, orders:write and webhooks:manage (the "Order plugin" preset in Settings, API keys). The key lives on your server, never in a web page: put your own endpoint in front of your checkout page.
The flow
- At checkout, choose the FFL. Use the FFL endpoints (
GET /checkout/ffls,/checkout/ffls/{id}) with an FFL Checkout key, from your server, to power the picker. Keep the FFL'sidwith the order. - When your own order exists, send it.
POST /orderswith the intake contract: yourintake_ref(your cart or order id), yourstore_order_number(so the order is open and matched at once), the lines, the FFL and the shopper. Send anIdempotency-Keytoo. Keep the returnedid. If you only know the cart when the shopper pays and the order number later, sendPOST /ordersfirst (it stays pending) and callPOST /orders/ref:<intake_ref>/matchwith{ "store_order_number": "…" }when your order exists. - Register one webhook, once, for
order.shipped,order.cancelled,order.deliveredanddistributor_order.status_changed. Store the secret. - When a webhook arrives: verify the signature, drop the event if you have its
id, answer200, thenGET /orders/{order_id}and update your own order (shipment and tracking, or cancel). - When you ship from your own admin (you, not Rollmark, ship):
POST /orders/{id}/shipwith{ "tracking": "…" }andIdempotency-Key: ship-<your shipment id>. Marking an order shipped counts as a Rollmark Transfers shipment, the same as in the dealer app, and a gun does not ship to a dealer whose license copy is not on file; the API answers409 invalid_stateand says so. - Catch up. Every 15 minutes:
GET /orders?updated_since=<the time your last catch-up started>&limit=100, follownext_cursor, apply what changed. A webhook you missed then costs nothing. - Errors. Retry
429and5xxwith the sameIdempotency-Key. Never retry a4xxunchanged. Logrequest_id.
A reference outline in Node
This is the integration above in about sixty lines. It is a sketch to copy from, not a library: your system's calls are the ones named yourSystem.
What the API never does
The API is for a store's own systems, so some things stay with the store's staff in Rollmark, for every plan and every key:
- Sending a distributor order (or marking one ready, confirming, cancelling or receiving it). That spends the store's money and commits it to a distributor. The API can make drafts from order lines, which cost nothing; a person reviews and sends them.
- Anything about a firearm's acquisition or disposition, and FastBound items: FastBound stays the record.
- The store's cost and pricing rules, billing, staff and keys.
- Hand-entered transfers (the Transfers tab), which pick a specific gun from FastBound.
Test it without a store's real orders
Make an order for a product and an FFL you control, watch it appear in the dealer app's Orders, then cancel it with POST /orders/{id}/cancel. Use Send test event on your webhook to check your endpoint without waiting for a real order.