Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Create a product–category link

Files a product under a category node.

product and category are required. The pair (product, category) must be unique; filing the same product under the same category node twice is rejected with 400 Bad Request carrying a non_field_errors entry.

post
/product_category/
Authorizations
AuthorizationstringRequired

Token credential sent in the Authorization header, in the form: Token <your-token>. Requires a staff (admin) account.

Body

The body of a product–category link create or full update request.

productintegerRequired

The identifier of the product to link.

categoryintegerRequired

The identifier of the category node to link.

is_mainboolean · nullableOptional

Whether this is the product's main category. Optional.

Responses
201

The created product–category link.

application/json

A product–category link.

pkintegerRead-onlyOptional

The unique identifier of the link.

productintegerOptional

The identifier of the linked product.

categoryintegerOptional

The identifier of the linked category node.

is_mainboolean · nullableOptional

Whether this is the product's main category. Defaults to null (unset).

post/product_category/
POST /api/v1/remote/1/product_category/ HTTP/1.1
Host: sandbox.akinon.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 43

{
  "product": 100,
  "category": 5,
  "is_main": true
}
{
  "pk": 42,
  "product": 100,
  "category": 5,
  "is_main": true
}

Last updated

Was this helpful?