create_cart

Swiggy Dineout: Create a cart for TABLE BOOKING or bill payment. For booking (DEAL_TICKET_PURCHASE): requires restaurant ID, slot details, and guest count. Validates billToPay = 0 and skipPayment = t...

Swiggy Dineout: Create a cart for TABLE BOOKING or bill payment. For booking (DEAL_TICKET_PURCHASE): requires restaurant ID, slot details, and guest count. Validates billToPay = 0 and skipPayment = true for free reservations. Note: book_table creates cart internally, so this is only needed for standalone cart operations.

See create_cart in actionComing soon

Example

const result = await client.callTool({
  name: "create_cart",
  arguments: {
    restaurantId: "rest_42",
    cartType: "DEAL_TICKET_PURCHASE",
    latitude: 12.9716,
    longitude: 77.5946,
  },
});

Parameters

ParameterTypeRequiredDescription
restaurantIdstringyesRestaurant ID
cartType"DEAL_TICKET_PURCHASE" | "DINEOUT"yesCart type: DEAL_TICKET_PURCHASE for booking, DINEOUT for bill payment
latitudenumberyesLatitude
longitudenumberyesLongitude
slotIdnumbernoSlot ID (required for booking cart)
itemIdstringnoItem ID (required for booking cart, format: "restaurantId-ticketId")
reservationTimenumbernoUnix timestamp (required for booking cart)
guestCountnumbernoNumber of guests (required for booking cart, 1-20)
billAmountnumbernoBill amount in rupees (required for bill payment cart)
sourcestringnoSource for bill payment cart (default: "direct-payment-cart")

Session credentials (user identity, access token) are supplied automatically by the authenticated MCP session - you do not pass them in the tool call. See Authenticate.

Response

Success:

{
  "success": true,
  "data": {
    "cart": { /* full cart object */ },
    "cartKey": "string",
    "availablePaymentMethods": ["string"],
    "paymentOptions": {
      "allMethods": [],
      "upiMethods": [],
      "allGroups": [],
      "paymentAmount": 0,
      "markdown": "string"
    },
    "gpoError": "string"
  },
  "cart": { /* back-compat alias — same as data.cart */ },
  "cartKey": "string",
  "message": "optional human-readable message"
}
  • data.cart / data.cartKey — primary fields. Top-level cart and cartKey are back-compat aliases pointing to the same values; present so older widget code reading top-level fields still works.
  • data.availablePaymentMethods — string array of available methods.
  • data.paymentOptions — full payment options breakdown.
  • data.gpoError — present only when the GPO fetch fails during cart creation.

On failure:

{
  "success": false,
  "cart": null,
  "error": "description of what went wrong"
}

Note: error is a plain string (not { message: string }). Read it as response.error, not response.error.message. cart: null is included at the top level on failure.

See Error codes for the full catalogue.

Details

FieldValue
Namecreate_cart
MCP ServerDineout
EndpointPOST mcp.swiggy.com/dineout
StageReserve
Behaviourmutating

Next in this journey →

Continue with book_table.