Taxes API

API Taxes

Core principles

This object represents a tax applicable to your transactions. Use it to define and manage taxes to apply to products or services in your system.

Scopes

taxes.read taxes.write

Create a tax

Allows you to create a tax in your system. Requires scope taxes.write.

POST https://api.smartbills.io/v1/taxes

Request

Request Body

You must provide a request body of type TaxCreateRequest.

ParameterDescriptionTypeRequired
nameName of the taxstringrequired
rateTax rate in percentagedecimalrequired
descriptionDescription of the taxstringoptional

Response

Response Body

SBTax

HTTP Status Codes

CodeDescription
201The tax was successfully created
400The request sent is not valid

Code example

import { SBClient, SBTax, TaxCreateRequest } from "@smartbills/sdk"
 
const client = new SBClient();
const request = {
  "name": "VAT",
  "rate": 15.0,
  "description": "Value Added Tax"
};
 
const tax = await client.taxes.create(request);

Retrieve a tax

Retrieve information about a tax in the system. Requires scope taxes.read.

GET https://api.smartbills.io/v1/taxes/:id

Path Parameter

ParameterDescriptionTypeRequired
idUnique identifier of the taxlongrequired

Response

SBTax

Code example

import { SBClient, SBTax } from "@smartbills/sdk"
 
const client = new SBClient();
const tax = await client.taxes.getByIdAsync(1);

Retrieve a list of taxes

Retrieve a list of taxes registered in the system. Requires scope taxes.read.

GET https://api.smartbills.io/v1/taxes

Query Parameters

SBListRequest

ParameterDescriptionTypeRequired
pagePage numberlongrequired
pageSizeNumber of records to returnlongrequired

Response

SBTax

Code example

import { SBClient, SBTax, SBList, SBListRequest } from "@smartbills/sdk"
 
const client = new SBClient();
const request = {
  "page": 1,
  "pageSize": 100
};
 
const taxes = await client.taxes.list(request);

Update a tax

Allows you to update information about a tax in the system. Requires scope taxes.write.

PUT https://api.smartbills.io/v1/taxes/:id

Path Parameter

ParameterDescriptionTypeRequired
idUnique identifier of the taxlongrequired

Request Body

You must provide a request body of type TaxUpdateRequest.

ParameterDescriptionTypeRequired
nameName of the taxstringrequired
rateTax rate in percentagedecimalrequired
descriptionDescription of the taxstringoptional

Response

HTTP Status Codes

CodeDescription
200The tax was successfully updated
400The request sent is not valid
404No tax was found

SBTax

Code example

import { SBClient, SBTax, TaxUpdateRequest } from "@smartbills/sdk"
 
const client = new SBClient();
const request = {
  "name": "VAT Updated",
  "rate": 20.0,
  "description": "Updated Value Added Tax"
};
 
const tax = await client.taxes.updateAsync(1, request);

Delete a tax

Allows you to delete a tax in the system. Requires scope taxes.write.

DELETE https://api.smartbills.io/v1/taxes/:id

Path Parameter

ParameterDescriptionTypeRequired
idUnique identifier of the taxlongrequired

Response

HTTP Status Codes

CodeDescription
200The tax was successfully deleted
404No tax was found

Code example

import { SBClient, SBTax } from "@smartbills/sdk"
 
const client = new SBClient();
const tax = await client.taxes.deleteAsync(1);