Server Side Cart

With the implimentation of Menu v2, the Server-Side Cart API provides a robust and secure way to manage shopping cart functionality on your ordering platforms. This API enables you to create and manipulate cart sessions by switching stores, order types, add or remove items, apply discounts, and process orders entirely on the server side, offering enhanced security and reliability compared to client-side cart management.

Core Features The API supports all essential cart operations including:

  • Cart creation and management
  • Item addition, removal, and quantity updates
  • Price calculation and tax handling
  • Discount code application
  • Inventory validation
  • Order conversion and checkout initialization

Initiate cart

Request

{
  "method": "post",
  "url": "https://api-playground.menu.app/api/cart/init",
  "headers": {
    "Api-Version": "4.60.0" ,
    "Application": "f3a90488ffee32c3acb6fcd0ca417cf6" ,
  }
}

Response

{
  "status": "OK",
  "code": 200,
  "data": {
    "cart": {
      "id": "f6ce31f7b7549cc7c3e5326661cf1dc3b5ea5c3fd89cce634667e483e23fb51a",
      "is_empty": true
    }
  }
}

Get cart

Request

{
  "method": "get",
  "url": "https://api-playground.menu.app/api/cart/{cart_id}",
  "headers": {
    "Api-Version": "4.60.0" ,
    "Application": "f3a90488ffee32c3acb6fcd0ca417cf6" ,
    "cart_id" : ,
  }
}

Response

{
  "status": "OK",
  "code": 200,
  "data": {
    "cart": {
      "id": "e6d0c777d7d46b1016ef80c8de20b132f53b2e74184bdc1e7c4bc3d840e5f07f",
      "products": [
        {
          "item_id": "14f4e650-987a-4000-b102-25629dfaa06e",
          "menu_id": "5a4e114f-3c1f-4e59-af0f-7af915b3d495",
          "category_id": "f167fe8b-2f16-426f-a742-fe0c0624a60c",
          "price_id": "9a4e25be-9c32-4b69-81b7-19a4f3595406",
          "price": 530,
          "name": "Amer - Super Burger",
          "is_available": true,
          "comment": "",
          "quantity": 1,
          "tax_amount": 0,
          "tax_rate": 0,
          "product_groups": [
            {
              "id": "273ec6f0-4d3c-402b-955e-75c5ba581058",
              "type": 1,
              "comment": "",
              "products": [
                {
                  "item_id": "79737674-49fe-4053-a72b-9c6d5e0b8481",
                  "menu_id": "5a4e114f-3c1f-4e59-af0f-7af915b3d495",
                  "category_id": "",
                  "price_id": "975ba87e-ac25-4da5-b04b-76844ef10421",
                  "price": 36,
                  "name": "Rye",
                  "is_available": true,
                  "comment": "",
                  "quantity": 1,
                  "tax_amount": 0,
                  "tax_rate": 0,
                  "product_groups": [],
                  "summary": {
                    "subtotal": 36,
                    "total": 36,
                    "total_tax": 0,
                    "tax_rates": []
                  }
                }
              ]
            }
          ],
          "summary": {
            "subtotal": 566,
            "total": 566,
            "total_tax": 0,
            "tax_rates": []
          }
        }
      ],
      "discounts": [],
      "tip": {
        "amount": 20,
        "type": 2
      },
      "fees": [
        {
          "amount": 100,
          "type": 4,
          "name": "Tech Fee"
        }
      ],
      "summary": {
        "subtotal": 566,
        "total": 679,
        "discount": 0,
        "payment_amount": 679,
        "tax_rates": [],
        "total_tax": 0,
        "total_fee": 0,
        "tip": 113,
        "loyalty": {
          "points_spent": 0,
          "points_accrued": 1,
          "available_points": 0
        }
      },
      "settings": {
        "prices_includes_tax": false
      }
    }
  }
}

Update cart

Request

{
  "method": "post",
  "url": "https://api-playground.menu.app/api/cart/{cart_id}",
  "headers": {
    "Api-Version": "4.60.0" ,
    "Application": "f3a90488ffee32c3acb6fcd0ca417cf6" ,
    "cart_id" , 
  }
}

