List price rules
const url = 'https://example.com/price-rules?audience=consumer&customerId=019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f&rateSetId=019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f&productId=019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f';const options = { method: 'GET', headers: {cookie: 'bottle.session_token=<bottle.session_token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://example.com/price-rules?audience=consumer&customerId=019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f&rateSetId=019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f&productId=019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f' \ --cookie bottle.session_token=<bottle.session_token>Every rule, oldest first, narrowed by audience, customerId, rateSetId or productId. productId gives every rule that could cover that product: its own, its gas type’s, its shop categories’ and those for everything. Who pays what, in order: a rule for that customer (off their agreed rate where there is one), then the rate agreed with them, then their rate set’s rules and prices, then trade or consumer rules, then the trade or consumer price. Within a level the most specific rule applies; between two equally specific, the cheaper for the customer.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”Consumer: everybody who is not a trade customer, signed in or not. trade: trade customers. rate_set: the members of one rate set, named by rateSetId. customer: one customer, named by customerId.
Consumer: everybody who is not a trade customer, signed in or not. trade: trade customers. rate_set: the members of one rate set, named by rateSetId. customer: one customer, named by customerId.
UUID v7
Example
019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8fUUID v7
UUID v7
Example
019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8fUUID v7
Rules that could apply to this product: its own, its gas type, its categories and everything.
Example
019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8fRules that could apply to this product: its own, its gas type, its categories and everything.
Responses
Section titled “Responses”The rules
object
object
Consumer: everybody who is not a trade customer, signed in or not. trade: trade customers. rate_set: the members of one rate set, named by rateSetId. customer: one customer, named by customerId.
UUID v7
UUID v7
What the rule covers: one product (productId), every size of a gas type (gasTypeId), a shop category (categoryId), or everything sold. Never deposits, rent or delivery.
UUID v7
UUID v7
UUID v7
Stepped: each step prices only the units within it (“first 5 at £38, next 5 at £36, then £34.20”). bulk: the highest step reached prices every unit (“10 or more and all of them are £34.20”).
UUID v7
Example
{ "items": [ { "audience": "consumer", "customerId": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f", "rateSetId": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f", "scope": "product", "productId": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f", "gasTypeId": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f", "categoryId": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f", "counting": "stepped", "steps": [ { "kind": "percent_off" } ], "id": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f" } ]}Not signed in
object
Example
{ "error": "not_found", "message": "Customer not found"}Not a member, or without the permission this needs
object
Example
{ "error": "not_found", "message": "Customer not found"}Validation failed
object
object
Example
{ "error": "validation", "issues": [ { "path": "email", "message": "Invalid email" } ]}