Skip to content
Docs

03API reference

Version 1.0.0Made from openapi.yaml

Distributor orders

Read your orders to distributors and make DRAFTS from order lines. Sending, readying, confirming, cancelling and receiving a distributor order are not in the API; staff do them in Rollmark.

List distributor orders

GET/distributor-orders
Scoped private key (rm_prv_), from a server
distributor_orders:read

The store's orders to distributors, oldest change first. Unit costs and quoted totals only for a key that also has catalog:cost:read. Needs the distributor_orders:read permission.

Parameters

NameInTypeDescription
statusquery"draft" | "ready" | "sent" | "confirmed" | "partially_shipped" | "shipped" | "received" | "cancelled" | "failed"
distributorquerystring
order_idquerystring

Only POs that serve this order.

updated_sincequerystring

ISO 8601 date or time. Lists what changed at or after it, oldest change first.

limitqueryinteger

Default 50. 1 to 100.

cursorquerystring

The next_cursor of the previous page. Opaque; do not build or change one. A cursor belongs to the request that produced it; with other parameters it is bad_cursor.

Up to 2048 characters.

Responses

Headers: X-Request-Id, X-RateLimit-Remaining

FieldTypeDescription
datarequiredobject[]
data[].idrequiredstring
data[].po_numberrequiredstring
data[].distributorrequiredstring

The distributor id (RSR, Lipseys, Davidsons, SportsSouth, Zanders).

data[].statusrequired"draft" | "ready" | "sent" | "confirmed" | "partially_shipped" | "shipped" | "received" | "cancelled" | "failed"
data[].methodrequired"api" | "manual"

How staff will place it.

data[].ship_torequired"shop" | "customer_ffl" | "customer_address"
data[].purpose"stock" | "customer"
data[].distributor_order_nostring | null

The distributor's own order or confirmation number

data[].trackingstring | null
data[].client_order_idsstring[]
data[].send_groupsobject[]

One entry per customer when a direct-ship PO was sent as several distributor orders.

data[].send_groups[].order_idstring
data[].send_groups[].sent_postring
data[].send_groups[].statusstring
data[].send_groups[].distributor_order_nostring | null
data[].linesrequiredobject[]
data[].lines[].line_norequiredinteger
data[].lines[].skurequiredstring
data[].lines[].titlerequiredstring
data[].lines[].quantityrequiredinteger
data[].lines[].shipped_quantityinteger
data[].lines[].received_quantityinteger
data[].lines[].order_idstring | null
data[].lines[].order_line_nointeger | null
data[].lines[].unit_cost_centsinteger | null

Only for a key with catalog:cost:read.

data[].quotedobject

Only for a key with catalog:cost:read.

data[].quoted.subtotal_centsinteger | null
data[].quoted.shipping_centsinteger | null
data[].quoted.tax_centsinteger | null
data[].quoted.total_centsinteger | null
data[].created_atstring (date-time) | null
data[].ready_atstring (date-time) | null
data[].sent_atstring (date-time) | null
data[].confirmed_atstring (date-time) | null
data[].shipped_atstring (date-time) | null
data[].received_atstring (date-time) | null
data[].cancelled_atstring (date-time) | null
data[].cancel_reasonstring | null
data[].updated_atrequiredstring (date-time)
next_cursorrequiredstring | null
Errors400401403429503in the error envelope.

Example

Shell
curl "https://app.getrollmark.com/api/v1/distributor-orders" \
  -H "Authorization: Bearer $ROLLMARK_KEY"

Make drafts from order lines

POST/distributor-orders/drafts
Scoped private key (rm_prv_), from a server
distributor_orders:write

