Tax Object¶
Taxes for both the entire receipt and individual items are stored as Tax objects, with the following keys:
Name |
Type |
Description |
---|---|---|
|
string, required |
the tax type name |
|
float, optional |
the tax rate, in percent |
|
float, required |
the amount of tax at this rate |
|
string, optional |
the tax code |
|
Tax Properties Object, optional |
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 valuenull
is usedAn
amount
of zero is a valid value if, for example, the rate is zero, the amount will always be zeroA
code
can be defined for each tax instance representing a code found in a receipt.