Skip to main content
PUT
/
v1
/
categories
/
{categoryId}
Update Category
curl --request PUT \
  --url https://{cluster}.voucherify.io/v1/categories/{categoryId} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'X-App-Id: <api-key>' \
  --header 'X-App-Token: <api-key>' \
  --data '{
  "name": "Summer",
  "hierarchy": 1
}'
{
"id": "cat_0b60cfe7d0d7ddbb55",
"name": "Update",
"hierarchy": 1,
"created_at": "2022-07-14T10:45:13.156Z",
"updated_at": "2022-08-16T11:03:54.727Z",
"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.

Path Parameters

categoryId
string
required

Unique category ID assigned by Voucherify.

Example:

"cat_0bb81a481615a37b5e"

Body

application/json

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

Request body schema for PUT v1/categories/{categoryId}.

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 category object with a refreshed updated_at property.

Response body schema for PUT v1/categories/{categoryId}.

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"

updated_at
string<date-time>
required

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

Example:

"2022-08-16T10:52:08.094Z"

I