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>

⚠️ 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
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

exclude_customer Exclude rules for certain customers.

0: None
1: Customer tags
2: Specific customers

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 fixed price
1: Subtract a fixed amount
2: Subtract a percentage (%)

market_condition_type Determines which markets the rule applies to.

0: All markets
1: Specific markets


Endpoint

POST https://b2b-solution-public-api.bsscommerce.com/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://b2b-solution-public-api.bsscommerce.com/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://b2b-solution-public-api.bsscommerce.com/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://b2b-solution-public-api.bsscommerce.com/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://b2b-solution-public-api.bsscommerce.com/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,
"product_ids": ["5460196589730"],
"discount_type": 2,
"discount_value": "40",
"exc_product_variants": [44531061752093, 45056544342301]
}
}

Response

{
"success": true,
"message": "Create the rule successfully",
"ruleId": 11
}

Endpoint

POST https://b2b-solution-public-api.bsscommerce.com/api/v1/rule/bulk-save

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

POST https://b2b-solution-public-api.bsscommerce.com/api/v1/rule/delete

Body

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

Response

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

POST https://b2b-solution-public-api.bsscommerce.com/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://b2b-solution-public-api.bsscommerce.com/api/v1/rule/delete-items

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

POST https://b2b-solution-public-api.bsscommerce.com/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://b2b-solution-public-api.bsscommerce.com/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.

POST https://b2b-solution-public-api.bsscommerce.com/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://b2b-solution-public-api.bsscommerce.com/api/v1/product/get-tags
{
"domain": "abc.myshopify.com",
"accessKey": "xxx"
}

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

POST https://b2b-solution-public-api.bsscommerce.com/api/v1/product/get-by-ids

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


Note: The “Get Collections” endpoint currently returns a customers array: behavior is identical to /customer/search.

POST https://b2b-solution-public-api.bsscommerce.com/api/v1/customer/search

  • 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.