Contains information about a ruleset, including a rules list, actions, conditions, product selection, and start and end dates. Use these endpoints to manage rulesets on a store.
List Rulesets
List all rulesets available for the specified shop. This requires read_price_rulesets scope/permission. For more information about querying for certain rulesets, refer to the Query and Pagination guide.
Authorizations:
path Parameters
shop_identifier required | string Bold platform identifier for the shop. Find this identifier using the Get Shop Info endpoint. |
query Parameters
external_ids | string A list of ruleset external IDs that can be used as a filter in the search. |
fields | string List of the ruleset fields to be returned; if this parameter is empty, all the available fields will be included in the response. |
page | string Page number, considering that the results could span for several pages. Default is 1. |
limit | string Page size, considering that the results could span for several pages. Default is 50. |
include_all_apps | boolean The standard behaviour for this endpoint is to return just the rulesets that were created using the same auth token. To see all rulesets instead, this parameter should be set to true. |
Responses
Response samples
- 200
- 401
- 403
- 500
{- "message": "string",
- "data": {
- "rulesets": [
- {
- "id": 0,
- "product_selection": {
- "titles": [
- "string"
], - "collection_ids": [
- "string"
], - "variant_ids": [
- "string"
], - "product_ids": [
- "string"
], - "vendors": [
- "string"
], - "product_types": "string",
- "sku_ids": [
- "string"
], - "type": "SHOPIFY_PRODUCT_SEARCH"
}, - "rules": [
- {
- "type": "DISCOUNT",
- "conditions": [
- {
- "type": "BUY_X_GET_Y_DISCOUNT_CODE",
- "buy_quantity": 1,
- "get_quantity": 1,
- "uses_per_order": 1,
- "requirement_selection": {
- "type": "PRODUCT_SEARCH",
- "product_ids": [
- null
]
}
}
], - "actions": [
- {
- "value": 99,
- "type": "PRICE_ADJUST_ABSOLUTE"
}
], - "meta": { },
- "external_id": "string",
- "priority": 0,
- "stack_order": 0,
- "id": 0
}
], - "updated_at": "2019-08-24T14:15:22Z",
- "created_at": "2019-08-24T14:15:22Z",
- "priority": 0,
- "sync_percent": 100,
- "expiry_date": "2019-08-24T14:15:22Z",
- "start_date": "2019-08-24T14:15:22Z",
- "public_name": "string",
- "internal_name": "string",
- "active": true,
- "external_id": "string",
- "app_slug": "string"
}
]
}, - "pagination": {
- "total": 0,
- "count": 0,
- "per_page": 0,
- "current_page": 0,
- "total_pages": 0
}
}
Create Ruleset
Create a new ruleset for the specified shop. This requires write_price_rulesets scope/permission.
Authorizations:
path Parameters
shop_identifier required | string Bold platform identifier for the shop. Find this identifier using the Get Shop Info endpoint. |
Request Body schema: application/json
object (BasicRuleset) A set of rules that can apply to a defined group of products, depending on the rule conditions being met. The basic ruleset type refers to the fields that should be passed when creating or updating a ruleset. | |||||||||||||||
|
Responses
Request samples
- Payload
{- "ruleset": {
- "external_id": "CreatedByAPI_1",
- "internal_name": "This ruleset was created by the API",
- "product_selection": {
- "type": "SHOPIFY_PRODUCT_SEARCH",
- "product_ids": [
- "1234567890123",
- "1234567890987"
]
}, - "rules": [
- {
- "type": "DISCOUNT",
- "conditions": [
- {
- "type": "CUSTOMER_GROUP",
- "value": "gold"
}, - {
- "type": "QTY_BY_PRODUCT",
- "operator": ">=",
- "value": 3
}
], - "actions": [
- {
- "type": "PRICE_ADJUST_PERCENT",
- "value": -10
}, - {
- "type": "CHARM_PRICE",
- "value": 99
}
]
}
]
}
}
Response samples
- 201
- 400
- 401
- 403
- 409
- 422
- 500
{- "message": "string",
- "data": {
- "ruleset": { }
}
}
List Rulesets for Shop
List all rulesets available for the specified shop. This requires read_price_rulesets scope/permission.
Authorizations:
path Parameters
shop_identifier required | string Bold platform identifier for the shop. Find this identifier using the Get Shop Info endpoint. |
query Parameters
external_ids | string A list of ruleset external IDs that can be used as a query filter. |
product_ids | string A list of product IDs that can be used as a query filter. |
variant_ids | string A list of product IDs or Variant IDs can be used combined as a query filter. |
skus | string A list of product SKUs can be used as a query filter. |
fields | string List of the ruleset fields to be returned; if this parameter is empty, all the available fields will be included in the response. |
page | string Page number, considering that the results could span for several pages. Default is 1. |
limit | string Page size, considering that the results could span for several pages. Default is 50. |
include_all_apps | boolean The standard behaviour for this endpoint is to return just the rulesets that were created using the same auth token. To see all rulesets instead, this parameter should be set to true. |
filter_expression | string This endpoint supports extra query columns to filter the rulesets. To use this parameter you should use like this: filter_expression:operation(column:value). |
Responses
Response samples
- 200
- 401
- 403
- 500
{- "message": "string",
- "data": {
- "rulesets": [
- {
- "id": 0,
- "product_selection": {
- "titles": [
- "string"
], - "collection_ids": [
- "string"
], - "variant_ids": [
- "string"
], - "product_ids": [
- "string"
], - "vendors": [
- "string"
], - "product_types": "string",
- "sku_ids": [
- "string"
], - "type": "SHOPIFY_PRODUCT_SEARCH"
}, - "rules": [
- {
- "type": "DISCOUNT",
- "conditions": [
- {
- "type": "BUY_X_GET_Y_DISCOUNT_CODE",
- "buy_quantity": 1,
- "get_quantity": 1,
- "uses_per_order": 1,
- "requirement_selection": {
- "type": "PRODUCT_SEARCH",
- "product_ids": [
- null
]
}
}
], - "actions": [
- {
- "value": 99,
- "type": "PRICE_ADJUST_ABSOLUTE"
}
], - "meta": { },
- "external_id": "string",
- "priority": 0,
- "stack_order": 0,
- "id": 0
}
], - "updated_at": "2019-08-24T14:15:22Z",
- "created_at": "2019-08-24T14:15:22Z",
- "priority": 0,
- "sync_percent": 100,
- "expiry_date": "2019-08-24T14:15:22Z",
- "start_date": "2019-08-24T14:15:22Z",
- "public_name": "string",
- "internal_name": "string",
- "active": true,
- "external_id": "string",
- "app_slug": "string"
}
]
}, - "pagination": {
- "total": 0,
- "count": 0,
- "per_page": 0,
- "current_page": 0,
- "total_pages": 0
}
}
Get Ruleset by ID
Return data for a specific ruleset, selected by the ruleset database ID. This requires read_price_rulesets scope/permission.
Authorizations:
path Parameters
shop_identifier required | string Bold platform identifier for the shop. Find this identifier using the Get Shop Info endpoint. |
ruleset_id required | string Ruleset database ID. |
Responses
Response samples
- 200
- 401
- 403
- 404
- 500
{- "message": "string",
- "data": {
- "ruleset": {
- "id": 0,
- "product_selection": {
- "titles": [
- "string"
], - "collection_ids": [
- "string"
], - "variant_ids": [
- "string"
], - "product_ids": [
- "string"
], - "vendors": [
- "string"
], - "product_types": "string",
- "sku_ids": [
- "string"
], - "type": "SHOPIFY_PRODUCT_SEARCH"
}, - "rules": [
- {
- "type": "DISCOUNT",
- "conditions": [
- {
- "type": "BUY_X_GET_Y_DISCOUNT_CODE",
- "buy_quantity": 1,
- "get_quantity": 1,
- "uses_per_order": 1,
- "requirement_selection": {
- "type": "PRODUCT_SEARCH",
- "product_ids": [
- "string"
]
}
}
], - "actions": [
- {
- "value": 99,
- "type": "PRICE_ADJUST_ABSOLUTE"
}
], - "meta": { },
- "external_id": "string",
- "priority": 0,
- "stack_order": 0,
- "id": 0
}
], - "updated_at": "2019-08-24T14:15:22Z",
- "created_at": "2019-08-24T14:15:22Z",
- "priority": 0,
- "sync_percent": 100,
- "expiry_date": "2019-08-24T14:15:22Z",
- "start_date": "2019-08-24T14:15:22Z",
- "public_name": "string",
- "internal_name": "string",
- "active": true,
- "external_id": "string",
- "app_slug": "string"
}
}
}
Update Ruleset by ID
Change attributes for an existent ruleset, selected by the ruleset database ID. This requires write_price_rulesets scope/permission.
Authorizations:
path Parameters
shop_identifier required | string Bold platform identifier for the shop. Find this identifier using the Get Shop Info endpoint. |
ruleset_id required | string Ruleset database ID. |
Request Body schema: application/json
object (BasicRuleset) A set of rules that can apply to a defined group of products, depending on the rule conditions being met. The basic ruleset type refers to the fields that should be passed when creating or updating a ruleset. | |||||||||||||||
|
Responses
Request samples
- Payload
{- "ruleset": {
- "external_id": "CreatedByAPI_1",
- "internal_name": "This ruleset was created by the API and now it is being changed",
- "product_selection": {
- "type": "SHOPIFY_PRODUCT_SEARCH",
- "product_ids": [
- "1234567890123",
- "1234567890987"
]
}, - "rules": [
- {
- "type": "DISCOUNT",
- "conditions": [
- {
- "type": "CUSTOMER_GROUP",
- "value": "silver"
}, - {
- "type": "QTY_BY_PRODUCT",
- "operator": ">=",
- "value": 3
}
], - "actions": [
- {
- "type": "PRICE_ADJUST_PERCENT",
- "value": -8
}, - {
- "type": "CHARM_PRICE",
- "value": 99
}
]
}
]
}
}
Response samples
- 200
- 401
- 403
{- "message": "Successfully updated ruleset",
- "data": {
- "ruleset": {
- "id": 84,
- "external_id": "CreatedByAPI_1",
- "active": true,
- "internal_name": "This ruleset was created by the API and now it is being changed",
- "public_name": "",
- "start_date": null,
- "expiry_date": null,
- "sync_percent": 0,
- "priority": 0,
- "created_at": "2020-05-08T14:42:56Z",
- "updated_at": "2020-05-08T14:43:14Z",
- "rules": [
- {
- "type": "DISCOUNT",
- "conditions": [
- {
- "type": "CUSTOMER_GROUP",
- "value": "silver"
}, - {
- "type": "QTY_BY_PRODUCT",
- "operator": ">=",
- "value": 3
}
], - "actions": [
- {
- "type": "PRICE_ADJUST_PERCENT",
- "value": -8
}, - {
- "type": "CHARM_PRICE",
- "value": 99
}
]
}
], - "product_selection": {
- "product_ids": [
- "1234567890123",
- "1234567890987"
], - "type": "SHOPIFY_PRODUCT_SEARCH"
}
}
}
}
Delete Ruleset by ID
Delete a ruleset, selected by the ruleset database ID. This requires write_price_rulesets scope/permission.
Authorizations:
path Parameters
shop_identifier required | string Bold platform identifier for the shop. Find this identifier using the Get Shop Info endpoint. |
ruleset_id required | string Ruleset database ID. |
Responses
Response samples
- 401
- 403
- 404
- 500
{- "message": "This request failed to be authenticated.",
- "code": "00-1",
- "type": "authentication.failed"
}
Patch Ruleset by ID
Change ruleset attributes including specified rules for an existing ruleset with the specified ruleset database ID without replacing unaffected rules. This requires write_price_rulesets scope/permission.
Authorizations:
path Parameters
shop_identifier required | string Bold platform identifier for the shop. Find this identifier using the Get Shop Info endpoint. |
ruleset_id required | string Ruleset database ID. |
Request Body schema: application/json
required | object | ||||||
|
Responses
Request samples
- Payload
{- "ruleset": {
- "start_date": "2020-11-01T00:00:00Z",
- "expiry_date": "2020-11-17T23:59:59Z",
- "rules": [
- {
- "external_id": "CreatedByAPI_1",
- "type": "DISCOUNT",
- "conditions": [
- {
- "type": "CUSTOMER_GROUP",
- "value": "silver"
}, - {
- "type": "QTY_BY_PRODUCT",
- "operator": ">=",
- "value": 3
}
], - "actions": [
- {
- "type": "PRICE_ADJUST_PERCENT",
- "value": -8
}
]
}
]
}
}
Response samples
- 401
- 403
{- "message": "This request failed to be authenticated.",
- "code": "00-1",
- "type": "authentication.failed"
}
Get Ruleset by External ID
Return data for a specific ruleset, selected by the ruleset external ID. This requires read_price_rulesets scope/permission.
Authorizations:
path Parameters
shop_identifier required | string Bold platform identifier for the shop. Find this identifier using the Get Shop Info endpoint. |
external_id required | string Ruleset external_id. |
query Parameters
include_all_apps | boolean Indicates whether to include rulesets created by other apps. Without this flag ( |
Responses
Response samples
- 200
- 401
- 403
- 404
- 500
{- "message": "string",
- "data": {
- "ruleset": {
- "id": 0,
- "product_selection": {
- "titles": [
- "string"
], - "collection_ids": [
- "string"
], - "variant_ids": [
- "string"
], - "product_ids": [
- "string"
], - "vendors": [
- "string"
], - "product_types": "string",
- "sku_ids": [
- "string"
], - "type": "SHOPIFY_PRODUCT_SEARCH"
}, - "rules": [
- {
- "type": "DISCOUNT",
- "conditions": [
- {
- "type": "BUY_X_GET_Y_DISCOUNT_CODE",
- "buy_quantity": 1,
- "get_quantity": 1,
- "uses_per_order": 1,
- "requirement_selection": {
- "type": "PRODUCT_SEARCH",
- "product_ids": [
- "string"
]
}
}
], - "actions": [
- {
- "value": 99,
- "type": "PRICE_ADJUST_ABSOLUTE"
}
], - "meta": { },
- "external_id": "string",
- "priority": 0,
- "stack_order": 0,
- "id": 0
}
], - "updated_at": "2019-08-24T14:15:22Z",
- "created_at": "2019-08-24T14:15:22Z",
- "priority": 0,
- "sync_percent": 100,
- "expiry_date": "2019-08-24T14:15:22Z",
- "start_date": "2019-08-24T14:15:22Z",
- "public_name": "string",
- "internal_name": "string",
- "active": true,
- "external_id": "string",
- "app_slug": "string"
}
}
}
Create Ruleset by External ID
This operation has two purposes. If the given ruleset external ID already exists in the database, the ruleset will be updated using the request body information. Otherwise, a new ruleset will be created with the same data. This requires write_price_rulesets scope/permission.
Authorizations:
path Parameters
shop_identifier required | string Bold platform identifier for the shop. Find this identifier using the Get Shop Info endpoint. |
external_id required | string Ruleset external_id. |
query Parameters
include_all_apps | boolean Indicates whether to include rulesets created by other apps. Without this flag ( |
Request Body schema: application/json
object (BasicRuleset) A set of rules that can apply to a defined group of products, depending on the rule conditions being met. The basic ruleset type refers to the fields that should be passed when creating or updating a ruleset. | |||||||||||||||
|
Responses
Request samples
- Payload
{- "ruleset": {
- "external_id": "CreatedByAPI_3",
- "internal_name": "This ruleset will be created if it still does not exist",
- "product_selection": {
- "type": "SHOPIFY_PRODUCT_SEARCH",
- "product_ids": [
- "1234567890123",
- "1234567890987"
]
}, - "rules": [
- {
- "type": "DISCOUNT",
- "conditions": [
- {
- "type": "QTY_BY_PRODUCT",
- "operator": ">=",
- "value": 3
}
], - "actions": [
- {
- "type": "PRICE_ADJUST_PERCENT",
- "value": -20
}, - {
- "type": "CHARM_PRICE",
- "value": 99
}
]
}
]
}
}
Response samples
- 200
- 201
- 401
- 403
- 422
- 500
{- "message": "Successfully updated ruleset",
- "data": {
- "ruleset": {
- "id": 83,
- "external_id": "CreatedByAPI_12",
- "active": true,
- "internal_name": "This was created by the API using the CreatedByAPI_12 ID",
- "public_name": "",
- "start_date": null,
- "expiry_date": null,
- "sync_percent": 0,
- "priority": 0,
- "created_at": "2020-05-07T11:05:23Z",
- "updated_at": "2020-05-07T11:05:23Z",
- "rules": [
- {
- "type": "DISCOUNT",
- "conditions": [
- {
- "type": "CUSTOMER_GROUP",
- "value": "wholesale"
}
], - "actions": [
- {
- "type": "PRICE_ADJUST_PERCENT",
- "value": 1250
}
]
}
], - "product_selection": {
- "product_ids": [
- "1234567890123",
- "1234567890987"
], - "type": "SHOPIFY_PRODUCT_SEARCH"
}
}
}
}
Delete Ruleset by External ID
Removes a specific ruleset, selected by the ruleset external ID. This requires write_price_rulesets scope/permission.
Authorizations:
path Parameters
shop_identifier required | string Bold platform identifier for the shop. Find this identifier using the Get Shop Info endpoint. |
external_id required | string Ruleset external_id. |
query Parameters
include_all_apps | boolean Indicates whether to include rulesets created by other apps. Without this flag ( |
Responses
Response samples
- 401
- 403
- 404
- 500
{- "message": "This request failed to be authenticated.",
- "code": "00-1",
- "type": "authentication.failed"
}
Patch Ruleset by External ID
Change ruleset attributes including specified rules for an existing ruleset with the specified ruleset external ID without replacing unaffected rules. This requires write_price_rulesets scope/permission.
Authorizations:
path Parameters
shop_identifier required | string Bold platform identifier for the shop. Find this identifier using the Get Shop Info endpoint. |
external_id required | string Ruleset external_id. |
query Parameters
include_all_apps | boolean Indicates whether to include rulesets created by other apps. Without this flag ( |
Request Body schema: application/json
required | object | ||||||
|
Responses
Request samples
- Payload
{- "ruleset": {
- "start_date": "2020-11-01T00:00:00Z",
- "expiry_date": "2020-11-17T23:59:59Z",
- "rules": [
- {
- "external_id": "CreatedByAPI_1",
- "type": "DISCOUNT",
- "conditions": [
- {
- "type": "CUSTOMER_GROUP",
- "value": "silver"
}, - {
- "type": "QTY_BY_PRODUCT",
- "operator": ">=",
- "value": 3
}
], - "actions": [
- {
- "type": "PRICE_ADJUST_PERCENT",
- "value": -8
}
]
}
]
}
}
Response samples
- 401
- 403
{- "message": "This request failed to be authenticated.",
- "code": "00-1",
- "type": "authentication.failed"
}
Activate All Rulesets
Set the status of all rulesets to active in the specified shop. This requires write_price_rulesets scope/permission.
Authorizations:
path Parameters
shop_identifier required | string Bold platform identifier for the shop. Find this identifier using the Get Shop Info endpoint. |
Responses
Response samples
- 200
- 401
- 403
- 500
{- "message": "Successfully activated 22 rulesets",
- "data": [ ]
}
Deactivate All Rulesets
Set the status of all rulesets to inactive in the specified shop. This requires write_price_rulesets scope/permission.
Authorizations:
path Parameters
shop_identifier required | string Bold platform identifier for the shop. Find this identifier using the Get Shop Info endpoint. |
Responses
Response samples
- 200
- 401
- 403
{- "message": "Successfully deactivated 18 rulesets",
- "data": [ ]
}
List Rulesets by Product ID
List all rulesets available for the specified shop and product IDs. This requires no special permissions.
Authorizations:
path Parameters
shop_identifier required | string Bold platform identifier for the shop. Find this identifier using the Get Shop Info endpoint. |
query Parameters
products required | string A comma separated list of all product IDs; Example: ?products=123 |
filter[] | string Rule condition filter. Example: &filter[]=eq(CUSTOMER_GROUP%3Agold)&filter[]=like(CURRENCY%3ACAD) |
Responses
Response samples
- 200
{- "message": "Successfully fetched rulesets",
- "data": {
- "rulesets": [
- {
- "id": 56,
- "app_slug": "my-cool-app",
- "public_name": "",
- "internal_name": "",
- "external_id": "",
- "active": true,
- "sync_percent": 100,
- "priority": 100,
- "expiry_date": null,
- "rules": [
- {
- "type": "DISCOUNT",
- "conditions": [
- {
- "type": "CUSTOMER_GROUP",
- "value": "wholesale"
}
], - "actions": [
- {
- "type": "PRICE_ADJUST_RELATIVE",
- "value": -5000
}
]
}, - {
- "type": "DISCOUNT",
- "conditions": [
- {
- "type": "CUSTOMER_GROUP",
- "value": "gold"
}
], - "actions": [
- {
- "type": "PRICE_ADJUST_RELATIVE",
- "value": -2500
}
]
}, - {
- "type": "DISCOUNT",
- "conditions": [
- {
- "type": "CUSTOMER_GROUP",
- "value": "silver"
}
], - "actions": [
- {
- "type": "PRICE_ADJUST_RELATIVE",
- "value": -1250
}
]
}, - {
- "type": "DISCOUNT",
- "conditions": [
- {
- "type": "CUSTOMER_GROUP",
- "value": "bronze"
}
], - "actions": [
- {
- "type": "PRICE_ADJUST_RELATIVE",
- "value": -620
}
]
}
], - "product_selection": {
- "type": "SHOPIFY_PRODUCT_SEARCH",
- "products": [
- {
- "product_id": "1234567890123"
}
]
}
}
], - "shop_options": {
- "compare_at_price_as_original": true,
- "verbose_logs": true,
- "include_base_prices": true
}, - "base_prices": [
- {
- "id": 98765432101234,
- "price": 10000
}, - {
- "id": 98765432109876,
- "price": 12000
}
]
}
}
Get Adjusted Cart
Return final price for lineItem in a cart. This requires read_price_rulesets scope/permission.
Authorizations:
path Parameters
shop_identifier required | string Bold platform identifier for the shop. Find this identifier using the Get Shop Info endpoint. |
Request Body schema: application/json
required | Array of objects (LineItem) |
matchLineItemProperty required | string Value: "sku" |
object (Customer) |
Responses
Request samples
- Payload
{- "lineItems": [
- {
- "key": "uniquekey1",
- "price": 12,
- "matchValue": "123",
- "quantity": 2
}, - {
- "key": "uniquekey2",
- "price": 15,
- "matchValue": "223",
- "quantity": 1
}
], - "matchLineItemProperty": "sku",
- "customer": {
- "shipping": {
- "postal_code": "R3Y0X5"
}
}
}
Response samples
- 200
- 401
- 403
- 500
{- "pre_checkout_id": "POS_123",
- "actions": [
- {
- "key": "uniquekey1",
- "price": 10,
- "matchValue": "123",
- "quantity": 2,
- "rule": [
- {
- "id": 1,
- "rule_set_id": 1,
- "rule_set_eid": "ruleset_eid"
}
]
}, - {
- "key": "uniquekey2",
- "price": 12,
- "matchValue": "223",
- "quantity": 1,
- "rule": [
- {
- "id": 1,
- "rule_set_id": 1,
- "rule_set_eid": "ruleset_eid"
}
]
}
]
}
A child of the Ruleset resource. Contains information about a rule, including the type, conditions, and actions of the rule. Use these endpoints to manage the rules in a ruleset.
Bulk Delete Rules by Ruleset EID
Remove one or more existent rules from a specific Ruleset. Requires the write_price_rulesets scope/permission.
Authorizations:
path Parameters
shop_identifier required | string Bold platform identifier for the shop. Find this identifier using the Get Shop Info endpoint. |
external_id required | string |
Request Body schema: application/json
rule_ids required | Array of integers |
Responses
Request samples
- Payload
{- "rule_ids": [
- 1,
- 2
]
}
Response samples
- 200
{- "message": "Successfully removed 2 rules from ruleset with rulesetId:1"
}
Bulk Delete Rules by Ruleset ID
Remove one or more existent rules from a specific Ruleset. Requires the write_price_rulesets scope/permission.
Authorizations:
path Parameters
shop_identifier required | string Bold platform identifier for the shop. Find this identifier using the Get Shop Info endpoint. |
ruleset_id required | string |
Request Body schema: application/json
rule_ids required | Array of integers |
Responses
Request samples
- Payload
{- "rule_ids": [
- 1,
- 2
]
}
Response samples
- 200
{- "message": "Successfully removed 2 rules from ruleset with rulesetId:1"
}
Update Rule by Ruleset EID and Rule EID
Update a Rule by using the Ruleset external_id and Rule external_id.
Requires the check_write_rulesets_permission scope/permission.
Authorizations:
path Parameters
shop_identifier required | string Bold platform identifier for the shop. Find this identifier using the Get Shop Info endpoint. |
external_id required | string |
rule_external_id required | string |
Request Body schema: application/json
required | object (Rule) Comprised by one or more actions that can alter the price or the storefront in general, and a set of zero or more conditions that must be met for the rule to be applied. | ||||||||||||||||
|
Responses
Request samples
- Payload
{- "rule": {
- "type": "DISCOUNT",
- "conditions": [
- {
- "type": "BUY_X_GET_Y_DISCOUNT_CODE",
- "buy_quantity": 1,
- "get_quantity": 1,
- "uses_per_order": 1,
- "requirement_selection": {
- "type": "PRODUCT_SEARCH",
- "product_ids": [
- "string"
]
}
}
], - "actions": [
- {
- "value": 99,
- "type": "PRICE_ADJUST_ABSOLUTE"
}
], - "meta": { },
- "external_id": "string",
- "priority": 0,
- "stack_order": 0,
- "id": 0
}
}
Response samples
- 200
{- "message": "string",
- "data": {
- "id": "string",
- "external_id": "string",
- "conditions": [
- {
- "value": 5,
- "type": "QTY_BY_LINE",
- "operator": "=",
- "requiresPrepare": true
}
], - "actions": [
- {
- "value": 99,
- "type": "PRICE_ADJUST_ABSOLUTE"
}
]
}
}
Bulk Add Rules by Ruleset EID
Bulk add Rules to a Ruleset.
Authorizations:
path Parameters
external_id required | string |
shop_identifier required | string Bold platform identifier for the shop. Find this identifier using the Get Shop Info endpoint. |
Request Body schema: application/json
required | Array of objects (Rule) | ||||||||||||||||
Array
|
Responses
Request samples
- Payload
{- "rules": [
- {
- "type": "DISCOUNT",
- "conditions": [
- {
- "type": "BUY_X_GET_Y_DISCOUNT_CODE",
- "buy_quantity": 1,
- "get_quantity": 1,
- "uses_per_order": 1,
- "requirement_selection": {
- "type": "PRODUCT_SEARCH",
- "product_ids": [
- "string"
]
}
}
], - "actions": [
- {
- "value": 99,
- "type": "PRICE_ADJUST_ABSOLUTE"
}
], - "meta": { },
- "external_id": "string",
- "priority": 0,
- "stack_order": 0,
- "id": 0
}
]
}
Update Rule by Ruleset ID and Rule ID
Update a Rule by using the Ruleset id and Rule id.
Requires the check_write_rulesets_permission scope/permission.
Authorizations:
path Parameters
shop_identifier required | string Bold platform identifier for the shop. Find this identifier using the Get Shop Info endpoint. |
ruleset_id required | string |
rule_id required | string |
Request Body schema: application/json
required | object (Rule) Comprised by one or more actions that can alter the price or the storefront in general, and a set of zero or more conditions that must be met for the rule to be applied. | ||||||||||||||||
|
Responses
Request samples
- Payload
{- "rule": {
- "type": "DISCOUNT",
- "conditions": [
- {
- "type": "BUY_X_GET_Y_DISCOUNT_CODE",
- "buy_quantity": 1,
- "get_quantity": 1,
- "uses_per_order": 1,
- "requirement_selection": {
- "type": "PRODUCT_SEARCH",
- "product_ids": [
- "string"
]
}
}
], - "actions": [
- {
- "value": 99,
- "type": "PRICE_ADJUST_ABSOLUTE"
}
], - "meta": { },
- "external_id": "string",
- "priority": 0,
- "stack_order": 0,
- "id": 0
}
}
Response samples
- 200
{- "message": "string",
- "data": {
- "id": "string",
- "external_id": "string",
- "conditions": [
- {
- "value": 5,
- "type": "QTY_BY_LINE",
- "operator": "=",
- "requiresPrepare": true
}
], - "actions": [
- {
- "value": 99,
- "type": "PRICE_ADJUST_ABSOLUTE"
}
]
}
}
Remove Rule by Ruleset ID and Rule ID
Remove one rule from a specific Ruleset. Requires the write_price_rulesets scope/permission.
Authorizations:
path Parameters
shop_identifier required | string Bold platform identifier for the shop. Find this identifier using the Get Shop Info endpoint. |
ruleset_id required | string |
rule_id required | string |
Responses
Response samples
- 401
- 403
- 404
- 500
{- "code": "string",
- "message": "string",
- "type": "string"
}
Update Rule by Ruleset EID and Rule ID
Update a Rule by using the Ruleset external_id and Rule id.
Requires the check_write_rulesets_permission scope/permission.
Authorizations:
path Parameters
shop_identifier required | string Bold platform identifier for the shop. Find this identifier using the Get Shop Info endpoint. |
external_id required | string |
rule_id required | string |
Request Body schema: application/json
required | object (Rule) Comprised by one or more actions that can alter the price or the storefront in general, and a set of zero or more conditions that must be met for the rule to be applied. | ||||||||||||||||
|
Responses
Request samples
- Payload
{- "rule": {
- "type": "DISCOUNT",
- "conditions": [
- {
- "type": "BUY_X_GET_Y_DISCOUNT_CODE",
- "buy_quantity": 1,
- "get_quantity": 1,
- "uses_per_order": 1,
- "requirement_selection": {
- "type": "PRODUCT_SEARCH",
- "product_ids": [
- "string"
]
}
}
], - "actions": [
- {
- "value": 99,
- "type": "PRICE_ADJUST_ABSOLUTE"
}
], - "meta": { },
- "external_id": "string",
- "priority": 0,
- "stack_order": 0,
- "id": 0
}
}
Response samples
- 200
{- "message": "string",
- "data": {
- "id": "string",
- "external_id": "string",
- "conditions": [
- {
- "value": 5,
- "type": "QTY_BY_LINE",
- "operator": "=",
- "requiresPrepare": true
}
], - "actions": [
- {
- "value": 99,
- "type": "PRICE_ADJUST_ABSOLUTE"
}
]
}
}
Delete Rule from Ruleset by Ruleset EID and Rule ID
Remove one rule from a specific Ruleset. Requires the write_price_rulesets scope/permission.
Authorizations:
path Parameters
shop_identifier required | string Bold platform identifier for the shop. Find this identifier using the Get Shop Info endpoint. |
external_id required | string |
rule_id required | string |
Responses
Response samples
- 401
- 403
- 404
- 500
{- "code": "string",
- "message": "string",
- "type": "string"
}
Update Rule by Ruleset ID and Rule EID
Update a Rule by using the Ruleset id and Rule external_id.
Requires the check_write_rulesets_permission scope/permission.
Authorizations:
path Parameters
shop_identifier required | string Bold platform identifier for the shop. Find this identifier using the Get Shop Info endpoint. |
ruleset_id required | string |
rule_external_id required | string |
Request Body schema: application/json
required | object (Rule) Comprised by one or more actions that can alter the price or the storefront in general, and a set of zero or more conditions that must be met for the rule to be applied. | ||||||||||||||||
|
Responses
Request samples
- Payload
{- "rule": {
- "type": "DISCOUNT",
- "conditions": [
- {
- "type": "BUY_X_GET_Y_DISCOUNT_CODE",
- "buy_quantity": 1,
- "get_quantity": 1,
- "uses_per_order": 1,
- "requirement_selection": {
- "type": "PRODUCT_SEARCH",
- "product_ids": [
- "string"
]
}
}
], - "actions": [
- {
- "value": 99,
- "type": "PRICE_ADJUST_ABSOLUTE"
}
], - "meta": { },
- "external_id": "string",
- "priority": 0,
- "stack_order": 0,
- "id": 0
}
}
Response samples
- 200
{- "message": "string",
- "data": {
- "id": "string",
- "external_id": "string",
- "conditions": [
- {
- "value": 5,
- "type": "QTY_BY_LINE",
- "operator": "=",
- "requiresPrepare": true
}
], - "actions": [
- {
- "value": 99,
- "type": "PRICE_ADJUST_ABSOLUTE"
}
]
}
}
Bulk Add Rules by Ruleset ID
Bulk add Rules to a Ruleset.
Authorizations:
path Parameters
shop_identifier required | string Bold platform identifier for the shop. Find this identifier using the Get Shop Info endpoint. |
ruleset_id required | string |
Request Body schema: application/json
required | Array of objects (Rule) non-empty | ||||||||||||||||
Array (non-empty)
|
Responses
Request samples
- Payload
{- "rules": [
- {
- "type": "DISCOUNT",
- "conditions": [
- {
- "type": "BUY_X_GET_Y_DISCOUNT_CODE",
- "buy_quantity": 1,
- "get_quantity": 1,
- "uses_per_order": 1,
- "requirement_selection": {
- "type": "PRODUCT_SEARCH",
- "product_ids": [
- "string"
]
}
}
], - "actions": [
- {
- "value": 99,
- "type": "PRICE_ADJUST_ABSOLUTE"
}
], - "meta": { },
- "external_id": "string",
- "priority": 0,
- "stack_order": 0,
- "id": 0
}
]
}
List Rules by Ruleset ID
Returns all rules in a ruleset in a paginated format.
Authorizations:
path Parameters
shop_identifier required | string Bold platform identifier for the shop. Find this identifier using the Get Shop Info endpoint. |
ruleset_id required | string |
query Parameters
page | string Page number, considering that the results could span for several pages. Default is 1. |
limit | string Page size, considering that the results could span for several pages. Default is 50. |
Responses
Response samples
- 200
- 404
{- "message": "Successfully fetched rules",
- "data": [
- {
- "id": "number",
- "external_id": "string",
- "conditions": [
- {
- "value": 5,
- "type": "QTY_BY_LINE",
- "operator": "=",
- "requiresPrepare": true
}
], - "actions": [
- {
- "value": 99,
- "type": "PRICE_ADJUST_ABSOLUTE"
}
]
}
], - "pagination": {
- "total": 2,
- "count": 2,
- "per_page": 50,
- "current_page": 1,
- "total_pages": 1
}
}
List Rules by Ruleset External ID
Returns all rules in a ruleset in a paginated format.
Authorizations:
path Parameters
shop_identifier required | string Bold platform identifier for the shop. Find this identifier using the Get Shop Info endpoint. |
external_id required | string |
query Parameters
page | string Page number, considering that the results could span for several pages. Default is 1. |
limit | string Page size, considering that the results could span for several pages. Default is 50. |
Responses
Response samples
- 200
{- "message": "string",
- "data": { },
- "pagination": {
- "total": 0,
- "count": 0,
- "per_page": 0,
- "current_page": 0,
- "total_pages": 0
}
}
Child of the Ruleset resource. Contains information about the criteria for triggering actions in a ruleset. Conditions are usually a type:value
pair. Use these endpoints to manage the conditions in a ruleset.
List Order Conditions
List all Order Conditions available for the specified shop. Requires the read_price_order_conditions scope/permission.
Authorizations:
path Parameters
shop_identifier required | string Bold platform identifier for the shop. Find this identifier using the Get Shop Info endpoint. |
query Parameters
deep | string If this flag is true, all the details of the Order Condition will be included in the response. Otherwise, only basic information (name, value, etc.) will be returned. |
page | integer The desired page number for the paginated result (default is 1). |
limit | integer Size of the page to be used for the paginated result (default is 50). |
Responses
Response samples
- 200
- 401
- 403
- 500
{- "message": "Successfully fetched order conditions",
- "data": {
- "order_conditions": [
- {
- "name": "ZONE",
- "value": "north-america-04",
- "operator": "ONE_OF",
- "type": "FIELD_SET",
- "field_sets": [
- {
- "field_set_id": 27,
- "customer.shipping.country": "Canada",
- "customer.shipping.postal_code": "R3Y0L6"
}, - {
- "field_set_id": 28,
- "customer.shipping.country": "Canada",
- "customer.shipping.postal_code": "R3T5Y3"
}, - {
- "field_set_id": 66,
- "customer.shipping.country": "Canada",
- "customer.shipping.postal_code": "R3T345"
}
]
}, - {
- "name": "ZONE",
- "value": "north-america-05",
- "operator": "ONE_OF",
- "type": "FIELD_SET",
- "field_sets": [
- {
- "field_set_id": 71,
- "customer.shipping.country": "United States of America",
- "customer.shipping.postal_code": "R3Y0L6"
}, - {
- "field_set_id": 72,
- "customer.shipping.country": "United States of America",
- "customer.shipping.postal_code": "R3T5Y3"
}
]
}
]
}, - "pagination": {
- "total": 2,
- "count": 2,
- "per_page": 50,
- "current_page": 1,
- "total_pages": 1
}
}
Create Order Condition
Creates an Order Condition. Requires the write_price_order_conditions scope/permission.
Authorizations:
path Parameters
shop_identifier required | string Bold platform identifier for the shop. Find this identifier using the Get Shop Info endpoint. |
Request Body schema: application/json
name required | string The name of the Order Condition. |
value required | string The value of the Order Condition. |
operator required | string (Operator) Defines the relationship of the Order Condition. Eg 'ONE_OF'. |
type required | string Specifies the |
Array of objects (FieldSet) All the different combinations of fields and values that match the Order Condition. For example, all the sets of country + city + postal code that are included in the 'DELIVERY_ZONE: NorthAmerica' condition. |
Responses
Request samples
- Payload
{- "name": "zone",
- "value": "north-america-05",
- "operator": "ONE_OF",
- "type": "FIELD_SET",
- "field_sets": [
- {
- "customer.shipping.postal_code": "90210",
- "customer.shipping.country_code": "US"
}, - {
- "customer.shipping.postal_code": "55555",
- "customer.shipping.country_code": "US"
}
]
}
Response samples
- 201
- 409
- 413
{- "message": "string",
- "data": {
- "order_condition": { }
}
}
Get Order Condition
Gets an Order Condition by its name and value. Requires the read_price_order_conditions scope/permission.
Authorizations:
path Parameters
shop_identifier required | string Bold platform identifier for the shop. Find this identifier using the Get Shop Info endpoint. |
condition_name required | string Name of the condition. This can be used to group similar options that depend on the same piece of data. For example, it is possible to have several Order Conditions with the same name (DELIVERY_ZONE) and different values (NorthAmerica, Europe) that evaluate the same fields (country, city and postal code). |
condition_value required | string Value of the condition. This describes an option available for a collection of conditions that share the same name. Discounts will be applied based on the presence of a specific "name:value" pair. It is possible to have several Order Conditions with identical names (DELIVERY_ZONE) and different values/options (NorthAmerica, Europe) as long as they evaluate the same fields (country, city and postal code). |
Responses
Response samples
- 200
- 401
- 403
- 404
- 500
{- "message": "Successfully fetched order condition",
- "data": {
- "order_condition": {
- "name": "ZONE",
- "value": "Prairies",
- "operator": "ONE_OF",
- "type": "FIELD_SET",
- "field_sets": [
- {
- "field_set_id": 71,
- "customer.shipping.country": "Canada",
- "customer.shipping.postal_code": "R3Y0L6"
}, - {
- "field_set_id": 72,
- "customer.shipping.country": "Canada",
- "customer.shipping.postal_code": "R3T5Y3"
}
]
}
}
}
Delete Order Condition by Name and Value
Delete an Order Condition by condition_name and condition_value. Requires the write_price_order_conditions scope/permission.
Authorizations:
path Parameters
shop_identifier required | string Bold platform identifier for the shop. Find this identifier using the Get Shop Info endpoint. |
condition_name required | string Name of the condition. This can be used to group similar options that depend on the same piece of data. For example, it is possible to have several Order Conditions with the same name (DELIVERY_ZONE) and different values (NorthAmerica, Europe) that evaluate the same fields (country, city and postal code). |
condition_value required | string Value of the condition. This describes an option available for a collection of conditions that share the same name. Discounts will be applied based on the presence of a specific "name:value" pair. It is possible to have several Order Conditions with identical names (DELIVERY_ZONE) and different values/options (NorthAmerica, Europe) as long as they evaluate the same fields (country, city and postal code). |
Responses
Response samples
- 401
- 403
- 404
- 500
{- "code": "string",
- "message": "string",
- "type": "string"
}
Update Order Condition
Updates an Order Condition. Requires the write_price_order_conditions scope/permission.
Authorizations:
path Parameters
shop_identifier required | string Bold platform identifier for the shop. Find this identifier using the Get Shop Info endpoint. |
condition_name required | string Name of the condition. This can be used to group similar options that depend on the same piece of data. For example, it is possible to have several Order Conditions with the same name (DELIVERY_ZONE) and different values (NorthAmerica, Europe) that evaluate the same fields (country, city and postal code). |
condition_value required | string Value of the condition. This describes an option available for a collection of conditions that share the same name. Discounts will be applied based on the presence of a specific "name:value" pair. It is possible to have several Order Conditions with identical names (DELIVERY_ZONE) and different values/options (NorthAmerica, Europe) as long as they evaluate the same fields (country, city and postal code). |
Request Body schema: application/json
name required | string The name of the Order Condition. |
value required | string The value of the Order Condition. |
operator required | string (Operator) Defines the relationship of the Order Condition. Eg 'ONE_OF'. |
type required | string Specifies the |
Array of objects (FieldSet) All the different combinations of fields and values that match the Order Condition. For example, all the sets of country + city + postal code that are included in the 'DELIVERY_ZONE: NorthAmerica' condition. |
Responses
Request samples
- Payload
{- "name": "ZONE",
- "value": "north-america-01",
- "operator": "ONE_OF",
- "type": "FIELD_SET",
- "field_sets": [
- {
- "field_set_id": 3,
- "customer.shipping.country": "United States of America",
- "customer.shipping.postal_code": "91210"
}, - {
- "customer.shipping.country": "United States of America",
- "customer.shipping.postal_code": "99999"
}
]
}
Response samples
- 200
- 400
- 401
- 403
- 413
- 422
- 500
{- "message": "Successfully updated order condition",
- "data": {
- "order_condition": {
- "name": "ZONE",
- "value": "north-america-01",
- "operator": "ONE_OF",
- "type": "FIELD_SET",
- "field_sets": [
- {
- "field_set_id": 82,
- "customer.shipping.country": "United States of America",
- "customer.shipping.postal_code": "91210"
}, - {
- "field_set_id": 83,
- "customer.shipping.country": "United States of America",
- "customer.shipping.postal_code": "99999"
}
]
}
}
}
List Valid Fields for Order Condition
Gets a list of all the shop/customer fields that can be evaluated in an Order Condition. Requires the read_price_order_conditions scope/permission.
Authorizations:
path Parameters
shop_identifier required | string Bold platform identifier for the shop. Find this identifier using the Get Shop Info endpoint. |
Responses
Response samples
- 200
- 401
- 403
- 404
- 500
{- "message": "Successfully fetched valid field names",
- "data": {
- "field_names": [
- "customer.shipping.country",
- "customer.shipping.country_code",
- "customer.shipping.postal_code",
- "customer.shipping.province",
- "customer.shipping.province_code"
]
}
}
Delete Order Condition by Name
Delete a collection of Order Conditions that share the same name, for example all the DELIVERY_ZONE Order Conditions regardless of their values (NorthAmerica, Europe, etc.). Requires the write_price_order_conditions scope/permission.
Authorizations:
path Parameters
shop_identifier required | string Bold platform identifier for the shop. Find this identifier using the Get Shop Info endpoint. |
condition_name required | string The name and value of an Order Condition are a combination that uniquely identifies that condition. |
query Parameters
condition_name required | string Name of the condition. |
Responses
Response samples
- 401
- 403
- 404
- 500
{- "code": "string",
- "message": "string",
- "type": "string"
}
Delete Order Condition Field by Name
Delete a field from all the Order Conditions that share the same name. For example, if a list of DELIVERY_ZONE conditions were evaluating both city and postal code before, and now they should check the postal code only, then the irrelevant field (city) can be erased by this operation. Requires the write_price_order_conditions scope/permission.
Authorizations:
path Parameters
shop_identifier required | string Bold platform identifier for the shop. Find this identifier using the Get Shop Info endpoint. |
condition_name required | string The name and value of an Order Condition are a combination that uniquely identifies that condition. |
field_name required | string Field that should be deleted, for example "customer.shipping.province". |
Responses
Response samples
- 401
- 403
- 404
- 500
{- "code": "string",
- "message": "string",
- "type": "string"
}
Add Field Sets to Order Condition
Adds one or more new Field Sets to a specific Order Condition. Requires the write_price_order_conditions scope/permission.
Authorizations:
path Parameters
shop_identifier required | string Bold platform identifier for the shop. Find this identifier using the Get Shop Info endpoint. |
Request Body schema: application/json
name | string The name and value of an Order Condition are a combination that uniquely identifies that condition. |
value | string The name and value of an Order Condition are a combination that uniquely identifies that condition. |
Array of objects (FieldSet) Field sets to be added. |
Responses
Request samples
- Payload
{- "name": "ZONE",
- "value": "north-america-05",
- "field_sets": [
- {
- "customer.shipping.country": "United States of America",
- "customer.shipping.postal_code": "98765"
}, - {
- "customer.shipping.country": "United States of America",
- "customer.shipping.postal_code": "43210"
}, - {
- "customer.shipping.country": "United States of America",
- "customer.shipping.postal_code": "88888"
}
]
}
Response samples
- 200
- 400
- 404
- 500
{- "message": "Successfully added field set(s) to order condition",
- "data": {
- "order_condition": {
- "name": "ZONE",
- "value": "Prairies",
- "operator": "ONE_OF",
- "type": "FIELD_SET"
}, - "field_sets_added": [
- {
- "field_set_id": 76,
- "customer.shipping.country": "United States of America",
- "customer.shipping.postal_code": "98765"
}, - {
- "field_set_id": 77,
- "customer.shipping.country": "United States of America",
- "customer.shipping.postal_code": "43210"
}, - {
- "field_set_id": 78,
- "customer.shipping.country": "United States of America",
- "customer.shipping.postal_code": "88888"
}
]
}
}
Delete Field Sets from Order Condition
Remove one or more existent Field Sets from a specific Order Condition. Requires the write_price_order_conditions scope/permission.
Authorizations:
path Parameters
shop_identifier required | string Bold platform identifier for the shop. Find this identifier using the Get Shop Info endpoint. |
Request Body schema: application/json
name | string The name and value of an Order Condition are a combination that uniquely identifies that condition. |
value | string The name and value of an Order Condition are a combination that uniquely identifies that condition. |
field_set_ids | Array of any List containing the ids of each Field Set that should be removed. |
Responses
Request samples
- Payload
{- "name": "ZONE",
- "value": "north-america-05",
- "field_set_ids": [
- 69,
- 70,
- 73
]
}
Response samples
- 200
- 400
- 404
- 500
{- "message": "Successfully removed 3 field set(s) from order condition",
- "data": {
- "order_condition": {
- "name": "ZONE",
- "value": "north-america-05"
}
}
}
List Matching Field Sets for Order Condition
Gets all the sets of fields that are valid/that comply with an Order Condition. An Order Condition can be matched by different sets of data, for example 'DELIVERY_ZONE: NorthAmerica' could include a lot of possible country + postal code combinations. Requires the read_price_order_conditions scope/permission.
Authorizations:
path Parameters
shop_identifier required | string Bold platform identifier for the shop. Find this identifier using the Get Shop Info endpoint. |
condition_name required | string Name of the condition. This can be used to group similar options that depend on the same piece of data. For example, it is possible to have several Order Conditions with the same name (DELIVERY_ZONE) and different values (NorthAmerica, Europe) that evaluate the same fields (country, city and postal code). |
condition_value required | string Value of the condition. This describes an option available for a collection of conditions that share the same name. Discounts will be applied based on the presence of a specific "name:value" pair. It is possible to have several Order Conditions with the identical names (DELIVERY_ZONE) and different values/options (NorthAmerica, Europe) as long as they evaluate the same fields (country, city and postal code). |
query Parameters
page | string The desired page number for the paginated result (default is 1). |
limit | string Size of the page to be used for the paginated result (default is 50). |
Responses
Response samples
- 200
- 401
- 403
- 404
- 500
{- "message": "Successfully fetched matched field sets for order condition",
- "data": {
- "field_sets": [
- {
- "field_set_id": 71,
- "customer.shipping.country": "United States of America",
- "customer.shipping.postal_code": "R3Y0L6"
}, - {
- "field_set_id": 72,
- "customer.shipping.country": "United States of America",
- "customer.shipping.postal_code": "R3T5Y3"
}
]
}, - "pagination": {
- "total": 2,
- "count": 2,
- "per_page": 50,
- "current_page": 1,
- "total_pages": 1
}
}
Validate Order Condition Group
This endpoint can be used to check internal inconsistencies between an Order Condition group (a set of conditions that share the same condition_name). All Order Conditions that share a name should evaluate the same fields.
For example: If a shop has a condition "name: zone, value: north-america-05" that contains several combinations of country and postal code on its field sets, when a new condition "name: zone, value: europe-01" is created on the same shop it should also use country and postal code to define its field sets.
Requires the read_price_order_conditions scope/permission.
Authorizations:
path Parameters
shop_identifier required | string Bold platform identifier for the shop. Find this identifier using the Get Shop Info endpoint. |
condition_name required | string Name of the condition. This can be used to group similar options that depend on the same piece of data. For example, it is possible to have several Order Conditions with the same name (DELIVERY_ZONE) and different values (NorthAmerica, Europe) that evaluate the same fields (country, city and postal code). |
Responses
Response samples
- 200
- 500
{- "message": "Order condition 'ZONE: North-America-05' has one or more field sets that are missing field(s). Order condition 'ZONE: North-America-10' has one or more field sets that contain unexpected fields. Order condition 'ZONE: Europe-07' has one or more field sets that are missing field(s). Expected fields for the 'ZONE' group are: [customer.shipping.country, customer.shipping.postal_code]",
- "data": [ ]
}
List Eligible Order Conditions for Shop
Tests order conditions against shop and customer data, and returns the condition names and values that match. Requires no special permissions/scopes.
Authorizations:
path Parameters
shop_domain required | string |
Request Body schema: application/json
object (OrderConditionCustomerSchema) | |||||||||||||||
|
Responses
Request samples
- Payload
{- "customer": {
- "shipping": {
- "postal_code": "string",
- "country": "string",
- "country_code": "string",
- "province": "string",
- "province_code": "string"
}
}
}
Response samples
- 200
{- "message": "Successfully applied order condition to shop",
- "data": {
- "order_condition": {
- "location": "Vancouver"
}
}
}
Contains information about a discount on your store and the products that are eligible for it. Use these endpoints to manipulate the discount codes available on your store.
Create Discount Code
Create one or more discount codes for the specified shop. This requires write_discount_codes scope/permission. Bold automatically assigns a DISCOUNT_CODE
rule condition type to every discount code created.
Authorizations:
path Parameters
shop_identifier required | string Bold platform identifier for the shop. Find this identifier using the Get Shop Info endpoint. |
Request Body schema: application/json
Initial data needed to configure the new discount code(s).
required | object (CreateDiscountCode) Payload to create one or more discount codes from scratch. | ||||||||||||||||||||
|
Responses
Request samples
- Payload
{- "discount_code": {
- "codes": [
- "BACK_TO_SCHOOL",
- "BLACKFRIDAY"
], - "limits": [
- {
- "limit_type": "per_shop",
- "limit_amount": 1000
}
], - "product_selection": {
- "type": "PRODUCT_SEARCH",
- "product_ids": [
- "1234567890123",
- "1234567890456"
]
}, - "conditions": [
- {
- "type": "CART_SUBTOTAL_MIN",
- "value": 5000
}
], - "action": {
- "type": "PRICE_ADJUST_PERCENT",
- "value": -10
}
}
}
Response samples
- 200
- 400
- 409
- 422
- 500
{- "message": "Discount code(s) created successfully!",
- "data": {
- "discount_codes": [
- {
- "code": "BACK_TO_SCHOOL",
- "updated_at": "2020-09-16T20:39:57.000000Z",
- "created_at": "2020-09-16T20:39:57.000000Z",
- "id": 8,
- "ruleset": {
- "id": "20",
- "external_id": "RELATED_TO_DISCOUNT_CODE_BACK_TO_SCHOOL",
- "active": true,
- "internal_name": "RELATED_TO_DISCOUNT_CODE_BACK_TO_SCHOOL",
- "created_at": "2020-09-16T15:39:56Z",
- "updated_at": "2020-09-16T15:39:56Z",
- "rules": [
- {
- "type": "DISCOUNT_CODE",
- "conditions": [
- {
- "type": "DISCOUNT_CODE",
- "value": "BACK_TO_SCHOOL"
}
], - "actions": [
- {
- "type": "PRICE_ADJUST_PERCENT",
- "value": -10
}
]
}
], - "product_selection": {
- "product_ids": [
- "1234567890123",
- "1234567890456"
], - "type": "PRODUCT_SEARCH"
}
}
}, - {
- "code": "BLACKFRIDAY",
- "updated_at": "2020-09-16T20:39:57.000000Z",
- "created_at": "2020-09-16T20:39:57.000000Z",
- "id": 9,
- "ruleset": {
- "id": "21",
- "external_id": "RELATED_TO_DISCOUNT_CODE_BLACKFRIDAY",
- "active": true,
- "internal_name": "RELATED_TO_DISCOUNT_CODE_BLACKFRIDAY",
- "created_at": "2020-09-16T15:39:57Z",
- "updated_at": "2020-09-16T15:39:57Z",
- "rules": [
- {
- "type": "DISCOUNT_CODE",
- "conditions": [
- {
- "type": "DISCOUNT_CODE",
- "value": "BLACKFRIDAY"
}
], - "actions": [
- {
- "type": "PRICE_ADJUST_PERCENT",
- "value": -10
}
]
}
], - "product_selection": {
- "product_ids": [
- "1234567890123",
- "1234567890456"
], - "type": "PRODUCT_SEARCH"
}
}
}
]
}
}
List Discount Codes
List all discount codes available for the specified shop. Requires the read_discount_codes scope/permission. Bold automatically assigns a DISCOUNT_CODE
rule condition type to every discount code created.
Authorizations:
path Parameters
shop_identifier required | string Bold platform identifier for the shop. Find this identifier using the Get Shop Info endpoint. |
query Parameters
page | integer The desired page number for the paginated result (default is 1). |
limit | integer Size of the page to be used for the paginated result (default is 50). |
status | string Enum: "ACTIVE" "SCHEDULED" "EXPIRED" Filter the results based on status |
name | string The name of the discount code |
Responses
Response samples
- 200
- 400
- 404
- 422
- 500
{- "message": "Successfully fetched discount codes",
- "data": {
- "discount_codes": [
- {
- "id": 18,
- "code": "BLACKFRIDAY",
- "created_at": "2020-09-24T13:51:23.000000Z",
- "updated_at": "2020-09-28T15:47:43.000000Z",
- "ruleset": {
- "id": "51",
- "external_id": "RELATED_TO_DISCOUNT_CODE_BLACKFRIDAY",
- "active": true,
- "internal_name": "RELATED_TO_DISCOUNT_CODE_BLACKFRIDAY",
- "created_at": "2020-09-28T10:47:43Z",
- "updated_at": "2020-09-28T15:47:44Z",
- "rules": [
- {
- "type": "DISCOUNT_CODE",
- "conditions": [
- {
- "type": "DISCOUNT_CODE",
- "value": "BLACKFRIDAY"
}
], - "actions": [
- {
- "type": "PRICE_ADJUST_PERCENT",
- "value": -10
}
]
}
], - "product_selection": {
- "product_ids": [
- "9876543210123",
- "9876543210987"
], - "type": "PRODUCT_SEARCH"
}
}
}, - {
- "id": 20,
- "code": "SUPER_SALE_2020",
- "created_at": "2020-09-28T21:21:37.000000Z",
- "updated_at": "2020-09-28T21:21:37.000000Z",
- "ruleset": {
- "id": "52",
- "external_id": "RELATED_TO_DISCOUNT_CODE_SUPER_SALE_2020",
- "active": true,
- "internal_name": "RELATED_TO_DISCOUNT_CODE_SUPER_SALE_2020",
- "created_at": "2020-09-28T16:21:37Z",
- "updated_at": "2020-09-28T21:21:38Z",
- "rules": [
- {
- "type": "DISCOUNT_CODE",
- "conditions": [
- {
- "type": "DISCOUNT_CODE",
- "value": "SUPER_SALE_2020"
}
], - "actions": [
- {
- "type": "PRICE_ADJUST_PERCENT",
- "value": -15
}
]
}
], - "product_selection": {
- "product_ids": [
- "1234567890123",
- "1234567890987"
], - "type": "PRODUCT_SEARCH"
}
}
}, - {
- "id": 21,
- "code": "1STORDERBONUS",
- "created_at": "2020-09-28T21:21:37.000000Z",
- "updated_at": "2020-09-28T21:21:37.000000Z",
- "ruleset": {
- "id": "53",
- "external_id": "RELATED_TO_DISCOUNT_CODE_1STORDERBONUS",
- "active": true,
- "internal_name": "RELATED_TO_DISCOUNT_CODE_1STORDERBONUS",
- "created_at": "2020-09-28T16:21:37Z",
- "updated_at": "2020-09-28T21:21:38Z",
- "rules": [
- {
- "type": "DISCOUNT_CODE",
- "conditions": [
- {
- "type": "DISCOUNT_CODE",
- "value": "1STORDERBONUS"
}
], - "actions": [
- {
- "type": "PRICE_ADJUST_RELATIVE",
- "value": -599
}
]
}
], - "product_selection": {
- "product_ids": [
- "9876543210123",
- "9876543210987"
], - "type": "PRODUCT_SEARCH"
}
}
}
]
}, - "pagination": {
- "total": 3,
- "count": 3,
- "per_page": 50,
- "current_page": 1,
- "total_pages": 1
}
}
Update Discount Code
Update an existing discount code available for the specified shop. This requires write_discount_codes scope/permission.
Authorizations:
path Parameters
shop_identifier required | string Bold platform identifier for the shop. Find this identifier using the Get Shop Info endpoint. |
discount_code_id required | integer The discount code unique identifier in the database |
Request Body schema: application/json
Target values for the discount code after update; all fields should be passed, fields that are not intended to change should contain their current values.
required | object (UpdateDiscountCode) Payload to update an existing discount code. | ||||||||||||||||||||||
|
Responses
Request samples
- Payload
{- "discount_code": {
- "code": "SOME_EXISTENT_DISCOUNT_CODE",
- "limit": {
- "limit_type": "per_customer",
- "limit_amount": 5
}, - "product_selection": {
- "type": "PRODUCT_SEARCH",
- "product_ids": [
- "4567890123456",
- "4567890987654"
]
}, - "action": {
- "type": "PRICE_ADJUST_RELATIVE",
- "value": -15
}
}
}
Response samples
- 200
- 400
- 404
- 409
- 422
- 500
{- "message": "Discount code updated successfully!",
- "data": {
- "discount_code": {
- "id": 15,
- "code": "SOME_EXISTENT_DISCOUNT_CODE",
- "created_at": "2020-09-22T20:39:39.000000Z",
- "updated_at": "2020-09-23T18:54:46.000000Z",
- "ruleset": {
- "id": "34",
- "external_id": "RELATED_TO_DISCOUNT_CODE_SOME_EXISTENT_DISCOUNT_CODE",
- "active": true,
- "internal_name": "RELATED_TO_DISCOUNT_CODE_SOME_EXISTENT_DISCOUNT_CODE",
- "created_at": "2020-09-23T13:54:46Z",
- "updated_at": "2020-09-23T13:54:46Z",
- "rules": [
- {
- "type": "DISCOUNT_CODE",
- "conditions": [
- {
- "type": "DISCOUNT_CODE",
- "value": "SOME_EXISTENT_DISCOUNT_CODE"
}
], - "actions": [
- {
- "type": "PRICE_ADJUST_RELATIVE",
- "value": -15
}
]
}
], - "product_selection": {
- "product_ids": [
- "4567890123456",
- "4567890987654"
], - "type": "PRODUCT_SEARCH"
}
}
}
}
}
Get Discount Code by ID
Return data for a specific discount code, selected by the discount code ID. This requires read_discount_codes scope/permission.
Authorizations:
path Parameters
shop_identifier required | string Bold platform identifier for the shop. Find this identifier using the Get Shop Info endpoint. |
discount_code_id required | integer The discount code unique identifier in the database |
Responses
Response samples
- 200
- 404
- 422
- 500
{- "message": "Successfully fetched discount code by id",
- "data": {
- "discount_code": {
- "id": 18,
- "code": "BLACKFRIDAY",
- "created_at": "2020-09-24T13:51:23.000000Z",
- "updated_at": "2020-09-25T21:27:14.000000Z",
- "ruleset": {
- "id": "50",
- "external_id": "RELATED_TO_DISCOUNT_CODE_BLACKFRIDAY",
- "active": true,
- "internal_name": "RELATED_TO_DISCOUNT_CODE_BLACKFRIDAY",
- "created_at": "2020-09-25T16:27:13Z",
- "updated_at": "2020-09-25T16:27:13Z",
- "rules": [
- {
- "type": "DISCOUNT_CODE",
- "conditions": [
- {
- "type": "DISCOUNT_CODE",
- "value": "BLACKFRIDAY"
}
], - "actions": [
- {
- "type": "PRICE_ADJUST_PERCENT",
- "value": -10
}
]
}
], - "product_selection": {
- "product_ids": [
- "1234567890123",
- "1234567890987"
], - "type": "PRODUCT_SEARCH"
}
}
}
}
}
Delete Discount Code
Remove an existing discount code available for the specified shop. This requires write_discount_codes scope/permission.
Authorizations:
path Parameters
shop_identifier required | string Bold platform identifier for the shop. Find this identifier using the Get Shop Info endpoint. |
discount_code_id required | integer The discount code unique identifier in the database |
Responses
Response samples
- 500
{- "code": "string",
- "message": "string",
- "type": "string"
}
Get Discount Code by Ruleset ID
Return data for a specific discount code, selected by the related ruleset ID. This requires read_discount_codes scope/permission.
Authorizations:
path Parameters
shop_identifier required | string Bold platform identifier for the shop. Find this identifier using the Get Shop Info endpoint. |
ruleset_id required | string The database ID for the ruleset that describes the discount code behaviour. |
Responses
Response samples
- 200
- 404
- 422
- 500
{- "message": "Successfully fetched discount code for ruleset",
- "data": {
- "discount_code": {
- "id": 29,
- "code": "TOP_CLEARANCE_10%",
- "created_at": "2020-09-29T20:28:31.000000Z",
- "updated_at": "2020-09-29T20:34:26.000000Z",
- "ruleset": {
- "id": "63",
- "external_id": "RELATED_TO_DISCOUNT_CODE_TOP_CLEARANCE_10%",
- "active": true,
- "internal_name": "RELATED_TO_DISCOUNT_CODE_TOP_CLEARANCE_10%",
- "created_at": "2020-09-29T15:34:26Z",
- "updated_at": "2020-09-29T20:34:27Z",
- "rules": [
- {
- "type": "DISCOUNT_CODE",
- "conditions": [
- {
- "type": "DISCOUNT_CODE",
- "value": "TOP_CLEARANCE_10%"
}
], - "actions": [
- {
- "type": "PRICE_ADJUST_PERCENT",
- "value": -10
}
]
}
], - "product_selection": {
- "product_ids": [
- "9998887770123",
- "9998887770456",
- "9998887770789"
], - "type": "PRODUCT_SEARCH"
}
}
}
}
}
Activate Discount Code
Updates the start_date
to be now()
, and will update the expiry_date
if it is in the past. Returns the data for the updated discount code. This requires write_discount_codes scope/permission.
Authorizations:
path Parameters
shop_identifier required | string Bold platform identifier for the shop. Find this identifier using the Get Shop Info endpoint. |
discount_code_id required | string |
Responses
Response samples
- 200
- 404
- 422
- 500
{- "message": "Successfully activated discount code",
- "data": {
- "discount_code": {
- "id": 197,
- "code": "efijo",
- "created_at": "2021-02-03T16:11:07.000000Z",
- "updated_at": "2021-02-05T16:32:46.000000Z",
- "ruleset": {
- "id": "272",
- "external_id": "RELATED_TO_DISCOUNT_CODE_efijo",
- "shop_id": 9,
- "app_slug": "pdc-shopify",
- "active": true,
- "internal_name": "RELATED_TO_DISCOUNT_CODE_efijo",
- "public_name": "",
- "rule_set_data": "{\"rules\":[{\"type\":\"DISCOUNT_CODE\",\"conditions\":[{\"type\":\"DISCOUNT_CODE\",\"value\":\"efijo\"}],\"actions\":[{\"type\":\"PRICE_ADJUST_PERCENT\",\"value\":50}]}]}",
- "start_date": "2021-02-03T16:11:07.000000Z",
- "expiry_date": "2021-02-03T16:11:07.000000Z",
- "sync_percent": 100,
- "priority": 0,
- "selection_type": 1,
- "selection_data": "{\"product_ids\":[\"5809048617123\",\"5809050615971\"]}",
- "created_at": "2021-02-03T16:11:07.000000Z",
- "updated_at": "2021-02-03T16:11:07.000000Z"
}, - "limits": [ ]
}
}
}
Deactivate Discount Code
Updates the expiry_date
to be now()
. Returns the data for the updated discount code. This requires write_discount_codes scope/permission.
Authorizations:
path Parameters
shop_identifier required | string Bold platform identifier for the shop. Find this identifier using the Get Shop Info endpoint. |
discount_code_id required | string |
Responses
Response samples
- 200
- 404
- 422
- 500
{- "message": "Successfully deactivated discount code",
- "data": {
- "discount_code": {
- "id": 197,
- "code": "efijo",
- "created_at": "2021-02-03T16:11:07.000000Z",
- "updated_at": "2021-02-05T16:32:46.000000Z",
- "ruleset": {
- "id": "272",
- "external_id": "RELATED_TO_DISCOUNT_CODE_efijo",
- "shop_id": 9,
- "app_slug": "pdc-shopify",
- "active": true,
- "internal_name": "RELATED_TO_DISCOUNT_CODE_efijo",
- "public_name": "",
- "rule_set_data": "{\"rules\":[{\"type\":\"DISCOUNT_CODE\",\"conditions\":[{\"type\":\"DISCOUNT_CODE\",\"value\":\"efijo\"}],\"actions\":[{\"type\":\"PRICE_ADJUST_PERCENT\",\"value\":50}]}]}",
- "start_date": "2021-02-03T16:11:07.000000Z",
- "expiry_date": "2021-02-03T16:11:07.000000Z",
- "sync_percent": 100,
- "priority": 0,
- "selection_type": 1,
- "selection_data": "{\"product_ids\":[\"5809048617123\",\"5809050615971\"]}",
- "created_at": "2021-02-03T16:11:07.000000Z",
- "updated_at": "2021-02-03T16:11:07.000000Z"
}, - "limits": [ ]
}
}
}
Use these endpoints to get the final price for a product or cart after all rules have been applied.
Get Final Price for Product
Return the final price for item. This requires no special permissions.
Authorizations:
path Parameters
shop_identifier required | string Bold platform identifier for the shop. Find this identifier using the Get Shop Info endpoint. |
Request Body schema: application/json
required | Array of objects (BestProductPriceItem) |
cart_params | object Supply optional parameters, such as orderData and source |
lineItemIdType required | string Value: "sku" |
object (TaggedCustomer) |
Responses
Request samples
- Payload
{- "lineItemIdType": "sku",
- "items": [
- {
- "price": 0,
- "id": "number",
- "quantity": 0
}
], - "cart_params": { },
- "customer": {
- "tags": "string",
- "shipping": {
- "postal_code": "string",
- "country": "string",
- "country_code": "string",
- "province": "string",
- "province_code": "string"
}
}
}
Response samples
- 200
- 500
{- "pre_best_price_log_id": "string",
- "actions": [
- {
- "type": "BEST_ITEM_PRICE",
- "sku": "string",
- "variant_id": "string",
- "value": 0,
- "rule": [
- {
- "id": 0,
- "rule_set_id": 0,
- "rule_set_eid": "string",
- "type": "DISCOUNT",
- "eid": "string",
- "rule_set_public_message": "string"
}
]
}
]
}
Get Currency Symbol for Currency Code
Get Currency information from a currency code (ie. USD, CAD, GDP). Can be obtained through: https://www.iban.com/currency-codes
Authorizations:
path Parameters
currency_name required | string Currency Code (ie. USD, CAD, GDP). Can be optained through: https://www.iban.com/currency-codes |
Responses
Response samples
- 200
{- "id": 181,
- "currency_iso_name": "CAD",
- "friendly_name": "Canadian Dollar",
- "currency_symbol": "$",
- "money_format": "${{amount}}",
- "money_with_currency_format": "${{amount}} CAD"
}
Get Best Price for Cart
Return final price for lineItem in a cart. This requires no special permissions.
Authorizations:
path Parameters
shop_identifier required | string Bold platform identifier for the shop. Find this identifier using the Get Shop Info endpoint. |
Request Body schema: application/json
required | Array of objects (LineItem) |
lineItemIdType required | string Value: "sku" |
object (TaggedCustomer) |
Responses
Request samples
- Payload
{- "lineItems": [
- {
- "key": "uniquekey1",
- "price": 12,
- "id": "123",
- "quantity": 2
}, - {
- "key": "uniquekey2",
- "price": 15,
- "id": "223",
- "quantity": 1
}
], - "lineItemIdType": "sku",
}
Response samples
- 200
- 500
{- "pre_checkout_id": "POS_123",
- "actions": [
- {
- "line_item_key": "uniquekey1",
- "value": 10,
- "sku": "123",
- "variant_id": 49702426812601,
- "rule": [
- {
- "id": 1593607,
- "eid": "rule_id",
- "rule_set_id": 101480,
- "rule_set_eid": "ruleset_eid",
- "rule_set_public_message": "",
- "type": "DISCOUNT"
}
]
}, - {
- "line_item_key": "uniquekey2",
- "value": 12,
- "sku": "223",
- "variant_id": 29702426812602,
- "rule": [
- {
- "id": 5593607,
- "eid": "rule_id_2",
- "rule_set_id": 601480,
- "rule_set_eid": "ruleset_eid_2",
- "rule_set_public_message": "A public message",
- "type": "DISCOUNT"
}
]
}
]
}
Simple Communication Test
Test endpoint to ensure that the request contains a valid token and that it is successfully reaching Price Rules API. This requires no special permissions.
Authorizations:
Responses
Response samples
- 200
- 401
{- "message": "Successfully reached Price Rules API",
- "data": {
- "hello": "world!"
}
}