Skip to content

Create

products.create(ProductCreateParams**kwargs) -> ProductCreateResponse
POST/products

Creates a product.

ParametersExpand Collapse
code: str

Unique product code.

description: Optional[str]

Product description.

ReturnsExpand Collapse
class ProductCreateResponse:
data: Product

Product object.

id: str

FRAGMENT generated unique ID.

code: str

Product code.

created: datetime

Timestamp when the product was created. Uses ISO 8601 format.

formatdate-time
update_version: float

Current version of the product.

workspace_id: str

Workspace ID of the product.

description: Optional[str]

Product description.

Create

from fragment import Fragment

client = Fragment()
product = client.products.create(
    code="PROD_001",
)
print(product.data)
{
  "data": {
    "id": "product_1234567890",
    "code": "PROD_001",
    "created": "2024-01-13T00:00:00Z",
    "update_version": 1,
    "workspace_id": "ws_1234567890",
    "description": "Premium subscription service"
  }
}
Returns Examples
{
  "data": {
    "id": "product_1234567890",
    "code": "PROD_001",
    "created": "2024-01-13T00:00:00Z",
    "update_version": 1,
    "workspace_id": "ws_1234567890",
    "description": "Premium subscription service"
  }
}