The cart is the main object processed by Ollie Shop Checkout API.

It stores a lot of contextual information about the order which is important to the proper processing of the order:

order items, client's personal data, delivery address, freight information, etc.

Using Ollie Shop APIs this information can be accessed, processed, and even changed on certain occasions.

The Checkout API is one of the main interfaces interacting with the cart object. Most of its operations will return the cart or part of it.

The object's basic structure is:

{
    "data": {
        "id": "{{cartId}}",
        "items": [],
        "totalizer": {
            "total": 0
        },
        "customer": null,
        "shipping": null,
        "delivery": null,
        "culture": {
            "currency": "USD",
            "country": "USA",
            "locale": "en-US"
        },
        "payment": {
            "selected": [],
            "options": []
        },
        "extensions": {}
    },
    "_metadata": {
        "version": "02c047a8-f109-4998-a258-0ef40d258ca3",
        "functions": []
    }
}

The cart is composed of two fundamental objects:

data and _metadata

The data object is the actual cart information, while _metadata is where you'll find information regarding the functions that are interacting with your cart. Click here to learn more about Functions.

Cart Sections

  • id
  • items
  • totalizer
  • customer
  • shipping
  • delivery
  • culture
  • payment
  • extensions

Items

It's an array containing an object for every item in the buyer's cart.

 [
   {
     "id": "2",
     "name": "adidas Women's Microdot Polo - Night Indigo S",
     "href": "/adidas-womens-microdot-polo-night-indigo/p",
     "price": 67670,
     "quantity": 1,
     "image": "https://olliepartnerus.vteximg.com.br/arquivos/ids/155402-1000-1000/adidas-womens-microdot-polo-night-indigo.jpg?v=638469804501800000",
     "lineId": "2e757f20f9ff4638b1f2892c6350e662",
     "available": true,
     "deliveryMethods": [],
     "attributes": [
       {
         "key": "sellerId",
         "value": "1"
       }
     ]
   }
]
FieldTypeDescription
idstringid of the product
namestringname of the product
hrefstringlink of the product
pricenumberprice without discounts
quantitynumberquantity of this product in your cart
imagestringlink to the image of this product
lineIdstringunique id used to identify this product inside the items array
availablebooleanIf the product is available to purchase or not
deliveryMethodsarray of objectsarray of objects with the delivery options available for this product
attributesarray of objects

attributes

FieldTypeDescription
keystringid of the attribute
valuestringvalue of the attribute
typestringType is an optional prop that can be a string to identify a specific attribute

Totalizers

It's an object with information about the prices in your cart

totalizer: {
  items: 57696,
  shipping:10000,
  taxes:10000,
  discounts: -1500,
  total: 76196
}
FieldTypeDescription
itemsstringsum of all items.prices
shippingstringsum of all delivery.prices
taxesstring
discountsstring
totalstring

Customer

It's an object with information about the user

"customer": {
  "id": "15415421z2xc1as2c1s5ac4x5z9a",
  "firstName": "Ruan",
  "lastName": "Ollie",
  "email": "[email protected]",
  "phone": "169945721247",
  "document": "32820736076"
}
FieldTypeDescription
idstringid of the user
firstNamestringfirst name of the user
lastNamestringlast name of the user
emailstringemail of the user
phonestringphone number of the user
documentstringdocument of the user

Shipping

It's an array of the user's addresses

{
  addresses: [
    {
      id: "72301363c1c9440ea8caf14b1e589414",
      addressLine1: "982 Will Drives",
      addressLine2: "140 apartment",
      state: "CR",
      city: "Washington",
      country: "USA",
      postalCode: "24168"
    }
  ]
}
FieldTypeDescription
idstringid of the address
addresLine1stringfirst line of the address, including the street and number
addresLine2stringadditional address details, such as apartment, suite, or other relevant information for delivery
statestringstate of the address
citystringcity of the address
countrystringcountry of the address
postalCodestringpostal code of the address

Delivery

{
  selected: [
    {
      id: "Fedex-Last-Mile-101",
      items: [
        "e369db3a9eb34ea4800422972d805261",
        "e2722d5fbaf743c0aa77bda31debb008",
        "4a2b422131064b54a0a3a688bfb820fd"
      ],
      name: "Fedex Express",
      type: "delivery",
      price: 555,
      shippingEstimate: "1d",
      addressId: "c05ea48d45574b6f8d5315fe3646cc7f"
    }
  ]
}
FieldTypeDescription
idstringid of the delivery method
itemsarrayarray with lineId's representing the products that will be packaged for this delivery
namestringpublic facing name of this delivery method
typestringtype of delivery (pickup or delivery)
pricenumberprice of shipping (555 equals $5.55)
shippingEstimatestringarrival estimate in business days counting from date of the order
addressIdstringid of the address used for this delivery

Culture

It's an object with information about the localization of this cart

{
  currency: "USD",
  country: "USA",
  locale: "en-US"
}

Payment

The payment section if composed of two objects: selected which is the payment option selected by the user, and options which lists all available payment methods for this cart.

        "selected": [
          {
            "id": "2",
            "value": 68370,
            "referenceValue": 68370,
            "paymentName": "Visa",
            "planId": "c4ca4238a0b92da140dcc509a6f71455c"
          }
        ],
        "options": [
            {
                "id": "2",
                "name": "Visa",
                "type": "credit-card",
                "plans": [
                    {
                        "id": "c4ca4238a0b92da140dcc509a6f71455c",
                        "installments": 1,
                        "interestRate": 0,
                        "installmentValue": 68370,
                        "totalAmount": 68370
                    }
                ]
            }
        ]

Selected

It's an array of objects with the payments methods selected

FieldTypeDescription
idstringid of the payment method
valuenumberamount to be paid with this method
referenceValuenumbervalue of the transaction (if you need to include interest or payment fees)
planIdstringid of the payment plan (there might be multiple options to choose from the same payment method)

Options

It's an array of objects for each payment options available for the cart

FieldTypeDescription
idstringid of the payment method
namearrayamount to be paid with this method
typestringvalue of the transaction (if you need to include interest or payment fees)
plansarrayid of the payment plan (there might be multiple options to choose from the same payment method)

plans

FieldTypeDescription
idstringid of the payment plan
installmentsnumbernumber of installments
interestRatenumbervalue of interest to be paid
installmentValuenumbervalue of installments
totalAmountnumbertotal value to be transacted