Creates a product.
const response = await client.products.create(
{
code: 'PROD_001',
description: 'Premium subscription service'
}
);| Name | Description |
|---|---|
codestring, required | Unique product code. |
descriptionstring | Product description. |
| Name | Description |
|---|---|
dataobject | Product object. |
{
"data": {
"id": "product_1234567890",
"workspace_id": "ws_1234567890",
"code": "PROD_001",
"description": "Premium subscription service",
"update_version": 1,
"created": "2024-01-13T00:00:00Z"
}
}Lists all products.
const response = await client.products.list();| Name | Description |
|---|---|
dataobject[] | List of products. |
{
"data": [
{
"id": "product_1234567890",
"workspace_id": "ws_1234567890",
"code": "PROD_001",
"description": "Premium subscription service",
"update_version": 1,
"created": "2024-01-13T00:00:00Z"
}
]
}Retrieves a product by code.
const response = await client.products.retrieve('PROD_001');| Name | Description |
|---|---|
codestring, required | Product code. Must not include #, /, or :. |
| Name | Description |
|---|---|
dataobject | Product object. |
{
"data": {
"id": "product_1234567890",
"workspace_id": "ws_1234567890",
"code": "PROD_001",
"description": "Premium subscription service",
"update_version": 1,
"created": "2024-01-13T00:00:00Z"
}
}