Create a new cart

The shopping cart is where the information on the products chosen by the customer while browsing a store is gathered. This data may include item prices, shipping value, payment, and delivery methods, among others.

This guide will describe how to create a new shopping cart with the API.

Creating the new shopping cart

To create a new shopping cart, you must use the Create a new cart endpoint. In this request, it is not required to send any additional information (path params, query, or body).

After making the call, the endpoint will return the response body containing the information about the new shopping cart created, as shown in the example below:

{
    "orderFormId": "ede846222cd44046ba6c638442c3505a",
    "salesChannel": "1",
    "loggedIn": false,
    "isCheckedIn": false,
    "storeId": null,
    "checkedInPickupPointId": null,
    "allowManualPrice": false,
    "canEditData": true,
    "userProfileId": null,
    "userType": null,
    "ignoreProfileData": false,
    "value": 0,
    "messages": [],
    "items": [],
    "selectableGifts": [],
    "totalizers": [],
    "shippingData": null,
    "clientProfileData": {
        "email": null,
        "firstName": null,
        "lastName": null,
        "document": null,
        "documentType": null,
        "phone": null,
        "corporateName": null,
        "tradeName": null,
        "corporateDocument": null,
        "stateInscription": null,
        "corporatePhone": null,
        "isCorporate": false,
        "profileCompleteOnLoading": null,
        "profileErrorOnLoading": null,
        "customerClass": null
    },
...

📘

For more information about the meaning of each of the fields available in the shopping cart, access the orderForm overview.

Accessing shopping cart information

You can access the shopping cart information through the Get cart information by ID endpoint. See more information at Get cart information by ID guide.

Error codes

The following error may appear as a message in the response body.

404 - Not Found

  • Message error example: "The requested URL was not found on the server". Check that the URL data is correct.
<body>
    <h1>404 Not Found</h1>
    <p>The requested URL was not found on this server.</p>
</body>