03API reference
Inventory
Keep the store's hand-managed stock in step with an inventory system, by your own external_id. FastBound items are read only (FastBound stays the record for guns). A change shows on the store after the next rebuild, normally within minutes.
/inventory/itemsList stock itemsGET/inventory/items/{external_id}One stock itemPUT/inventory/items/{external_id}Create or update a hand-managed itemPATCH/inventory/items/{external_id}Change a hand-managed itemDELETE/inventory/items/{external_id}Remove a hand-managed itemPOST/inventory/items/{external_id}/zeroSet the quantity to zeroPOST/inventory/batchChange many items at onceList stock items
/inventory/itemsHand-managed items and FastBound items, oldest change first, with cursor paging. A FastBound item has writable: false and only the last four of its serial; cost is never shown. Needs the inventory:read permission.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
source | query | "manual" | "fastbound" | |
product_key | query | string | |
external_id | query | string | |
hidden | query | "true" | "false" | |
updated_since | query | string | ISO 8601 date or time. Lists what changed at or after it, oldest change first. |
limit | query | integer | Default 50. 1 to 100. |
cursor | query | string | The Up to 2048 characters. |
Responses
Headers: X-Request-Id
| Field | Type | Description |
|---|---|---|
datarequired | object[] | |
data[].idrequired | string | Rollmark's id for the item. |
data[].external_id | string | null | Your id for a hand-managed item. Null for a FastBound item. |
data[].sourcerequired | "manual" | "fastbound" | |
data[].writablerequired | boolean | True for a hand-managed item; false for a FastBound item |
data[].product_key | string | null | The catalog product a hand-managed item adds stock to. |
data[].title | string | null | |
data[].manufacturer | string | |
data[].model | string | |
data[].upc | string | null | |
data[].mpn | string | null | |
data[].category | string | null | |
data[].firearm | boolean | |
data[].quantityrequired | integer | At least 0. |
data[].price | number | null | Your selling price in dollars. |
data[].condition | string | null | |
data[].location | string | null | |
data[].note | string | null | |
data[].hiddenrequired | boolean | Hidden from the store ( |
data[].serial_last4 | string | null | Only on a FastBound item. The last four characters of its serial number; never more. |
data[].updated_atrequired | string (date-time) | |
next_cursorrequired | string | null |
Example
One stock item
/inventory/items/{external_id}A hand-managed item by your own id. Any item, FastBound ones too, can also be read by its Rollmark id. Needs the inventory:read permission.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
external_idrequired | path | string | Your own id for the item (1 to 100 characters), URL-encoded. 1 to 100 characters. |
Responses
Headers: X-Request-Id
| Field | Type | Description |
|---|---|---|
datarequired | object | |
data.idrequired | string | Rollmark's id for the item. |
data.external_id | string | null | Your id for a hand-managed item. Null for a FastBound item. |
data.sourcerequired | "manual" | "fastbound" | |
data.writablerequired | boolean | True for a hand-managed item; false for a FastBound item |
data.product_key | string | null | The catalog product a hand-managed item adds stock to. |
data.title | string | null | |
data.manufacturer | string | |
data.model | string | |
data.upc | string | null | |
data.mpn | string | null | |
data.category | string | null | |
data.firearm | boolean | |
data.quantityrequired | integer | At least 0. |
data.price | number | null | Your selling price in dollars. |
data.condition | string | null | |
data.location | string | null | |
data.note | string | null | |
data.hiddenrequired | boolean | Hidden from the store ( |
data.serial_last4 | string | null | Only on a FastBound item. The last four characters of its serial number; never more. |
data.updated_atrequired | string (date-time) |
Example
Create or update a hand-managed item
/inventory/items/{external_id}Creates the item if your external_id is new (201, a quantity is required), or changes the fields you send (200; what you leave out stays). Checked like the Add item form. The same external_id is always the same item, so a repeat is safe. A FastBound item is 409 fastbound_managed; a field named cost is 400. The store shows the change after the next rebuild, which this call queues. Needs the inventory:write permission.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
external_idrequired | path | string | Your own id for the item (1 to 100 characters), URL-encoded. 1 to 100 characters. |
Idempotency-Key | header | string | 1 to 255 printable characters (a UUID is fine). The first request with a key runs and its answer is kept for 24 hours; the same request again gets the same answer with 1 to 255 characters. |
Request body
| Field | Type | Description |
|---|---|---|
link_to | string | A catalog product key the item adds stock to. Give this, or |
title | string | Up to 160 characters. |
manufacturer | string | Up to 80 characters. |
model | string | Up to 80 characters. |
upc | string | null | A valid UPC/EAN (the check digit is verified). |
mpn | string | Up to 60 characters. |
category | "handguns" | "rifles" | "shotguns" | "nfa" | "ammunition" | "magazines" | "optics" | "parts" | "gear" | "reloading" | |
quantity | integer | 0 to 9999. |
quantity_delta | integer | PATCH only. Adds (or, negative, takes) this many; the quantity never goes below 0. Applied in the database, so two writers do not lose an update. Not with |
price | number | null | Dollars; null clears it. At least 0. |
condition | string | Up to 40 characters. |
location | string | Up to 60 characters. |
note | string | Up to 300 characters. |
hidden | boolean | Hide the item from the store |
Responses
Headers: X-Request-Id
| Field | Type | Description |
|---|---|---|
datarequired | object | |
data.idrequired | string | Rollmark's id for the item. |
data.external_id | string | null | Your id for a hand-managed item. Null for a FastBound item. |
data.sourcerequired | "manual" | "fastbound" | |
data.writablerequired | boolean | True for a hand-managed item; false for a FastBound item |
data.product_key | string | null | The catalog product a hand-managed item adds stock to. |
data.title | string | null | |
data.manufacturer | string | |
data.model | string | |
data.upc | string | null | |
data.mpn | string | null | |
data.category | string | null | |
data.firearm | boolean | |
data.quantityrequired | integer | At least 0. |
data.price | number | null | Your selling price in dollars. |
data.condition | string | null | |
data.location | string | null | |
data.note | string | null | |
data.hiddenrequired | boolean | Hidden from the store ( |
data.serial_last4 | string | null | Only on a FastBound item. The last four characters of its serial number; never more. |
data.updated_atrequired | string (date-time) | |
changerequired | "created" | "updated" | "unchanged" | |
effectiverequired | "after_rebuild" | The store shows the change after the next rebuild. |
Example
Change a hand-managed item
/inventory/items/{external_id}Changes an item that exists (404 otherwise; use PUT to create). Send quantity to set it or quantity_delta to add or take; price; hidden to hide the item from the store or show it again. Needs the inventory:write permission.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
external_idrequired | path | string | Your own id for the item (1 to 100 characters), URL-encoded. 1 to 100 characters. |
Idempotency-Key | header | string | 1 to 255 printable characters (a UUID is fine). The first request with a key runs and its answer is kept for 24 hours; the same request again gets the same answer with 1 to 255 characters. |
Request body
| Field | Type | Description |
|---|---|---|
link_to | string | A catalog product key the item adds stock to. Give this, or |
title | string | Up to 160 characters. |
manufacturer | string | Up to 80 characters. |
model | string | Up to 80 characters. |
upc | string | null | A valid UPC/EAN (the check digit is verified). |
mpn | string | Up to 60 characters. |
category | "handguns" | "rifles" | "shotguns" | "nfa" | "ammunition" | "magazines" | "optics" | "parts" | "gear" | "reloading" | |
quantity | integer | 0 to 9999. |
quantity_delta | integer | PATCH only. Adds (or, negative, takes) this many; the quantity never goes below 0. Applied in the database, so two writers do not lose an update. Not with |
price | number | null | Dollars; null clears it. At least 0. |
condition | string | Up to 40 characters. |
location | string | Up to 60 characters. |
note | string | Up to 300 characters. |
hidden | boolean | Hide the item from the store |
Responses
Headers: X-Request-Id
| Field | Type | Description |
|---|---|---|
datarequired | object | |
data.idrequired | string | Rollmark's id for the item. |
data.external_id | string | null | Your id for a hand-managed item. Null for a FastBound item. |
data.sourcerequired | "manual" | "fastbound" | |
data.writablerequired | boolean | True for a hand-managed item; false for a FastBound item |
data.product_key | string | null | The catalog product a hand-managed item adds stock to. |
data.title | string | null | |
data.manufacturer | string | |
data.model | string | |
data.upc | string | null | |
data.mpn | string | null | |
data.category | string | null | |
data.firearm | boolean | |
data.quantityrequired | integer | At least 0. |
data.price | number | null | Your selling price in dollars. |
data.condition | string | null | |
data.location | string | null | |
data.note | string | null | |
data.hiddenrequired | boolean | Hidden from the store ( |
data.serial_last4 | string | null | Only on a FastBound item. The last four characters of its serial number; never more. |
data.updated_atrequired | string (date-time) | |
changerequired | "created" | "updated" | "unchanged" | |
effectiverequired | "after_rebuild" | The store shows the change after the next rebuild. |
Example
Remove a hand-managed item
/inventory/items/{external_id}Takes the item out of the inventory (the same as Remove on the screen). To keep the item and show none on hand, use /zero; to keep it off the store, set hidden. Needs the inventory:write permission.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
external_idrequired | path | string | Your own id for the item (1 to 100 characters), URL-encoded. 1 to 100 characters. |
Idempotency-Key | header | string | 1 to 255 printable characters (a UUID is fine). The first request with a key runs and its answer is kept for 24 hours; the same request again gets the same answer with 1 to 255 characters. |
Responses
Headers: X-Request-Id
| Field | Type | Description |
|---|---|---|
datarequired | object | |
data.idrequired | string | |
data.external_idrequired | string | |
data.deletedrequired | true |
Example
Set the quantity to zero
/inventory/items/{external_id}/zeroThe item stays (and so does your external_id); the store shows none on hand. Needs the inventory:write permission.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
external_idrequired | path | string | Your own id for the item (1 to 100 characters), URL-encoded. 1 to 100 characters. |
Idempotency-Key | header | string | 1 to 255 printable characters (a UUID is fine). The first request with a key runs and its answer is kept for 24 hours; the same request again gets the same answer with 1 to 255 characters. |
Responses
Headers: X-Request-Id
| Field | Type | Description |
|---|---|---|
datarequired | object | |
data.idrequired | string | Rollmark's id for the item. |
data.external_id | string | null | Your id for a hand-managed item. Null for a FastBound item. |
data.sourcerequired | "manual" | "fastbound" | |
data.writablerequired | boolean | True for a hand-managed item; false for a FastBound item |
data.product_key | string | null | The catalog product a hand-managed item adds stock to. |
data.title | string | null | |
data.manufacturer | string | |
data.model | string | |
data.upc | string | null | |
data.mpn | string | null | |
data.category | string | null | |
data.firearm | boolean | |
data.quantityrequired | integer | At least 0. |
data.price | number | null | Your selling price in dollars. |
data.condition | string | null | |
data.location | string | null | |
data.note | string | null | |
data.hiddenrequired | boolean | Hidden from the store ( |
data.serial_last4 | string | null | Only on a FastBound item. The last four characters of its serial number; never more. |
data.updated_atrequired | string (date-time) | |
changerequired | "created" | "updated" | "unchanged" | |
effectiverequired | "after_rebuild" | The store shows the change after the next rebuild. |
Example
Change many items at once
/inventory/batchUp to 500 operations (upsert, patch, zero, delete), each with its external_id and the fields of the single call. Each is applied on its own, so one bad item does not lose the rest: the answer is 200 with a result per item and the counts, and an item's failure is in its result. One rebuild is queued for the whole request. The body is at most 1 MB and an Idempotency-Key is required, so a request that timed out can be sent again. A batch is limited to 60 a minute. Needs the inventory:write permission.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
Idempotency-Keyrequired | header | string | Required on this call, because it counts toward billing. See the other calls for how the key works. 1 to 255 characters. |
Request body
| Field | Type | Description |
|---|---|---|
itemsrequired | object[] | 1 to 500 items. |
items[].external_idrequired | string | |
items[].op | "upsert" | "patch" | "zero" | "delete" | Default "upsert". |
Responses
Headers: X-Request-Id
| Field | Type | Description |
|---|---|---|
resultsrequired | object[] | |
results[].external_idrequired | string | null | |
results[].statusrequired | "created" | "updated" | "unchanged" | "deleted" | "error" | |
results[].error | object | |
results[].error.coderequired | string | |
results[].error.messagerequired | string | |
results[].error.fields | object[] | |
results[].error.fields[].field | string | |
results[].error.fields[].message | string | |
summaryrequired | object | |
summary.totalrequired | integer | |
summary.createdrequired | integer | |
summary.updatedrequired | integer | |
summary.unchangedrequired | integer | |
summary.deletedrequired | integer | |
summary.errorrequired | integer | |
effectiverequired | "after_rebuild" |