Manage price lists

Price books let you set prices that differ from those entered on the product records (e.g. a price list for business customers) and manage quantity-based discounts.


1/ Installation

In the Apps section of your account, install the 'Price book' app (Premium option required).

Create a price book by giving it a name and choosing whether its rules will be set at the product level or the product group level (product tags).
Working at the product group level lets you apply the same price to every product grouped under the same tag.

Click the 'Show' button on the row of the price book you created.

Add your products (or product tags) with your specific prices.
For products, enter the product ID and its variant ID (if it has one, otherwise leave it empty).
For products with variants, you can enter 0 as the variant ID to set a generic price rule for the product, whatever the variant (if a rule exists for a specific variant, it takes precedence).
The quantity field sets the minimum quantity from which the price book price applies (1 by default).
If several rules exist for the same product (same tag), the rule with the highest quantity applies.

Go back to the main table listing your price books and click the 'Enable' button to activate the price book you configured.

You can import a price book from a .CSV file with 4 columns: product ID, variant ID, selling price and quantity.


2/ Usage

Create a sale and add the products the customer is buying.

At the top right of the sale, an 'Action' drop-down lets you choose the price book to apply.

When you select your price book, the prices of the products in the sale that are covered by the price book are updated.
The prices of the other products remain unchanged.


3/ API

Your price books are available through an API, for example to sync them from an ERP or an e-commerce website.

API address: https://pricebook.hiboutik.net/api/v2

Authentication

Reading: public, by adding the account parameter with your account name (e.g. ?account=mycompany). Price books contain no confidential data.

Creating, updating and deleting: a token is required.
To get one, click 'Generate a token' in the 'API access' section, below the app's main table.
The token is shown only once: copy it right away and keep it somewhere safe.
If it is lost or compromised, click 'Regenerate' (the old token stops working immediately) or 'Revoke'.

Send the token in the Authorization HTTP header:

Authorization: Bearer pbk_xxxxxxxx…

If a proxy strips the Authorization header, the X-Api-Token: pbk_xxxxxxxx… header is also accepted.
The token must never be passed in the URL.

With a token, the account is identified automatically: the account parameter is not needed.

To check your token:

curl -H "Authorization: Bearer pbk_xxxxxxxx…" https://pricebook.hiboutik.net/api/v2/

The response shows the authenticated account (authenticated_account).

Security: never use the token in code that runs in a browser (website JavaScript). It must stay on the server side.

Response format

All responses are JSON (UTF-8).
On success, the result is in data:

{ "data": { "id": 12, "label": "Wholesale", "type": "products", "active": true, "rules_count": 340 } }

On error, an error object gives a code, a message and, for validation errors, details for each field:

{ "error": { "code": "validation_failed", "message": "Données invalides.",
             "details": [ { "field": "rules[2].price", "message": "Prix numérique >= 0 requis." } ] } }

Base your processing on the code field, which never changes. The message field is for information only and is currently in French.

Price book types and rules

A price book is either of type products (rules per product and variant) or tags (rules per product tag).

A rule contains:

  • prod_id: product ID (products price books) or tag_id: product tag ID (tags price books)
  • size_id: variant ID, products price books only. 0 or missing = rule valid for all variants
  • qtity: minimum quantity from which the price applies (1 by default)
  • price: selling price. Accepted formats: 12.5, "12,50", "1 234,50 €"

Rules apply exactly as in the app: the rule with the highest quantity that is less than or equal to the quantity sold wins, and for a products price book, a rule for the exact variant takes precedence over the generic rule (variant 0).
For a tags price book, the quantity is the total of all sale lines carrying the tag.

List your price books

GET /pricebooks?account=mycompany

{ "data": [ { "id": 12, "label": "Wholesale", "type": "products", "active": true, "rules_count": 340 } ] }
Create a price book

POST /pricebooks (token required): 201 response

Fields: label (required, 255 characters max), type (products by default, or tags), rules (optional).

