Public APIs for Custom Pricing (CP)
Programmatically manage Custom Pricing rules via REST API: create, retrieve, update, delete rules, and calculate prices for specific customers.
The Custom Pricing Public API is a feature of the BSS B2B Solution Shopify app.
It allows developers to manage and sync customer-specific pricing rules directly from external systems such as ERPs, CRMs, or custom integrations.
These are REST APIs: you can use them to:
- Manage customer pricing rules
- Calculate variant prices based on active rules
- Retrieve product and customer data
- Automate B2B price synchronization
Get the Access Key
Section titled “Get the Access Key”- Get your API Key. If you don’t have one yet, please follow this document to generate it.
- All endpoints on this page are v1: include the key either as
accessKeyin the request body, or as a header:
x-bss-b2b-api-key: <accessKey>⚠️ Not the same header as v2 (
x-api-key, used only by the Volume Pricing v2 endpoint): check the Authentication table if you’re integrating multiple API groups.
Rule Endpoints
Section titled “Rule Endpoints”Before using the endpoints, familiarize yourself with the Rule model fields below.
| Field | Description | Values |
|---|---|---|
priority |
Determines which rule takes precedence over others. | Integer |
status |
Activation status of the rule. |
|
apply_to |
Defines which customers the rule applies to. |
|
exclude_customer |
Exclude rules for certain customers. |
|
product_condition_type |
Determines which products are targeted. |
|
exc_product_type |
Excludes certain products from the rule. |
|
discount_type |
Discount method to apply. |
|
market_condition_type |
Determines which markets the rule applies to. |
|
Get Rules by Domain
Section titled “Get Rules by Domain”Endpoint
POST https://b2b-solution-public-api.bsscommerce.com/api/v1/rule/get-by-domainHeaders
Content-Type: application/jsonRequest Body
{ "domain": "abc.myshopify.com", "accessKey": "xxx"}Response
{ "success": true, "rules": [ { "id": 536662, "shop_id": 9204, "name": "Discount 20%l", "priority": 1, "status": 1, "apply_to": 0, "customer_ids": [], "customer_tags": [], "product_condition_type": 4, "variant_ids": ["6586590625965", "6586590658733", "6586590691501"], "discount_type": 2, "discount_value": "10.00", "market_condition_type": 1, "market_ids": ["49314136349"], "createdAt": "2023-03-09T03:38:50.000Z", "updatedAt": "2023-06-15T02:16:47.000Z" }, { "id": 545507, "name": "test4", "status": 0, "apply_to": 3, "customer_ids": ["6819529654557", "6905095291165"], "product_ids": ["8174450049309"], "discount_type": 0, "discount_value": "50.00", "market_condition_type": 0 } ]}Get Rule by ID
Section titled “Get Rule by ID”Endpoint
POST https://b2b-solution-public-api.bsscommerce.com/api/v1/rule/get-by-idRequest Body
{ "domain": "abc.myshopify.com", "accessKey": "xxx", "id": 79}Response
{ "success": true, "rule": { "id": 79, "name": "Discount 20%l", "priority": 1, "status": 1, "apply_to": 0, "variant_ids": ["6586590625965", "6586590658733", "6586590691501"], "discount_type": 2, "discount_value": "10.00", "market_condition_type": 1, "market_ids": ["49314136349"] }}Get Rules by Products
Section titled “Get Rules by Products”Endpoint
POST https://b2b-solution-public-api.bsscommerce.com/api/v1/rule/get-rules-by-productsRequest Body
{ "domain": "abc.myshopify.com", "accessKey": "xxx", "product_ids": [7208233467979, 7208233467980], "product_tags": ["b2b", "pants"]}You can get rules either by product IDs or product tags.
Response
{ "success": true, "data": [ { "productId": "8249126813999", "ruleId": 40, "ruleName": "VIP group", "appliedPrice": 27100 }, { "productId": "8249222791471", "ruleId": 40, "ruleName": "VIP group", "appliedPrice": 63.5 } ]}Get Rules by Customers
Section titled “Get Rules by Customers”Endpoint
POST https://b2b-solution-public-api.bsscommerce.com/api/v1/rule/get-rules-by-customersRequest Body
{ "domain": "abc.myshopify.com", "accessKey": "xxx", "customer_ids": [7208233467979, 7208233467980], "customer_tags": ["b2b", "pants"]}You can get rules by customer IDs or customer tags.
Response
{ "success": true, "data": [ { "customerId": "6764123291723", "rules": [ { "ruleId": 2151079182, "ruleName": "Wholesale", "customerTags": ["b2b"] } ] } ]}Create or Update a Single Rule
Section titled “Create or Update a Single Rule”Endpoint
POST https://b2b-solution-public-api.bsscommerce.com/api/v1/rule/saveIf no
idis provided, a new rule is created.
Ifidexists, the existing rule is updated.
Request Body
{ "domain": "abc.myshopify.com", "accessKey": "xxx", "rule": { "name": "Test rule", "priority": 1, "status": 0, "apply_to": 1, "product_condition_type": 4, "product_ids": ["5460196589730"], "discount_type": 2, "discount_value": "40", "exc_product_variants": [44531061752093, 45056544342301] }}Response
{ "success": true, "message": "Create the rule successfully", "ruleId": 11}Create or Update Multiple Rules
Section titled “Create or Update Multiple Rules”Endpoint
POST https://b2b-solution-public-api.bsscommerce.com/api/v1/rule/bulk-saveRequest Body
{ "domain": "abc.myshopify.com", "accessKey": "xxx", "rules": [ { "name": "sencond1", "priority": 0, "status": 1, "discount_type": 2, "discount_value": 10.0 }, { "id": 545507, "name": "test4", "status": 0, "discount_type": 0, "discount_value": "50.00", "exc_product_tags": ["b2b", "wholesale"] } ]}Response
{ "success": true, "message": [ "Create new rule 'sencond1' with ID 214780831 successfully", "Update rule 'test4' with ID 545507 successfully" ]}Delete a Rule
Section titled “Delete a Rule”POST https://b2b-solution-public-api.bsscommerce.com/api/v1/rule/deleteBody
{ "domain": "abc.myshopify.com", "accessKey": "xxx", "id": 79}Response
{ "success": true, "message": "Deleted rule ID 79 successfully"}Delete Multiple Rules
Section titled “Delete Multiple Rules”POST https://b2b-solution-public-api.bsscommerce.com/api/v1/rule/mass-deleteBody
{ "domain": "abc.myshopify.com", "accessKey": "xxx", "ids": [79, 80, 81]}Response
{ "success": true, "message": "Deleted multiple rule successfully"}Remove Existing Products from Rules
Section titled “Remove Existing Products from Rules”PUT https://b2b-solution-public-api.bsscommerce.com/api/v1/rule/delete-itemsRequest Body
{ "domain": "abc.myshopify.com", "accessKey": "xxx", "rules": [ { "id": 2, "product_condition_type": 1, "product_ids": ["8746948329722", "8746948821242"] } ]}Response (Success)
{ "success": true, "message": "Success", "data": { "success": ["Update rule with id 2 success"], "failed": [] }}Response (Error)
{ "message": "Fail", "data": { "failed": [ { "rule_id": 3, "errors": ["Invalid product_condition_type", "product_ids must be array"] } ] }}Get Applied Rules for Products
Section titled “Get Applied Rules for Products”POST https://b2b-solution-public-api.bsscommerce.com/api/v1/rule/get-products-applied-rulesIf
customer_idisnull, the system checks rules that apply to all or not-logged-in customers.
Request Body
{ "domain": "abc.myshopify.com", "product_ids": [6586590625965, 6586590658733], "customer_id": 5127974846637, "accessKey": "xxxx"}Response
{ "success": true, "productsAppliedRule": [ { "id": "6586590625965", "discount_type": 2, "value": "10.00", "name": "Discount 30%" } ]}Get Variant Price List Based on Rules
Section titled “Get Variant Price List Based on Rules”POST https://b2b-solution-public-api.bsscommerce.com/api/v1/rule/get-variants-price-listRequest Body
{ "domain": "abc.myshopify.com", "product_ids": [6586590625965, 6586590658733], "customer_id": 5127974846637, "accessKey": "xxx"}Response
{ "success": true, "priceList": [ { "id": "6586590625965", "discount_type": 2, "value": "10.00", "name": "Discount 30%", "variants": [ { "id": "39454422368429", "price": "70", "compareAtPrice": "85", "appliedRulePrice": 63 } ] } ]}Product Endpoints
Section titled “Product Endpoints”All product endpoints follow the same pattern: domain + accessKey required.
Search Products
Section titled “Search Products”POST https://b2b-solution-public-api.bsscommerce.com/api/v1/product/searchCursor
afterIndex indicates where to continue fetching.
If null, search starts from the beginning.
{ "domain": "abc.myshopify.com", "accessKey": "xxx", "afterIndex": null, "first": 20, "searchQuery": "ocean"}Get Product Tags
Section titled “Get Product Tags”POST https://b2b-solution-public-api.bsscommerce.com/api/v1/product/get-tags{ "domain": "abc.myshopify.com", "accessKey": "xxx"}Get Products by Tags
Section titled “Get Products by Tags”POST https://b2b-solution-public-api.bsscommerce.com/api/v1/product/get-by-tags"operation": "AND"→ all tags must match"operation": "OR"→ any tag matches
Get Products by IDs
Section titled “Get Products by IDs”POST https://b2b-solution-public-api.bsscommerce.com/api/v1/product/get-by-idsCustomer Endpoints
Section titled “Customer Endpoints”Search Customers
Section titled “Search Customers”POST https://b2b-solution-public-api.bsscommerce.com/api/v1/customer/searchGet Customer Tags
Section titled “Get Customer Tags”POST https://b2b-solution-public-api.bsscommerce.com/api/v1/customer/get-tagsGet Customers by IDs
Section titled “Get Customers by IDs”POST https://b2b-solution-public-api.bsscommerce.com/api/v1/customer/get-by-idsGet Customers by Tags
Section titled “Get Customers by Tags”POST https://b2b-solution-public-api.bsscommerce.com/api/v1/customer/get-by-tags
"operation": "AND"→ must contain all tags
"operation": "OR"→ contain any tag
Collection Endpoints
Section titled “Collection Endpoints”Note: The “Get Collections” endpoint currently returns a
customersarray: behavior is identical to/customer/search.
POST https://b2b-solution-public-api.bsscommerce.com/api/v1/customer/searchRequest Handling Policy
Section titled “Request Handling Policy”- Requests are processed one at a time.
- A new request starts only after the previous one completes.
- If a server error occurs, please wait up to 3 minutes before retrying.