Skip to main content

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

ParameterRequiredDefaultDescription
products.*YesAn array of products to update

Products

ParameterData typeRequiredDefaultDescription
item_numberstringYesThe 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
namestringIf new productThe name of the product
descriptionstringLong description of the product
activebooleantrueShould 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_b2bbooleanfalseShould be continue selling when out of stock on B2B orders. This field is a product / variant-level field
make_to_order_b2cbooleanfalseShould be continue selling when out of stock on B2C orders. This field is a product / variant-level field
metaobjectAn 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
weightfloatnullThe weight of the product. This field is a product / variant-level field
weight_typestringgThe weight unit of the product. Should be g or kg. This field is a product / variant-level field
no_inventorybooleanfalseDo not create inventory changes or store inventory for this product. (e.g. for digital products)
release_datedatenullWhen 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
noosbooleanfalseMark this product as part of our NOOS (never out of stock program). This field is a product / variant-level field
min_order_quantityintegernullB2B customers have to buy at least X pieces of this product. Unless the user has permission to skip this check
custom_sortintegernullCustom sort order for B2B webshop pages with custom sort order activated
order_colli_onlybooleanfalseB2B customers have to buy in colli. Unless the user has permission to skip this check.
colliArray<integer>[]Colli sizes for B2B orders
urlstringnullProduct URL in Shopify
meta_titlestringnullMeta title in Shopify
meta_descriptionstringnullMetea description in Shopify
tagsArray<string>An array of tags. Formatted like ["tag1", "tag2"]
deletebooleanIf true Traede will attempt to delete the product
categories_sync_modestringIf categories is givenUse replace to replace existing categories, append to append to existing categories
categoriesArray<categories>Categories of the product
suppliers_sync_modestringIf suppliers is givenUse replace to replace existing suppliers, append to append to existing suppliers
suppliersArray<suppliers>Suppliers of the product
variantsArray<variants>If new productVariants of the product

Categories

ParameterData typeRequiredDefaultDescription
top_categorystringYesThe top category
sub_categorystringnullLeave empty if what you want to sync is a top category
create_if_missingbooleanfalseShould category be created if it does not already exist?

Suppliers

ParameterData typeRequiredDefaultDescription
supplier_numberstringYesThe supplier number of the supplier. Must already exist in Traede
primarybooleanfalseThe default supplier of the product
lead_time_typestringweeksThe unit of the lead time period. Either weeks or days
lead_time_fromintegernull
lead_time_tointegernull
cost_price_setstringnullThe 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

ParameterData typeRequiredDefaultDescription
skustringYesThe 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
attributesobjectIf new variantThe attributes (Color, Size, etc.) of a variant. When updating variants you can pass only the ones you want to update
archivedbooleanfalseIf true, the variant is marked as archived and cannot be sold on B2B orders
b2c_availablebooleantrueIf false, the variant is marked as archived and cannot be sold on B2C orders
deletebooleanIf true Traede will attempt to delete the variant
make_to_order_b2bbooleannullShould be continue selling when out of stock on B2B orders. This field is a product / variant-level field
make_to_order_b2cbooleannullShould be continue selling when out of stock on B2C orders. This field is a product / variant-level field
metaobjectAn 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
weightfloatnullThe weight of the product. This field is a product / variant-level field
weight_typestringnullThe weight unit of the product. Should be g or kg. This field is a product / variant-level field
release_datedatenullWhen 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
noosbooleannullMark this product as part of our NOOS (never out of stock program). This field is a product / variant-level field
pricesObject<prices>An object of prices for the product. Prices should be keyed by their currency code
drops_sync_modestringIf drops is givenUse replace to replace existing drops, append to append to existing drops
dropsArray<drops>An array of drops. Use this to update the drops of a variant
inventoryArray<inventory changes>An array of inventory changes. Use this to update inventory
imagesArray<images>An array of images
cost_pricesArray<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.

ParameterRequiredDefaultDescription
sales_price0The wholesale (WHS) price of the variant. This price is used for B2B orders
rec_sales_price0The 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_pricenullA 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_pricenullA 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

ParameterRequiredDefaultDescription
drop_idYes, if no drop_code is supplied
drop_codeYes, if no drop_id is supplied

Inventory changes

ParameterRequiredDefaultDescription
quantityYes, if no adjustment is suppliedUse quantity if you want to set the quantity of the variant to a specific number
adjustmentYes, if no quantity is suppliedUse 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
textOptionally, add a text that is shown in Traede. Use this to describe why the change was made.
inventory_location_idDefault inventory locationUse this if you want to adjust a different inventory location. Leave empty if you want to adjust on your default inventory location

Cost prices

ParameterRequiredDefaultDescription
currencyYesProduct sync API will update a product cost price set using the currency. If none exist, one will be created
cost_price_set_labelYou can use this to update a specific cost price set. If none exist with this name it will get created
cost_price_set_idYou can use this to update a specific cost price set
cost_priceYesThe cost price of the product

Images

ParameterRequiredDefaultDescription
urlYesTraede will download the image from url and attach it as an image to the variant
altnullOptionally you can supply an alt text for the image

Translations

ParameterData typeRequiredDefaultDescription
product_locale_idintegerYes, if no product_locale_code is givenThe locale ID for the translation
product_locale_codestringYes, if no product_locale_id is givenThe locale code (e.g., danish) for the translation
namestringYesThe translated product name
descriptionstringNoThe translated product description
meta_titlestringNoThe translated product meta_title
meta_descriptionstringNoThe 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" }
]
}
]
}
]
}