Skip to content

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

  1. Get your API Key. If you don’t have one yet, please follow this document to generate it.
  2. All endpoints on this page are v1: include the key either as accessKey in 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.


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.

0: Inactive
1: Active

apply_to Defines which customers the rule applies to.

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

exclude_from Excludes certain customers from the rule. Set exc_customer_tags or exc_customers (customer IDs) to match.

0: None
1: Customer tags
2: Specific customers
3: Company locations

product_condition_type Determines which products are targeted.

0: All products
1: Specific products
2: Product collections
3: Product tags
4: Specific variants

exc_product_type Excludes certain products from the rule.

0: None
1: Specific products
2: Product collections
3: Product tags
4: Specific variants

discount_type Discount method to apply.

0: Apply a decreasing price (legacy option, still supported)
1: Decrease a fixed amount
2: Decrease in percentage (%)
3: Apply an increasing price (legacy option, still supported)
4: Increase a fixed amount
5: Increase in percentage (%)
6: Set a fixed price (recommended instead of 0 and 3)

discount_value Amount, percentage or price used by discount_type.

Types 0, 1, 3, 4: a number, 0 or more
Types 2, 5: a number from 0 to 100
Type 6: a number greater than 0

market_condition_type Determines which markets the rule applies to.

0: All markets
1: Specific markets

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/"
}
]

Endpoint

POST https://solution-public-api.bss-b2b.solutions/api/v1/rule/get-by-domain

Headers

Content-Type: application/json

Request 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
}
]
}

Endpoint

POST https://solution-public-api.bss-b2b.solutions/api/v1/rule/get-by-id

Request 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"]
}
}

Endpoint

POST https://solution-public-api.bss-b2b.solutions/api/v1/rule/get-rules-by-products

Request 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 }
]
}

Endpoint

POST https://solution-public-api.bss-b2b.solutions/api/v1/rule/get-rules-by-customers

Request 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"] }
]
}
]
}

Endpoint

POST https://solution-public-api.bss-b2b.solutions/api/v1/rule/save

If no id is provided, a new rule is created.
If id exists, 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
}

Endpoint

POST https://solution-public-api.bss-b2b.solutions/api/v1/rule/bulk-save

Request 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"
]
}

POST https://solution-public-api.bss-b2b.solutions/api/v1/rule/delete

Body

{
"domain": "abc.myshopify.com",
"accessKey": "xxx",
"id": 79
}

Response

{
"success": true,
"message": "Deleted rule ID 79 successfully"
}

POST https://solution-public-api.bss-b2b.solutions/api/v1/rule/mass-delete

Body

{
"domain": "abc.myshopify.com",
"accessKey": "xxx",
"ids": [79, 80, 81]
}

Response

{
"success": true,
"message": "Deleted multiple rule successfully"
}

PUT https://solution-public-api.bss-b2b.solutions/api/v1/rule/delete-items

Request 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"] }
]
}
}

POST https://solution-public-api.bss-b2b.solutions/api/v1/rule/get-products-applied-rules

If customer_id is null, 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%" }
]
}

POST https://solution-public-api.bss-b2b.solutions/api/v1/rule/get-variants-price-list

Request 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
}
]
}
]
}

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.

POST https://solution-public-api.bss-b2b.solutions/api/v1/product/search

Cursor
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"
}

POST https://solution-public-api.bss-b2b.solutions/api/v1/product/get-tags
{
"domain": "abc.myshopify.com",
"accessKey": "xxx"
}

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

POST https://solution-public-api.bss-b2b.solutions/api/v1/product/get-by-ids

POST https://solution-public-api.bss-b2b.solutions/api/v1/customer/search
POST https://solution-public-api.bss-b2b.solutions/api/v1/customer/get-tags
POST https://solution-public-api.bss-b2b.solutions/api/v1/customer/get-by-ids
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


POST https://solution-public-api.bss-b2b.solutions/api/v1/collection/get-list

Returns your product collections in a collections array. Body: domain, accessKey.


  • 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-delete or delete-items call is running, other bulk-save, mass-delete and bulk-delete calls for the same store, in any module (CP, PL, VP), return 429 Domain is executing another process. Try later.