added
API - Price and Tax Breakdown fields
over 2 years ago by Daniel Oakley
Executive Summary
This API change adds fields that let your software see how prices are calculated and the applied taxes. This lets integrations present the price by line item.
We've added the price_breakdown
and tax_breakdown
fields. These let you see the line items for quote and order prices, and see which taxes are applied to the price.
Changes
- The Get products endpoint returns these fields under each quote.
- The Get a quote endpoint returns these fields.
- The Create and View an Order endpoints return these fields.
Also:
- The Return an order and View a return order endpoints do not return these fields.
The new fields
price_breakdown
: Explains the components of the price. We may change elements underneath if different line items are used in future. This equals thegross
cost we currently return.base
: The base price for the order/quote.discount
: Any discounts applied to the price.cover
: Any cover price applied.fuel_surcharge
: Any fuel surcharge applied to the price.base_tax
: Tax that applies to the base price.discount_tax
: Tax that applies to any discounts.cover_tax
: Tax that applies to any cover.fuel_surcharge_tax
: Tax that applies to the fuel surcharge.
tax_breakdown
: Explains the taxes applicable to this price, and that we have charged. This equals thetax
cost we currently return.<tax-name>
: This tax's name.amount
: The cost of this tax on this order/quote.currency
: Currency of the above amount. For example,AUD
for Australian Dollars andUSD
for United States Dollars.rate
: The rate of this tax. For example, a 10% tax returns0.1
for this field.
Taxes
gst
: The Australian Goods and Services Tax.
Examples
Get Products / Quote response
[
{
"quote": {
"gross": {
"amount": 8.47,
"currency": "AUD"
},
"net": {
"amount": 7.70,
"currency": "AUD"
},
"tax": {
"amount": 0.77,
"currency": "AUD"
}
},
"price_breakdown": {
"base": {
"amount": 15.00,
"currency": "AUD"
},
"discount": {
"amount": -7.50,
"currency": "AUD"
},
"cover": {
"amount": 0.0,
"currency": "AUD"
},
"fuel_surcharge": {
"amount": 0.20,
"currency": "AUD"
},
"base_tax": {
"amount": 1.50,
"currency": "AUD"
},
"discount_tax": {
"amount": -0.75,
"currency": "AUD"
},
"cover_tax": {
"amount": 0.0,
"currency": "AUD"
},
"fuel_surcharge_tax": {
"amount": 0.02,
"currency": "AUD"
}
},
"tax_breakdown": {
"gst": {
"amount": 0.77,
"currency": "AUD",
"rate": 0.1
}
},
...
"product": {
"atl_only": false,
"code": "STANDARD-PICKUP",
"name": "Standard Pickup",
"first_mile_option": "pickup",
"service": "standard"
}
}
]
Create / View an Order response
{
"order_id": "f5233746-71d4-4b05-bf63-56f4abaed5f6",
"state": "Pickup",
"order_url": "https://api.sendle.com/api/orders/f5233746-71d4-4b05-bf63-56f4abaed5f6",
"sendle_reference": "SNFJJ3",
...
"price": {
"tax": {
"currency": "AUD",
"amount": 1.02
},
"net": {
"currency": "AUD",
"amount": 10.23
},
"gross": {
"currency": "AUD",
"amount": 11.25
}
},
"price_breakdown": {
"base": {
"amount": 10.23,
"currency": "AUD"
},
"discount": {
"amount": 0.0,
"currency": "AUD"
},
"cover": {
"amount": 0.0,
"currency": "AUD"
},
"fuel_surcharge": {
"amount": 0.0,
"currency": "AUD"
},
"base_tax": {
"amount": 1.02,
"currency": "AUD"
},
"discount_tax": {
"amount": 0.0,
"currency": "AUD"
},
"cover_tax": {
"amount": 0.0,
"currency": "AUD"
},
"fuel_surcharge_tax": {
"amount": 0.0,
"currency": "AUD"
}
},
"tax_breakdown": {
"gst": {
"amount": 1.02,
"currency": "AUD",
"rate": 0.1
}
}
}