Skip to main content
POST
/
v1
/
categories
Create Category
curl --request POST \
  --url https://{cluster}.voucherify.io/v1/categories \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'X-App-Id: <api-key>' \
  --header 'X-App-Token: <api-key>' \
  --data '{
  "name": "Eighth",
  "hierarchy": 8
}'
{
"id": "cat_0b8b5a427a0283c854",
"name": "Eighth",
"hierarchy": 8,
"created_at": "2022-08-16T11:45:54.171Z",
"object": "category"
}

Authorizations

X-App-Id
string
header
required
X-App-Token
string
header
required
Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Body

application/json

Specify the details of the category that you would like to create.

Request body schema for POST v1/categories.

name
string
required

Category name.

hierarchy
integer
required

Category hierarchy. Categories with lower hierarchy are processed before categories with higher hierarchy value.

Required range: x >= 0

Response

Returns a newly created category object.

Response body schema for POST v1/categories.

id
string
required

Unique category ID assigned by Voucherify.

name
string
required

Category name.

hierarchy
integer
required

Category hierarchy. Categories with lower hierarchy are processed before categories with higher hierarchy value.

Required range: x >= 0
object
enum<string>
default:category
required
Available options:
category
created_at
string<date-time>
required

Timestamp representing the date and time when the category was created. The value is shown in the ISO 8601 format.

Example:

"2022-07-14T10:45:13.156Z"

I