Skip to content

Taxes

POST /taxes/

Creates a tax rate

Required scopes: tax_types

param type required sample value description
name string true "19 %" Tax name.
tax_rate decimal true 19 Has to be unique.

Required headers: 'Content-Type: application/json'

Request

curl -X POST \
  https://app.inventorum.com/api/taxes/ \
  -H 'Authorization: Bearer  {{oauth_token}}' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "14%",
    "tax_rate": 14.00
}'

Response

[
    {
        "id": 57374,
        "name": "14%",
        "tax_rate": "14.0"
    }
]

Error

{
    "detail": "Serialization error",
    "error": {
        "fields": {
            "tax_rate": [
                "Tax rate already exists"
            ]
        },
        "description": "Serialization error",
        "key": "common.serializer_error"
    }
}

GET /taxes/

Returns list of tax rates

Required scopes: tax_types

Request

curl -X GET \
  https://app.inventorum.com/api/taxes/ \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer  {{oauth_token}}' \

Response

[
    {
        "id": 57374,
        "name": "Test 98%",
        "tax_rate": "98.000"
    },
    ...
]

GET /taxes/tax_id/

Returns details of a tax rate

Required scopes: tax_types

Request

curl -X GET \
  https://app.inventorum.com/api/taxes/57374/ \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer  {{oauth_token}}' \

Response

{
    "id": 57374,
    "name": "Test 98%",
    "tax_rate": "98.000"
}

Error

Status 404 Not found
{
    "error": {
        "fields": {},
        "description": null,
        "key": "common.unknown"
    }
}

PUT /taxes/tax_id/

Updates a tax rate

Important

User should NOT change tax rate. Associated products gross price will NOT be updated automatically.

Required scopes: tax_types

param type required sample value description
name string true "19 %" Tax name.
tax_rate decimal true 19 Has to be unique.

Required headers: 'Content-Type: application/json'

Request

curl -X PUT \
  https://app.inventorum.com/api/taxes/59978/ \
  -H 'Authorization: Bearer  {{oauth_token}}' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "newname",
    "tax_rate": "95.00"
}'

Response

{
    "id": 59978,
    "name": "newname",
    "tax_rate": "95.000"
}

Error

400 Bad request
{
    "detail": "Serialization error",
    "error": {
        "fields": {
            "tax_rate": [
                "Tax rate already exists"
            ]
        },
        "description": "Serialization error",
        "key": "common.serializer_error"
    }
}

DELETE /taxes/tax_id/

Deletes a tax rate.

Important

Products will automatically get reassigned to "new tax" provided in body. So using this method requires user to provide the new tax rate ID.
Same attention here: gross price will not be update but the net.

Required scopes: tax_types

param type required sample value description
new_tax integer true 5166 ID of a tax rate where products from deleted tax rate will be reassigned.

Request

curl -X DELETE \
  https://app.inventorum.com/api/taxes/59342/ \
  -H 'Authorization: Bearer  {{oauth_token}}' \
  -H 'Content-Type: application/json' \
  -d '{
    "new_tax": 57494
}'

Response

Status 200 OK

error

Status 400 Bad Request
{
    "error": {
        "fields": {
            "new_tax": [
                "This field is required."
            ]
        },
        "description": "Serialization error",
        "key": "common.serializer_error"
    }
}