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.
Example
const result = await client.callTool({
name: "create_cart",
arguments: {
restaurantId: "rest_42",
cartType: "DEAL_TICKET_PURCHASE",
latitude: 12.9716,
longitude: 77.5946,
},
});Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
restaurantId | string | yes | Restaurant ID |
cartType | "DEAL_TICKET_PURCHASE" | "DINEOUT" | yes | Cart type: DEAL_TICKET_PURCHASE for booking, DINEOUT for bill payment |
latitude | number | yes | Latitude |
longitude | number | yes | Longitude |
slotId | number | no | Slot ID (required for booking cart) |
itemId | string | no | Item ID (required for booking cart, format: "restaurantId-ticketId") |
reservationTime | number | no | Unix timestamp (required for booking cart) |
guestCount | number | no | Number of guests (required for booking cart, 1-20) |
billAmount | number | no | Bill amount in rupees (required for bill payment cart) |
source | string | no | Source 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-levelcartandcartKeyare 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:
erroris a plain string (not{ message: string }). Read it asresponse.error, notresponse.error.message.cart: nullis included at the top level on failure.
See Error codes for the full catalogue.
Details
| Field | Value |
|---|---|
| Name | create_cart |
| MCP Server | Dineout |
| Endpoint | POST mcp.swiggy.com/dineout |
| Stage | Reserve |
| Behaviour | mutating |
Next in this journey →
Continue with book_table.