Baskets

Order management endpoints

General basket endpoints
{ "data": [ { "id": "e1py5kv7wdgojx3", "total": 130.01, "sub_total": 108.34, "tax_total": 21.67, "discount_total": 0, "changed": false, "meta": null, "lines": { "data": { "id": "e1py5kv7wdgojx3", "quantity": 1, "line_total": 108.34, "unit_price": 54.17, "unit_tax": 10.84, "tax": 21.67, "line_discount": null, "meta": [] } } } ] }
php $info = Candy::baskets()->update([ 'lines' => [ [ 'id' => 'xojxzgy5', 'quantity' => 2 ] ] ]); var_dump($info);
Parameter Type Required Description

variants

Array

true

The variants that belong in the basket.

basket_id

String

false

The ID of an existing basket to use, creates new one if omitted.

includes

String|Array

false

The included relations, see model definition for more info.

Working with specific baskets
{ "data": [ { "id": "e1py5kv7wdgojx3", "total": 130.01, "sub_total": 108.34, "tax_total": 21.67, "discount_total": 0, "changed": false, "meta": null, "lines": { "data": { "id": "e1py5kv7wdgojx3", "quantity": 1, "line_total": 108.34, "unit_price": 54.17, "unit_tax": 10.84, "tax": 21.67, "line_discount": null, "meta": [] } } } ] }
php $info = Candy::baskets()->get('6ThYhSS3'); var_dump($info);
Parameter Type Required Description

id

String

true

The hashed ID of the basket

includes

String|Array

false

The included relations, see model definition for more info

{ "success": { "http_code": 200, "message": null } }
php $info = Candy::baskets()->delete('6ThYhSS3'); var_dump($info);
Parameter Type Required Description

id

String

true

The hashed ID of the basket

Get a users current basket
{ "data": [ { "id": "e1py5kv7wdgojx3", "total": 130.01, "sub_total": 108.34, "tax_total": 21.67, "discount_total": 0, "changed": false, "meta": null, "lines": { "data": { "id": "e1py5kv7wdgojx3", "quantity": 1, "line_total": 108.34, "unit_price": 54.17, "unit_tax": 10.84, "tax": 21.67, "line_discount": null, "meta": [] } } } ] }
php $info = Candy::baskets()->current(); var_dump($info);
Parameter Type Required Description

includes

String|Array

false

The included relations, see model definition for more info

Model Definitions

Order Transaction