Create a product

post
/products

Create a product.

as-store-id
string
required

The unique store identifier is generated by AfterShip. You can obtain this id by making a GET /stores call to get existing stores or a POST /stores to create a new store.

Example:
0ecb8ff7efa84d7d8f763ed7b89851c8
source_id
string
required

A unique identifier for the product.

<= 32 characters
title
string
required

The title of the product.

<= 1024 characters
slug
string

URL friendly unique identifier for the product. It is different from the order slug.

<= 1024 characters
categories
array[string]

Catogories for the product used for filtering and searching products.

<= 100 items
tags
array[string]

Tags that are used for filtering and search.

<= 100 items
image_urls
array[string]
required

URLs of the images.

<= 100 items
url
string

URL of a product.

<= 2048 characters
published
boolean

To indicate whether a product has been published.

Default:
true
description
string

Description of a product.

<= 10240 characters
variants
array[object]
required

Variants of a product.

>= 1 items<= 500 items
source_id
string
required

A unique identifier for the product variant.

<= 32 characters
available_quantity
integer

Available quantity.

sku
string
required

A unique identifier for the product variant in the shop

<= 256 characters
title
string
required

The title of the product variant

<= 1024 characters
price
string
required

The price of the product variant.

<= 100 characters
image_urls
array[string]

URLs of the images.

<= 100 items
compare_at_price
string

The original price of the item before an adjustment or a sale.

weight
Weight
Example:
{"unit":"kg","value":10}
allow_backorder
boolean

To indicate whether customers are allowed to place an order for the product variant that's out of stock.

options
array[object]

The custom product properties.

>= 1 items
source_created_at
string

The date and time when the product was created. ISO 8601.

source_updated_at
string

The date and time when the product was last modified. ISO 8601.

Created

meta
Meta

Meta data object.

Example:
{"code":20000,"type":"OK","message":"The request was successfully processed by Automizely."}
code
number
required
Default:
20000
Example:
20000
type
string
required
>= 1 characters
Example:
OK
message
string
required
>= 1 characters
Example:
The request was successfully processed by Automizely.
errors
array[Error]

Each error object contains a "path" key and an "info" key. The "path" is the JSON path of the request object to indicate the error location. The "info" is a human-readable description of the error.

data
Product
Example:
{"id":"f74f8af7578042b0991e104533158ad1","source_id":"00093d19495447a2a082bfe44d75658a","store":{"id":"0ecb8ff7efa84d7d8f763ed7b21851d1"},"title":"update title","slug":"baby-girl-clothes","categories":["shoes"],"tags":["baby"],"image_urls":["https://cdn.shopify.com/s/files/1/xxx/xxx/products/xxx.jpg?v=xxx"],"url":"https://xxx.myshopify.com/products/baby-girl-clothes","published":true,"description":"<strong>Brand Name: </strong>","variants":[{"source_id":"00b0a1e329cf4ecc861136ed0ab94fc2","available_quantity":20,"sku":"23213-sda-asa-2T","title":"baby girl clothes","price":"31.8","image_urls":["https://cdn.shopify.com/s/files/1/xxx/xxx/products/xxx.jpg?v=xxx"],"compare_at_price":"31.8","weight":{"unit":"kg","value":0.1},"allow_backorder":true,"options":[{"name":"Color","value":"BLACK DRESSES"}]}],"source_created_at":"2021-07-26T13:42:22Z","source_updated_at":"2021-07-26T13:43:22Z","created_at":"2022-07-19T10:56:40Z","updated_at":"2022-07-20T12:53:32Z"}
id
string

Unique identifier generated by AfterShip.

source_id
string
required

A unique identifier for the product in your system.

store
object

Indicate which store the product belongs to.

title
string
required

The title of the product.

slug
string

URL friendly unique identifier for the product. It is different from the order slug.

categories
array[string]

Catogories for the product used for filtering and searching products.

tags
array[string]

Tags that are used for filtering and search.

image_urls
array[string]
required

URLs of the images.

url
string

URL of a product.

published
boolean

To indicate whether a product has been published.

Default:
true
description
string

Description of a product.

variants
array[object]
required

Variants of a product.

>= 1 items
source_created_at
string

The date and time when the product was created. ISO 8601.

source_updated_at
string

The date and time when the product was last modified. ISO 8601.

created_at
string

The date and time (ISO 8601 format) when an order was created in AfterShip.

updated_at
string

The date and time (ISO 8601 format) when an order was updated in AfterShip.

Bad Request

meta
Meta

Meta data object.

Example:
{"code":20000,"type":"OK","message":"The request was successfully processed by Automizely."}
code
number
required
Default:
20000
Example:
20000
type
string
required
>= 1 characters
Example:
OK
message
string
required
>= 1 characters
Example:
The request was successfully processed by Automizely.
errors
array[Error]

Each error object contains a "path" key and an "info" key. The "path" is the JSON path of the request object to indicate the error location. The "info" is a human-readable description of the error.

data
object

Unauthorized

meta
Meta

Meta data object.

Example:
{"code":20000,"type":"OK","message":"The request was successfully processed by Automizely."}
code
number
required
Default:
20000
Example:
20000
type
string
required
>= 1 characters
Example:
OK
message
string
required
>= 1 characters
Example:
The request was successfully processed by Automizely.
errors
array[Error]

