Get Cart Items
If a Cart does not exist with a provided reference, one is created and an empty cart items array is returned.
GET
Get Cart Items by Cart reference
https://api.moltin.com/v2/carts/:reference/items
Parameters
Path parameters
Name | Required | Type | Description |
---|---|---|---|
reference | Required | string | A custom reference for this cart created by you. |
Headers
Name | Required | Type | Description |
---|---|---|---|
Authorization | Required | string | The Bearer token required to get access to the API. |
Query parameters
Name | Required | Type | Description |
---|---|---|---|
include | Optional | string | tax_items |
Request Examples
Curl
curl -X GET https://api.moltin.com/v2/carts/:reference/items \
-H "Authorization: Bearer XXXX"
JavaScript SDK
const reference = "XXXX";
// Where `EPCC` is an authenticated client
await Moltin.Cart(reference).Items();
Response Example
200 OK
{
"data": [],
"meta": {
"display_price": {
"with_tax": {
"amount": 0,
"currency": "",
"formatted": "0"
},
"without_tax": {
"amount": 0,
"currency": "",
"formatted": "0"
}
},
"timestamps": {
"created_at": "0001-01-01T00:00:00Z",
"updated_at": "0001-01-01T00:00:00Z",
"expires_at": "0001-01-20T00:00:00Z"
}
}
}