added

API - Price and Tax Breakdown fields

📘

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

Also:

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 the gross 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 the tax 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 and USD for United States Dollars.
      • rate: The rate of this tax. For example, a 10% tax returns 0.1 for this field.

Taxes

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
      }
  }
}