Create a product.
If you receive an error message stating "Precondition failed, the store not found.", please first create a store using the Create a store API.
This value equals to store.id of Store Resource. You can obtain this id by making a GET /stores call to get existing stores or a POST /stores to create a new store.
A custom identifier for the product. If not provided, the system will generate a UUID. Must be unique within the store and immutable. You can use this ID to manage the resource in subsequent API calls.
The title of the product.
URL friendly unique identifier for the product.
The categories associated with the product, used for filtering and search purposes.
The tags associated with the product, used for filtering and search purposes.
URLs of the product images.
The URL of the product page in your online storefront.
To indicate whether the product has been published.
Description of the product.
Product variant information.
A unique identifier for the product variant in your system.
The product SKU of the product variant.
The price of the product variant.
Available quantity of the product variant.
The product image URL of the product variant.
The title of the product variant.
The original price of the item before an adjustment or a sale.
The weight information of the product variant.
Harmonized System (HS) Codes.
The origin country of this product variant. The field should be in ISO 3166-1 alpha-3 format.
To specify whether customers are permitted to place an order for this out-of-stock product variant.
The custom product variant properties, such as size, color, and material.
The date and time, formatted in ISO 8601, indicating when the product was created in your e-commerce system.
The date and time, formatted in ISO 8601, indicating when the product was updated in your e-commerce system.
The Meta model holds the metadata of the API response, including relevant error details for debugging purposes.Show all...
Error code in integer format. For detailed information, please refer to the Request Error introduction page.
Response type string for the reference. For detailed information, please refer to the Request Error introduction page.
Human-readable response message. For detailed information, please refer to the Request Error introduction page.
Error detail object. 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.Show all...
The Product model represents an individual item of your store. It includes essential attributes such as product title, price, variants, SKU, and so on. This model is crucial for cataloging and managing the store's inventory effectively.
The unique identifier of the product. If a custom ID was provided in the request, that value is used; otherwise, a system-generated UUID is assigned. You can use this ID to manage this resource in related API calls.
Indicate which store the product belongs to.
The title of the product.
URL friendly unique identifier for the product.
The categories associated with the product, used for filtering and search purposes.
The tags associated with the product, used for filtering and search purposes.
URLs of the product images.
The URL of the product page in your online storefront.
To indicate whether the product has been published.
Description of the product.
Product variant information.
The date and time, formatted in ISO 8601, indicating when the product was created in your e-commerce system.
The date and time, formatted in ISO 8601, indicating when the product was updated in your e-commerce system.
The date and time, formatted in ISO 8601, indicating when the product was created in AfterShip system.
The date and time, formatted in ISO 8601, indicating when the product was updated in AfterShip system.
{
"id": "546735673",
"title": "Power Mobile Phone",
"slug": "power-mobile-phone",
"categories": [
"mobile-phone"
],
"tags": [
"mobile-phone"
],
"image_urls": [
"https://example.com/product/image.png"
],
"url": "https://example.com/product/",
"published": true,
"description": "string",
"variants": [
{
"id": "5634477687",
"available_quantity": 1,
"sku": "string",
"title": "Power Mobile Phone",
"price": "10",
"image_urls": [
"https://example.com/product/image.png"
],
"compare_at_price": "string",
"weight": {
"unit": "kg",
"value": 10
},
"hs_code": "6403911600",
"origin_country_region": "AUS",
"allow_backorder": true,
"options": [
{
"name": "color",
"value": "white"
}
]
}
],
"source_created_at": "2021-04-15T20:02:09Z",
"source_updated_at": "2021-04-15T20:02:09Z"
}{ "meta": { "code": 20100, "type": "Created", "message": "The request was successful, we created a new resource and the response body contains the representation." }, "data": { "id": "546735673", "store": { "id": "0ecb8ff7efa84d7d8f763ed7b21851d1" }, "title": "Power Mobile Phone", "slug": "power-mobile-phone", "categories": [ "mobile-phone" ], "tags": [ "mobile-phone" ], "image_urls": [ "https://example.com/product/image.png" ], "url": "https://example.com/product/image.png", "published": true, "description": "string", "variants": [ { "id": "5634477687", "available_quantity": 1, "sku": "SKU001", "title": "Power Mobile Phone", "price": "10", "image_urls": [ "https://example.com/product/image.png" ], "compare_at_price": "string", "weight": { "unit": "kg", "value": 10 }, "hs_code": "6403911600", "origin_country_region": "AUS", "allow_backorder": true, "options": [ { "name": "color", "value": "white" } ] } ], "source_created_at": "2021-04-15T20:02:09Z", "source_updated_at": "2021-04-15T20:02:09Z", "created_at": "2021-04-15T20:02:09Z", "updated_at": "2021-04-15T20:02:09Z" } }