Cart

Manage the user's active cart. A cart holds items from a single restaurant. Adding items from a different restaurant requires forceClear: true to replace the existing cart.

Get Cart

GET/ret11/api/cart
Auth Required

Include a Bearer token.

Parameter In Required Description
userId query optional Your own platform's user ID for the logged-in user

Add to Cart

POST/ret11/api/cart/add
Auth Required

Include a Bearer token.

Request Body

Field Type Required Description
providerId string required From nearby-restaurants
sellerId string required From nearby-restaurants
locationIds string[] required Provider location IDs. Example: ["SSL1"]
items array required At least one item. See below.
forceClear boolean optional Set true to clear existing cart (from another restaurant) before adding. Default: false
userId string optional Your own platform's user ID for the logged-in user

items[]

Field Type Required Description
itemId string required Item ID from menu
locationId string required Location ID. Example: "SSL1"
quantity integer required Positive integer
type string required "item" or "customization"
price number required Item price (from menu response)
parentItemId string optional Shared ID grouping a base item with its customizations
parentCategoryId string optional Customization group ID (e.g., "CG11")
{
  "providerId": "pramaan_provider_1",
  "sellerId": "019b9e8e-baeb-7158-8090-14afa4db5c46",
  "locationIds": ["SSL1"],
  "items": [
    {
      "itemId": "id_1cctu3_9_0",
      "locationId": "SSL1",
      "quantity": 1,
      "type": "item",
      "price": 530
    }
  ],
  "forceClear": false
}

Cart Response (all endpoints)

Field Type Description
id string Cart UUID
userId string Owner user ID
providerId string Restaurant provider ID
sellerId string Restaurant seller ID
restaurantName string Display name of the restaurant
locationIds string[] Provider location IDs
image string Restaurant image URL
items[] array Cart items. Each has itemId, name, shortDesc, locationId, quantity, price, itemType, image, customizations[]
totalAmount number Sum of all item prices
totalItems number Count of items in cart
availableOffers[] array Applicable offers for this cart
{
  "id": "bf722ad0-1234-5678-abcd-ef0123456789",
  "userId": "120123",
  "providerId": "pramaan_provider_1",
  "sellerId": "019b9e8e-baeb-7158-8090-14afa4db5c46",
  "restaurantName": "Pramaan Store 1",
  "locationIds": ["LOC_01"],
  "image": "https://pramaan.ondc.org/beta/preprod/mock/seller/assets/logo/store1.png",
  "items": [
    {
      "itemId": "id_1cctu3_9_0",
      "name": "Double Patty Cheese Burger",
      "shortDesc": "Double Patty Cheese Burger",
      "locationId": "LOC_01",
      "quantity": 1,
      "price": 200,
      "itemType": "item",
      "image": "https://pramaan.ondc.org/assets/burger.jpg",
      "customizations": []
    }
  ],
  "totalAmount": 200,
  "availableOffers": [],
  "totalItems": 1
}
Clear Cart Response

DELETE /ret11/api/cart/clear returns an empty object {}.

Update Item Quantity

PATCH/ret11/api/cart/items/{itemId}
Auth Required

Include a Bearer token.

Field In Required Description
itemId path required The cart item ID to update
quantity body required New quantity. Use 0 to remove the item.
userId body optional Your own platform's user ID for the logged-in user

Remove Item

DELETE/ret11/api/cart/items/{itemId}
Auth Required

Include a Bearer token.

Removes the item and all its customizations from the cart.

Validate Cart

GET/ret11/api/cart/validate
Auth Required

Include a Bearer token.

Validates cart items are still available and prices are current. Call before proceeding to select.

Clear Cart

DELETE/ret11/api/cart/clear
Auth Required

Include a Bearer token.

Removes all items from the cart. Returns an empty cart object.

Cart to Order Flow
  1. Add items to cart via POST /cart/add
  2. Validate cart via GET /cart/validate
  3. Pass cart items to select to start the ONDC transaction