🔗Public APIs for Quantity Breaks (QB)

🔐 Get Your Access Key

After installing the B2B/Wholesale Solution Shopify app:

  1. Open the Public API page

  2. Click Copy to copy your Access Key

Use this key in request bodies shown below.


🧱 Rule Model — Fields & Enums

Understand these fields before calling the endpoints:

priority Determines which rule takes precedence over others.

status

0: inactive
1: active

apply_to

0: All customers
1: Logged-in customers
2: Not-logged-in customers
3: Specific customers
4: Customer tags

exclude_customer

product_condition_type

exc_product_type

rule_setting

qb_table_type

Note

  • When you get rules by domain or ID, rule_setting appears in the response to indicate whether a rule is Quantity Break or Amount Break.

  • When you create/update a rule, rule_setting will be Quantity Break by default (create/update Amount Break is not supported as of now).


📊 qty_table — Quantity Settings

rule_type

Behavior explanations (verbatim logic):

  • Minimum Product Qty If one order contains the selected products and the number of each product meets the quantity break ranges, the price of the product will be discounted accordingly. Example: Products A (variants A1, A2) and B (variants B1, B2) are selected. Ranges: 0–5 (−10%), 6–10 (−15%). If a customer buys 3×A1, 6×A2, 4×B1 → Total A qty = 9A gets −15%, B gets −10%. If qty is not within ranges, original prices apply.

  • Minimum Order Qty If one order contains the selected products and the total number of those products meets the ranges, they will be discounted accordingly. Example: Products A, B; A has A1, A2, B has B1, B2. Ranges: 0–5 (−10%), 6–10 (−15%), 11–20 (−20%). If customer buys 3×A1, 6×A2, 4×B1 → Total A+B qty = 13A & B get −20%. If qty not within ranges, original prices apply.

  • Minimum Variant Qty If one order contains the selected products and the number of variants meets the ranges, those variants are discounted accordingly. Example: Products A, B; variants A1, A2, B1, B2. Ranges: 0–5 (−10%), 6–10 (−15%), 11–20 (−20%). If customer buys 3×A1, 6×A2, 4×B1A1 & B1 get −10%, A2 gets −15%. If qty not within ranges, original prices apply.

Range fields

  • qty_from: lower bound of a range

  • qty_to: upper bound of a range

discount_type


📥 Rule Endpoints

Get rules by domain

Headers

Body

Response 200 (excerpt)


Get rules by ID

Headers

Body

Response 200 (excerpt)


Create or Update a single rule

Headers

Rules

  • If there’s no id, a new rule is created.

  • If id is present, that rule is updated.

  • If "product_condition_type" = 4 (specific variants), then rule_type must not be 0 (minimum product qty).

Body

Response 200


Create or Update multiple rules

Headers

Rules

  • If a rule has no id, it will be created.

  • If a rule has an id, it will be updated.

  • If an id is incorrect/not found inside the batch, those rules will not be created/updated.

Body (excerpt)

Response 200


Delete rule

Headers

Body

Response 200


Delete multiple rules

Headers

Body

Response 200


Get Applied Rules for Products

Headers

Behavior If customer_id is null, the system checks rules that apply to All customers or Not-logged-in customers.

Body

Response 200 (excerpt)


Get Price List of Variants based on Applied Rules

Headers

Behavior If customer_id is null, the system checks Custom Pricing rules that apply to All or Not-logged-in customers.

Body

Response 200 (excerpt)


🧭 Product Endpoints

Search products

Headers

Cursoring afterIndex is a cursor. If afterIndex is null, search starts from the beginning. Example:

Body

Response 200 (excerpt)

Get Product Tags

Headers

Body

Response 200 (excerpt)

Get Products by Tags

Headers

Body

Operation

  • "AND" → returned products contain all tags

  • "OR" → returned products contain any of the tags

Response 200 (excerpt)

Get Products by IDs

Headers

Body

Response 200 (excerpt)


👥 Customer Endpoints

Search Customers

Headers

Body

Response 200 (excerpt)

Get Customer Tags

Headers

Body

Response 200

Get Customers by IDs

Headers

Body

Response 200

Get Customers by Tags

Headers

Body

Operation

  • "AND" → returned customers must contain all tags

  • "OR" → returned customers need any one tag

Response 200 (excerpt)


🗂️ Collection Endpoints

As provided: The “Get Collections” section uses the /customer/search endpoint and returns a customers payload. The following block is reproduced exactly.

Get Collections

Headers

Body

Response 200 (excerpt)


⚙️ Request Handling Policy

  • The system handles one request at a time. After a request completes, the next one is processed.

  • In case of a server error, recovery may take up to 3 minutes before a new request can be processed.

Last updated

Was this helpful?