Get cart
const url = 'https://myshop.com/shopgate/v1/carts/example';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://myshop.com/shopgate/v1/carts/example \ --header 'Authorization: Bearer <token>'Fetch the whole cart with all products and totals.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Responses
Section titled “Responses”object
object
Message to be shown to the customer.
object
Message to be displayed to the customer.
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.
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
Unique identifier of the cart item. It can be used to remove/manipulate the respective cart item.
Quantity of the cart item.
object
Code of the coupon.
Description of the coupon.
Label of the coupon.
Indicates how much discount the coupon applies in percent or absolute.
object
object
The ID of the product. It is NOT a database ID but the item_number, unique within the scope of a specific shop.
Name of the product.
Some additional info for the product to be shown on the cart page. E.g. basePrice, SKU, weight, …
object
The image of the product.
Selected properties of the current cart item.
object
Display label of the property.
The selected value of the property.
object
Price of a single product. With or without tax, depending on the shop settings.
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.
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.
All discouts applied to the current line item.
object
Code of the coupon.
Description of the coupon.
Label of the coupon.
Indicates how much discount the coupon applies in percent or absolute.
object
All messages specific to the current cart item.
Message to be shown to the customer.
object
Message to be displayed to the customer.
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.
object
object
Additional texts for the current cart, like legal text. It can contain HTML content.
object
Additional information about the cart.
object
Holds information about the cart prices being gross values or not.
Indicates if the current cart is orderable.
States if coupon functionality is enabled or not.
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 }}object
Example
{ "message": "Invalid token: access token is invalid", "name": "invalid_token"}object
Example
{ "message": "Cart not found!"}
