Tax Object

Taxes for both the entire receipt and individual items are stored as Tax objects, with the following keys:

Name

Type

Description

name

string, required

the tax type name

rate

float, optional

the tax rate, in percent

amount

float, required

the amount of tax at this rate

code

string, optional

the tax code

properties

Tax Properties Object, optional

see Tax Properties Object

The Tax object is used the same in both the receipt object and in the item object. A receipt or receipt item contains a taxes property and is always a list of tax objects. Each tax object describes a specific tax at a specific rate with a specific tax name. Think of the tax name as the tax type.

Tax name should have consistent formatting to prevent confusion and alternate names for the same tax type. This is important when querying or totalling the taxes. Names should follow this pattern [a-z0-9_]+. It is recommended that tax name be lower case and contain no elaborate symbol use. A good example for a tax name is ‘vat’ or ‘sales_tax’.

Notes

  • A rate of zero is a valid rate (for zero rated items), when the rate is unknown the value null is used

  • An amount of zero is a valid value if, for example, the rate is zero, the amount will always be zero

  • A code can be defined for each tax instance representing a code found in a receipt.