Skip to main content

cart_items

Creates, updates, deletes, gets or lists a cart_items resource.

Overview​

Namecart_items
TypeResource
Idovh.order.cart_items

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
cart_idstringCart identifier (wire: cartId)
item_idintegerCurrent product identifier (wire: itemId)
offer_idstringOffer unique identifier of the product added (wire: offerId)
parent_item_idintegerId of parent item (if item is an option) (wire: parentItemId)
product_idstringType of the product added (wire: productId)
configurationsarrayConfiguration set for this product
durationstring (duration)Duration for the service
optionsarrayOptions item ID attached to this item
pricesarrayPrice of the item
settingsobjectItem settings

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectcart_id, item_idRetrieve information about a specific item of a cart
listselectcart_idx_pagination_modeList all the items of a cart
updateupdatecart_id, item_idUpdate some values on a cart item
deletedeletecart_id, item_idDelete 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.

NameDatatypeDescription
api_hoststringThe 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_idstringCart ID (wire: cartId)
item_idintegerItem ID (wire: itemId)
x_pagination_modestringSent as CachedObjectList-Pages by default so the list returns the full objects rather than their identifiers. (wire: X-Pagination-Mode)

SELECT examples​

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
;

UPDATE examples​

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 an item from a cart

DELETE FROM ovh.order.cart_items
WHERE cart_id = '{{ cart_id }}' --required
AND item_id = '{{ item_id }}' --required
;