Sync products
The sync products API is a single API endpoint that you can use to send product data into Traede.
Creating vs updating products
Traede will use item numbers and SKUs to determine if a product already exists and we are trying to create a new product or updating an existing one.
For instance, if you send a product with item number product-001
Traede will look for an existing one. If an existing one all properties of that product will
be used to update the existing one. If no product was found with the item number then a new product is created.
Creating vs updating variants
Variants can be passed as part of the product data. Here we use the SKU to determine if a variant already exists or not. In the same way as with products and
item numbers, if you pass a variant with sku sku-1234
then we look for an existing variant with that SKU. If we find one, then we use the variant data
to update the variant. If we do not find one, we will use the variant data to create a new variant within the existing product.
Updating item numbers and SKUs of existing products
Due to above model you are not able to update item numbers and SKUs using the product sync API. This is because if you pass a long a new item number, then i will simply be used to create a new product. Same with SKUs and variants. Be sure to think of this when you build your product sync integration.
Deleting products
You can delete products by passing along delete: true
to the product data. Note that products with orders and invoices and other data
cannot be deleted. Traede will return an error response if the delete was unsuccessful for any reason
Deleting variants
You can delete variants by passing along delete: true
to the variant data. Note that variants with orders and invoices and other data
cannot be deleted. Traede will return an error response if the delete was unsuccessful for any reason
POST /products/sync
Endpoint: POST /products/sync
Parameter | Required | Default | Description |
---|---|---|---|
products.* | Yes | An array of products to update |
Products
Parameter | Data type | Required | Default | Description |
---|---|---|---|---|
item_number | string | Yes | The item number of the product. We use this to determine if a product already exists and we are updating it or we are creating a new one | |
name | string | If new product | The name of the product | |
description | string | Long description of the product | ||
active | boolean | true | Should this product be active for selling? Note: you can control this on the variant-level using variants.*.archived and variants.*.b2c_available | |
make_to_order_b2b | boolean | false | Should be continue selling when out of stock on B2B orders. This field is a product / variant-level field | |
make_to_order_b2c | boolean | false | Should be continue selling when out of stock on B2C orders. This field is a product / variant-level field | |
meta | object | An object of {"key":"value"} . This is where Traede stores product custom fields. When updating Traede will use the input as "partial update" to the meta object | ||
weight | float | null | The weight of the product. This field is a product / variant-level field | |
weight_type | string | g | The weight unit of the product. Should be g or kg . This field is a product / variant-level field | |
no_inventory | boolean | false | Do not create inventory changes or store inventory for this product. (e.g. for digital products) | |
release_date | date | null | When should this product be shipped customers. Setting a date in this field will prevent it from appearing "Ready to ship" until the date is reached. This field is a product / variant-level field | |
noos | boolean | false | Mark this product as part of our NOOS (never out of stock program). This field is a product / variant-level field | |
min_order_quantity | integer | null | B2B customers have to buy at least X pieces of this product. Unless the user has permission to skip this check | |
custom_sort | integer | null | Custom sort order for B2B webshop pages with custom sort order activated | |
order_colli_only | boolean | false | B2B customers have to buy in colli. Unless the user has permission to skip this check. | |
colli | Array<integer> | [] | Colli sizes for B2B orders | |
url | string | null | Product URL in Shopify | |
meta_title | string | null | Meta title in Shopify | |
meta_description | string | null | Metea description in Shopify | |
tags | Array<string> | An array of tags. Formatted like ["tag1", "tag2"] | ||
delete | boolean | If true Traede will attempt to delete the product | ||
categories_sync_mode | string | If categories is given | Use replace to replace existing categories, append to append to existing categories | |
categories | Array<categories> | Categories of the product | ||
suppliers_sync_mode | string | If suppliers is given | Use replace to replace existing suppliers, append to append to existing suppliers | |
suppliers | Array<suppliers> | Suppliers of the product | ||
variants | Array<variants> | If new product | Variants of the product |
Categories
Parameter | Data type | Required | Default | Description |
---|---|---|---|---|
top_category | string | Yes | The top category | |
sub_category | string | null | Leave empty if what you want to sync is a top category | |
create_if_missing | boolean | false | Should category be created if it does not already exist? |
Suppliers
Parameter | Data type | Required | Default | Description |
---|---|---|---|---|
supplier_number | string | Yes | The supplier number of the supplier. Must already exist in Traede | |
primary | boolean | false | The default supplier of the product | |
lead_time_type | string | weeks | The unit of the lead time period. Either weeks or days | |
lead_time_from | integer | null | ||
lead_time_to | integer | null | ||
cost_price_set | string | null | The name of the cost price set to use for this supplier. If left empty it will default to the default cost price set in the currency of the supplier |
Variants
Parameter | Data type | Required | Default | Description |
---|---|---|---|---|
sku | string | Yes | The sku of the variant. We use this to determine if a variant already exists and we are updating it or we are creating a new one | |
attributes | object | If new variant | The attributes (Color, Size, etc.) of a variant. When updating variants you can pass only the ones you want to update | |
archived | boolean | false | If true , the variant is marked as archived and cannot be sold on B2B orders | |
b2c_available | boolean | true | If false , the variant is marked as archived and cannot be sold on B2C orders | |
delete | boolean | If true Traede will attempt to delete the variant | ||
make_to_order_b2b | boolean | null | Should be continue selling when out of stock on B2B orders. This field is a product / variant-level field | |
make_to_order_b2c | boolean | null | Should be continue selling when out of stock on B2C orders. This field is a product / variant-level field | |
meta | object | An object of {"key":"value"} . This is where Traede stores variant custom fields. When updating Traede will use the input as "partial update" to the meta object | ||
weight | float | null | The weight of the product. This field is a product / variant-level field | |
weight_type | string | null | The weight unit of the product. Should be g or kg . This field is a product / variant-level field | |
release_date | date | null | When should this product be shipped customers. Setting a date in this field will prevent it from appearing "Ready to ship" until the date is reached. This field is a product / variant-level field | |
noos | boolean | null | Mark this product as part of our NOOS (never out of stock program). This field is a product / variant-level field | |
prices | Object<prices> | An object of prices for the product. Prices should be keyed by their currency code | ||
drops_sync_mode | string | If drops is given | Use replace to replace existing drops, append to append to existing drops | |
drops | Array<drops> | An array of drops. Use this to update the drops of a variant | ||
inventory | Array<inventory changes> | An array of inventory changes. Use this to update inventory | ||
images | Array<images> | An array of images | ||
cost_prices | Array<cost prices> | Cost prices of the variant |
Prices
note
Prices should be keyed by their currency code. E.g.
{
"DKK": {
"sales_price": 100
},
"EUR": {
"sales_price": 10
}
}
This would add a DKK price and a EUR price to the variant.
Parameter | Required | Default | Description |
---|---|---|---|
sales_price | 0 | The wholesale (WHS) price of the variant. This price is used for B2B orders | |
rec_sales_price | 0 | The rec retail price (RRP) of the variant. This price is used for B2C orders. This price is also used for B2C integrations like Shopify and Woocommerce. | |
offer_price | null | A special temporary offer price for B2B orders. When this price is not null it means that it should be used instead of sales_price . Also the B2B shop in Traede will show the percentage difference between sales_price and offer_price as "savings" when buying the product. Use this property to put a variant "on sale" for B2B orders | |
b2c_offer_price | null | A special temporary offer price for B2C orders. When this price is not null it means that it should be used instead of rec_sales_price . We will also use this property to put the variant "on sale" in B2C systems like Shopify and Woocommerce. Use this property to put a variant "on sale" for B2C orders |
Drops
Parameter | Required | Default | Description |
---|---|---|---|
drop_id | Yes, if no drop_code is supplied | ||
drop_code | Yes, if no drop_id is supplied |
Inventory changes
Parameter | Required | Default | Description |
---|---|---|---|
quantity | Yes, if no adjustment is supplied | Use quantity if you want to set the quantity of the variant to a specific number | |
adjustment | Yes, if no quantity is supplied | Use adjustment if you want to create a relative adjustment to the current inventory. E.g. +2 would increase inventory with 2 and -2 would decrease current inventory with 2 | |
text | Optionally, add a text that is shown in Traede. Use this to describe why the change was made. | ||
inventory_location_id | Default inventory location | Use this if you want to adjust a different inventory location. Leave empty if you want to adjust on your default inventory location |
Cost prices
Parameter | Required | Default | Description |
---|---|---|---|
currency | Yes | Product sync API will update a product cost price set using the currency. If none exist, one will be created | |
cost_price_set_label | You can use this to update a specific cost price set. If none exist with this name it will get created | ||
cost_price_set_id | You can use this to update a specific cost price set | ||
cost_price | Yes | The cost price of the product |
Images
Parameter | Required | Default | Description |
---|---|---|---|
url | Yes | Traede will download the image from url and attach it as an image to the variant | |
alt | null | Optionally you can supply an alt text for the image |
Translations
Parameter | Data type | Required | Default | Description |
---|---|---|---|---|
product_locale_id | integer | Yes, if no product_locale_code is given | The locale ID for the translation | |
product_locale_code | string | Yes, if no product_locale_id is given | The locale code (e.g., danish ) for the translation | |
name | string | Yes | The translated product name | |
description | string | No | The translated product description | |
meta_title | string | No | The translated product meta_title | |
meta_description | string | No | The translated product meta_description |
You can provide translations for the product name using either product_locale_id
or product_locale_code
. Below are examples for both methods.
Example with Locale ID
{
"products": [
{
"name": "A product sync product",
"item_number": "product-sync-001",
"translations": [
{
"product_locale_id": 1,
"name": "Et produkt",
"description": "En beskrivelse 2",
"meta_title": "Meta title 2",
"meta_description": "Meta description 2"
}
],
"variants": [
{
"attributes": {
"Color": "Black",
"Size": "XS"
},
"sku": "product-001-000-XS"
}
]
}
]
}
Example with Locale Code
{
"products": [
{
"name": "A product sync product",
"item_number": "product-sync-001",
"translations": [
{
"product_locale_code": "danish",
"name": "Et produkt",
"description": "En beskrivelse 2",
"meta_title": "Meta title 2",
"meta_description": "Meta description 2"
}
],
"variants": [
{
"attributes": {
"Color": "Black",
"Size": "XS"
},
"sku": "product-001-000-XS"
}
]
}
]
}
Basic example of a POST body for /products/sync
POST /products/sync
{
"products": [
{
"name": "A cool product",
"item_number": "cool-product-001",
"variants": [
{
"attributes": {
"Color": "Black",
"Size": "XS"
},
"sku": "cool-product-000-XS",
"prices": {
"DKK": {
"sales_price": 100,
"rec_sales_price": 300
},
"EUR": {
"sales_price": 15,
"rec_sales_price": 45
}
},
"inventory": [{ "quantity": 10, "text": "Initial stock" }],
"images": [
{ "url": "https://traede.com/cool-product-001-01.jpg" },
{ "url": "https://traede.com/cool-product-001-02.jpg" }
]
}
]
}
]
}