Skip to main content
POST
/
api
/
v2
/
platform
/
tax_categories
Create a Tax Category
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    tax_category: {
      name: 'Clothing',
      is_default: true,
      tax_code: '1257L',
      description: 'Men\'s, women\'s and children\'s branded clothing'
    }
  })
};

fetch('http://{defaultHost}/api/v2/platform/tax_categories', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
{
  "data": {
    "id": "157",
    "type": "tax_category",
    "attributes": {
      "name": "TaxCategory - 646810",
      "description": "Facilis quis quos unde reiciendis.",
      "is_default": false,
      "deleted_at": null,
      "created_at": "2022-11-08T19:35:42.001Z",
      "updated_at": "2022-11-08T19:35:42.001Z",
      "tax_code": null
    },
    "relationships": {
      "tax_rates": {
        "data": []
      }
    }
  }
}

Documentation Index

Fetch the complete documentation index at: https://spreecommerce.org/docs/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

include
string

Select which associated resources you would like to fetch, see: https://jsonapi.org/format/#fetching-includes

Body

application/json
tax_category
object
required

Response

Record created

data
object
required