Money and rounding
Integer kopecks, hryvnia only
Section titled “Integer kopecks, hryvnia only”Every amount in the API, the order document, the subscribe button and the emails is an integer number of kopecks. 249000 is 2 490,00 ₴. There is one currency — UAH; there is no currency field.
Who computes what
Section titled “Who computes what”- The shop server names each line’s
price(before discount) inPOST /v1/shop/orders/create. The Neocarts catalogue holds no prices. - Neocarts computes each line’s
discounted_price,subtotal,totaland the ordertotals. Those numbers go to the payment provider. - The widget computes no money and always shows server amounts. The one exception is the price preview in the subscribe button and its modal, computed with the same formula.
Discount formula
Section titled “Discount formula”The discount discount_percent is an integer 0–100 from the shop settings (empty field = no discount). It is copied onto the order at creation and then onto the subscription; a later change to the setting does not touch open orders.
discounted_price = round(price × (100 − discount_percent) / 100)Rounding is to a whole kopeck per unit, halves rounded up. It applies to mode = subscription lines only; for one_time, discounted_price = price.
Example: 249000 at 7 % → 249000 × 93 / 100 = 231570 (2 315,70 ₴).
Example with rounding: 99999 at 7 % → 92999.07 → 92999.
Line and order totals
Section titled “Line and order totals”| Field | Formula |
|---|---|
items[].subtotal |
price × quantity |
items[].total |
discounted_price × quantity |
totals.items_total |
Σ subtotal |
totals.total |
Σ total — charged today |
totals.discount_total |
items_total − total |
The discount is rounded per unit and then multiplied by quantity, so discount_total can differ from “a percentage of the sum” by a few kopecks. That is expected — reconcile against the document fields instead of recomputing.
What total does not include
Section titled “What total does not include”Delivery cost. Neocarts does not know it and does not charge it; the shopper settles with the carrier on receipt.
Repricing subscriptions
Section titled “Repricing subscriptions”PUT /v1/shop/products/{external_id}/price changes price on subscriptions, and discounted_price is recomputed with the same formula using the percentage stored on each subscription. The new amount applies from the next charge; an order already issued and awaiting payment is not repriced — at the next charge attempt it is cancelled and a new one is created. Details in Billing.