Order Tags

Create, read, rename, delete, assign and subscribe to order labels through the Store API.

Order Tags require order scopes: reads use read_orders and writes use write_orders. Tags label orders for workflows such as Wholesale or Rush. They are separate from Product Tags and Customer Tags. Names are unique in the store, ignoring capitalisation and extra spaces, and the slug is always generated from the name, also when a tag is renamed. Each order carries at most max_per_order tags (see the limits endpoint); tagging several orders at once changes nothing when any of them would go over it. Order reads include each order's tags, and GET /orders?tag= filters by tag name. Renaming or deleting a tag also sends orders/update for every order that carries it, in the background.

Endpoints#

Order Tag limits

GET read_orders

Get Order Tag limits.

Returns the field and request limits enforced by Order Tag endpoints. max_per_order is the most tags one order can have; assign_orders_max_count is the most order ids one tag or untag request can name.

Headers

Name Type Description
Authorization required string

Bearer Store API token.

List Order Tags

GET read_orders

List Order Tags for the store.

Returns a paginated, searchable, and sortable list. search matches anywhere in the name, ignoring capitalization, or in the slug. order_count counts the orders that have the tag; it is updated shortly after assignments change.

Query parameters

Name Type Description
page integer

Page number.

Example: 1
limit integer

Page size, 1 to 500; defaults to 25.

Example: 25
search string

Matches anywhere in the name or slug.

Example: gift
sort_by string

Sort by name, order_count, or created_at.

Allowed values
nameorder_countcreated_at
Example: name
sort_direction string

Sort direction: asc or desc.

Allowed values
ascdesc
Example: asc

Headers

Name Type Description
Authorization required string

Bearer Store API token.

Errors

  • 400 ORDER_TAG_LIST_INVALID_PAGE

    Page must be a positive integer.

  • 400 ORDER_TAG_LIST_INVALID_LIMIT

    Limit is not an integer in the Order Tag range.

  • 400 ORDER_TAG_LIST_INVALID_SORT_BY

    Sort_by is not supported.

  • 400 ORDER_TAG_LIST_INVALID_SORT_DIRECTION

    Sort_direction is not supported.

  • 400 ORDER_TAG_SEARCH_TOO_LONG

    Search exceeds the maximum length.

Get an Order Tag

GET read_orders

Get one Order Tag.

Returns the Order Tag when it belongs to the token's store.

Path parameters

Name Type Description
id required string

Order Tag UUID.

Example: 5d0c8a4e-2b7f-4e19-9c3a-6f1e2d4b8a70

Headers

Name Type Description
Authorization required string

Bearer Store API token.

Errors

  • 400 ORDER_TAG_REQUEST_INVALID

    Id is not a valid UUID (details.field is id).

  • 404 ORDER_TAG_NOT_FOUND

    Order Tag does not exist in this store.

Create an Order Tag

POST write_orders

Create an Order Tag.

Creates an Order Tag. The slug is generated from the name. Sends order_tags/create.

Headers

Name Type Description
Authorization required string

Bearer Store API token.

Body parameters

Name Type Description
name required string

Order Tag name.

Example: Gift wrap

Errors

  • 400 STORE_API_INVALID_REQUEST_BODY

    Request body is not valid JSON.

  • 400 ORDER_TAG_NAME_REQUIRED

    Name is required.

  • 400 ORDER_TAG_NAME_TOO_LONG

    Name exceeds the configured limit.

  • 400 ORDER_TAG_NAME_INVALID_CHARS

    Name contains characters a name cannot have, such as control characters.

  • 400 ORDER_TAG_SLUG_GENERATION_FAILED

    No slug could be generated from the name.

  • 409 ORDER_TAG_NAME_DUPLICATE

    An Order Tag with this name already exists, ignoring capitalization; details.existing_id names it.

  • 400 ORDER_TAGS_STORE_LIMIT

    The store has reached its Order Tag limit.

  • 400 STORE_API_BODY_PROPERTY_UNKNOWN

    The body has a property this request does not accept. The message and error.details.properties list the allowed and required properties (nested for each object or list of objects).

  • 400 STORE_API_BODY_PROPERTY_INVALID

    A body property has the wrong type (error.details.expected_type). The message and error.details.properties list the allowed and required properties.

Bulk create Order Tags

POST write_orders

Create multiple Order Tags.

