Magidoc

This section describes how you can create, read, or update products. A product consist of multiple variants, such as Red, Blue, Small or Large. You are free to name the colors, sizes, or other options however you like. We recommend you use our ProductVariantAttributes endpoint to list all the available attributes for a product, since these are dynamic and may change in the future.

Querying products

#

For information on which fields you can fetch see the Product object type .

    
  

Fetch a single product

#

With the query below you can fetch all information for a single product. For information on which fields you can fetch see the Product object type .

    
  

Response

    
  

Get the titles of a product's first five variants

#

    
  

Response:

    
  

Paginating

#

Fetch products with pagination

#

When fetching multiple results you always need to specify how many results you want to receive. You will also receive a paginator which tells you if there are more pages available. You can use the cursor to fetch the next page.

This is how you fetch the first page

    
  

When the hasNextPage returns true you can use the endCursor as the after parameter to fetch the next page.

    
  

Paginate products by their timestamp

#

If you want to periodically fetch the products based on their updated_at, you can use the startCursor or endCursor. This cursor remembers the position you left off, and gives you the newest results depending on what you sorted on.

For example lets say we sort by the UPDATED_AT_ASC. When we start paginating we receive all the pages sorted from least recently to most recently updated. You keep looping until you reached the last page, marked by the hasNextPage = false. You then remember this endCursor so that next time you can start from there.

    
  

Next time, only fetch the results more recent than your endCursor:

    
  

Creating products

#

A product always consists of one or multiple variants. A variant needs to have either a Color, Size, or Option. Where the values are free to name them how you'd like. This way you can use any color or size, and the option field is free to describe a property that isnt a color or size.

Create a product

#

You have to send a mutation for every single variant using the Color, Size, or Option fields. You may group multiple variants using the productId or externalProductId.

The externalProductId and externalProductVariantId can be used to send your unique identifier. We will store this value to allow you to easily update the product later on.

Also make sure you request the userErrors to make sure your didn't receive any validation errors. See the userErrors for more information .

    
  

Response

    
  

Updating products

#

When you update a product variant you can either specify the productVariantId we have assigned to the variant, or use your own externalProductVariantId field.

    
  

Product properties

#

This section describes the different properties a product can have, which are:

Also check the Enums section to see which categories , tags , or lead times you can use.

Product Options

#

A product generally exists of multiple variants, although this isnt required. A product can have up to 3 options (a Color, Size, and Option). Every variant can have up to three options, but at least one. For example a T-shirt comes in a variety of Colors and Sizes. The variable table will look something like this:

Product
Color
Size
Variant
Red
S
Variant
Red
M
Variant
Red
L
Variant
Blue
S
Variant
Blue
M
Variant
Blue
L
    
  

Product Category

#

Orderchamp works with a pre-defined list of categories. A category is defined by its CategoryPath. Please note that categories are subject to change so it is recommended to often fetch the list of available categories. Preferably even use the ProductVariantAttributes endpoint.

Category tree

#

You can fetch the entire category tree with the query below.

    
  

The query above will return a flat list of all categories with their children. The tree has 3 levels of depth and products can only be assigned a category with a depth of 2 (sub-sub category). In the example below you can see the category "Home & Living" with subcategory "Pillows & Plaids" and sub-sub-category "Plaids".

    
  

Product Lead time

#

The lead time is the time it will take for this product to be shipped and delivered to the retailer. A brand may configure an average lead time for their products and Orderchamp will automatically determine your average lead time based on your actual delivery time, but you can overwrite this value per product. For example when a product has an exceptionally long delivery time. Visit the lead-time enum to see all the different lead times.

Product Dimensions

#

The dimensions of a product can be specified either at a product or at a variant level. We recommend specifying them at the product level and only specify per variant when the dimensions are not the same for every variant. Visit the section

    
  

Product Inventory

#

A product itself has no inventory. Every variant within a product can hold inventory, along with a policy for when it has sold out. You can "allow backorders" to keep selling the item when inventory is zero. This will result in a negative inventory quantity.

In the example below you can see we use inventoryQuantity and inventoryPolicy. See the InventoryPolicy enum for the options .

    
  

Product Images

#

You can specify a number of product images by giving the source url.

    
  

Product Translations

#

You do not have to specify translations through the API. Instead Orderchamp will automatically translate titles and description to all supported languages, which at the time of writing are English, Dutch, German, and French. We do recommend upload all products in the same language. We only translate products once they enter the marketplace, which happens after it is successfully published.