Skip to content

Public API v2: Auto Tag

Rules that tag customers and orders, add notes or mark a customer tax exempt when an event happens.

Scopes auto-tag:read, auto-tag:write
Plan Your current plan must include Auto Tag; otherwise 403
Takes effect Applies as soon as it is saved. No upload.

Every response has the same envelope (success, status, data, meta; see Responses). Returns below describes data. The examples are real calls; the rules were created disabled.

  • Rules apply as soon as they are saved; there is no upload for Auto Tag.
  • A condition has field or form_field. form_field is a field of the registration form form_id and goes with customer_created only. The form is not checked: an unknown form_id saves a rule that never matches.
  • Each event takes the fields the app offers for it. Paid-order totals need paid_orders_days (1–365); weight fields need unit (g, kg, lb, oz).
  • Tags in an action value are comma-separated. mark_tax_exempt takes no value and appears once at most.

What every read returns. Lists come back as [] when empty, never null.

idstringread-only

Rule id.

namestring

Rule name.

priorityinteger

Lower number wins; see Rules.

statusenum

disabled rules are kept but not applied. One of disabled, enabled.

eventenum

One of customer_created, order_created, order_paid, order_fulfilled, order_cancelled.

form_idstring or null

matchenum

One of all, any.

conditions[object]

Show fields

fieldenum or null

One of customer_name, customer_email, customer_first_name, customer_last_name, customer_tags, customer_orders_count, customer_total_spent, shipping_city, shipping_country, shipping_province, shipping_postcode, billing_city, billing_country, billing_province, billing_postcode, default_address_city, default_address_country, default_address_province, default_address_postcode, product_name, product_sku, order_items_count, order_quantity, order_amount, paid_orders_amount, paid_orders_count, order_weight, paid_orders_weight.

form_fieldobject or null

form_field.namestring

form_field.labelstring

operationenum

One of contains, not_contains, equals, not_equals, greater_than, less_than, greater_than_or_equal, less_than_or_equal, starts_with.

valuestring or null

unitenum or null

One of g, kg, lb, oz.

paid_orders_daysinteger or null

actions[object]

Show fields

typeenum

One of add_customer_tags, remove_customer_tags, add_customer_note, add_order_note, add_order_tags, remove_order_tags, mark_tax_exempt.

valuestring or null

created_atstring or nullread-only

UTC, ending in Z.

updated_atstring or nullread-only

UTC, ending in Z.

The rule object
{
"id": "28",
"name": "Tag EU wholesalers",
"priority": 1,
"status": "disabled",
"event": "customer_created",
"form_id": "12",
"match": "all",
"conditions": [
{
"field": null,
"form_field": {
"name": "country-field",
"label": "Country"
},
"operation": "equals",
"value": "Germany",
"unit": null,
"paid_orders_days": null
},
{
"field": "customer_email",
"form_field": null,
"operation": "contains",
"value": "@acme.de",
"unit": null,
"paid_orders_days": null
}
],
"actions": [
{
"type": "add_customer_tags",
"value": "eu,wholesale"
},
{
"type": "mark_tax_exempt",
"value": null
}
],
"created_at": "2026-10-21T09:34:27.000Z",
"updated_at": "2026-10-21T09:34:27.000Z"
}

List rules

GET/api/v2/auto-tag/rules

Scope auto-tag:readCost 10

List rules, newest first, with their conditions and actions.

limitinteger

1–250, default 50. See Paging.

cursorstring

next_cursor or prev_cursor of the last page; leave out for the first page. Keep the same filters on every page.

filter_statusenum

One of disabled, enabled.

filter_namestring

Part of the name, any case. 1–200 characters.

filter_eventenum

One of customer_created, order_created, order_paid, order_fulfilled, order_cancelled.

data[Rule]

The rules of this page; [] when there are none.

meta.paginationobject

limit, next_cursor, prev_cursor and links to the next and previous pages.

cURL
curl -X GET "https://solution-public-api.bss-b2b.solutions/api/v2/auto-tag/rules?limit=2&filter_name=Tag" \
-H "X-API-Key: $B2B_API_KEY" \
-H "X-Shop-Domain: your-store.myshopify.com"

