Appearance
Products
Manage your entire product catalog including creation, updates, search, and deletion. Products are the core entities of your e-commerce system, containing all information about items available for sale such as pricing, descriptions, inventory, and relationships with categories, brands, and manufacturers.
Headers
| Header | Required | Description |
|---|---|---|
X-Tenant | REQUIRED | Identifies the store on which operations will be performed |
X-Authorization | ONE OF | Managed via per-tenant API Key. Alternatively, the header TSID Access Token can be used. |
TSID Access Token | ONE OF | Authorization: Bearer access_token. Alternatively, the header X-Authorization can be used. |
X-Locale | OPTIONAL | Allows API responses in available languages. |
Properties
| Key | Type | Values | Default |
|---|---|---|---|
| brand_id | brand.id | null | |
| depth | number | null | |
| description | string | null | |
| discounted_price | number | null | |
| ean | string | null | |
| height | number | null | |
| hidden | boolean | false | |
| manufacturer_id | manufacturer.id | null | |
| metas | array | {} | |
| mpn | string | null | |
| name | string | null | |
| parent_id | product.id | null | |
| price | number | 0 | |
| purchase_price | number | null | |
| sku | string | null | |
| slug | string | null | |
| status | boolean | false | |
| tags | array of strings | [] | |
| type | Enum | goodservice | one Of Values |
| unlimited | boolean | false | |
| weight | number | null | |
| width | number | null |
Warning! Paginated responses don't provide a complete structure.
Relations
All available keys to retrieve a direct relation through a relations array. For example:
TS
Client.API.Core.Products.get(1, { relations: ['categories'] });| Resource | Key | Description |
|---|---|---|
| Attributes | attributes | Product data enrichment through custom attributes and specifications |
| Categories | categories | Product organization through hierarchical categorization for grouping and filtering |
| Manufacturers | manufacturer | Manufacturer information for product identification and supplier management |
| Brands | brand | Brand association for product organization and marketing purposes |
| Warehouses | warehouses | Warehouse location and inventory management for product stock tracking |
Get products listing
View on PostmanGet a list of
products.JS
// Page 1
let products = await Client.API.Core.Products.all().resource.data;
// Page 2
let products = await Client.API.Core.Products.all({ page: 2 }).resource.data;TS
import { PaginatedResponse, Products } from "@tscommerce/sdk-typescript"
// Page 1
Client.API.Core.Products.all().then((response:PaginatedResponse<Products>) => {
response.resource.data.forEach((product:Products) => {
console.log(product.id);
});
});
// Page 2
Client.API.Core.Products.all({ page: 2 }).then((response:PaginatedResponse<Products>) => {
response.resource.data.forEach((product:Products) => {
console.log(product.id);
});
});PHP
// Page 1
$products = $client->API->Core->Products->all();
// Page 2
$products = $client->API->Core->Products->all(['page' => 2]);Query Params
| Key | Type | Description | Default |
|---|---|---|---|
| page | number | Get paginated response (15 per page) | 1 |
Basic CRUD Actions
Create new product
View on PostmanCreate a brand new product.
JS
const payload = {
sku: 'LOREM-001'
name: 'Lorem ipsum',
description: '<div>Lorem ipsum dolor sit amet</div>',
price: 15.50,
discounted_price: 9.90,
};
let products = Client.API.Products.create(payload);TS
import { ProductPayload, Product, Response } from '@tscommerce/sdk-typescript'
Client.API.Core.Products.fresh();
Client.API.Core.Products.data.sku = 'LOREM-001';
Client.API.Core.Products.data.name = 'Lorem Ipsum';
Client.API.Core.Products.data.description = '<div>Lorem ipsum dolor sit amet</div>';
Client.API.Core.Products.data.price = 15.50;
Client.API.Core.Products.data.discounted_price = 9.90;
const payload = new ProductPayload(Client.API.Core.Products.data).create();
Client.API.Core.Products.create(payload).then((response:Response<Product>) => {
// Your code here ...
});PHP
const $payload = [
'sku' => 'LOREM-001',
'name' => 'Lorem Ipsum'
'description' => '<div>Lorem ipsum dolor sit amet</div>'
'price' => 15.10
'discounted_price' => 9.90
];
$client->API->Core->Products->create($payload);Get product
View on PostmanGet an existing product.
JS
const productId = 1234;
Client.API.Core.Products.get(productId);TS
import { Product, Response } from '@tscommerce/sdk-typescript'
const productId:Product['id'] = 1234;
Client.API.Core.Products.get(productId).then((response:Response<Product>) => {
// Your code here...
});PHP
$productId = 1234;
$client->API->Core->Products->get($productId);Update product
View on PostmanUpdate an existing product.
JS
const productId = 1234;
const payload = {
sku: 'LOREM-001'
name: 'Lorem ipsum',
description: '<p>Lorem ipsum dolor sit amet</p>',
price: 19.90,
discounted_price: 11.90,
};
let products = Client.API.Products.update(productId, payload);TS
import { ProductPayload, Product, Response } from '@tscommerce/sdk-typescript'
const productId:Product['id'] = 1234;
Client.API.Core.Products.fresh();
Client.API.Core.Products.data.sku = 'LOREM-001';
Client.API.Core.Products.data.name = 'Lorem Ipsum';
Client.API.Core.Products.data.description = '<p>Lorem ipsum dolor sit amet</p>';
Client.API.Core.Products.data.price = 15.50;
Client.API.Core.Products.data.discounted_price = 9.90;
const payload = new ProductPayload(Client.API.Core.Products.data).update();
Client.API.Core.Products.update(productId, payload).then((response:Response<Product>) => {
// Your code here ...
});PHP
const $payload = [
'sku' => 'LOREM-001',
'name' => 'Lorem Ipsum'
'description' => '<p>Lorem ipsum dolor sit amet</p>'
'price' => 19.10
'discounted_price' => 10.90
];
$client->API->Core->Products->update($payload);Delete product
View on PostmanDelete an existing product.
JS
// Delete
const productId = 1234;
Client.API.Core.Products.delete(productId);
// Bulk Delete
const productIds = [1234, 4321];
Client.API.Core.Products.bulkDelete(productIds);TS
import { Product, Response } from "@tscommerce/sdk-typescript"
// Delete
const productId:Product['id'] = 1234;
Client.API.Core.Products.delete(productId).then((response:Response) => {
// Your code here...
});
// Bulk Delete
const productIds:Array<Product['id']> = [1234, 4321];
Client.API.Core.Products.bulkDelete(productIds).then((response:Response) => {
// Your code here...
});PHP
// Delete
$productId = 1234;
$client->API->Core->Products->delete($productId);
// Bulk Delete
$productIds = [1234, 4321];
$client->API->Core->Products->bulkDelete($productIds);Useful Actions
Search product
View on PostmanSearch for existing
products.JS
const productId = 1234;
Client.API.Core.Products.get(productId);TS
import { Product, Response } from '@tscommerce/sdk-typescript'
const productId:Product['id'] = 1234;
Client.API.Core.Products.get(productId).then((response:Response<Product>) => {
// Your code here...
});PHP
$productId = 1234;
$client->API->Core->Products->get($productId);Partially update product
View on PostmanPartially update an existing product.
TS
import { PatchProductPayload } from "@tscommerce/sdk-typescript"
const products:PatchProductPayload = {
description: '<p>This is just an example of a edited description</p>',
price: 19.99
}
Client.API.Core.Products.patch(payload);PHP
$products = [
'description' => '<p>This is just an example of a edited description</p>',
'price' => 19.99
];
$client->API->Core->Products->patch($payload);Get product tags
View on PostmanRetrieve all available product tags in the system.
JS
let tags = await Client.API.Core.Products.tags();
console.log('Available product tags:', tags);TS
import { Response } from "@tscommerce/sdk-typescript"
Client.API.Core.Products.tags().then((response:Response<Array<string>>) => {
response.resource.forEach((tag:string) => {
console.log(tag);
});
});PHP
$tags = $client->API->Core->Products->tags();
foreach($tags as $tag) {
echo $tag;
}Get parent product
View on PostmanGet the parent product of a variant or child product.
JS
const productId = 1234;
let parentProduct = await Client.API.Core.Products.parent(productId);
console.log('Parent product:', parentProduct);TS
import { Product, Response } from "@tscommerce/sdk-typescript"
const productId:Product['id'] = 1234;
Client.API.Core.Products.parent(productId).then((response:Response<Product>) => {
console.log('Parent product:', response.resource);
});PHP
$productId = 1234;
$parentProduct = $client->API->Core->Products->parent($productId);Get child products
View on PostmanRetrieve all child products (variants) of a parent product.
JS
const productId = 1234;
let childProducts = await Client.API.Core.Products.childs(productId);
console.log('Child products:', childProducts);TS
import { Product, Response } from "@tscommerce/sdk-typescript"
const productId:Product['id'] = 1234;
Client.API.Core.Products.childs(productId).then((response:Response<Array<Product>>) => {
response.resource.forEach((child:Product) => {
console.log(child.id, child.name);
});
});PHP
$productId = 1234;
$childProducts = $client->API->Core->Products->childs($productId);
foreach($childProducts as $child) {
echo $child->name;
}Duplicate product
View on PostmanCreate a duplicate of an existing product with all its properties.
JS
const productId = 1234;
let duplicatedProduct = await Client.API.Core.Products.duplicate(productId);TS
import { Product, Response } from "@tscommerce/sdk-typescript"
const productId:Product['id'] = 1234;
Client.API.Core.Products.duplicate(productId).then((response:Response<Product>) => {
console.log('Duplicated product:', response.resource);
});PHP
$productId = 1234;
$duplicatedProduct = $client->API->Core->Products->duplicate($productId);Bulk Actions
Bulk update products
View on PostmanPartially bulk update existing products.
JS
const payload = {
products: [
{
id: 1234,
description: '<p>This is just an example of a edited description</p>'
},
{
id: 4321,
price: 19.99
}
]
}
Client.API.Core.Products.bulkUpdate(payload);TS
import { BulkPatchProductPayload, Reponse } from "@tscommerce/sdk-typescript"
const payload:BulkPatchProductPayload = {
products: [
{
id: 1234,
description: '<p>This is just an example of a edited description</p>'
},
{
id: 4321,
price: 19.99
}
]
}
Client.API.Core.Products.bulkUpdate(payload).then((response:Response) => {
// Your code here...
});;PHP
$payload = [
'products' => [
[
'id' => 1234,
'description' => '<p>This is just an example of a edited description</p>'
],
[
'id' => 4321,
'price' => 19.99
]
]
];
$client->API->Core->Products->bulkUpdate($payload);Bulk delete products
View on PostmanDelete multiple products at once.
JS
const productIds = [1234, 5678, 9012];
Client.API.Core.Products.bulkDelete(productIds);TS
import { Product, Response } from "@tscommerce/sdk-typescript"
const productIds:Array<Product['id']> = [1234, 5678, 9012];
Client.API.Core.Products.bulkDelete(productIds).then((response:Response) => {
console.log('Products deleted successfully');
});PHP
$productIds = [1234, 5678, 9012];
$client->API->Core->Products->bulkDelete($productIds);Assign product variants
View on PostmanAssign attributes and create variants for a product.
JS
const productId = 1234;
const payload = {
attributes: [
{ attribute_id: 5, value: 'Red' },
{ attribute_id: 8, value: 'Large' }
]
};
Client.API.Core.Products.assignVariants(productId, payload);TS
import { Product, Response } from "@tscommerce/sdk-typescript"
interface VariantPayload {
attributes: Array<{
attribute_id: number;
value: string;
}>;
}
const productId:Product['id'] = 1234;
const payload:VariantPayload = {
attributes: [
{ attribute_id: 5, value: 'Red' },
{ attribute_id: 8, value: 'Large' }
]
};
Client.API.Core.Products.assignVariants(productId, payload).then((response:Response) => {
console.log('Variants assigned successfully');
});PHP
$productId = 1234;
$payload = [
'attributes' => [
['attribute_id' => 5, 'value' => 'Red'],
['attribute_id' => 8, 'value' => 'Large']
]
];
$client->API->Core->Products->assignVariants($productId, $payload);Import products
View on PostmanBulk import products from a file (CSV, Excel, etc.).
JS
const file = document.getElementById('fileInput').files[0];
const formData = new FormData();
formData.append('file', file);
Client.API.Core.Products.import(formData);TS
import { Response } from "@tscommerce/sdk-typescript"
const file = (document.getElementById('fileInput') as HTMLInputElement).files?.[0];
const formData = new FormData();
if (file) {
formData.append('file', file);
}
Client.API.Core.Products.import(formData).then((response:Response) => {
console.log('Import completed:', response);
});PHP
$file = $_FILES['file'];
$client->API->Core->Products->import($file);Product Attributes
Get product attributes
View on PostmanRetrieve all attributes assigned to a specific product.
JS
const productId = 1234;
let attributes = await Client.API.Core.Products.attributes(productId);
console.log('Product attributes:', attributes);TS
import { Product, ProductAttribute, Response } from "@tscommerce/sdk-typescript"
const productId:Product['id'] = 1234;
Client.API.Core.Products.attributes(productId).then((response:Response<Array<ProductAttribute>>) => {
response.resource.forEach((attr:ProductAttribute) => {
console.log(attr.attribute_id, attr.value);
});
});PHP
$productId = 1234;
$attributes = $client->API->Core->Products->attributes($productId);
foreach($attributes as $attribute) {
echo $attribute->value;
}Assign attribute value
View on PostmanAssign or update an attribute value for a product.
JS
const productId = 1234;
const attributeId = 5;
const payload = {
value: 'Red'
};
Client.API.Core.Products.assignAttribute(productId, attributeId, payload);TS
import { Product, Response } from "@tscommerce/sdk-typescript"
interface AttributePayload {
value: string;
}
const productId:Product['id'] = 1234;
const attributeId:number = 5;
const payload:AttributePayload = {
value: 'Red'
};
Client.API.Core.Products.assignAttribute(productId, attributeId, payload).then((response:Response) => {
console.log('Attribute assigned successfully');
});PHP
$productId = 1234;
$attributeId = 5;
$payload = ['value' => 'Red'];
$client->API->Core->Products->assignAttribute($productId, $attributeId, $payload);Delete attribute value
View on PostmanRemove an attribute value from a product.
JS
const productId = 1234;
const attributeId = 5;
Client.API.Core.Products.deleteAttribute(productId, attributeId);TS
import { Product, Response } from "@tscommerce/sdk-typescript"
const productId:Product['id'] = 1234;
const attributeId:number = 5;
Client.API.Core.Products.deleteAttribute(productId, attributeId).then((response:Response) => {
console.log('Attribute deleted successfully');
});PHP
$productId = 1234;
$attributeId = 5;
$client->API->Core->Products->deleteAttribute($productId, $attributeId);Product Categories
Get product categories
View on PostmanRetrieve all categories assigned to a specific product.
JS
const productId = 1234;
let categories = await Client.API.Core.Products.categories(productId);
console.log('Product categories:', categories);TS
import { Product, Category, Response } from "@tscommerce/sdk-typescript"
const productId:Product['id'] = 1234;
Client.API.Core.Products.categories(productId).then((response:Response<Array<Category>>) => {
response.resource.forEach((category:Category) => {
console.log(category.id, category.name);
});
});PHP
$productId = 1234;
$categories = $client->API->Core->Products->categories($productId);
foreach($categories as $category) {
echo $category->name;
}Bulk assign categories
View on PostmanAssign multiple categories to a product at once, replacing existing assignments.
JS
const productId = 1234;
const categoryIds = [10, 15, 20];
Client.API.Core.Products.massAssignCategories(productId, { category_ids: categoryIds });TS
import { Product, Response } from "@tscommerce/sdk-typescript"
interface MassAssignPayload {
category_ids: Array<number>;
}
const productId:Product['id'] = 1234;
const payload:MassAssignPayload = {
category_ids: [10, 15, 20]
};
Client.API.Core.Products.massAssignCategories(productId, payload).then((response:Response) => {
console.log('Categories assigned successfully');
});PHP
$productId = 1234;
$payload = ['category_ids' => [10, 15, 20]];
$client->API->Core->Products->massAssignCategories($productId, $payload);Assign category
View on PostmanAssign a single category to a product.
JS
const productId = 1234;
const categoryId = 10;
Client.API.Core.Products.assignCategory(productId, categoryId);TS
import { Product, Response } from "@tscommerce/sdk-typescript"
const productId:Product['id'] = 1234;
const categoryId:number = 10;
Client.API.Core.Products.assignCategory(productId, categoryId).then((response:Response) => {
console.log('Category assigned successfully');
});PHP
$productId = 1234;
$categoryId = 10;
$client->API->Core->Products->assignCategory($productId, $categoryId);Remove category
View on PostmanRemove a category assignment from a product.
JS
const productId = 1234;
const categoryId = 10;
Client.API.Core.Products.deleteCategory(productId, categoryId);TS
import { Product, Response } from "@tscommerce/sdk-typescript"
const productId:Product['id'] = 1234;
const categoryId:number = 10;
Client.API.Core.Products.deleteCategory(productId, categoryId).then((response:Response) => {
console.log('Category removed successfully');
});PHP
$productId = 1234;
$categoryId = 10;
$client->API->Core->Products->deleteCategory($productId, $categoryId);Product Inventory
Get product warehouses
View on PostmanRetrieve inventory information for a product across all warehouses.
JS
const productId = 1234;
let warehouses = await Client.API.Core.Products.warehouses(productId);
console.log('Product warehouses:', warehouses);TS
import { Product, Warehouse, Response } from "@tscommerce/sdk-typescript"
const productId:Product['id'] = 1234;
Client.API.Core.Products.warehouses(productId).then((response:Response<Array<Warehouse>>) => {
response.resource.forEach((warehouse:Warehouse) => {
console.log(warehouse.id, warehouse.name, warehouse.quantity);
});
});PHP
$productId = 1234;
$warehouses = $client->API->Core->Products->warehouses($productId);
foreach($warehouses as $warehouse) {
echo $warehouse->name . ': ' . $warehouse->quantity;
}