Creates tags from names. Blank names are ignored. Names that already exist, ignoring capitalization, are skipped; invalid names and names over the store limit are returned in row_errors with the same codes as Create an Order Tag, and the other names are still created. Sends order_tags/create for each tag created.

Headers

Name Type Description
Authorization required string

Bearer Store API token.

Body parameters

Name Type Description
names required array<string>

Order Tag names to create, at most 50.

Example: ["Gift wrap", "Priority"]

Errors

  • 400 STORE_API_INVALID_REQUEST_BODY

    Request body is not valid JSON.

  • 400 ORDER_TAGS_BULK_EMPTY

    Names must contain at least one item.

  • 400 ORDER_TAGS_BULK_CREATE_MAX

    The request exceeds the bulk-create cap.

  • 400 STORE_API_BODY_PROPERTY_UNKNOWN

    The body has a property this request does not accept. The message and error.details.properties list the allowed and required properties (nested for each object or list of objects).

  • 400 STORE_API_BODY_PROPERTY_INVALID

    A body property has the wrong type (error.details.expected_type). The message and error.details.properties list the allowed and required properties.

Rename an Order Tag

PUT write_orders

Rename an Order Tag.

Renames the tag; its slug is generated again from the new name. Sends order_tags/update, then orders/update with changed_fields tags for each order with the tag. Renaming to the current name changes nothing.

Path parameters

Name Type Description
id required string

Order Tag UUID.

Example: 5d0c8a4e-2b7f-4e19-9c3a-6f1e2d4b8a70

Headers

Name Type Description
Authorization required string

Bearer Store API token.

Body parameters

Name Type Description
name required string

Order Tag name.

Example: Gift wrap

Errors

  • 400 ORDER_TAG_REQUEST_INVALID

    Id is not a valid UUID (details.field is id).

  • 404 ORDER_TAG_NOT_FOUND

    Order Tag does not exist in this store.

  • 400 STORE_API_INVALID_REQUEST_BODY

    Request body is not valid JSON.

  • 400 ORDER_TAG_NAME_REQUIRED

    Name is required.

  • 400 ORDER_TAG_NAME_TOO_LONG

    Name exceeds the configured limit.

  • 400 ORDER_TAG_NAME_INVALID_CHARS

    Name contains characters a name cannot have, such as control characters.

  • 400 ORDER_TAG_SLUG_GENERATION_FAILED

    No slug could be generated from the name.

  • 409 ORDER_TAG_NAME_DUPLICATE

    An Order Tag with this name already exists, ignoring capitalization; details.existing_id names it.

  • 409 TAG_MUTATION_RETRY

    The tag changed or its new slug was taken while renaming; nothing changed. Retry the request.

  • 400 STORE_API_BODY_PROPERTY_UNKNOWN

    The body has a property this request does not accept. The message and error.details.properties list the allowed and required properties (nested for each object or list of objects).

  • 400 STORE_API_BODY_PROPERTY_INVALID

    A body property has the wrong type (error.details.expected_type). The message and error.details.properties list the allowed and required properties.

Tag orders

POST write_orders

Add the Order Tag to orders.

Adds the tag to every listed order of the token's store that does not have it. added is the number of orders tagged; already_tagged lists ids that already had the tag and not_found lists ids that are not orders of this store, so one bad id does not fail the batch. If any order would go over the tags an order can have (max_per_order from Order Tag limits), no order is changed and ORDER_TAGS_PER_ORDER_LIMIT is returned. Each order tagged sends orders/update with changed_fields tags. The message is ORDERS_BULK_TAGGED when every id was tagged, otherwise ORDERS_BULK_TAGGED_PARTIAL with the three counts. Duplicate ids count once.

Path parameters

Name Type Description
id required string

Order Tag UUID.

Example: 5d0c8a4e-2b7f-4e19-9c3a-6f1e2d4b8a70

Headers

Name Type Description
Authorization required string

Bearer Store API token.

Body parameters

Name Type Description
order_ids required array<string>

Order UUIDs to tag, at most 250.

Example: ["da9b07a6-803f-4e41-8a18-97ff831bd588"]

