Orders are built from products, so set up what you sell first.
Endpoints: Products · Taxes · Discounts · Fees · Groups · Units
Steps
- Optional: create groups and units to organise products:
POST /product_groups,POST /product_units. - Create the taxes, discounts and fees you'll use:
POST /product_taxes,POST /product_discounts,POST /product_fees. - Optional: preview a product's totals before saving it:
POST /products/calculate. - Create each product:
POST /products. Set its type, price and currency, and attach a tax, fee or discount by ID.
flowchart LR GU["Groups & units (optional)"] --> Product TDF["Taxes, discounts & fees"] --> Product Product["Product POST /products"] --> Line["Used on order lines"]
Payment schedule
Instalment and subscription products set how often the customer is charged. There are two ways to say it:
collection_interval: a preset, such asMONTHorQUARTER. Send it on its own. BillPro fills in the other two fields.scheduled_interval+scheduled_duration_unit: a number and a unit, such as3+MONTHfor every 3 months. Send them only withcollection_interval: CUSTOM, for a schedule the presets don't cover.
Orders only use the number and unit. They don't take collection_interval, and they don't copy the product's schedule. When you create an order, send the pair that matches the product:
collection_interval | scheduled_interval | scheduled_duration_unit |
|---|---|---|
WEEK | 1 | WEEK |
FORTNIGHT | 2 | WEEK |
28DAYS | 28 | DAY |
MONTH | 1 | MONTH |
QUARTER | 3 | MONTH |
YEAR | 1 | YEAR |
CUSTOM | the product's scheduled_interval | the product's scheduled_duration_unit |
scheduled_duration_number is separate: it's how many payments an instalment plan has, not how often they happen.
Good to know
- A product's type sets how it's paid:
single_payment,instalment,subscriptionormetered. - Tax is included in the price, not added on top.
- Only fixed-amount fees are supported right now.
- To stop selling a product, set its
product_statustoinactive. It stays on existing orders.
Next
Continue to 3 · Create customers & orders.