{ lines: [{ order_id, line_no, quantity?, offer_id?, ship_to? }] }, up to 100. Rollmark plans what is not given (the quantity still to order, the best offer, where it is delivered under the store's drop-ship settings) and makes one draft per distributor and place. Lines that cannot be planned come back in skipped. Nothing is sent: a draft costs nothing and staff review and send it in Rollmark. 201 when a draft was made, else 200. Needs the distributor_orders:write permission.

Parameters

NameInTypeDescription
Idempotency-Keyheaderstring

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 Idempotent-Replay: true. The same key with a different method, path or body is 409 idempotency_conflict. A refusal is not kept, so a corrected request can use the same key.

1 to 255 characters.

Request body

FieldTypeDescription
linesrequiredobject[]

1 to 100 items.

lines[].order_idrequiredstring
lines[].line_norequiredinteger
lines[].quantityinteger

At least 1.

lines[].offer_idstring
lines[].ship_to"shop" | "customer_ffl" | "customer_address"

Responses

FieldTypeDescription
datarequiredobject[]
data[].idrequiredstring
data[].po_numberrequiredstring
data[].distributorrequiredstring

The distributor id (RSR, Lipseys, Davidsons, SportsSouth, Zanders).

data[].statusrequired"draft" | "ready" | "sent" | "confirmed" | "partially_shipped" | "shipped" | "received" | "cancelled" | "failed"
data[].methodrequired"api" | "manual"

How staff will place it.

data[].ship_torequired"shop" | "customer_ffl" | "customer_address"
data[].purpose"stock" | "customer"
data[].distributor_order_nostring | null

The distributor's own order or confirmation number

data[].trackingstring | null
data[].client_order_idsstring[]
data[].send_groupsobject[]

One entry per customer when a direct-ship PO was sent as several distributor orders.

data[].send_groups[].order_idstring
data[].send_groups[].sent_postring
data[].send_groups[].statusstring
data[].send_groups[].distributor_order_nostring | null
data[].linesrequiredobject[]
data[].lines[].line_norequiredinteger
data[].lines[].skurequiredstring
data[].lines[].titlerequiredstring
data[].lines[].quantityrequiredinteger
data[].lines[].shipped_quantityinteger
data[].lines[].received_quantityinteger
data[].lines[].order_idstring | null
data[].lines[].order_line_nointeger | null
data[].lines[].unit_cost_centsinteger | null

Only for a key with catalog:cost:read.

data[].quotedobject

Only for a key with catalog:cost:read.

data[].quoted.subtotal_centsinteger | null
data[].quoted.shipping_centsinteger | null
data[].quoted.tax_centsinteger | null
data[].quoted.total_centsinteger | null
data[].created_atstring (date-time) | null
data[].ready_atstring (date-time) | null
data[].sent_atstring (date-time) | null
data[].confirmed_atstring (date-time) | null
data[].shipped_atstring (date-time) | null
data[].received_atstring (date-time) | null
data[].cancelled_atstring (date-time) | null
data[].cancel_reasonstring | null
data[].updated_atrequiredstring (date-time)
skippedrequiredobject[]

Lines that could not be planned, with why. The rest were made.

skipped[].order_idrequiredstring
skipped[].line_norequiredinteger
skipped[].reasonrequired"not_found" | "order_not_live" | "covered" | "bad_offer" | "no_offer" | "ship_to_not_allowed" | "quantity"
skipped[].messagerequiredstring
Errors400401403429503in the error envelope.

Example

Shell
curl -X POST "https://app.getrollmark.com/api/v1/distributor-orders/drafts" \
  -H "Authorization: Bearer $ROLLMARK_KEY" \
  -H "Content-Type: application/json" \
  -d '{"lines":[{"order_id":"…","line_no":1}]}'

One distributor order

GET/distributor-orders/{id}
Scoped private key (rm_prv_), from a server
distributor_orders:read

Status, lines, the distributor's own order number, tracking and what has shipped and been received. Needs the distributor_orders:read permission.

Parameters

NameInTypeDescription
idrequiredpathstring

Responses

Headers: X-Request-Id, X-RateLimit-Remaining

FieldTypeDescription
datarequiredobject
data.idrequiredstring
data.po_numberrequiredstring
data.distributorrequiredstring

The distributor id (RSR, Lipseys, Davidsons, SportsSouth, Zanders).

data.statusrequired"draft" | "ready" | "sent" | "confirmed" | "partially_shipped" | "shipped" | "received" | "cancelled" | "failed"
data.methodrequired"api" | "manual"

How staff will place it.

data.ship_torequired"shop" | "customer_ffl" | "customer_address"
data.purpose"stock" | "customer"
data.distributor_order_nostring | null

The distributor's own order or confirmation number

data.trackingstring | null
data.client_order_idsstring[]
data.send_groupsobject[]

One entry per customer when a direct-ship PO was sent as several distributor orders.

data.send_groups[].order_idstring
data.send_groups[].sent_postring
data.send_groups[].statusstring
data.send_groups[].distributor_order_nostring | null
data.linesrequiredobject[]
data.lines[].line_norequiredinteger
data.lines[].skurequiredstring
data.lines[].titlerequiredstring
data.lines[].quantityrequiredinteger
data.lines[].shipped_quantityinteger
data.lines[].received_quantityinteger
data.lines[].order_idstring | null
data.lines[].order_line_nointeger | null
data.lines[].unit_cost_centsinteger | null

Only for a key with catalog:cost:read.

data.quotedobject

Only for a key with catalog:cost:read.

data.quoted.subtotal_centsinteger | null
data.quoted.shipping_centsinteger | null
data.quoted.tax_centsinteger | null
data.quoted.total_centsinteger | null
data.created_atstring (date-time) | null
data.ready_atstring (date-time) | null
data.sent_atstring (date-time) | null
data.confirmed_atstring (date-time) | null
data.shipped_atstring (date-time) | null
data.received_atstring (date-time) | null
data.cancelled_atstring (date-time) | null
data.cancel_reasonstring | null
data.updated_atrequiredstring (date-time)
Errors401403404429503in the error envelope.

Example

Shell
curl "https://app.getrollmark.com/api/v1/distributor-orders/<id>" \
  -H "Authorization: Bearer $ROLLMARK_KEY"

Delete a draft

DELETE/distributor-orders/{id}
Scoped private key (rm_prv_), from a server
distributor_orders:write

A draft that was never marked ready. Anything else is 409 not_a_draft. Needs the distributor_orders:write permission.

Parameters

NameInTypeDescription
idrequiredpathstring
Idempotency-Keyheaderstring

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 Idempotent-Replay: true. The same key with a different method, path or body is 409 idempotency_conflict. A refusal is not kept, so a corrected request can use the same key.

1 to 255 characters.

Responses

Headers: X-Request-Id, X-RateLimit-Remaining

FieldTypeDescription
datarequiredobject
data.idrequiredstring
data.deletedrequiredtrue
Errors401403404409429503in the error envelope.

Example

Shell
curl -X DELETE "https://app.getrollmark.com/api/v1/distributor-orders/<id>" \
  -H "Authorization: Bearer $ROLLMARK_KEY"

Add an order line to a draft

POST/distributor-orders/{id}/lines
Scoped private key (rm_prv_), from a server
distributor_orders:write

{ order_id, order_line_no, quantity?, offer_id? }. Only a draft; any other status is 409 not_a_draft. The offer defaults to the best one from the draft's distributor. Needs the distributor_orders:write permission.

Parameters

NameInTypeDescription
idrequiredpathstring
Idempotency-Keyheaderstring

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 Idempotent-Replay: true. The same key with a different method, path or body is 409 idempotency_conflict. A refusal is not kept, so a corrected request can use the same key.

1 to 255 characters.

Request body

FieldTypeDescription
order_idrequiredstring
order_line_norequiredinteger
quantityinteger

At least 1.

offer_idstring

Responses

Headers: X-Request-Id, X-RateLimit-Remaining

FieldTypeDescription
datarequiredobject
data.idrequiredstring
data.po_numberrequiredstring
data.distributorrequiredstring

The distributor id (RSR, Lipseys, Davidsons, SportsSouth, Zanders).

data.statusrequired"draft" | "ready" | "sent" | "confirmed" | "partially_shipped" | "shipped" | "received" | "cancelled" | "failed"
data.methodrequired"api" | "manual"

How staff will place it.

data.ship_torequired"shop" | "customer_ffl" | "customer_address"
data.purpose"stock" | "customer"
data.distributor_order_nostring | null

The distributor's own order or confirmation number

data.trackingstring | null
data.client_order_idsstring[]
data.send_groupsobject[]

One entry per customer when a direct-ship PO was sent as several distributor orders.

data.send_groups[].order_idstring
data.send_groups[].sent_postring
data.send_groups[].statusstring
data.send_groups[].distributor_order_nostring | null
data.linesrequiredobject[]
data.lines[].line_norequiredinteger
data.lines[].skurequiredstring
data.lines[].titlerequiredstring
data.lines[].quantityrequiredinteger
data.lines[].shipped_quantityinteger
data.lines[].received_quantityinteger
data.lines[].order_idstring | null
data.lines[].order_line_nointeger | null
data.lines[].unit_cost_centsinteger | null

Only for a key with catalog:cost:read.

data.quotedobject

Only for a key with catalog:cost:read.

data.quoted.subtotal_centsinteger | null
data.quoted.shipping_centsinteger | null
data.quoted.tax_centsinteger | null
data.quoted.total_centsinteger | null
data.created_atstring (date-time) | null
data.ready_atstring (date-time) | null
data.sent_atstring (date-time) | null
data.confirmed_atstring (date-time) | null
data.shipped_atstring (date-time) | null
data.received_atstring (date-time) | null
data.cancelled_atstring (date-time) | null
data.cancel_reasonstring | null
data.updated_atrequiredstring (date-time)
Errors400401403404409429503in the error envelope.

Example

Shell
curl -X POST "https://app.getrollmark.com/api/v1/distributor-orders/<id>/lines" \
  -H "Authorization: Bearer $ROLLMARK_KEY" \
  -H "Content-Type: application/json" \
  -d '{"order_id":"…","order_line_no":1}'

Remove a line from a draft

DELETE/distributor-orders/{id}/lines/{line_no}
Scoped private key (rm_prv_), from a server
distributor_orders:write

Only a draft. Needs the distributor_orders:write permission.

Parameters

NameInTypeDescription
idrequiredpathstring
line_norequiredpathinteger

At least 1.

Idempotency-Keyheaderstring

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 Idempotent-Replay: true. The same key with a different method, path or body is 409 idempotency_conflict. A refusal is not kept, so a corrected request can use the same key.

1 to 255 characters.

Responses

Headers: X-Request-Id, X-RateLimit-Remaining

FieldTypeDescription
datarequiredobject
data.idrequiredstring
data.po_numberrequiredstring
data.distributorrequiredstring

The distributor id (RSR, Lipseys, Davidsons, SportsSouth, Zanders).

data.statusrequired"draft" | "ready" | "sent" | "confirmed" | "partially_shipped" | "shipped" | "received" | "cancelled" | "failed"
data.methodrequired"api" | "manual"

How staff will place it.

data.ship_torequired"shop" | "customer_ffl" | "customer_address"
data.purpose"stock" | "customer"
data.distributor_order_nostring | null

The distributor's own order or confirmation number

data.trackingstring | null
data.client_order_idsstring[]
data.send_groupsobject[]

One entry per customer when a direct-ship PO was sent as several distributor orders.

data.send_groups[].order_idstring
data.send_groups[].sent_postring
data.send_groups[].statusstring
data.send_groups[].distributor_order_nostring | null
data.linesrequiredobject[]
data.lines[].line_norequiredinteger
data.lines[].skurequiredstring
data.lines[].titlerequiredstring
data.lines[].quantityrequiredinteger
data.lines[].shipped_quantityinteger
data.lines[].received_quantityinteger
data.lines[].order_idstring | null
data.lines[].order_line_nointeger | null
data.lines[].unit_cost_centsinteger | null

Only for a key with catalog:cost:read.

data.quotedobject

Only for a key with catalog:cost:read.

data.quoted.subtotal_centsinteger | null
data.quoted.shipping_centsinteger | null
data.quoted.tax_centsinteger | null
data.quoted.total_centsinteger | null
data.created_atstring (date-time) | null
data.ready_atstring (date-time) | null
data.sent_atstring (date-time) | null
data.confirmed_atstring (date-time) | null
data.shipped_atstring (date-time) | null
data.received_atstring (date-time) | null
data.cancelled_atstring (date-time) | null
data.cancel_reasonstring | null
data.updated_atrequiredstring (date-time)
Errors401403404409429503in the error envelope.

Example

Shell
curl -X DELETE "https://app.getrollmark.com/api/v1/distributor-orders/<id>/lines/<line_no>" \
  -H "Authorization: Bearer $ROLLMARK_KEY"
Rollmark is made by Illumina Studios LLC. It was built at Ironcrest Arms LLC. Sample dealers, license numbers and costs in these docs are made up. Questions: [email protected].