Response

{
  "status": "OK",
  "code": 200,
  "data": {
    "cart": {
      "id": "e6d0c777d7d46b1016ef80c8de20b132f53b2e74184bdc1e7c4bc3d840e5f07f",
      "products": [
        {
          "item_id": "14f4e650-987a-4000-b102-25629dfaa06e",
          "menu_id": "5a4e114f-3c1f-4e59-af0f-7af915b3d495",
          "category_id": "f167fe8b-2f16-426f-a742-fe0c0624a60c",
          "price_id": "9a4e25be-9c32-4b69-81b7-19a4f3595406",
          "price": 530,
          "name": "Amer - Super Burger",
          "is_available": true,
          "comment": "",
          "quantity": 1,
          "tax_amount": 0,
          "tax_rate": 0,
          "product_groups": [
            {
              "id": "273ec6f0-4d3c-402b-955e-75c5ba581058",
              "type": 1,
              "comment": "",
              "products": [
                {
                  "item_id": "79737674-49fe-4053-a72b-9c6d5e0b8481",
                  "menu_id": "5a4e114f-3c1f-4e59-af0f-7af915b3d495",
                  "category_id": "",
                  "price_id": "975ba87e-ac25-4da5-b04b-76844ef10421",
                  "price": 36,
                  "name": "Rye",
                  "is_available": true,
                  "comment": "",
                  "quantity": 1,
                  "tax_amount": 0,
                  "tax_rate": 0,
                  "product_groups": [],
                  "summary": {
                    "subtotal": 36,
                    "total": 36,
                    "total_tax": 0,
                    "tax_rates": []
                  }
                }
              ]
            }
          ],
          "summary": {
            "subtotal": 566,
            "total": 566,
            "total_tax": 0,
            "tax_rates": []
          }
        }
      ],
      "discounts": [],
      "tip": {
        "amount": 20,
        "type": 2
      },
      "fees": [],
      "summary": {
        "subtotal": 566,
        "total": 679,
        "discount": 0,
        "payment_amount": 679,
        "tax_rates": [],
        "total_tax": 0,
        "total_fee": 0,
        "tip": 113,
        "loyalty": {
          "points_spent": 0,
          "points_accrued": 1,
          "available_points": 0
        }
      },
      "settings": {
        "prices_includes_tax": false
      }
    }
  }
}

Checkout

Request

{
  "method": "post",
  "url": "https://api-playground.menu.app/api/cart/{cart_id}/checkout",
  "headers": {
    "Api-Version": "4.60.0" ,
    "cart_id": "" ,
  }
}

Response

{
  "status": "OK",
  "code": 200,
  "data": {
    "cart": {
      "id": "e6d0c777d7d46b1016ef80c8de20b132f53b2e74184bdc1e7c4bc3d840e5f07f",
      "products": [
        {
          "item_id": "14f4e650-987a-4000-b102-25629dfaa06e",
          "menu_id": "5a4e114f-3c1f-4e59-af0f-7af915b3d495",
          "category_id": "f167fe8b-2f16-426f-a742-fe0c0624a60c",
          "price_id": "9a4e25be-9c32-4b69-81b7-19a4f3595406",
          "price": 530,
          "name": "Amer - Super Burger",
          "is_available": true,
          "comment": "",
          "quantity": 1,
          "tax_amount": 0,
          "tax_rate": 0,
          "product_groups": [
            {
              "id": "273ec6f0-4d3c-402b-955e-75c5ba581058",
              "type": 1,
              "comment": "",
              "products": [
                {
                  "item_id": "79737674-49fe-4053-a72b-9c6d5e0b8481",
                  "menu_id": "5a4e114f-3c1f-4e59-af0f-7af915b3d495",
                  "category_id": "",
                  "price_id": "975ba87e-ac25-4da5-b04b-76844ef10421",
                  "price": 36,
                  "name": "Rye",
                  "is_available": true,
                  "comment": "",
                  "quantity": 1,
                  "tax_amount": 0,
                  "tax_rate": 0,
                  "product_groups": [],
                  "summary": {
                    "subtotal": 36,
                    "total": 36,
                    "total_tax": 0,
                    "tax_rates": []
                  }
                }
              ]
            }
          ],
          "summary": {
            "subtotal": 566,
            "total": 566,
            "total_tax": 0,
            "tax_rates": []
          }
        }
      ],
      "discounts": [],
      "tip": {
        "amount": 20,
        "type": 2
      },
      "fees": [
        {
          "amount": 100,
          "type": 4,
          "name": "Tech Fee"
        }
      ],
      "summary": {
        "subtotal": 566,
        "total": 679,
        "discount": 0,
        "payment_amount": 679,
        "tax_rates": [],
        "total_tax": 0,
        "total_fee": 0,
        "tip": 113,
        "loyalty": {
          "points_spent": 0,
          "points_accrued": 1,
          "available_points": 0
        }
      },
      "settings": {
        "prices_includes_tax": false
      }
    }
  }
}

