← Documentation

Browse fixtures Download API fixtures (JSON)

Public API reference

Use the Menu API to render a published menu and the Orders API to start and track a pickup checkout. Use the Menpub API origin and menu URL supplied in the builder handoff. Checkout availability depends on the menu’s enabled services and payment connection.

Fixtures for testing

The downloadable JSON has endpoints with named request and response fixtures and errors with sample responses for every documented error code. Each endpoint’s error_fixtures list points to its applicable entries in errors. Use them to mock the API in a builder preview or in tests. Example identifiers and URLs are sample data. A response body of null on an OPTIONS or 304 fixture represents an empty HTTP response.

Endpoints

Method and path Success Purpose
GET /api/v1/menus/{menu_id} 200 or 304 Fetch a published menu by its public ID.
GET /api/v1/menus/{client_slug}/{menu_slug} 200 or 304 Fetch the same published menu by client and menu slug.
POST /api/v1/menus/{menu_id}/checkouts 201 Start or replay a pickup checkout.
OPTIONS /api/v1/menus/{menu_id}/checkouts 204 Browser preflight for the registered website origin.
GET /api/v1/checkouts/{checkout_id} 200 Read the payment status for an opaque checkout ID.

Menu reads and checkout status reads are public without account cookies. Start checkout from the menu’s registered Website origin or Menpub. The browser sends Origin automatically. Requests to start checkout use Content-Type: application/json. An allowed preflight returns HTTP 204 with an empty body. A rejected preflight returns JSON with origin_not_allowed (403) or menu_not_found (404) for diagnostics. Browsers block the checkout POST after a failed preflight and hide the diagnostic body from storefront code.

Read a menu

A successful response contains menu and environment. Use menu.id and menu.version_id when creating a cart. Use menu.locations to choose an active pickup location. Render recursive categories and items from menu.menu_roots. menu.sections is the legacy view of the first root. The menu also supplies its currency, locale, business details, and hours when available.

Store the response’s ETag and send it in If-None-Match when revalidating the same URL. A 304 response means the saved representation is current.

Start checkout

Send a cart with its menu version, pickup location, catalog selections, and quantities. Each modifier quantity applies to one unit of the parent item. The server determines current prices and checkout totals.

{
  "pickup_name": "Alex",
  "idempotency_key": "checkout-689a4730b5434c56",
  "cart": {
    "schema_version": 1,
    "menu_id": "0b389055-7488-4b31-b4ed-c0376214d95a",
    "menu_version": "<menu.version_id>",
    "location_id": "<active location ID>",
    "line_items": [
      {
        "uid": "item-1",
        "item_id": "<catalog item ID>",
        "variation_id": "<catalog variation ID>",
        "quantity": 1,
        "modifiers": [],
        "note": ""
      }
    ]
  }
}

Each modifier selection contains group_id, modifier_id, and quantity. Use the catalog IDs from the published menu. A 201 response contains an opaque checkout id, checkout_url for hosted payment, status_url for verification, and receipt_url when the menu has a live registered website URL. The receipt URL points to /order-confirmation?menpub_checkout={checkout_id} on that website. Navigate to the returned checkout_url and preserve the cart and checkout ID.

Check payment

Fetch the returned status_url. Checkout status includes id, status, environment, order_id, total_cents, currency, fulfillment_state, and checked_at. Values that are still unknown may be null. Status is pending, paid, refunded, or canceled. Clear the matching cart after the server confirms paid.

Environment metadata

environment is sandbox or production when the associated provider environment is known, and unknown otherwise. An existing checkout uses the environment recorded at creation. The X-Menpub-Environment header carries the same value, including on bodyless OPTIONS and 304 responses. Sites can use it for a test-site label. Request handling, customer messages, and recovery use the same contract in either environment.

Error format

{
  "error": "orders_api_not_connected",
  "message": "Orders API is disconnected for this menu.",
  "environment": "sandbox"
}

Builder handoffs use ?environment=sandbox or ?environment=production on the menu URL to keep sites tied to their catalog after a Website mode change.

HTTP status Error code Meaning
403 api_not_connected Menu API access is disconnected.
404 menu_not_found The menu identifier does not resolve.
409 menu_environment_changed The menu uses a different environment. Keep the last successful menu and resume updates when the expected mode is restored.
503 menu_unavailable The menu source or published data is unavailable.
502 or 503 menu_fetch_failed The source fetch failed. A 503 indicates a temporary provider failure.

Keep the last successful menu during a temporary failure. On 304, keep the cached menu and ETag.

Checkout creation

HTTP status Error code Meaning
403 orders_api_not_connected Orders API is disconnected. The menu owner can reconnect it from Website.
403 square_source_not_connected Orders API is enabled, and the menu owner needs to connect a Square source.
403 reauthorization_required The menu owner needs to reconnect Square and authorize Orders API.
409 checkout_environment_changed The cart environment differs from the website mode. Fetch the menu again and ask the buyer to review the cart.
403 origin_not_allowed Start checkout on the menu’s registered website or Menpub. The origin check runs before the Square connection checks.
404 menu_not_found The menu identifier does not resolve.
409 menu_changed Refresh the menu and let the customer review the preserved cart.
409 checkout_changed The key was tied to a different cart, pickup name, or connection. Review the order before starting a new checkout.
422 invalid_idempotency_key The checkout key is missing or invalid.
422 pickup_name_required Supply a pickup name from 1 to 100 characters.
422 invalid_cart The request needs a cart object.
422 outside_hours The pickup location or menu is closed for ordering.
422 schedule_unavailable The source schedule could not be verified.
422 unavailable_at_location Review an item or option unavailable at the pickup location.
422 unsupported_total Checkout requires a positive total in the menu currency.
502 invalid_payment_link, invalid_square_response The provider did not return a usable checkout.
502 square_request_rejected Square rejected the checkout request. Contact the restaurant if the problem continues.
503 square_unavailable The checkout provider is temporarily unavailable.

Additional HTTP 422 cart codes describe invalid or unavailable selections. Use the path and message together and preserve the rest of the cart.

Error code Meaning
unsupported_version, wrong_menu, invalid_location Review the cart schema, menu, or pickup location.
invalid_shape, invalid_id, duplicate_line Correct the cart structure or line identifier.
unknown_selection, unavailable, unsupported_configuration Review the item or option against the current menu.
invalid_quantity, invalid_note Correct the quantity or note.
duplicate_modifier, quantity_not_allowed, selection_limit Correct option selections or quantities.
price_unavailable A current price in the menu currency is required.

Reuse the same idempotency key when retrying unchanged intent after a timeout or provider failure. Generate a new key for changed intent.

Checkout status

HTTP status Error code Meaning
404 checkout_not_found The checkout identifier does not resolve.
502 order_mismatch, payment_mismatch The provider returned inconsistent payment information.
503 connection_changed The original payment connection is unavailable.
503 status_unavailable Payment has not been verified. Check again shortly.

Keep the matching cart until the status endpoint returns paid. An error means payment could not be verified.

API fixtures

Expand a fixture to view and copy its JSON.

Endpoint fixtures

GET /api/v1/menus/{menu_id}

GET /api/v1/menus/{client_slug}/{menu_slug}

POST /api/v1/menus/{menu_id}/checkouts

OPTIONS /api/v1/menus/{menu_id}/checkouts

GET /api/v1/checkouts/{checkout_id}

Error fixtures