Edara API v3

Edara API v3: Taxes

Read the guide first: authentication, paging, errors, rate limits and the shared PagedResult, BatchResult and *Reference shapes.

Endpoints

GET /v3/taxes: Lists taxes.

Operation GetTaxes · permission read:tax

Query string: GetTaxesQuery

field type default validation description
offset int? 0 >= 0 Number of items to skip before returning results. Defaults to 0.
limit int? 100 1..1000 (out of range → 400) Maximum number of items to return. Defaults to 100, maximum 1000.
name string Must(name => !string.IsNullOrWhiteSpace(name)) .When(x => x.Name != null) The tax name filter.
rate decimal? GreaterThanOrEqualTo(0m) .When(x => x.Rate.HasValue) The tax rate filter.
scope TaxScope? Must(BeValidScope) .When(x => x.Scope.HasValue) The scope filter.

Responses: OK PagedResult<TaxResponse>: Paged list of taxes.

Notes


GET /v3/taxes/{id}: Gets a tax by id.

Operation GetTaxById · permission read:tax

Parameters

name in type default description
id route int The tax id.

Responses: OK TaxResponse: The tax.

Notes


POST /v3/taxes: Creates a tax.

Operation CreateTax · permission create:tax

Body: TaxUpsertRequest

field type default validation description
name string NotEmpty() The tax name.
rate decimal InclusiveBetween(0m, 100m) The tax rate percentage.
eInvoiceTaxTypeId int? GreaterThan(0) .When(x => x.EInvoiceTaxTypeId.HasValue) The e-invoice tax type identifier.
scope TaxScope? Must(BeValidPersistedScope) .When(x => x.Scope.HasValue) The tax scope.
salesAccountId int? GreaterThan(0) .When(x => x.SalesAccountId.HasValue) The sales account identifier.
salesWithholdingAccountId int? GreaterThan(0) .When(x => x.SalesWithholdingAccountId.HasValue) The sales withholding account identifier.
purchaseAccountId int? GreaterThan(0) .When(x => x.PurchaseAccountId.HasValue) The purchase account identifier.
active bool Whether the tax is active.
(object rule) RuleFor(x => x) .Must(HaveAtLeastOneAccount) .WithMessage("At least one tax account must be supplied.")

Responses: Created TaxResponse: Tax created.

Business errors (HTTP 409, match on errorCode):

Notes


PUT /v3/taxes/{id}: Updates a tax.

Operation UpdateTax · permission update:tax

Parameters

name in type default description
id route int The tax id.

Body: TaxUpsertRequest

field type default validation description
name string NotEmpty() The tax name.
rate decimal InclusiveBetween(0m, 100m) The tax rate percentage.
eInvoiceTaxTypeId int? GreaterThan(0) .When(x => x.EInvoiceTaxTypeId.HasValue) The e-invoice tax type identifier.
scope TaxScope? Must(BeValidPersistedScope) .When(x => x.Scope.HasValue) The tax scope.
salesAccountId int? GreaterThan(0) .When(x => x.SalesAccountId.HasValue) The sales account identifier.
salesWithholdingAccountId int? GreaterThan(0) .When(x => x.SalesWithholdingAccountId.HasValue) The sales withholding account identifier.
purchaseAccountId int? GreaterThan(0) .When(x => x.PurchaseAccountId.HasValue) The purchase account identifier.
active bool Whether the tax is active.
(object rule) RuleFor(x => x) .Must(HaveAtLeastOneAccount) .WithMessage("At least one tax account must be supplied.")

Responses: OK TaxResponse: The updated tax.

Business errors (HTTP 409, match on errorCode):

Notes


DELETE /v3/taxes/{id}: Deletes a tax.

Operation DeleteTax · permission delete:tax

Parameters

name in type default description
id route int The tax id.

Responses: NoContent: (not declared; read from the method body)

Business errors (HTTP 409, match on errorCode):

Notes


GET /v3/taxes/einvoice-tax-types: Lists e-invoice tax types.

Operation GetEInvoiceTaxTypes · permission read:tax

Query string: GetEInvoiceTaxTypesQuery

field type default validation description
country string NotEmpty() The country filter.

Responses: OK IReadOnlyCollection<EInvoiceTaxTypeResponse>: List of e-invoice tax types.

Notes

Types

AccountReference

Lightweight account reference (id + code + name).

field type description
id int The account id.
code string The account code.
name string The account name.

EInvoiceTaxTypeResponse

Response describing an e-invoice tax type.

field type description
id int The tax type identifier.
description string The tax type description.
type string The tax type.
code string The external-system code.
country string The country the tax type applies to.

TaxResponse

Response describing a tax.

field type description
id int The tax identifier.
name string The tax name.
rate decimal The tax rate percentage.
eInvoiceTaxTypeId int? The e-invoice tax type identifier.
scope TaxScope The tax scope.
salesAccount AccountReference The sales account reference.
salesWithholdingAccount AccountReference The sales withholding account reference.
purchaseAccount AccountReference The purchase account reference.
active bool Whether the tax is active.

TaxScope

Tax scopes exposed by the v3 API.

Values (sent/returned as the name): Any=0 (Any scope.), StockItem=1 (Stock items.), ServiceItem=2 (Service items.)