NAV Navbar
cURL .NET Java Go PHP Python Ruby

Tax Rates

A tax rate describes a tax that customers should be charged. Tax rates can be applied to invoices, line items, and subscriptions.

Tax Rate Object

Attributes

{
    "created_at": 1477418268,
    "currency": null,
    "id": "vat",
    "inclusive": false,
    "is_percent": true,
    "metadata": [],
    "name": "VAT",
    "object": "tax_rate",
    "updated_at": 1477418268,
    "value": 5
}
Parameter Type Description
id string The tax rate's unique ID
object string Object type, tax_rate
name string Tax rate name
currency string 3-letter ISO code
value number Amount
inclusive boolean When true, pricing is calculated as tax-inclusive
is_percent boolean When true the value is a %
created_at timestamp Timestamp when created
updated_at timestamp Timestamp when updated
metadata object A hash of key/value pairs that can store additional information about this object.

Create a tax rate

curl "https://api.invoiced.com/tax_rates" \
  -u {API_KEY}: \
  -d id="vat" \
  -d name="VAT" \
  -d value=5 \
invoiced.TaxRate.create(
  :id => "vat",
  :name => "VAT",
  :value => 5
)
<?php

$invoiced->TaxRate->create([
  'id' => "vat",
  'name' => "VAT",
  'value' => 5
]);
client.TaxRate.create(
  id="vat",
  name="VAT",
  value=5,
)
TaxRate taxRate = invoiced.newTaxRate();
taxRate.id = "vat";
taxRate.name = "VAT";
taxRate.value = 5;
taxRate.create();
var taxRate = invoiced.NewTaxRate();
taxRate.Id = "vat";
taxRate.Name = "VAT";
taxRate.Value = 5;
taxRate.Create();
taxRate, err := client.TaxRate.Create(&invoiced.TaxRateRequest{
  Id: invoiced.String("vat"),
  Name: invoiced.String("VAT"),
  Value: invoiced.Float64(5),
})

The above command returns JSON structured like this:

{
    "created_at": 1477418268,
    "currency": null,
    "id": "vat",
    "inclusive": false,
    "is_percent": true,
    "metadata": [],
    "name": "VAT",
    "object": "tax_rate",
    "updated_at": 1477418268,
    "value": 5
}

Create a new tax rate with this endpoint.

HTTP Request

POST /tax_rates

Attributes

Parameter Type Description
id string The tax rate's unique ID. Auto-generated by default.
name string Tax rate name
currency string 3-letter ISO code
value number Amount
inclusive boolean When true, pricing is calculated as tax-inclusive
is_percent boolean When true the value is a %
metadata object A hash of key/value pairs that can store additional information about this object.

Retrieve a tax rate

curl "https://api.invoiced.com/tax_rates/:id" \
  -u {API_KEY}:
tax_rate = invoiced.TaxRate.retrieve("{TAX_RATE_ID}")
<?php

$taxRate = $invoiced->TaxRate->retrieve("{TAX_RATE_ID}");
tax_rate = client.TaxRate.retrieve("{TAX_RATE_ID}")
TaxRate taxRate = invoiced.newTaxRate().retrieve({TAX_RATE_ID});
var taxRate = invoiced.NewTaxRate().Retrieve({TAX_RATE_ID});
taxRate, err := client.TaxRate.Retrieve({TAX_RATE_ID})

The above command returns JSON structured like this:

{
    "created_at": 1477418268,
    "currency": null,
    "id": "vat",
    "inclusive": false,
    "is_percent": true,
    "metadata": [],
    "name": "VAT",
    "object": "tax_rate",
    "updated_at": 1477418268,
    "value": 5
}

This endpoint retrieves a specific tax rate.

HTTP Request

GET /tax_rates/:id

Update a tax rate

curl "https://api.invoiced.com/tax_rates/:id" \
  -u {API_KEY}: \
  -X PATCH \
  -d name="GST"
tax_rate.name = "GST"
tax_rate.save
<?php

$taxRate->name = "GST";
$taxRate->save();
tax_rate.name = "GST"
tax_rate.save()
taxRate.name = "GST";
taxRate.save();
taxRate.Name = "GST";
taxRate.SaveAll();
err := client.TaxRate.Update({TAX_RATE_ID}, &invoiced.TaxRateRequest{
  Name: invoiced.String("GST"),
})

The above command returns JSON structured like this:

{
    "created_at": 1477418268,
    "currency": null,
    "id": "vat",
    "inclusive": false,
    "is_percent": true,
    "metadata": [],
    "name": "GST",
    "object": "tax_rate",
    "updated_at": 1477418268,
    "value": 5
}

Use this endpoint to update a tax rate.

The properties that can be updated via this endpoint are limited. For other updates, it is necessary to delete and recreate the tax rate.

HTTP Request

PATCH /tax_rates/:id

Attributes

Parameter Type Description
name string Tax rate name
metadata object A hash of key/value pairs that can store additional information about this object.

Delete a tax rate

curl "https://api.invoiced.com/tax_rates/:id" \
  -u {API_KEY}: \
  -X DELETE
tax_rate.delete
<?php

$taxRate->delete();
tax_rate.delete()
taxRate.delete();
taxRate.Delete();
err := client.TaxRate.Delete({TAX_RATE_ID})

The above command returns 204 No Content

This endpoint deletes a specific tax rate.

HTTP Request

DELETE /tax_rates/:id

List all tax rates

curl "https://api.invoiced.com/tax_rates" \
  -u {API_KEY}:
tax_rates, metadata = invoiced.TaxRate.list(:per_page => 3)
<?php

list($taxRate, $metadata) = $invoiced->TaxRate->all(['per_page' => 3]);
tax_rates, metadata = client.TaxRate.list(per_page=3)
EntityList<TaxRate> taxRates = conn.newTaxRate().listAll();
var taxRates = invoiced.NewTaxRate().ListAll();
taxRates, err := client.TaxRate.ListAll(nil, nil)

The above command returns JSON structured like this:

[
  {
     "created_at": 1477418268,
     "currency": null,
     "id": "vat",
     "inclusive": false,
     "is_percent": true,
     "metadata": [],
     "name": "VAT",
     "object": "tax_rate",
     "updated_at": 1477418268,
     "value": 5
 }
]

This endpoint retrieves all tax rates.

HTTP Request

GET /tax_rates

Query Parameters

Parameter Description
sort string Column to sort by, i.e. name asc
filter object Filter object
updated_after timestamp Only gets records updated after the given timestamp