Create a rule

POST/api/v2/auto-tag/rules

Scope auto-tag:writeCost 11

Create a rule.

The body of POST /rules, PUT /rules/{id} and each element of bulk-upsert (add id to replace a rule). PUT replaces the whole rule: optional fields left out go back to their defaults. Fields not listed here are refused with 422.

namestringrequired

Rule name. 1–200 characters.

priorityintegerrequired

Lower number wins; see Rules. 0–99.

statusenumrequired

disabled rules are kept but not applied. One of disabled, enabled.

eventenumrequired

  • customer_created: A customer signs up through a registration form (form_id).
  • order_created, order_paid, order_fulfilled, order_cancelled: An order is placed, paid, fulfilled or cancelled.

form_idstring

The registration form the rule watches; required with customer_created, else left out. Numeric id as a string.

matchenumrequired

all conditions, or any one of them.

  • all, any: Every condition must match, or any one of them.

conditions[object]required

1–50 items.

Show fields

fieldenum

Leave out with form_field. One of customer_name, customer_email, customer_first_name, customer_last_name, customer_tags, customer_orders_count, customer_total_spent, shipping_city, shipping_country, shipping_province, shipping_postcode, billing_city, billing_country, billing_province, billing_postcode, default_address_city, default_address_country, default_address_province, default_address_postcode, product_name, product_sku, order_items_count, order_quantity, order_amount, paid_orders_amount, paid_orders_count, order_weight, paid_orders_weight.

form_fieldobject

A field of the registration form form_id; only with customer_created.

form_field.namestringrequired

The name (version 1) or id of the field in the form. Not empty.

form_field.labelstringrequired

Not empty.

operationenumrequired

One of contains, not_contains, equals, not_equals, greater_than, less_than, greater_than_or_equal, less_than_or_equal, starts_with.

valuestringrequired

A number for number fields and paid-order totals. 0–300 characters.

unitenum

Required with the weight fields, else left out. One of g, kg, lb, oz.

paid_orders_daysinteger

How many days back the paid-order totals count; required with them, else left out. 1–365.

actions[object]required

1–50 items.

Show fields

typeenumrequired

One of add_customer_tags, remove_customer_tags, add_customer_note, add_order_note, add_order_tags, remove_order_tags, mark_tax_exempt.

valuestring

Tags (comma-separated) or the note to add; left out with mark_tax_exempt. 1–300 characters.

dataRule

The new rule.

cURL
curl -X POST "https://solution-public-api.bss-b2b.solutions/api/v2/auto-tag/rules" \
-H "X-API-Key: $B2B_API_KEY" \
-H "X-Shop-Domain: your-store.myshopify.com" \
-H "Content-Type: application/json" \
-d '{
"name": "Tag EU wholesalers",
"priority": 1,
"status": "disabled",
"event": "customer_created",
"form_id": "12",
"match": "all",
"conditions": [
{
"form_field": {
"name": "country-field",
"label": "Country"
},
"operation": "equals",
"value": "Germany"
},
{
"field": "customer_email",
"operation": "contains",
"value": "@acme.de"
}
],
"actions": [
{
"type": "add_customer_tags",
"value": "eu,wholesale"
},
{
"type": "mark_tax_exempt"
}
]
}'

Get a rule

GET/api/v2/auto-tag/rules/{id}

Scope auto-tag:readCost 10

Get a rule.

idstringrequired

Rule id.

dataRule

The rule. An id that does not exist answers 404 RESOURCE_NOT_FOUND.

cURL
curl -X GET "https://solution-public-api.bss-b2b.solutions/api/v2/auto-tag/rules/28" \
-H "X-API-Key: $B2B_API_KEY" \
-H "X-Shop-Domain: your-store.myshopify.com"

Replace a rule

PUT/api/v2/auto-tag/rules/{id}

Scope auto-tag:writeCost 11

Replace a rule with all its conditions and actions.

idstringrequired

Rule id.

The same fields as Create a rule.

dataRule

The rule after the change.