Errors

  • 400 ORDER_TAG_REQUEST_INVALID

    Id is not a valid UUID (details.field is id).

  • 404 ORDER_TAG_NOT_FOUND

    Order Tag does not exist in this store.

  • 400 STORE_API_INVALID_REQUEST_BODY

    Request body is not valid JSON.

  • 400 ORDER_TAG_NO_ORDER_IDS

    order_ids is empty.

  • 400 ORDER_TAG_REQUEST_INVALID

    An order id is not a valid UUID (details.field is order_ids).

  • 400 ORDER_TAG_ORDERS_MAX

    More order ids than assign_orders_max_count from Order Tag limits.

  • 400 ORDER_TAGS_PER_ORDER_LIMIT

    A listed order already has the most tags an order can have; no order was changed.

  • 400 STORE_API_BODY_PROPERTY_UNKNOWN

    The body has a property this request does not accept. The message and error.details.properties list the allowed and required properties (nested for each object or list of objects).

  • 400 STORE_API_BODY_PROPERTY_INVALID

    A body property has the wrong type (error.details.expected_type). The message and error.details.properties list the allowed and required properties.

Untag orders

POST write_orders

Remove the Order Tag from orders.

Removes the tag from every listed order of the token's store that has it. removed is the number of orders untagged; not_tagged lists ids that did not have the tag and not_found lists ids that are not orders of this store. Each order untagged sends orders/update with changed_fields tags. The message is ORDERS_BULK_UNTAGGED when every id was untagged, otherwise ORDERS_BULK_UNTAGGED_PARTIAL. Duplicate ids count once.

Path parameters

Name Type Description
id required string

Order Tag UUID.

Example: 5d0c8a4e-2b7f-4e19-9c3a-6f1e2d4b8a70

Headers

Name Type Description
Authorization required string

Bearer Store API token.

Body parameters

Name Type Description
order_ids required array<string>

Order UUIDs to untag, at most 250.

Example: ["da9b07a6-803f-4e41-8a18-97ff831bd588"]

Errors

  • 400 ORDER_TAG_REQUEST_INVALID

    Id is not a valid UUID (details.field is id).

  • 404 ORDER_TAG_NOT_FOUND

    Order Tag does not exist in this store.

  • 400 STORE_API_INVALID_REQUEST_BODY

    Request body is not valid JSON.

  • 400 ORDER_TAG_NO_ORDER_IDS

    order_ids is empty.

  • 400 ORDER_TAG_REQUEST_INVALID

    An order id is not a valid UUID (details.field is order_ids).

  • 400 ORDER_TAG_ORDERS_MAX

    More order ids than assign_orders_max_count from Order Tag limits.

  • 400 STORE_API_BODY_PROPERTY_UNKNOWN

    The body has a property this request does not accept. The message and error.details.properties list the allowed and required properties (nested for each object or list of objects).

  • 400 STORE_API_BODY_PROPERTY_INVALID

    A body property has the wrong type (error.details.expected_type). The message and error.details.properties list the allowed and required properties.

Delete an Order Tag

DELETE write_orders

Delete an Order Tag.

If orders have the tag, retry with the returned confirmation token. Sends order_tags/delete; the tag is then removed from its orders in the background, each sending orders/update with changed_fields tags.

Path parameters

Name Type Description
id required string

Order Tag UUID.

Example: 5d0c8a4e-2b7f-4e19-9c3a-6f1e2d4b8a70

Headers

Name Type Description
Authorization required string

Bearer Store API token.

Body parameters

Name Type Description
confirmed boolean

On a confirmation retry, set this to true and send the returned confirmation_token. Omit it on the first request.

confirmation_token string

Token from the CONFIRMATION_REQUIRED response. Omit it on the first request and resend the exact same id selection when using it.

Errors

  • 400 ORDER_TAG_REQUEST_INVALID

    Id is not a valid UUID (details.field is id).

  • 404 ORDER_TAG_NOT_FOUND

    Order Tag does not exist in this store.

  • 400 STORE_API_INVALID_REQUEST_BODY

    Request body is not valid JSON.

  • 409 CONFIRMATION_REQUIRED

    Orders have the tag; deletion requires confirmation. details.affected_order_count is the number of orders.

  • 400 ORDER_TAG_CONFIRMATION_INVALID

    The confirmation token is invalid or expired, or a tag changed since it was issued; obtain a fresh confirmation.

  • 409 TAG_MUTATION_RETRY

    A tag is being changed by another request; nothing was deleted. Retry the request.

  • 400 STORE_API_BODY_PROPERTY_UNKNOWN

    The body has a property this request does not accept. The message and error.details.properties list the allowed and required properties (nested for each object or list of objects).

  • 400 STORE_API_BODY_PROPERTY_INVALID

    A body property has the wrong type (error.details.expected_type). The message and error.details.properties list the allowed and required properties.

