Skip to content

Public API v2: Quickstart

Create a Custom Pricing rule from the command line and publish it to the storefront.

In the app, open Integrations, click Get API key on the Public API card, then Create API key on the API keys tab. Add a row Custom Pricing with Read & Edit, click Create key and copy the key: it shows once. Keep it in an environment variable:

Terminal window
export B2B_API_KEY="sk_live_…"

List the store’s Custom Pricing rules. A 200 means the key, the store and the permission are right.

Terminal window
curl -X GET "https://solution-public-api.bss-b2b.solutions/api/v2/custom-pricing/rules?limit=2" \
-H "X-API-Key: $B2B_API_KEY" \
-H "X-Shop-Domain: your-store.myshopify.com"
Response 200
{
"success": true,
"status": "success",
"data": [
{
"id": "90718",
"name": "VIP 10%",
"priority": 1,
"status": "disabled",
"apply_to": "customer_tags",
"customer_ids": [],
"customer_tags": [
"vip"
],
"company_location_ids": [],
"exclude_from": "none",
"exc_customer_tags": [],
"exc_customers": [],
"exc_company_location_ids": [],
"product_condition_type": "by_collections",
"product_ids": [],
"product_collections": [
"482901234567"
],
"product_tags": [],
"variant_ids": [],
"exc_product_type": "none",
"exc_specific_products": [],
"exc_product_collections": [],
"exc_product_tags": [],
"exc_product_variants": [],
"market_condition_type": "all",
"market_ids": [],
"discount_type": "decrease_percentage",
"discount_value": "10.00",
"start_at": "2026-10-31T17:00:00.000Z",
"end_at": null,
"created_at": "2026-10-21T09:32:48.000Z",
"updated_at": "2026-10-21T09:32:48.000Z"
}
],
"meta": {
"timestamp": "2026-10-21T09:32:50.797Z",
"version": "v2",
"request_id": "fbdc5205-5f7e-45d4-a6e2-dd283106c2b8",
"rate_limit": {
"cost": 10,
"limit": 600,
"remaining": 590,
"restore_rate": 10
},
"pagination": {
"limit": 2,
"next_cursor": null,
"prev_cursor": null,
"links": {
"self": "/api/v2/custom-pricing/rules?limit=2&filter_name=VIP",
"next": null,
"prev": null
}
}
}
}

Create it disabled first: it is saved, but not applied anywhere.

Terminal window
curl -X POST "https://solution-public-api.bss-b2b.solutions/api/v2/custom-pricing/rules" \
-H "X-API-Key: $B2B_API_KEY" \
-H "X-Shop-Domain: your-store.myshopify.com" \
-H "Content-Type: application/json" \
-d '{
"name": "VIP 10%",
"priority": 1,
"status": "disabled",
"apply_to": "customer_tags",
"customer_tags": [
"vip"
],
"product_condition_type": "by_collections",
"product_collections": [
"482901234567"
],
"discount_type": "decrease_percentage",
"discount_value": "10",
"start_at": "2026-10-31T17:00:00Z",
"end_at": null
}'
Response 201
{
"success": true,
"status": "success",
"data": {
"id": "90718",
"name": "VIP 10%",
"priority": 1,
"status": "disabled",
"apply_to": "customer_tags",
"customer_ids": [],
"customer_tags": [
"vip"
],
"company_location_ids": [],
"exclude_from": "none",
"exc_customer_tags": [],
"exc_customers": [],
"exc_company_location_ids": [],
"product_condition_type": "by_collections",
"product_ids": [],
"product_collections": [
"482901234567"
],
"product_tags": [],
"variant_ids": [],
"exc_product_type": "none",
"exc_specific_products": [],
"exc_product_collections": [],
"exc_product_tags": [],
"exc_product_variants": [],
"market_condition_type": "all",
"market_ids": [],
"discount_type": "decrease_percentage",
"discount_value": "10.00",
"start_at": "2026-10-31T17:00:00.000Z",
"end_at": null,
"created_at": "2026-10-21T09:32:48.000Z",
"updated_at": "2026-10-21T09:32:48.000Z"
},
"meta": {
"timestamp": "2026-10-21T09:32:48.151Z",
"version": "v2",
"request_id": "7567d695-3ffe-46f2-ada0-0e0453a77cc6",
"rate_limit": {
"cost": 11,
"limit": 600,
"remaining": 589,
"restore_rate": 10
}
}
}

Send the rule again with "status": "enabled". PUT replaces the whole rule, so send every field.

Terminal window
curl -X PUT "https://solution-public-api.bss-b2b.solutions/api/v2/custom-pricing/rules/90718" \
-H "X-API-Key: $B2B_API_KEY" \
-H "X-Shop-Domain: your-store.myshopify.com" \
-H "Content-Type: application/json" \
-d '{
"name": "VIP 10%",
"priority": 1,
"status": "enabled",
"apply_to": "customer_tags",
"customer_tags": [
"vip"
],
"product_condition_type": "by_collections",
"product_collections": [
"482901234567"
],
"discount_type": "decrease_percentage",
"discount_value": "10",
"start_at": "2026-10-31T17:00:00Z",
"end_at": null
}'

Writes are saved in the app only. Upload pushes every enabled Custom Pricing rule to the storefront and checkout.

Terminal window
curl -X POST "https://solution-public-api.bss-b2b.solutions/api/v2/custom-pricing/rules/upload" \
-H "X-API-Key: $B2B_API_KEY" \
-H "X-Shop-Domain: your-store.myshopify.com"

Next: read Rules & publishing and the Custom Pricing reference.