Products

Endpoints to help you manage the products in your store

{ "data": [ { "id": "lnrxvznx", "brand": "Jolly Rancher", "name": "Jolly Ranchers Assorted Flavours Hard Candy", "page_title": "The sweetest Candy in the Galaxy", "product_information": "A piece of Candy" } ] }
php $products = Candy::products()->get(); var_dump($products);
Parameter Type Required Description

ids

Array

false

An array of IDs to limit the response to

includes

String|Array

false

The included relations, see model definition for more info

{ "data": [ { "id": "1mgd4gwq", "name": "Bubblegum Blues" } ] }
php $product = Candy::products()->create([ 'name' => ['en' => 'Bubblegum Blues'], 'url' => 'bubblegum-blues', 'sku' => 'bubblegum-blues-567', 'stock' => 1, 'family_id' => '8edoldnr', 'price' => 3.97 ]); var_dump($product);
Parameter Type Required Description

name

Array

true

The name of the product

stock

Number

true

The stock level for the product

family_id

String

true

The Hashed ID of the product family

price

Float|Number

true

The price of the product

sku

String

true

The unique SKU for the product

{ "data": [ { "id": "lnrxvznx", "brand": "Jolly Rancher", "name": "Jolly Ranchers Assorted Flavours Hard Candy", "page_title": "The sweetest Candy in the Galaxy", "product_information": "A piece of Candy" } ] }
php $products = Candy::products()->get($id); var_dump($products);
Parameter Type Required Description

includes

String|Array

false

The included relations, see model definition for more info

{ "data": [ { "id": "lnrxvznx", "brand": "Jolly Rancher", "name": "Jolly Ranchers Assorted Flavours Hard Candy", "page_title": "The sweetest Candy in the Galaxy", "product_information": "A piece of Candy" } ] }
php $products = Candy::products()->get([ 'attribute_data' => [ 'name' => [ 'webstore' => [ 'en' => 'Jolly Ranchers', 'fr' => 'Délicieux bonbons Jolly Ranchers' ] ] ] ]); var_dump($products);
Parameter Type Required Description

family_id

String

false

The hashed ID of the product family

attribute_data

Array

true

The attribute data to update

includes

String|Array

false

The included relations, see model definition for more info

{ "data": [ { "id": "lnrxvznx", "brand": "Jolly Rancher", "name": "Jolly Ranchers Assorted Flavours Hard Candy", "page_title": "The sweetest Candy in the Galaxy", "product_information": "A piece of Candy" } ] }
Parameter Type Required Description

groups

Array

true

An array of group info

groups.*.id

String

true

The ID of the customer group

groups.*.visible

Boolean

true

Whether the product is visible for this group

groups.*.purchasable

Boolean

true

Whether the product is purchasable for this group

includes

String|Array

false

The included relations, see model definition for more info

Model Definitions

Product Product-family