🔗Public APIs for Volume Pricing (VP)
Programmatically create, update, retrieve, and delete Volume Pricing (Quantity Break) rules via REST API.
🔑 Get the Access Key
Get your API Key. If you don’t have one yet, please follow this document to generate it.
Include it in the request body for endpoints that require it.
API Versions
v2 (recommended)
List and read rules with pagination and filtering
✅ Current
v1 write endpoints
Create, update, delete rules
✅ Active
v1 read endpoints (get-by-domain, get-by-id)
Retrieve rules
⚠️ Deprecated — use v2 instead
Why migrate read operations to v2? v2 uses cursor-based pagination and field selection, returning only the data you need — significantly improving performance compared to v1.
v2 — List Volume Pricing Rules
v2 - Get rules by domain or ID
GET /api/v2/vp/rules
Base URL: https://b2b-solution-public-api.bsscommerce.com
Authentication
Header
x-api-key
Your Access Key
domain is required — pass it as a query parameter (?domain=) or in the request body.
Example:
Query Parameters
domain
string
—
Your shop domain (required)
limit
integer
30
Rules per page. Min: 1, max: 250
sort
enum
id
Sort field: id | priority | createdAt
order
enum
see note
Sort direction: asc | desc. Default: asc for priority, desc for id and createdAt
status
enum
—
Filter by status: enable | disable
name
string
—
Filter by rule name (case-insensitive substring match)
ruleSetting
enum
—
Filter by setting type: quantity | value
ruleType
enum
—
Filter by scope: product | order | variant
ids
string
—
Comma-separated rule IDs (max 100). When present, all pagination params are ignored.
fields
string
—
Comma-separated field names to return. id is always included.
nextCursor
string
—
Cursor for the next page (from previous response)
previousCursor
string
—
Cursor for the previous page (from previous response)
Available Fields (?fields=)
Top-level rule fields:
Nested fields (trigger a JOIN — omit if only rule metadata is needed):
Internal fields not exposed: shop_id, file_theme_index, deletedAt.
Response Envelope
Success (HTTP 200):
Error (4xx / 5xx):
pageInfo fields:
limit
integer
The limit value used for this response
count
integer
Number of rules returned in this page
hasNext
boolean
true if a next page exists
hasPrevious
boolean
true if a previous page exists
nextCursor
string | null
Pass as nextCursor to get the next page. null when hasNext is false
previousCursor
string | null
Pass as previousCursor to get the previous page. null when hasPrevious is false
sort
string
Sort field used for this response
order
string
Sort direction used for this response
Cursor Pagination
First call — send no cursor. Read
pageInfo.nextCursorfrom the response.Next page — pass
?nextCursor=<value>from the previous response.Previous page — pass
?previousCursor=<value>from the previous response.Never send both cursors in the same request — returns
400 INVALID_QUERY.Treat cursors as opaque strings — do not parse or modify them.
Changing
sortororderinvalidates existing cursors — restart from the first page.
Examples
List rules sorted by priority (first page):
Next page:
Fetch specific rules by ID:
Reduce payload with field selection:
Incremental sync — most recently created first:
Rate Limits
Default: 60 requests per minute per shop (fixed window).
Every v2 response includes these headers:
X-RateLimit-Limit
Total requests allowed per window
X-RateLimit-Remaining
Requests remaining in the current window
X-RateLimit-Reset
Unix timestamp (seconds) when the window resets
Retry-After
(429 only) Seconds to wait before retrying
Monitor X-RateLimit-Remaining on every response. When it reaches 0, pause until X-RateLimit-Reset before sending the next request.
Error Codes
ACCESS_KEY_MISSING
401
No Access Key provided
Add x-api-key header
ACCESS_KEY_INVALID
401
Access Key does not match shop
Verify key in app dashboard under Public API
DOMAIN_MISSING
400
No domain provided
Add ?domain=your-shop.myshopify.com
SHOP_NOT_FOUND
404
Domain not found
Check domain is correct and app is installed
PUBLIC_API_DISABLED
403
Public API not enabled
Enable it in app dashboard under Public API
RATE_LIMIT_EXCEEDED
429
Rate limit exceeded
Wait Retry-After seconds, then retry
INVALID_QUERY
400
Invalid query parameter
Check error.message for which field failed
UPSTREAM_UNAVAILABLE
502
Internal service unreachable
Retry after a short delay
v1 — Write Operations (Create / Update / Delete)
⚠️
get-by-domainandget-by-idare deprecated. UseGET /api/v2/vp/rulesinstead — it is faster and supports pagination and filtering.The endpoints below (save, bulk-save, delete, mass-delete, applied rules, price list) remain active and are still required for writing rules.
Base URL: https://b2b-solution-public-api.bsscommerce.com
All v1 requests use POST with Content-Type: application/json. Include domain and accessKey in every request body.
🧱 Rule Model — Fields & Enums
Understand these fields before calling the endpoints.
priority — Determines which rule takes precedence over others.
status
apply_to
exclude_customer
product_condition_type
exc_product_type
rule_setting
qb_table_type
Note
When you get rules by domain or ID,
rule_settingappears in the response to indicate whether a rule is Quantity-based or Volume-based.When you create/update a rule,
rule_settingwill be Quantity-based by default (create/update Volume-based is not supported as of now).
📊 qty_table — Quantity Settings
rule_type
Behavior explanations:
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 = 9 → A 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 = 13 → A & 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×B1 → A1 & B1 get −10%, A2 gets −15%. If qty not within ranges, original prices apply.
Range fields:
qty_from— lower bound of a rangeqty_to— upper bound of a range
discount_type
Get rule by domain (Deprecated)
Get rules by (Deprecated)
Create or Update a Single Rule
Rules:
If there is no
id, a new rule is created.If
idis present, that rule is updated.If
product_condition_type = 4(specific variants),rule_typemust not be0(minimum product qty).
Request body:
Response 200:
Create or Update Multiple Rules
Rules:
Rules without an
idare created.Rules with an
idare updated.If an
idis not found, those rules are skipped.
Request body:
Response 200:
Delete a Rule
Request body:
Response 200:
Delete Multiple Rules
Request body:
Response 200:
Get Applied Rules for Products
Returns which rules and discount tiers apply to specific products for a given customer.
If
customer_idisnull, the system checks rules that apply to All customers or Not-logged-in customers.
Request body:
Response 200:
Get Price List of Variants Based on Applied Rules
Returns calculated variant prices after all applicable Volume Pricing rules are applied for a customer.
If
customer_idisnull, the system checks rules that apply to All or Not-logged-in customers.
Request body:
Response 200:
🧭 Product Endpoints
Search Products
afterIndex is a cursor — pass null to start from the beginning.
Request body:
Get Product Tags
Get Products by Tags
"AND"— returned products contain all listed tags"OR"— returned products contain any of the listed tags
Get Products by IDs
👥 Customer Endpoints
Search Customers
Get Customer Tags
Get Customers by IDs
Get Customers by Tags
"AND"— returned customers must have all listed tags"OR"— returned customers need any one of the listed tags
⚙️ Request Handling Policy (v1)
v1 processes 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