Bulk delete Order Tags

POST write_orders

Delete multiple Order Tags.

Deletes the selected store-scoped UUIDs transactionally; ids that are not UUIDs or not tags of this store are listed in failed. If orders have any of the tags, retry with the returned confirmation token and the same ids. Sends order_tags/delete for each tag deleted; the tags are then removed from their orders in the background, each sending orders/update with changed_fields tags.

Headers

Name Type Description
Authorization required string

Bearer Store API token.

Body parameters

Name Type Description
tag_ids required array<string>

Store-scoped Order Tag UUIDs, at most 500.

Example: ["5d0c8a4e-2b7f-4e19-9c3a-6f1e2d4b8a70"]
confirmed boolean

On a confirmation retry, set this to true and send the returned confirmation_token. Omit it on the first request.

confirmation_token string

Token from the CONFIRMATION_REQUIRED response. Omit it on the first request and resend the exact same id selection when using it.

Errors

  • 400 STORE_API_INVALID_REQUEST_BODY

    Request body is not valid JSON.

  • 400 ORDER_TAGS_NONE_SPECIFIED

    Tag_ids must contain at least one id.

  • 400 ORDER_TAGS_BULK_DELETE_MAX

    The request exceeds the bulk-delete cap.

  • 409 CONFIRMATION_REQUIRED

    Orders have the tag; deletion requires confirmation. details.affected_order_count is the number of orders.

  • 400 ORDER_TAG_CONFIRMATION_INVALID

    The confirmation token is invalid or expired, or a tag changed since it was issued; obtain a fresh confirmation.

  • 409 TAG_MUTATION_RETRY

    A tag is being changed by another request; nothing was deleted. Retry the request.

  • 400 STORE_API_BODY_PROPERTY_UNKNOWN

    The body has a property this request does not accept. The message and error.details.properties list the allowed and required properties (nested for each object or list of objects).

  • 400 STORE_API_BODY_PROPERTY_INVALID

    A body property has the wrong type (error.details.expected_type). The message and error.details.properties list the allowed and required properties.

Fields#

Field

Type

Create

Update

Required

Translatable

name

text

Yes

Yes

create, update

No

slug

slug

No

No

No

order_count

integer

No

No

No

created_at

datetime

No

No

No

updated_at

datetime

No

No

No

Webhook events#

Subscribe to these events to keep your integration in sync with order tags. Each event shows the required Store API scope and store permission, the available payload fields, and an example payload. Subscription setup is validated against those permissions; delivery is always restricted to the subscription's store.

Order tag created

EVENT order_tags/create App scope: read_orders Staff permission: orders:read

Fired when an order tag is created, including a tag created by adding a new name to an order. Adding the tag to or removing it from an order sends orders/update (tags).

Payload fields

Field Type Description
tag.id string Always present
tag.name string Selectable in the Payload builder
tag.slug string Selectable in the Payload builder
tag.order_count integer Selectable in the Payload builder
tag.created_at string Selectable in the Payload builder
tag.updated_at string Selectable in the Payload builder

Order tag updated

EVENT order_tags/update App scope: read_orders Staff permission: orders:read

Fired when an order tag is renamed. Each order with the tag then sends orders/update (tags).

Possible changed_fields values

The changed_fields array names exactly which of these changed in this event — use it to skip processing updates your integration doesn't care about.

name slug

Payload fields

Field Type Description
previous.id string Always present
previous.name string Selectable in the Payload builder
previous.slug string Selectable in the Payload builder
previous.order_count integer Selectable in the Payload builder
previous.created_at string Selectable in the Payload builder
previous.updated_at string Selectable in the Payload builder
current.id string Always present
current.name string Selectable in the Payload builder
current.slug string Selectable in the Payload builder
current.order_count integer Selectable in the Payload builder
current.created_at string Selectable in the Payload builder
current.updated_at string Selectable in the Payload builder
changed_fields array Selectable in the Payload builder

Order tag deleted

EVENT order_tags/delete App scope: read_orders Staff permission: orders:read

Fired when an order tag is deleted. Each order that had the tag then sends orders/update (tags) as the tag is removed from it.

Payload fields

Field Type Description
tag.id string Always present
tag.name string Selectable in the Payload builder
tag.slug string Selectable in the Payload builder
tag.order_count integer Selectable in the Payload builder
tag.created_at string Selectable in the Payload builder
tag.updated_at string Selectable in the Payload builder