Each error object contains a "path" key and an "info" key. The "path" is the JSON path of the request object to indicate the error location. The "info" is a human-readable description of the error.

data
object

Forbidden

meta
Meta

Meta data object.

Example:
{"code":20000,"type":"OK","message":"The request was successfully processed by Automizely."}
code
number
required
Default:
20000
Example:
20000
type
string
required
>= 1 characters
Example:
OK
message
string
required
>= 1 characters
Example:
The request was successfully processed by Automizely.
errors
array[Error]

Each error object contains a "path" key and an "info" key. The "path" is the JSON path of the request object to indicate the error location. The "info" is a human-readable description of the error.

data
object

Precondition Failed

meta
Meta

Meta data object.

Example:
{"code":20000,"type":"OK","message":"The request was successfully processed by Automizely."}
code
number
required
Default:
20000
Example:
20000
type
string
required
>= 1 characters
Example:
OK
message
string
required
>= 1 characters
Example:
The request was successfully processed by Automizely.
errors
array[Error]

Each error object contains a "path" key and an "info" key. The "path" is the JSON path of the request object to indicate the error location. The "info" is a human-readable description of the error.

data
object

Unprocessable Entity (WebDAV)

meta
Meta

Meta data object.

Example:
{"code":20000,"type":"OK","message":"The request was successfully processed by Automizely."}
code
number
required
Default:
20000
Example:
20000
type
string
required
>= 1 characters
Example:
OK
message
string
required
>= 1 characters
Example:
The request was successfully processed by Automizely.
errors
array[Error]

Each error object contains a "path" key and an "info" key. The "path" is the JSON path of the request object to indicate the error location. The "info" is a human-readable description of the error.

data
object

Too Many Requests

meta
Meta

Meta data object.

Example:
{"code":20000,"type":"OK","message":"The request was successfully processed by Automizely."}
code
number
required
Default:
20000
Example:
20000
type
string
required
>= 1 characters
Example:
OK
message
string
required
>= 1 characters
Example:
The request was successfully processed by Automizely.
errors
array[Error]

Each error object contains a "path" key and an "info" key. The "path" is the JSON path of the request object to indicate the error location. The "info" is a human-readable description of the error.

data
object

Internal Server Error

meta
Meta
required

Meta data object.

Example:
{"code":20000,"type":"OK","message":"The request was successfully processed by Automizely."}
code
number
required
Default:
20000
Example:
20000
type
string
required
>= 1 characters
Example:
OK
message
string
required
>= 1 characters
Example:
The request was successfully processed by Automizely.
errors
array[Error]

Each error object contains a "path" key and an "info" key. The "path" is the JSON path of the request object to indicate the error location. The "info" is a human-readable description of the error.

data
object
required
Auth
:
Parameters
:
Body
{ "source_id": "00093d19495447a2a082bfe44d75658a", "title": "baby girl clothes", "slug": "baby-girl-clothes", "categories": [ "shoes" ], "tags": [ "baby" ], "image_urls": [ "https://cdn.shopify.com/s/files/1/xxx/xxx/products/xxx.jpg?v=xxx" ], "url": "https://xxx.myshopify.com/products/baby-girl-clothes", "published": true, "description": "<strong>Brand Name: </strong>", "variants": [ { "source_id": "00b0a1e329cf4ecc861136ed0ab94fc2", "available_quantity": 20, "sku": "23213-sda-asa-2T", "title": "baby girl clothes", "price": "31.8", "compare_at_price": "31.8", "image_urls": [ "https://cdn.shopify.com/s/files/1/xxx/xxx/products/xxx.jpg?v=xxx" ], "weight": { "unit": "kg", "value": 0.35 }, "allow_backorder": true, "options": [ { "name": "Color", "value": "BLACK DRESSES" } ] } ], "source_created_at": "2020-07-03T15:37:30Z", "source_updated_at": "2020-07-04T16:41:50Z" }
Response Example
{ "meta": { "code": 20100, "type": "Created", "message": "The request was successful, we created a new resource and the response body contains the representation." }, "data": { "id": "f74f8af7578042b0991e104533158ad1", "source_id": "00093d19495447a2a082bfe44d75658a", "store": { "id": "0ecb8ff7efa84d7d8f763ed7b21851d1" }, "title": "update title", "slug": "baby-girl-clothes", "categories": [ "shoes" ], "tags": [ "baby" ], "image_urls": [ "https://cdn.shopify.com/s/files/1/xxx/xxx/products/xxx.jpg?v=xxx" ], "url": "https://xxx.myshopify.com/products/baby-girl-clothes", "published": true, "description": "<strong>Brand Name: </strong>", "variants": [ { "source_id": "00b0a1e329cf4ecc861136ed0ab94fc2", "available_quantity": 20, "sku": "23213-sda-asa-2T", "title": "baby girl clothes", "price": "31.8", "image_urls": [ "https://cdn.shopify.com/s/files/1/xxx/xxx/products/xxx.jpg?v=xxx" ], "compare_at_price": "31.8", "weight": { "unit": "kg", "value": 0.1 }, "allow_backorder": true, "options": [ { "name": "Color", "value": "BLACK DRESSES" } ] } ], "source_created_at": "2021-07-26T13:42:22Z", "source_updated_at": "2021-07-26T13:43:22Z", "created_at": "2022-07-19T10:56:40Z", "updated_at": "2022-07-20T12:53:32Z" } }