Skip to content

Get cart

GET
/carts/{cartId}
curl --request GET \
--url https://myshop.com/shopgate/v1/carts/example \
--header 'Authorization: Bearer <token>'

Fetch the whole cart with all products and totals.

cartId
required
string
Media typeapplication/json
object
output
required
object
messages
Array<object>

Message to be shown to the customer.

object
type
required
string
Allowed values: error warning info
message
required

Message to be displayed to the customer.

string
code

Message code, mapped by the extension. It can be used to react in a specific way for certain messages and/or to enable the possibility for message translations.

string
cartItems
required
Array<object>

The cart item can be a product OR a coupon. The property type defines which one it is. The key coupon is not set if the type is product and vice versa.

object
id
required

Unique identifier of the cart item. It can be used to remove/manipulate the respective cart item.

string
quantity
required

Quantity of the cart item.

number
type
required
string
Allowed values: product coupon
coupon
object
code

Code of the coupon.

string
description

Description of the coupon.

string
label

Label of the coupon.

string
savedPrice
required

Indicates how much discount the coupon applies in percent or absolute.

object
value
number
type
string
Allowed values: fixed percentage
product
object
id
required

The ID of the product. It is NOT a database ID but the item_number, unique within the scope of a specific shop.

string
name
required

Name of the product.

string
addtionalInfo

Some additional info for the product to be shown on the cart page. E.g. basePrice, SKU, weight, …

Array<object>
object
label
string
value
string
featuredImageUrl
required

The image of the product.

string
properties

Selected properties of the current cart item.

Array<object>
object
type
required
string
Allowed values: option input
label

Display label of the property.

string
value
required

The selected value of the property.

string
price
required
object
unit
required

Price of a single product. With or without tax, depending on the shop settings.

number
default
required

The price of a single product, multiplied by the quantity of the cart item WITHOUT any discounts. With or without tax, depending on the shop settings.

number
special

The special price of a single product, multiplied by the cart item quantity. It is only set if a discount is applied to the product.

number
appliedDiscounts

All discouts applied to the current line item.

Array<object>
object
code

Code of the coupon.

string
description

Description of the coupon.

string
label

Label of the coupon.

string
savedPrice
required

Indicates how much discount the coupon applies in percent or absolute.

object
value
number
type
string
Allowed values: fixed percentage
messages

All messages specific to the current cart item.

Array<object>

Message to be shown to the customer.

object
type
required
string
Allowed values: error warning info
message
required

Message to be displayed to the customer.

string
code

Message code, mapped by the extension. It can be used to react in a specific way for certain messages and/or to enable the possibility for message translations.

string
currency
required
string
Allowed values: EUR CHF USD RON PLN AUD GBP CAD SEK DKK NOK
totals
required
Array<object>
object
type
required
string
Allowed values: subTotal shipping tax payment discount grandTotal
label
required
string
amount
required
number
subTotals
Array<object>
object
type
required
string
Allowed values: subTotal shipping tax payment discount grandTotal
label
required
string
amount
required
number
text

Additional texts for the current cart, like legal text. It can contain HTML content.

object
legal
string
flags
required

Additional information about the cart.

object
taxIncluded
required

Holds information about the cart prices being gross values or not.

boolean
orderable
required

Indicates if the current cart is orderable.

boolean
coupons
required

States if coupon functionality is enabled or not.

boolean
default: true
Example
{
"messages": [
{
"type": "error",
"message": "The cart amount is too high for online purchase. The maximum amount is USD 4.99.",
"code": "CART_VALUE_TOO_HIGH"
}
],
"cartItems": [
{
"id": "a84de7d7-2b7d-4aa8-a64d-9558ca791b86",
"quantity": 5,
"type": "product",
"coupon": {
"code": "20OFF",
"description": "Reduces the cost of all products by 20%.",
"label": "20% off of all products.",
"savedPrice": {
"value": 20,
"type": "percentage"
}
},
"product": {
"id": "10080466570",
"name": "Awesome T-Shirt",
"additionalInfo": [
{
"label": "Manufacturer",
"value": "Lacoste"
}
],
"featuredImageUrl": "https://myshop.example/images/product_xyz_featured.png",
"properties": [
{
"type": "option",
"label": "Color",
"value": "Red"
}
],
"price": {
"unit": 10,
"default": 50,
"special": 40
},
"appliedDiscounts": [
{
"code": "20OFF",
"description": "Reduces the cost of all products by 20%.",
"label": "20% off of all products.",
"savedPrice": {
"value": 20,
"type": "percentage"
}
}
]
},
"messages": [
{
"type": "info",
"message": "This product will be ordered for you after purchase.",
"code": "ORDER_ON_PURCHASE"
}
]
}
],
"currency": "USD",
"totals": [
{
"type": "tax",
"label": "Tax (19%)",
"amount": 7.6,
"subTotals": [
{
"type": "tax",
"label": "Tax (19%)",
"amount": 7.6
}
]
}
],
"text": {
"legal": "By placing your order you agree to our <b><u>Privacy Policy</u></b>, our <b><u>Terms and Conditions</u></b> as well as our <b><u>Cancellation Policy</u></b>."
},
"flags": {
"taxIncluded": false,
"orderable": false,
"coupons": true
}
}
Media typeapplication/json
object
message
string
name
string
Example
{
"message": "Invalid token: access token is invalid",
"name": "invalid_token"
}
Media typeapplication/json
object
message
string
Example
{
"message": "Cart not found!"
}