Tip

As part of the checkout and cart update calls, you can optionally include a tip object to add a gratuity to the order.

      "tip": {
        "amount": 20,
        "type": 2
      }

The tip object contains the following fields:

  • amount: The value of the tip, which depends on the type.

  • type: Determines how the amount is interpreted:

    • 1 – A fixed amount in cents (e.g., amount: 200 means a $2.00 tip).

    • 2 – A percentage of the cart’s subtotal (e.g., amount: 15 applies a 15% tip based on the subtotal).

This allows tipping to be either a static fixed amount or dynamically calculated as a percentage of the order value.

Payment Initialization

Request

{
  "method": "post",
  "url": "https://api-playground.menu.app/api/cart/{cart_id}/payments/init",
  "headers": {
    "cart_id"
    "Api-Version": "4.60.0" ,
    "Application": "f3a90488ffee32c3acb6fcd0ca417cf6" ,
    "device_uuid": " " ,
  }
}

Response

{
  "status": "string",
  "code": 0,
  "data": {
    "id": 0,
    "payment_method_id": 0,
    "payment_processor_type_id": 0,
    "payment_init_hash": "string",
    "allows_webhooks": true,
    "expires_in": 0,
    "status_polling_interval": 0,
    "additional_info": {}
  }
}

Order Create

Request

{
  "method": "post",
  "url": "https://api-playground.menu.app/api/cart/{cart_id}/order",
  "headers": {
    "Api-Version": "4.60.0" ,
    "cart_id": "4.60.0" ,
    "Application": "f3a90488ffee32c3acb6fcd0ca417cf6" ,
    "device_uuid": " " ,
  }
}

Response

