Public APIs for Uploading
These public endpoints allow you to upload pricing and discount rules from an external system directly into your Shopify store using BSS B2B Solution.
When a request is made, the app automatically uploads all enabled rules to your active theme, keeping your storefront pricing logic up-to-date.
Get the Access Key
Section titled “Get the Access Key”- Generate your Access Key as described in Public APIs.
- Security Note: Your Access Key is displayed only once upon generation for enhanced security. Copy and store it in a secure password manager or server environment variable immediately.
- Include the key in your request body as
accessKey.
Authentication
Section titled “Authentication”All requests require an Access Key generated in your app. The upload endpoints read the key from the request body only. Send accessKey in the JSON body (see the examples below); the x-bss-b2b-api-key header is not supported here and returns 400 No domain or access key invalid.
⚠️ Important: Each endpoint has a rate limit of 1 request per module per 5 minutes.
Exceeding this limit returns a429 Too Many Requestsresponse.
I. Upload Custom Pricing Rules
Section titled “I. Upload Custom Pricing Rules”Upload all active Custom Pricing rules from your app or system to Shopify.
Endpoint
Section titled “Endpoint”POST https://solution-public-api.bss-b2b.solutions/api/v1/rule/uploadRequest Body
Section titled “Request Body”| Field | Type | Required | Description |
|---|---|---|---|
domain |
String | ✅ | Your store’s myshopify.com domain |
accessKey |
String | ✅ | API Access Key generated from BSS B2B Solution |
Example Request
Section titled “Example Request”curl -X POST "https://solution-public-api.bss-b2b.solutions/api/v1/rule/upload" \ -H "Content-Type: application/json" \ -d '{ "domain": "bsscommerce-store.myshopify.com", "accessKey": "YOUR_ACCESS_KEY" }'Responses
Section titled “Responses”| Code | Meaning | Notes |
|---|---|---|
200 OK |
Upload successful | All enabled rules were applied to the active theme |
429 Too Many Requests |
Rate limit exceeded | Wait 5 minutes before sending another request |
II. Upload Volume Pricing Rules
Section titled “II. Upload Volume Pricing Rules”Upload all active Quantity-based or Volume-based rules to your store.
Endpoint
Section titled “Endpoint”POST https://solution-public-api.bss-b2b.solutions/api/v1/qb/rule/uploadRequest Body
Section titled “Request Body”| Field | Type | Required | Description |
|---|---|---|---|
domain |
String | ✅ | Your store’s myshopify.com domain |
accessKey |
String | ✅ | API Access Key generated from the app |
Example Request
Section titled “Example Request”curl -X POST "https://solution-public-api.bss-b2b.solutions/api/v1/qb/rule/upload" \ -H "Content-Type: application/json" \ -d '{ "domain": "bsscommerce-store.myshopify.com", "accessKey": "YOUR_ACCESS_KEY" }'Responses
Section titled “Responses”| Code | Meaning | Notes |
|---|---|---|
200 OK |
Rules uploaded successfully | Quantity/Amount Breaks were synced |
429 Too Many Requests |
Rate limit exceeded | Wait 5 minutes before retrying |
III. Upload Price List Rules
Section titled “III. Upload Price List Rules”Upload all active Price List rules to your Shopify store.
Endpoint
Section titled “Endpoint”POST https://solution-public-api.bss-b2b.solutions/api/v1/pl/rule/uploadRequest Body
Section titled “Request Body”| Field | Type | Required | Description |
|---|---|---|---|
domain |
String | ✅ | Your store’s myshopify.com domain |
accessKey |
String | ✅ | API Access Key generated from the app |
Example Request
Section titled “Example Request”curl -X POST "https://solution-public-api.bss-b2b.solutions/api/v1/pl/rule/upload" \ -H "Content-Type: application/json" \ -d '{ "domain": "bsscommerce-store.myshopify.com", "accessKey": "YOUR_ACCESS_KEY" }'Responses
Section titled “Responses”| Code | Meaning | Notes |
|---|---|---|
200 OK |
Rules uploaded successfully | Price List data has been deployed to the theme |
429 Too Many Requests |
Rate limit exceeded | Wait 5 minutes before sending another request |
Data Storage and Capacity Limitations
Section titled “Data Storage and Capacity Limitations”When uploading rules through these APIs, the data is stored in Shopify metafields as JSON.
| Specification | Details |
|---|---|
| Maximum metafields | 10 keys |
| Data type | JSON |
| Max size per key | 2,000,000 characters |
| Total max data size | ~20,000,000 characters |
| Exceeding data | Any content beyond capacity is safely skipped and reported |
| Uploaded content | Primarily rule data and minimal setting data |
| Active rules only | Only enabled rules are uploaded: inactive ones are ignored |
Partial Upload & Capacity Skip Reporting
Section titled “Partial Upload & Capacity Skip Reporting”If your uploaded rule dataset exceeds Shopify’s maximum single metafield capacity, the API avoids total failure by persisting all rules that fit within capacity and returning a structured partial report:
{ "success": false, "status": "partial_success", "message": "Some rules skipped due to Shopify metafield capacity limits.", "data": { "total": 1200, "uploaded": 950, "skipped": 250, "skipReason": "SHOPIFY_METAFIELD_CAPACITY_EXCEEDED", "skippedRuleIdRange": { "from": 10951, "to": 11200 } }}The partial report is returned with HTTP status 200 OK: check status (or success: false) rather than the HTTP code to detect it. The same structure is returned by all three upload endpoints (Custom Pricing, Volume Pricing, Price List).
| Field | Type | Description |
|---|---|---|
success |
Boolean | false when some rules were skipped |
status |
String | partial_success |
message |
String | Human-readable summary |
data.total |
Number | Number of active rules the API tried to upload |
data.uploaded |
Number | Number of rules saved to your store |
data.skipped |
Number | Number of rules skipped |
data.skipReason |
String | Reason for skipping, e.g. SHOPIFY_METAFIELD_CAPACITY_EXCEEDED |
data.skippedRuleIdRange |
Object | from / to: the first and last skipped rule ID (numeric) |
When this occurs, partition large rule catalogs or prune inactive rules before re-triggering synchronization.
Example Automation Flow
Section titled “Example Automation Flow”- External system (ERP/CRM) updates B2B rules.
- System triggers a POST request to the relevant upload API.
- BSS B2B Solution validates data and pushes it to the Shopify metafields.
- Storefront automatically reflects updated pricing and rule logic.
With these Public Upload APIs, your development team can fully automate pricing rule synchronization: ensuring your B2B store always delivers accurate, real-time pricing without manual updates.
- 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 Custom Pricing (CP)Programmatically manage Custom Pricing rules via REST API, create, retrieve, update, delete rules, and calculate prices for specific customers.
- 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.