curl -X POST https://pricebook.hiboutik.net/api/v2/pricebooks \
  -H "Authorization: Bearer pbk_xxxxxxxx…" \
  -H "Content-Type: application/json" \
  -d '{
    "label": "Wholesale 2027",
    "type": "products",
    "rules": [
      { "prod_id": 12, "price": 10.50 },
      { "prod_id": 12, "qtity": 10, "price": 9.00 },
      { "prod_id": 12, "size_id": 3, "price": 11.00 }
    ]
  }'

Price books created through the API are inactive: activate them from the app with the 'Enable' button.

View a price book

GET /pricebooks/{id}?account=mycompany

Rename a price book

PATCH /pricebooks/{id} (token required)

{ "label": "New name" }

A price book's type cannot be changed.

Delete a price book

DELETE /pricebooks/{id} (token required): 204 response, all the price book's rules are deleted.
An active price book cannot be deleted through the API (409 error): disable it in the app first.

View a price book's rules

GET /pricebooks/{id}/rules?account=mycompany&limit=1000&offset=0

Rules are paginated: limit defaults to 1000 (5000 max), offset sets the starting position.

{ "data": [ { "prod_id": 12, "size_id": 0, "qtity": 1, "price": 10.5 } ],
  "pagination": { "total": 340, "limit": 1000, "offset": 0 } }
Add or update rules

POST /pricebooks/{id}/rules (token required)

{ "rules": [ { "prod_id": 12, "price": 10.90 }, { "prod_id": 15, "price": 4.20 } ] }

Rules not yet in the price book are added, the price of existing rules (same product, variant and quantity) is updated, other rules are left unchanged.

{ "data": { "created": 1, "updated": 1 } }
Replace all rules

PUT /pricebooks/{id}/rules (token required), same format as above.

All existing rules are deleted and replaced with the ones sent. Ideal for a full sync from another system.

{ "data": { "deleted": 340, "created": 352 } }
Delete rules

DELETE /pricebooks/{id}/rules?prod_id=12&size_id=3&qtity=10 (token required)

prod_id (or tag_id for a tags price book) is required. size_id and qtity are optional: if omitted, all matching rules are deleted (for example, without qtity, every quantity tier).

{ "data": { "deleted": 2 } }
Calculate a price

GET /pricebooks/{id}/price?account=mycompany&prod_id=12&size_id=3&qtity=15

Returns the price that would be applied at checkout, along with the rule used:

{ "data": { "price": 9.0, "rule": { "prod_id": 12, "size_id": 0, "qtity": 10, "price": 9.0 } } }

For a tags price book, use tag_id instead of prod_id. If no rule applies, the API returns 404 (no_matching_rule).

Limits
  • 5000 rules max per request and 2 MB max per request. Beyond that, send several POST /pricebooks/{id}/rules requests.
  • A request containing an error saves nothing: all data is checked before anything is saved.
  • If the same rule appears several times in one request, the last occurrence is kept.
  • Read responses may be cached for up to 30 seconds.
Error codes
  • 400 missing_account, invalid_account, invalid_json, invalid_parameter: malformed request
  • 401 unauthorized: token missing (for a write), invalid or revoked
  • 403 forbidden: the account parameter does not match the token's account
  • 404 pricebook_not_found, no_matching_rule, not_found: price book, rule or address not found
  • 405 method_not_allowed: method not allowed (see the Allow header)
  • 409 pricebook_active: attempt to delete an active price book
  • 413 payload_too_large: request larger than 2 MB
  • 422 validation_failed: invalid data, details in error.details
  • 500 internal_error, 503 service_unavailable: service error, try again later
Previous API

The previous address https://pricebook.hiboutik.net/api/?account=mycompany is still available in read-only mode, but we recommend using API v2.

Send us a message

Contact us
  • 🇫🇷 +33 (0)1 48 78 40 06
  • 🇨🇭 +41 (0)21 519 00 17
  • 🇧🇪 +32 (0)2 318 82 77
  • 🇪🇸 +34 (0)912 69 39 94