{
  "status": "string",
  "code": 0,
  "data": {
    "id": 0,
    "code": "string",
    "uuid": "string",
    "type_id": 0,
    "reference_type": "string",
    "init_hash": "string",
    "external_reference": null,
    "external_code": null,
    "external_channel_id": null,
    "application_id": 0,
    "application_info": {
      "id": 0,
      "key": "string",
      "name": "string",
      "uuid": "string",
      "type_id": 0,
      "brand_id": 0,
      "created_at": "string",
      "updated_at": "string",
      "is_dpa_signed": 0,
      "reference_type": "string"
    },
    "venue_id": 0,
    "venue_info": {
      "id": 0,
      "name": "string",
      "address": "string",
      "city": "string",
      "zip": "string",
      "latitude": 0,
      "longitude": 0,
      "phone": "string",
      "delivery_travel_type": "string",
      "use_pos_order_number": true,
      "timezone": {
        "name": "string",
        "offset": "string"
      },
      "tax_number": "string",
      "pickup_time": 0,
      "image": null,
      "country": {
        "id": 0,
        "name": "string",
        "code": "string",
        "calling_code": "string",
        "currency_settings": {
          "currency_space": true,
          "decimal_separator": "string",
          "thousands_separator": "string",
          "symbol_position": "string"
        }
      },
      "currency": {
        "id": 0,
        "code": "string",
        "code_numeric": "string",
        "symbol": "string",
        "rounding_unit": 0,
        "rounding_unit_tip": 0
      },
      "dispatch_legacy": true
    },
    "singular_point_id": 0,
    "singular_point_info": {
      "id": 0,
      "input": {
        "id": 0,
        "name": "string",
        "singular_point_id": 0
      },
      "input_id": 0,
      "area_info": {
        "id": 0,
        "name": "string",
        "pos_id": null,
        "type_id": 0,
        "reference_type": "string"
      },
      "parent_id": 0,
      "created_at": null,
      "input_type": "string",
      "table_info": {
        "id": 0,
        "number": "string",
        "pos_id": null
      },
      "parent_type": "string"
    },
    "pos_ticket_id": "string",
    "pos_ticket_code": "string",
    "customer_account_id": 0,
    "customer_account_info": {
      "id": 0,
      "uuid": "string",
      "email": "string",
      "state": 0,
      "locale": "string",
      "type_id": 0,
      "brand_id": 0,
      "v2_token": null,
      "confirmed": 0,
      "last_name": "string",
      "created_at": "string",
      "first_name": "string",
      "updated_at": "string",
      "customer_id": null,
      "demographics": [
        {}
      ],
      "phone_number": "string",
      "is_dpa_signed": 0,
      "discount_cards": [
        {}
      ],
      "reference_type": "string",
      "optin_status_pn": 0,
      "optin_status_sms": 0,
      "optin_status_email": 0,
      "created_by_application_id": 0,
      "optin_status_sms_internal": 0
    },
    "order_type": 0,
    "order_type_info": {
      "id": 0,
      "uuid": "string",
      "state": 0,
      "tip_max": null,
      "type_id": 0,
      "venue_id": 0,
      "created_at": "string",
      "updated_at": "string",
      "tip_default": null,
      "is_dpa_signed": 0,
      "reference_type": "string",
      "external_channel_only": 0
    },
    "order_type_properties": {
      "type_id": 0,
      "table_id": "string"
    },
    "order_additional_info": {
      "pos_wait_until_paid": true
    },
    "is_scheduled": true,
    "trigger_type": 0,
    "status": "string",
    "status_changed_by": "string",
    "payment_status": "string",
    "fraud_detection_status": null,
    "fiscal_status": null,
    "fiscalization_number": null,
    "tablet_status": "string",
    "delivery_status": null,
    "is_test": true,
    "calculation_method": "string",
    "subtotal": 0,
    "discount": 0,
    "subsidy": 0,
    "external_payment_amount": 0,
    "discount_info": null,
    "service_charge": 0,
    "service_charge_rate": 0,
    "service_charge_tax_rate": 0,
    "delivery_fee_tax_rate": 0,
    "delivery_fee": 0,
    "delivery_fee_tax": 0,
    "minimal_order_amount": 0,
    "minimum_surcharge": 0,
    "minimum_surcharge_tax": 0,
    "tip": 0,
    "tip_rate": 0,
    "fees": [
      {
        "name": "Tech Fee",
        "type: 4,
        "total": 150,
        "subtotal": 130,
        "tax": 20
      }
    ],
    "total": 0,
    "tax": 0,
    "tax_exemption": 0,
    "tax_rates": [
      {}
    ],
    "tax_rates_exemption": [
      {}
    ],
    "fees": [
      {
        "name": "Tech Fee",
        "type: 4,
        "total": 150,
        "subtotal": 130,
        "tax": 20
      }
    ],
    "refunded": 0,
    "products": [
      {
        "pos_id": null,
        "name": "string",
        "translations": {
          "name": null
        },
        "price": 0,
        "quantity": 0,
        "subtotal": 0,
        "tax": 0,
        "tax_rates": [
          {}
        ],
        "comment": "string",
        "image": {
          "thumbnail_small": "string",
          "thumbnail_medium": "string",
          "fullsize": "string"
        },
        "product_groups": [
          {
            "group_type": 0,
            "pos_id": null,
            "name": "string",
            "translations": {
              "name": null
            },
            "subtotal": 0,
            "tax": 0,
            "tax_rates": [
              {}
            ],
            "image": {
              "thumbnail_small": "string",
              "thumbnail_medium": "string",
              "fullsize": "string"
            },
            "products": [
              {
                "pos_id": null,
                "name": "string",
                "translations": {
                  "name": null
                },
                "price": 0,
                "quantity": 0,
                "subtotal": 0,
                "tax": 0,
                "tax_rates": [
                  {}
                ],
                "comment": "string",
                "image": {
                  "thumbnail_small": "string",
                  "thumbnail_medium": "string",
                  "fullsize": "string"
                }
              }
            ]
          }
        ]
      }
    ],
    "payments": [
      {
        "id": 0,
        "payment_method_id": 0,
        "payment_processor_type_id": 0,
        "payment_processor_id": null,
        "total": 0,
        "pos_receipt_id": "string",
        "stored_payment_method_vault": null
      }
    ],
    "refunds": [
      {}
    ],
    "pickup_code": null,
    "preparation_time": 0,
    "additional_delivery_info": null,
    "delivery_delay_time": null,
    "is_customer_arrived": true,
    "is_status_fired": true,
    "cancellation_reason_id": null,
    "delivery_job": {},
    "regret_cancel_until": null,
    "send_at": "string",
    "pickup_at": null,
    "ready_at": null,
    "arriving_at": null,
    "delivery_at": null,
    "created_at": "string",
    "updated_at": "string"
  }
}

