cart_items
Creates, updates, deletes, gets or lists a cart_items resource.
Overview​
| Name | cart_items |
| Type | Resource |
| Id | ovh.order.cart_items |
Fields​
The following fields are returned by SELECT queries:
- get
- list
successful operation
| Name | Datatype | Description |
|---|---|---|
cart_id | string | Cart identifier (wire: cartId) |
item_id | integer | Current product identifier (wire: itemId) |
offer_id | string | Offer unique identifier of the product added (wire: offerId) |
parent_item_id | integer | Id of parent item (if item is an option) (wire: parentItemId) |
product_id | string | Type of the product added (wire: productId) |
configurations | array | Configuration set for this product |
duration | string (duration) | Duration for the service |
options | array | Options item ID attached to this item |
prices | array | Price of the item |
settings | object | Item settings |
Representation of a cart item
| Name | Datatype | Description |
|---|---|---|
cart_id | string | Cart identifier (wire: cartId) |
item_id | integer | Current product identifier (wire: itemId) |
offer_id | string | Offer unique identifier of the product added (wire: offerId) |
parent_item_id | integer | Id of parent item (if item is an option) (wire: parentItemId) |
product_id | string | Type of the product added (wire: productId) |
configurations | array | Configuration set for this product |
duration | string (duration) | Duration for the service |
options | array | Options item ID attached to this item |
prices | array | Price of the item |
settings | object | Item settings |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | cart_id, item_id | Retrieve information about a specific item of a cart | |
list | select | cart_id | x_pagination_mode | List all the items of a cart |
update | update | cart_id, item_id | Update some values on a cart item | |
delete | delete | cart_id, item_id | Delete an item from a cart |
Parameters​
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
api_host | string | The OVHcloud API host. Selected by OVH_ENDPOINT (ovh-eu, ovh-ca or ovh-us; default ovh-eu). (default: api.eu.ovhcloud.com, x-stackQL-envVarSelector: {"envVar":"OVH_ENDPOINT","default":"ovh-eu","values":{"ovh-eu":"api.eu.ovhcloud.com","ovh-ca":"api.ca.ovhcloud.com","ovh-us":"api.us.ovhcloud.com"}}) |
cart_id | string | Cart ID (wire: cartId) |
item_id | integer | Item ID (wire: itemId) |
x_pagination_mode | string | Sent as CachedObjectList-Pages by default so the list returns the full objects rather than their identifiers. (wire: X-Pagination-Mode) |
SELECT examples​
- get
- list
Retrieve information about a specific item of a cart
SELECT
cart_id,
item_id,
offer_id,
parent_item_id,
product_id,
configurations,
duration,
options,
prices,
settings
FROM ovh.order.cart_items
WHERE cart_id = '{{ cart_id }}' -- required
AND item_id = '{{ item_id }}' -- required
;
List all the items of a cart
SELECT
cart_id,
item_id,
offer_id,
parent_item_id,
product_id,
configurations,
duration,
options,
prices,
settings
FROM ovh.order.cart_items
WHERE cart_id = '{{ cart_id }}' -- required
AND x_pagination_mode = '{{ x_pagination_mode }}'
;
UPDATE examples​
- update
Update some values on a cart item
UPDATE ovh.order.cart_items
SET
duration = '{{ duration }}',
quantity = {{ quantity }}
WHERE
cart_id = '{{ cart_id }}' --required
AND item_id = '{{ item_id }}' --required
RETURNING
cart_id,
item_id,
offer_id,
parent_item_id,
product_id,
configurations,
duration,
options,
prices,
settings;
DELETE examples​
- delete
Delete an item from a cart
DELETE FROM ovh.order.cart_items
WHERE cart_id = '{{ cart_id }}' --required
AND item_id = '{{ item_id }}' --required
;