Create a product variant
POST /stores/{storeResourceId}/products/{productResourceId}/variants
/stores/{storeResourceId}/products/{productResourceId}/variantsAdds a variant to a product, with its own price, SKU and stock.
When to use: When a shop synchronizes its catalog, before creating orders that include the variant. Orders refer to variants, not to products.
When not to use: To change a variant that already exists use update_product_variant.
Permissions: Requires the manager role or higher, or the marketing.audiences.write capability.
Value for the X-Auth-Token header parameter.
In: header
Path Parameters
Identifier (resource_id) of the store.
Identifier (resource_id) of the product the variant belongs to.
The new Variant resource
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/problem+json
application/problem+json
application/problem+json
application/problem+json
curl -X POST "https://api.easymailing.com/stores/acme-shop/products/sneaker-01/variants" \ -H "X-Auth-Token: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "resource_id": "string", "title": "string", "sku": "string", "price": 0, "inventory_quantity": 0, "image_url": "http://example.com", "url": "http://example.com" }'{ "resource_id": "string", "title": "string", "sku": "string", "price": 0, "inventory_quantity": 0, "image_url": "http://example.com", "url": "http://example.com", "product": "/entity/1", "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z"}