Public API v2: Quickstart
Create a Custom Pricing rule from the command line and publish it to the storefront.
1. Create a key
Section titled “1. Create a key”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:
export B2B_API_KEY="sk_live_…"2. Check the key
Section titled “2. Check the key”List the store’s Custom Pricing rules. A 200 means the key, the store and the permission are right.
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 } } }}3. Create a rule
Section titled “3. Create a rule”Create it disabled first: it is saved, but not applied anywhere.
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 } }}4. Turn it on
Section titled “4. Turn it on”Send the rule again with "status": "enabled". PUT replaces the whole rule, so send every field.
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}'5. Publish
Section titled “5. Publish”Writes are saved in the app only. Upload pushes every enabled Custom Pricing rule to the storefront and checkout.
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.
- Public API v2: Authentication & keysCreate Public API v2 keys with per-module permissions, send them with every request, and keep them safe.
- Public API v2: Auto TagRules that tag customers and orders, add notes or mark a customer tax exempt when an event happens.
- Public API v2: Buy X Get YBuy X Get Y offers: what the customer buys, what they get, and the discount on it.
- Public API v2: Bulk & idempotencyCreate, replace or delete up to 250 rules in one Public API v2 request, and retry POST requests safely.