Categories

Add, edit, and delete anything related to categories.

Category

category_id
integer

The unique ID for the category in WP EasyCart. Leave blank if you are adding or updating.

post_id
integer

The unqiue post ID to connect this item to WordPress

parent_id
integer

The category_id connecting this to another WP EasyCart category

enabled
boolean

True to enable this on your store.

featured
boolean

True to make a featured category, which may apply if your is setup to use this option.

category_name
string

The category name.

short_description
string

Optional description for this category

category_image
string

Optional banner image for this category, should be a URL.

priority
integer

The sort order of category, higher numbers are higher priority.

square_id
string

The unqiue ID connecting this item to SquareUp, if enabled in your store.

{
  • "category_id": 0,
  • "post_id": 0,
  • "parent_id": 0,
  • "enabled": true,
  • "featured": true,
  • "category_name": "string",
  • "short_description": "string",
  • "category_image": "string",
  • "priority": 0,
  • "square_id": "string"
}

Gets a list of categories

This allows you to get a list of categories

SecuritybearerAuth or basicAuth
Request
query Parameters
page
integer <int64>

Page number starting at 1

perpage
integer <int64>

Number of items per page

sortby
string

Sort results by term

sortdir
string

Sort results ASC or DESC

search
string

Filter categories by a search term

Responses
200

Successful operation

400

Unauthorized

get/categories
Request samples
Response samples
application/json
[
  • {
    }
]

Add a category

This allows you to add a new category

SecuritybearerAuth
Request
Request Body schema: application/json
required

Submit any or all elements to add a new category.

parent_id
integer

The category_id connecting this to another WP EasyCart category

enabled
boolean

True to enable this on your store.

featured
boolean

True to make a featured category, which may apply if your is setup to use this option.

category_name
required
string

The category name.

short_description
string

Optional description for this category

category_image
string

Optional banner image for this category, should be a URL.

priority
integer

The sort order of category, higher numbers are higher priority.

square_id
string

The unqiue ID connecting this item to SquareUp, if enabled in your store.

Responses
200

Successful operation

400

Unauthorized

post/categories
Request samples
application/json
{
  • "parent_id": 0,
  • "enabled": true,
  • "featured": true,
  • "category_name": "string",
  • "short_description": "string",
  • "category_image": "string",
  • "priority": 0,
  • "square_id": "string"
}
Response samples
application/json
{
  • "category_id": 0,
  • "post_id": 0,
  • "parent_id": 0,
  • "enabled": true,
  • "featured": true,
  • "category_name": "string",
  • "short_description": "string",
  • "category_image": "string",
  • "priority": 0,
  • "square_id": "string"
}

Gets a category by ID

This allows you to get a category from your store by category ID

SecuritybearerAuth or basicAuth
Request
path Parameters
category_id
required
integer <int64>

Category ID

Responses
200

Successful operation

400

Unauthorized

get/categories/{category_id}
Request samples
Response samples
application/json
{
  • "category_id": 0,
  • "post_id": 0,
  • "parent_id": 0,
  • "enabled": true,
  • "featured": true,
  • "category_name": "string",
  • "short_description": "string",
  • "category_image": "string",
  • "priority": 0,
  • "square_id": "string"
}

Updates a category by ID

This allows you to update a category by category ID

SecuritybearerAuth
Request
path Parameters
category_id
required
integer <int64>

Category ID

Request Body schema: application/json
required

Submit any or all elements to update the product by ID.

parent_id
integer

The category_id connecting this to another WP EasyCart category

enabled
boolean

True to enable this on your store.

featured
boolean

True to make a featured category, which may apply if your is setup to use this option.

category_name
string

The category name.

short_description
string

Optional description for this category

category_image
string

Optional banner image for this category, should be a URL.

priority
integer

The sort order of category, higher numbers are higher priority.

square_id
string

The unqiue ID connecting this item to SquareUp, if enabled in your store.

Responses
200

Successful operation

400

Unauthorized

patch/categories/{category_id}
Request samples
application/json
{
  • "parent_id": 0,
  • "enabled": true,
  • "featured": true,
  • "category_name": "string",
  • "short_description": "string",
  • "category_image": "string",
  • "priority": 0,
  • "square_id": "string"
}
Response samples
application/json
{
  • "category_id": 0,
  • "post_id": 0,
  • "parent_id": 0,
  • "enabled": true,
  • "featured": true,
  • "category_name": "string",
  • "short_description": "string",
  • "category_image": "string",
  • "priority": 0,
  • "square_id": "string"
}

Deletes a category by ID

This allows you to delete a category from your store by category ID

SecuritybearerAuth
Request
path Parameters
category_id
required
integer <int64>

Category ID

Responses
200

Successful operation

400

Unauthorized

delete/categories/{category_id}
Request samples
Response samples
application/json
{
  • "category_id": 0,
  • "post_id": 0,
  • "parent_id": 0,
  • "enabled": true,
  • "featured": true,
  • "category_name": "string",
  • "short_description": "string",
  • "category_image": "string",
  • "priority": 0,
  • "square_id": "string"
}

Add category products

This allows you to add new products to a category

SecuritybearerAuth or basicAuth
Request
path Parameters
category_id
required
integer <int64>

Category ID

Request Body schema: application/json
required

Submit any or all elements to update the category products.

product_ids
Array of integers
Responses
200

Successful operation

400

Unauthorized

post/categories/{category_id}/products
Request samples
application/json
{
  • "product_ids": [
    ]
}
Response samples
application/json
{ }

Replace category products

This allows you to replace products for a category with a new list

SecuritybearerAuth
Request
path Parameters
category_id
required
integer <int64>

Category ID

Request Body schema: application/json
required

Submit a new list or product ids for a cateogry.

product_ids
Array of integers
Responses
200

Successful operation

400

Unauthorized

patch/categories/{category_id}/products
Request samples
application/json
{
  • "product_ids": [
    ]
}
Response samples
application/json
{ }

Deletes category products

This allows you to delete produts from a category

SecuritybearerAuth
Request
path Parameters
category_id
required
integer <int64>

Category ID

Request Body schema: application/json
required

Submit a new list or product ids for a cateogry.

product_ids
Array of integers
Responses
200

Successfully deleted

400

Unauthorized

delete/categories/{category_id}/products
Request samples
application/json
{
  • "product_ids": [
    ]
}
Response samples
application/json
{ }