Cross-Sell API

The cross-sell API provides product recommendations to the user. This feature introduces a new property to both the cart GET and PUT API calls to manage the source of these recommendations.

GET Cross-Sell Products

This endpoint retrieves a list of recommended products based on the current cart contents. It returns a new top-level property, cross_sell_type, which indicates the source of the recommendations.

Request

{
  "method": "get",
  "url": "/api/cart/{cart_id}/cross-sell",
  "headers": {
    "Api-Version": "4.60.0" ,
    "Application": "f3a90488ffee32c3acb6fcd0ca417cf6" ,
  }
}

Response

{
  "status": "OK",
  "code": 200,
  "data": {
    "cart": {
      "id": "e6d0c777d7d46b1016ef80c8de20b132f53b2e74184bdc1e7c4bc3d840e5f07f",
      "cross_sell_type": {
        "label": "menu",
        "value": 0
      },
      "cross_sell_products": [
        {
          "price_id": "cabf785e-32d6-4358-98ed-8eb401025c35",
          "name": "Recommended Drink",
          "price": 300,
          "is_available": true
        }
      ],
    }
  }
}

The cross_sell_type property can have one of two forms:

  • { label: "menu", value: 0 }: Recommendations are sourced from the menu system.
  • { label: "punchh", value: 1 }: Recommendations are sourced from Punchh.

Update Cart with Cross-Sell Product

When adding a cross-sell product to the cart, the cross_sell_type property is added to the product object. This property should only contain the value from the GET /api/cart/{cart_id}/cross-sell response.

Request

{
  "method": "put",
  "url": "/api/cart/{cart_id}",
  "headers": {
    "Api-Version": "4.60.0" ,
    "Application": "f3a90488ffee32c3acb6fcd0ca417cf6" ,
    "cart_id": ""
  },
  "body": {
    "metadata": {},
    "customer_info": {},
    "cart": {
      "products": [
        {
          "price_id": "dc7b5bf2-4d1f-471a-995e-be7cf7d8a214",
          "comment": "",
          "quantity": 50,
          "product_groups": []
        },
        {
          "price_id": "cabf785e-32d6-4358-98ed-8eb401025c35",
          "comment": "",
          "quantity": 5,
          "product_groups": [],
          "cross_sell_type": 1
        }
      ],
      "discounts": [],
      "tip": {}
    }
  }
}