extensions / Commerce extension
POST
/api/projects/{project_id}/extensions/2/productsCreate product
Creates a product for a project extension from the submitted product JSON payload.
Authentication
- Requirement
- Required
- Credential type
- Bearer API key
- Scopes
- Not specified
Permissions
- API-key requests must use a key with an active connection to the target project.
Headers
| Name | Required | Type | Details |
|---|---|---|---|
Authorization | Yes | Not specified | Description: Bearer credential used to authenticate the request. |
Path Parameters
| Name | Required | Type | Details |
|---|---|---|---|
project_id | Yes | Not specified | Description: Target project identifier. |
Query Parameters
Request Body
Schema: ProductWriteRequest
| Field | Required | Type | Details |
|---|---|---|---|
name | No | string | Description: Product display name. Empty names are stored as Untitled. |
slug | No | string | Description: URL-safe product slug. When omitted, the API generates a unique slug from the product name. |
price | No | number|string | Description: Base product price. Numeric values and numeric strings are accepted. |
product_type | No | string | Description: Product behavior and configuration type. Defaults to physical. Allowed values: physicalvariablegroupedvirtualdownloadablebundle |
category_slug | No | string | Description: Category slug associated with the product when the extension uses slug-based category data. |
description | No | string | Description: Product description content. |
status | No | string | Description: Publication status. Defaults to draft. Allowed values: draftactiveunlistedarchived |
is_draft | No | boolean | Description: Marks an initial product as a draft. The API also treats a missing name or slug as a draft. |
categories | No | array<integer> | Description: Category IDs to attach to the product. Items: integer |
media | No | array<string|object> | Description: Product media. Each item can be a URL/path string or an object containing path, url, src, or image. Items: string|object Item shape: path stringurl stringsrc stringimage string |
media_urls | No | array<string|object> | Description: Alias for media. Items: string|object Item shape: url string |
images | No | array<string|object> | Description: Alias for media. Items: string|object Item shape: url string |
attribute_values | No | object<string,JSON> | Description: Values keyed by the project's product attribute code, such as sku, color, size, quantity, or weight. Object shape: sku stringcolor string|array<string> example attribute keysize string|array<string> example attribute keyqty integerweight number |
attributes | No | array<object> | Description: Attribute definitions used to configure a variable product. Items: object Item shape: code stringlabel stringvalues array<string> |
variants | No | array<object> | Description: Purchasable variants for a variable product. Items: object Item shape: title stringsku stringprice numberqty integerenabled booleanmedia array<string|object>attribute_values object<string,JSON> |
group_items | No | array<object> | Description: Products included by a grouped product. Items: object Item shape: product_id integer|stringdefault_qty integerposition integer |
bundle_pricing_mode | No | string | Description: Whether bundle pricing comes from its items or the product's fixed base price. Allowed values: dynamicfixed |
downloads | No | array<object> | Description: Files delivered for a downloadable product. Items: object Item shape: id integer|stringtitle stringurl stringmax_downloads integerexpires_in_days integer |
virtual_services | No | array<object> | Description: Service options offered by a virtual product. Items: object Item shape: label stringprice numberduration_value integerduration_unit stringlocation stringallowed_countries array<string>allowed_regions array<string>allowed_cities array<string>allowed_postal_codes array<string>all_states booleanall_cities booleanall_postal_codes boolean |
meta | No | object<string,JSON> | Description: Structured product configuration metadata. |
sku | No | string | Description: Primary stock-keeping unit. Stored as a product attribute value. |
currency | No | string | Description: Currency code stored with the product's attribute data. |
weight | No | number|string | Description: Product weight stored with the product's attribute data. |
stock_quantity | No | integer | Description: Available stock quantity. |
track_stock | No | boolean | Description: Whether inventory should be tracked for this product. |
backorders | No | boolean | Description: Whether orders may exceed available stock. |
require_shipping | No | boolean | Description: Whether checkout requires shipping for this product. |
Response Body
Example 200 response
json
{
"id": 1,
"name": "Example",
"slug": "example-slug",
"price": "string",
"product_type": "string",
"categories": [],
"is_draft": 1,
"status": "active"
}Errors
Availability
- Available in
- v0.1.0
- Available since
- v0.1.0
- Implementation
- Available
- Deprecation
- Not specified
- Rate limits
- Not specified

