Product Types API Routes
Products can be organized into types. Each type has a name and a value.
Products are organized into the same type if they have the same value.
These API routes allow admin users to manage product types.
GET /admin/product-types#
List Product Types
Retrieve a list of product types. The product types can be filtered by fields such as id. The product types can also be sorted or paginated.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Query parameters
fieldsstringOptional+ it will be added to the default fields, using - will remove it from the default fields. without prefix it will replace the entire default fields.offsetnumberOptionallimitnumberOptionalorderstringOptional-.qstringOptionalidstring | string[]Optionalvaluestring | string[]Optionalcreated_atobjectOptionalupdated_atobjectOptionaldeleted_atobjectOptional$andobject[]Optional$orobject[]Optionalwith_deletedbooleanOptionalexternal_idstring | string[]OptionalRequest examples
Responses
200 OK
limitnumberoffsetnumbercountnumberproduct_typesobject[]The list of product types.
product_typesobject[]estimate_countnumberOptional400, 401, 404, 409, 422, 500: an error response is returned.
POST /admin/product-types#
Create Product Type
Create a product type.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Query parameters
fieldsstringOptional+ it will be added to the default fields, using - will remove it from the default fields. without prefix it will replace the entire default fields.Request body (application/json)
metadataobjectOptionalvaluestringexternal_idstringOptionalRequest examples
Responses
200 OK
product_typeobjectThe product type's details.
product_typeobject400, 401, 404, 409, 422, 500: an error response is returned.
Emitted events
product-type.created: Emitted when product types are created.
GET /admin/product-types/{id}#
Get a Product Type
Retrieve a product type by its ID. You can expand the product type's relations or select the fields that should be returned.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Path parameters
idstringQuery parameters
fieldsstringOptional+ it will be added to the default fields, using - will remove it from the default fields. without prefix it will replace the entire default fields.Request examples
Responses
200 OK
product_typeobjectThe product type's details.
product_typeobject400, 401, 404, 409, 422, 500: an error response is returned.
POST /admin/product-types/{id}#
Update a Product Type
Update a product type's details.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Path parameters
idstringQuery parameters
fieldsstringOptional+ it will be added to the default fields, using - will remove it from the default fields. without prefix it will replace the entire default fields.Request body (application/json)
valuestringOptionalmetadataobjectOptionalexternal_idstringOptionalRequest examples
Responses
200 OK
product_typeobjectThe product type's details.
product_typeobject400, 401, 404, 409, 422, 500: an error response is returned.
Emitted events
product-type.updated: Emitted when product types are updated.
DELETE /admin/product-types/{id}#
Delete a Product Type
Delete a product type. This doesn't delete products of this type.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Path parameters
idstringRequest examples
Responses
200 OK
idstringobjectstringDefault: "product_type"
deletedboolean400, 401, 404, 409, 422, 500: an error response is returned.
Emitted events
product-type.deleted: Emitted when product types are deleted.