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>Exception: PUT /rule/delete-items reads the key from the request body only. Send accessKey in the JSON body; the header alone is rejected with 400 No domain or access key invalid.
⚠️ 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 from 0 to 99 |
status |
Activation status of the rule. |
|
apply_to |
Defines which customers the rule applies to. |
|
exclude_from |
Excludes certain customers from the rule. Set exc_customer_tags or exc_customers (customer IDs) to match. |
|
product_condition_type |
Determines which products are targeted. |
|
exc_product_type |
Excludes certain products from the rule. |
|
discount_type |
Discount method to apply. |
|
discount_value |
Amount, percentage or price used by discount_type. |
Types |
market_condition_type |
Determines which markets the rule applies to. |
|
Required fields: name, priority (0-99), status, apply_to, product_condition_type, discount_type and market_condition_type are required on every rule sent to rule/save or rule/bulk-save. When product_condition_type is 4, send variant_ids. When you send any exc_* product field, send all five: exc_product_type, exc_specific_products, exc_product_collections, exc_product_tags, exc_product_variants.
Set a fixed price (discount_type: 6): the price becomes exactly the discount_value you send. Types 0 and 3 keep working for existing and new rules, but they only apply the price you send when it is lower (0) or higher (3) than the original price; 6 does not have that condition. A discount_type outside 0 to 6 is rejected, and so is a type 6 rule with a discount_value of 0 or less.
{ "domain": "abc.myshopify.com", "accessKey": "xxx", "rule": { "name": "Fixed wholesale price", "priority": 1, "status": 1, "apply_to": 4, "customer_tags": ["wholesale"], "product_condition_type": 4, "variant_ids": ["44531061719325"], "discount_type": 6, "discount_value": "45.00", "market_condition_type": 0 }}Send this body to POST /api/v1/rule/save (or use the same fields in each rule of rule/bulk-save).
Notice for types 0 and 3: when a save request (rule/save, rule/bulk-save) has at least one discount_type of 0 or 3, it is still processed and saved as before, with the same status code and response fields. The response also gets a notices array, plus the headers Deprecation: @1791331200 (October 7, 2026, per RFC 9745) and Link: <https://docs.bss-b2b.solutions/b2b-solution/api-integration/public-apis/public-apis-for-custom-pricing-cp/>; rel="deprecation". Requests that use only types 1, 2, 4, 5 or 6 get no notice.
"notices": [ { "code": "DISCOUNT_TYPE_OLDER_OPTION", "message": "discount_type 0 and 3 are older options and still work. We recommend discount_type 6 (Set a fixed price).", "docs": "https://docs.bss-b2b.solutions/b2b-solution/api-integration/public-apis/public-apis-for-custom-pricing-cp/" }]Get Rules by Domain
Section titled “Get Rules by Domain”Endpoint
POST https://solution-public-api.bss-b2b.solutions/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://solution-public-api.bss-b2b.solutions/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://solution-public-api.bss-b2b.solutions/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://solution-public-api.bss-b2b.solutions/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://solution-public-api.bss-b2b.solutions/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, "variant_ids": ["44531061719325"], "discount_type": 2, "discount_value": "40", "market_condition_type": 0, "exc_product_type": 4, "exc_specific_products": [], "exc_product_collections": [], "exc_product_tags": [], "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://solution-public-api.bss-b2b.solutions/api/v1/rule/bulk-saveRequest Body
{ "domain": "abc.myshopify.com", "accessKey": "xxx", "rules": [ { "name": "sencond1", "priority": 0, "status": 1, "apply_to": 0, "product_condition_type": 0, "discount_type": 2, "discount_value": 10.0, "market_condition_type": 0 }, { "id": 545507, "name": "test4", "priority": 1, "status": 0, "apply_to": 0, "product_condition_type": 0, "discount_type": 0, "discount_value": "50.00", "market_condition_type": 0, "exc_product_type": 3, "exc_specific_products": [], "exc_product_collections": [], "exc_product_tags": ["b2b", "wholesale"], "exc_product_variants": [] } ]}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://solution-public-api.bss-b2b.solutions/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://solution-public-api.bss-b2b.solutions/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://solution-public-api.bss-b2b.solutions/api/v1/rule/delete-itemsRequest Body
{ "domain": "abc.myshopify.com", "accessKey": "xxx", "rules": [ { "id": 2, "product_condition_type": 1, "product_ids": ["8746948329722", "8746948821242"], "product_collections": [], "product_tags": [], "product_variants": [] } ]}Each rule must include all four arrays (product_ids, product_collections, product_tags, product_variants), even when some are empty.
Response (Success)
{ "success": true, "message": "Success", "data": { "success": ["Update rule with id 2 success"], "failed": [] }}Response (Error)
{ "success": false, "message": "Request data error", "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://solution-public-api.bss-b2b.solutions/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://solution-public-api.bss-b2b.solutions/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. Product, customer and collection endpoints are shared by all modules. See Price List API for request and response examples.
Search Products
Section titled “Search Products”POST https://solution-public-api.bss-b2b.solutions/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://solution-public-api.bss-b2b.solutions/api/v1/product/get-tags{ "domain": "abc.myshopify.com", "accessKey": "xxx"}Get Products by Tags
Section titled “Get Products by Tags”POST https://solution-public-api.bss-b2b.solutions/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://solution-public-api.bss-b2b.solutions/api/v1/product/get-by-idsCustomer Endpoints
Section titled “Customer Endpoints”Search Customers
Section titled “Search Customers”POST https://solution-public-api.bss-b2b.solutions/api/v1/customer/searchGet Customer Tags
Section titled “Get Customer Tags”POST https://solution-public-api.bss-b2b.solutions/api/v1/customer/get-tagsGet Customers by IDs
Section titled “Get Customers by IDs”POST https://solution-public-api.bss-b2b.solutions/api/v1/customer/get-by-idsGet Customers by Tags
Section titled “Get Customers by Tags”POST https://solution-public-api.bss-b2b.solutions/api/v1/customer/get-by-tags
"operation": "AND"→ must contain all tags
"operation": "OR"→ contain any tag
Collection Endpoints
Section titled “Collection Endpoints”POST https://solution-public-api.bss-b2b.solutions/api/v1/collection/get-listReturns your product collections in a collections array. Body: domain, accessKey.
Request 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.
- While a
bulk-save,mass-deleteordelete-itemscall is running, otherbulk-save,mass-deleteandbulk-deletecalls for the same store, in any module (CP, PL, VP), return429 Domain is executing another process. Try later.
- Public APIs for Credit LimitRead each customer's credit limit, owed, pending and available amounts with the Credit limit API for Net Terms, and sync them with your ERP or accounting tool.
- Public APIs for Price List (PL)Programmatically manage Price List per Customer rules, create rules with per-product pricing for individual customers, retrieve applied prices, and manage customer/product data.
- Public APIs for Registration form (RF)Programmatically manage wholesale registration workflows, retrieve form schemas, create registrants, filter applicants, and manage approval status.
- Public APIs for UploadingThese public endpoints allow you to upload pricing and discount rules from an external system directly into your Shopify store using BSS B2B Solution.