API endpoints

The widget communicates with the backend via the following endpoints

GET /settings

Retrieves the account settings and configuration for the widget.

Status Codes:

  • 200 OK: Success.

Parameters:

  • locale (string): The current locale (e.g., "en").

  • include_restaurants (boolean): Whether to include restaurant data (default: false).

Response:

{
  "is_test_mode": false,
  "pickup_restaurants_count": 5,
  "delivery_restaurants_count": 3,
  "pickup_restaurants": [
    {
      "id": 1,
      "name": "Downtown Branch",
      "address_line_1": "123 Main St",
      "city": "New York",
      "region": "NY",
      "is_pickup_enabled": true,
      "is_delivery_enabled": false
    }
  ],
  "delivery_restaurants": [
    {
      "id": 2,
      "name": "Uptown Branch",
      "address_line_1": "456 Broadway",
      "city": "New York",
      "region": "NY",
      "is_pickup_enabled": true,
      "is_delivery_enabled": true
    }
  ],
  "settings": {
    "base_country": "United States",
    "advanced": {
      "show_restaurant_name": true,
      "show_restaurant_address": true,
      "address_format": "{address_line_1}, {city}",
      "always_show_order_note": false
    },
    "google": {
      "maps_api_key": "AIzaSy...",
      "enable_widget_map": true
    },
    "widget": {
      "google": {
        "maps_api_key": "AIzaSy...",
        "enable_widget_map": true
      },
      "advanced": {
        "show_restaurant_name": true,
        "show_restaurant_address": true,
        "address_format": "{address_line_1}, {city}",
        "always_show_order_note": false
      },
      "restaurant": {
        "select_delivery_location": true,
        "adjust_location_with_map": true
      },
      "location_types": {
        "sort_by_type": true
      }
    },
    "company_name": "My Store",
    "language": "en",
    "currency_code": "USD",
    "country_code": "US",
    "time_format": "12h",
    "developer": {
      "selectors": {
        "product_add_to_cart": "form[action='/cart/add']",
        "product_add_to_cart_text": ".add-to-cart-text"
      }
    },
    "checkout_locales": {
      "pickup": "en",
      "delivery": "en",
      "shipping": "en"
    }
  },
  "translations": [
    {
      "id": 1,
      "translation_key": "front_widget",
      "values": {
        "en": "Order Now",
        "es": "Ordenar Ahora"
      }
    }
  ]
}

POST /product-options

Retrieves available product options for a given product, used for checking availability and restrictions. ​

Status Codes:

  • 200 OK: Success.

  • 400 Bad Request: Missing product data.

  • 404 Not Found: Shop or account not found.

Payload:

Response:

POST /search

Searches for available restaurants based on location and delivery option.

​Status Codes:

  • 200 OK: Success.

Payload:

Response:

POST /checkouts

Creates a draft order or processes the checkout.

Status Codes:

  • 200 OK: Success.

  • 422 Unprocessable Entity: Validation errors (e.g., out of stock).

Payload:

Success Response (200 Ok):

Error Response (422 Unprocessable Entity):

GET /restaurant/{restaurant}/menu/{menu}

Retrieves the details of a specific menu for a restaurant. ​

Status Codes:

  • 200 OK: Success.

  • 404 Not Found: Restaurant or menu not found.

Parameters:

  • restaurant (integer): The restaurant ID.

  • menu (integer): The menu ID.

Response:

Last updated