Skip to main content
Webhooks let your external systems react as soon as an event happens in Bonx, such as an order moving to a new step or a lot being created. Instead of polling the API, you get notified the moment the event occurs. You register a callback URL for the events you care about. Bonx sends a POST request describing the event each time it happens.
Webhooks cover outbound automations, when Bonx notifies your tools. To drive Bonx from your tools, use the API reference.

Discounts in a sales order payload

A sales order line can carry several discounts in a row, its discountTiers. Each tier gives its type (PERCENTAGE in base 1, or AMOUNT), its value, its label and its reasonCode. Tiers with the same cascadeIndex form a cascade: each one applies to what the previous position left. Each cascade starts again from the gross, and the cascades add up.
  • On a line with tiers, discountType is AMOUNT and discountValue is the total of its tiers: gross minus net. It is a summary, not a discount entered as an amount. totalPriceBeforeTax stays the net of the line. When the gross of the line is negative, the pair is null: read discountTiers to know whether the line has tiers.
  • An order discount with tiers comes in documentDiscountTiers. The order’s own discountType and discountValue are then null. Its cascades apply to the sum of the line nets and give the order total before tax.