cURL
curl -X PUT "https://solution-public-api.bss-b2b.solutions/api/v2/auto-tag/rules/28" \
-H "X-API-Key: $B2B_API_KEY" \
-H "X-Shop-Domain: your-store.myshopify.com" \
-H "Content-Type: application/json" \
-d '{
"name": "Tag EU wholesalers (updated)",
"priority": 2,
"status": "disabled",
"event": "customer_created",
"form_id": "12",
"match": "all",
"conditions": [
{
"form_field": {
"name": "country-field",
"label": "Country"
},
"operation": "equals",
"value": "Germany"
},
{
"field": "customer_email",
"operation": "contains",
"value": "@acme.de"
}
],
"actions": [
{
"type": "add_customer_tags",
"value": "eu,wholesale"
},
{
"type": "mark_tax_exempt"
}
]
}'

Delete a rule

DEL/api/v2/auto-tag/rules/{id}

Scope auto-tag:writeCost 11

Delete a rule.

idstringrequired

Rule id.

data.idstring

Id of the deleted rule.

data.deletedboolean

true.

cURL
curl -X DELETE "https://solution-public-api.bss-b2b.solutions/api/v2/auto-tag/rules/28" \
-H "X-API-Key: $B2B_API_KEY" \
-H "X-Shop-Domain: your-store.myshopify.com"

Create or replace rules in bulk

POST/api/v2/auto-tag/rules/bulk-upsert

Scope auto-tag:writeCost ceil(10 + 0.4 × rules)

Create or replace up to 250 rules; each one succeeds or fails on its own.

See Bulk & idempotency.

rules[object]required

1–250 rules, each with the fields of Create a rule.

Show fields

idstring

Set it to replace that rule, as Replace a rule does; leave it out to create one.

data.results[object]

One entry per rule, in the order sent.

Show fields

indexinteger

Position of the rule in rules.

idstring

Rule id.

resultenum

created, updated or error.

errorobject

code and message, only when result is error.

data.summaryobject

total, succeeded, failed.

cURL
curl -X POST "https://solution-public-api.bss-b2b.solutions/api/v2/auto-tag/rules/bulk-upsert" \
-H "X-API-Key: $B2B_API_KEY" \
-H "X-Shop-Domain: your-store.myshopify.com" \
-H "Content-Type: application/json" \
-d '{
"rules": [
{
"name": "Tag EU wholesalers B",
"priority": 1,
"status": "disabled",
"event": "customer_created",
"form_id": "12",
"match": "all",
"conditions": [
{
"form_field": {
"name": "country-field",
"label": "Country"
},
"operation": "equals",
"value": "Germany"
},
{
"field": "customer_email",
"operation": "contains",
"value": "@acme.de"
}
],
"actions": [
{
"type": "add_customer_tags",
"value": "eu,wholesale"
},
{
"type": "mark_tax_exempt"
}
]
},
{
"name": "Tag EU wholesalers (bulk)",
"priority": 1,
"status": "disabled",
"event": "customer_created",
"form_id": "12",
"match": "all",
"conditions": [
{
"form_field": {
"name": "country-field",
"label": "Country"
},
"operation": "equals",
"value": "Germany"
},
{
"field": "customer_email",
"operation": "contains",
"value": "@acme.de"
}
],
"actions": [
{
"type": "add_customer_tags",
"value": "eu,wholesale"
},
{
"type": "mark_tax_exempt"
}
],
"id": "28"
}
]
}'

Delete rules in bulk

POST/api/v2/auto-tag/rules/bulk-delete

Scope auto-tag:writeCost ceil(10 + 0.4 × rules)

Delete up to 250 rules; an unknown id fails on its own.

See Bulk & idempotency.

ids[string]required

1–250 rule ids.

data.results[object]

One entry per id: index, id, result (deleted or error) and error (code, message) when it failed.

data.summaryobject

total, succeeded, failed.

cURL
curl -X POST "https://solution-public-api.bss-b2b.solutions/api/v2/auto-tag/rules/bulk-delete" \
-H "X-API-Key: $B2B_API_KEY" \
-H "X-Shop-Domain: your-store.myshopify.com" \
-H "Content-Type: application/json" \
-d '{
"ids": [
"29",
"999999999"
]
}'