Tax Rates
Tax rates are used to specify taxes that will be used when creating invoices. By default, ActiveCollab ships an example tax rate:
Response:
1 2 3 4 5 6 7 8 9 10
[ { "id": 1, "class": "TaxRate", "url_path": "\/tax-rates\/1", "name": "VAT", "percentage": 17.5, "is_default": false } ]
The rate is not good, so we'll adjust it:
Payload:
1 2 3
{ "percentage": 22 }
Response:
1 2 3 4 5 6 7 8 9 10
{ "single": { "id": 1, "class": "TaxRate", "url_path": "\/tax-rates\/1", "name": "VAT", "percentage": 22, "is_default": false } }
Lets add two more tax rates:
Payload:
1 2 3 4
{ "name": "ADD1", "percentage": 5 }
Response:
1 2 3 4 5 6 7 8 9 10
{ "single": { "id": 2, "class": "TaxRate", "url_path": "\/tax-rates\/2", "name": "ADD1", "percentage": 5, "is_default": false } }
Payload:
1 2 3 4
{ "name": "ADD2", "percentage": 4.5 }
Response:
1 2 3 4 5 6 7 8 9 10
{ "single": { "id": 3, "class": "TaxRate", "url_path": "\/tax-rates\/3", "name": "ADD2", "percentage": 4.5, "is_default": false } }
Now we'll create a new invoice and use VAT
, to demonstrate that used tax rates can't be updated or deleted:
Payload:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
{ "company_id": 0, "company_name": "Client Company GmbH", "company_address": "Street Name 12\nCity", "number": "1\/2014", "items": [ { "description": "First item", "quantity": 100, "unit_cost": 25 }, { "description": "Second item", "quantity": 250, "unit_cost": 13, "first_tax_rate_id": 2 }, { "description": "Third item", "quantity": 15, "unit_cost": 25 } ] }
Response:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139
{ "single": { "id": 1, "class": "Invoice", "url_path": "\/invoices\/1", "is_trashed": false, "trashed_on": null, "trashed_by_id": 0, "company_id": 0, "company_name": "Client Company GmbH", "company_address": "Street Name 12\nCity", "note": null, "currency_id": 0, "language_id": 0, "discount_rate": 0, "subtotal": 6125, "subtotal_without_discount": 6125, "discount": 0, "tax": 162.5, "rounding_difference": 0, "rounded_total": 6287.5, "total": 6287.5, "paid_amount": 0, "balance_due": 6287.5, "recipients": null, "email_from": null, "email_subject": null, "email_body": null, "second_tax_is_enabled": false, "second_tax_is_compound": false, "created_on": 1430164798, "created_by_id": 1, "updated_on": 1430164798, "based_on_type": null, "based_on_id": null, "number": "1\/2014", "project_id": 0, "purchase_order_number": null, "issued_on": 1430164798, "due_on": 1430164798, "allow_payments": 1, "closed_on": null, "sent_on": null, "hash": "rbnsriC1o15Y9VcXy1HuNUKdWkEi7IPnJ4F2a8Qo", "status": "issued", "public_url": "http:\/\/feather.dev\/s\/invoice?hash=rbnsriC1o15Y9VcXy1HuNUKdWkEi7IPnJ4F2a8Qo&number=1%2F2014", "is_credit_invoice": false }, "reminders": [], "items": [ { "id": 1, "class": "InvoiceItem", "url_path": "\/invoice-items\/1", "parent_type": "Invoice", "parent_id": 1, "discount_rate": 0, "description": "First item", "quantity": 100, "unit_cost": 25, "first_tax_rate_id": 0, "first_tax_value": 0, "first_tax_name": "", "first_tax_rate": 0, "second_tax_rate_id": 0, "second_tax_value": 0, "second_tax_name": "", "second_tax_rate": 0, "second_tax_is_enabled": false, "second_tax_is_compound": false, "subtotal": 2500, "subtotal_without_discount": 2500, "discount": 0, "total": 2500, "position": 1, "time_record_ids": [], "expense_ids": [] }, { "id": 2, "class": "InvoiceItem", "url_path": "\/invoice-items\/2", "parent_type": "Invoice", "parent_id": 1, "discount_rate": 0, "description": "Second item", "quantity": 250, "unit_cost": 13, "first_tax_rate_id": 2, "first_tax_value": 162.5, "first_tax_name": "ADD1", "first_tax_rate": 5, "second_tax_rate_id": 0, "second_tax_value": 0, "second_tax_name": "", "second_tax_rate": 0, "second_tax_is_enabled": false, "second_tax_is_compound": false, "subtotal": 3250, "subtotal_without_discount": 3250, "discount": 0, "total": 3412.5, "position": 2, "time_record_ids": [], "expense_ids": [] }, { "id": 3, "class": "InvoiceItem", "url_path": "\/invoice-items\/3", "parent_type": "Invoice", "parent_id": 1, "discount_rate": 0, "description": "Third item", "quantity": 15, "unit_cost": 25, "first_tax_rate_id": 0, "first_tax_value": 0, "first_tax_name": "", "first_tax_rate": 0, "second_tax_rate_id": 0, "second_tax_value": 0, "second_tax_name": "", "second_tax_rate": 0, "second_tax_is_enabled": false, "second_tax_is_compound": false, "subtotal": 375, "subtotal_without_discount": 375, "discount": 0, "total": 375, "position": 3, "time_record_ids": [], "expense_ids": [] } ], "time_records": [], "expenses": [], "payments": [] }
Note that rate of a tax that is already used in an invoice can't be changed:
Payload:
1 2 3
{ "percentage": 18 }
Response:
1 2 3 4 5 6 7 8 9 10
{ "single": { "id": 2, "class": "TaxRate", "url_path": "\/tax-rates\/2", "name": "ADD1", "percentage": 5, "is_default": false } }
ActiveCollab will not throw an error, but it will ignore the change. We recommend that you add a new tax record.
Default Tax Rate #
ActiveCollab lets you set up a tax rate that will be set as invoice it's tax rate by default. This feature is off by default:
Payload:
1 2 3
{ "tax_rate_id": 1 }
Response:
1 2 3 4 5 6 7 8 9 10
{ "single": { "id": 1, "class": "TaxRate", "url_path": "\/tax-rates\/1", "name": "VAT", "percentage": 22, "is_default": true } }
To unset default tax rate, simply send DELETE request:
Deleting a Tax Rate #
To delete a tax rate, send DELETE command to /tax-rates/:tax_rate_id. Note that default tax rate can't be deleted:
Payload:
1 2 3
{ "tax_rate_id": 1 }
Response:
1 2 3 4 5 6 7 8 9 10
{ "single": { "id": 1, "class": "TaxRate", "url_path": "\/tax-rates\/1", "name": "VAT", "percentage": 22, "is_default": true } }
Tax rates that are used in invoices can't be deleted:
Unused tax rates can be deleted: