### GraphQL Query Examples Source: https://api.ezcater.io/using-graphql Examples of common GraphQL queries that can be executed against the ezCater API, including fetching menus, schema information, and type details. ```APIDOC ## GraphQL Query Examples ### Template Query This is a basic template for constructing a query. ```graphql query { menus { Nodes { Id Name startDate endDate } } } ``` ### `menusByCaterer` Query Fetches a list of menus with their ID, name, start date, and end date. ```graphql query menusByCaterer { menus { nodes { id name startDate endDate } } } ``` ### `fullschema` Query Retrieves the entire GraphQL schema, including types, their kinds, descriptions, and fields. ```graphql query fullschema { __schema { types { name kind description fields { name } } } } ``` ### `__type` Query Fetches detailed information about a specific type within the GraphQL schema, such as the 'Menu' type. ```graphql query { __type(name: "Menu" ) { name kind description fields { name } } } ``` ``` -------------------------------- ### GraphQL Variables for Subscription Creation Examples Source: https://api.ezcater.io/subscription-create These are example variable payloads for the `createSubscription` mutation, demonstrating how to specify different events and entities for which notifications are desired. Each example includes the `eventEntity`, `eventKey`, `parentEntity`, `parentId`, and `subscriberId`. ```graphql { "subscriptionParams": { "eventEntity": "Order", "eventKey": "accepted", "parentEntity": "Caterer", "parentId": "ezcater-caterer-id", "subscriberId": "your-subscriber-id" } } ``` ```graphql { "subscriptionParams": { "eventEntity": "Mennu", "eventKey": "updated", "parentEntity": "Caterer", "parentId": "ezcater-caterer-id", "subscriberId": "your-subscriber-id" } } ``` ```graphql { "subscriptionParams": { "eventEntity": "MenuCreationRequest", "eventKey": "succeeded", "parentEntity": "Caterer", "parentId": "ezcater-caterer-id", "subscriberId": "your-subscriber-id" } } ``` -------------------------------- ### MenuCreationException Example (GraphQL) Source: https://api.ezcater.io/menu-schema-reference An example of the MenuCreationException object, which details errors or warnings encountered during menu creation. It includes a message and specific details about the source and referenced entity. ```graphql { "details": { "source": "categories", "source_name": "Pizzas", "source_pos_id": "pizzas-category-id", "reference_type": "items", "referenced_pos_id": "margherita-pizza-item-id" }, "message": "Referenced entity is not defined" } ``` -------------------------------- ### MenuCreationRequest Example (GraphQL) Source: https://api.ezcater.io/menu-schema-reference An example of the MenuCreationRequest object, illustrating the status and outcome of a menu creation request. It includes fields for errors, the created menu's UUID, overall outcome, status, and any warnings. ```graphql { "errors": [MenuCreationException!], "menuUuid": "ezcater-menu-id", "outcome": "success", "status": "complete", "warnings": [MenuCreationException!] } ``` -------------------------------- ### ItemSelectionInput Example (GraphQL) Source: https://api.ezcater.io/menu-schema-reference This example demonstrates how to structure the ItemSelectionInput object in GraphQL to specify various attributes of an item selection, including price, size, calorie information, and serving details. It shows multiple instances for different pizza sizes. ```graphql { "price": 16.75, "posId": "12-inch-pizza-item-selection-id", "size": "12\" Pizza", "serves": 2, "minCalories": 512, "maxCalories": 1024, "sortOrder": 1 }, { "price": 24.75, "posId": "16-inch-pizza-item-selection-id", "size": "16\" Pizza", "serves": 4, "minCalories": 512, "maxCalories": 1024, "sortOrder": 1 }, { "price": 32.75, "posId": "20-inch-pizza-item-selection-id", "size": "20\" Pizza", "serves": 8, "minCalories": 512, "maxCalories": 1024, "sortOrder": 1 } ``` -------------------------------- ### GraphQL Example: Create Subscriber Input Fields Source: https://api.ezcater.io/subscription-schema-reference This GraphQL example demonstrates the input fields required for creating a new subscriber. It includes 'name' for the subscriber's identity and 'webhookUrl' for receiving notifications. ```graphql { "name": "Example Provider - Example Brand", "webhookUrl": "https://example.net/subscriptions" } ``` -------------------------------- ### GraphQL Response Examples for Subscribers (JSON) Source: https://api.ezcater.io/subscriber-list These JSON examples illustrate the possible response payloads for the `subscribers` GraphQL query. They cover scenarios where no subscribers exist, subscribers exist but have no subscriptions, and subscribers with active subscriptions. These examples help in understanding and parsing the API's responses. ```json { "data": { "subscribers": [] } } ``` ```json { "data": { "subscribers": [ { "id": "your-subscriber-id", "name": "Example Provider Updated - Example Brand", "subscriptions": [], "webhookUrl": "https://example.net/subscriptions" } ] } } ``` ```json { "data": { "subscribers": [ { "id": "your-subscriber-id", "name": "Example Provider Updated - Example Brand", "subscriptions": [ { "eventEntity": "Menu", "eventKey": "updated", "parentEntity": "Caterer", "parentId": "ezcater-caterer-id", "subscriberId": "your-subscriber-id" }, { "eventEntity": "MenuCreationRequest", "eventKey": "failed", "parentEntity": "Caterer", "parentId": "ezcater-caterer-id", "subscriberId": "your-subscriber-id" }, { "eventEntity": "MenuCreationRequest", "eventKey": "succeeded", "parentEntity": "Caterer", "parentId": "ezcater-caterer-id", "subscriberId": "your-subscriber-id" }, { "eventEntity": "MenuCreationRequest", "eventKey": "succeeded_with_warnings", "parentEntity": "Caterer", "parentId": "ezcater-caterer-id", "subscriberId": "your-subscriber-id" }, { "eventEntity": "Order", "eventKey": "accepted", "parentEntity": "Caterer", "parentId": "ezcater-caterer-id", "subscriberId": "your-subscriber-id" }, { "eventEntity": "Order", "eventKey": "cancelled", "parentEntity": "Caterer", "parentId": "ezcater-caterer-id", "subscriberId": "your-subscriber-id" }, { "eventEntity": "Order", "eventKey": "rejected", "parentEntity": "Caterer", "parentId": "ezcater-caterer-id", "subscriberId": "your-subscriber-id" }, { "eventEntity": "Order", "eventKey": "submitted", "parentEntity": "Caterer", "parentId": "ezcater-caterer-id", "subscriberId": "your-subscriber-id" }, { "eventEntity": "Order", "eventKey": "uncancelled", "parentEntity": "Caterer", "parentId": "ezcater-caterer-id", "subscriberId": "your-subscriber-id" } ], "webhookUrl": "https://example.net/subscriptions" } ] } } ``` -------------------------------- ### OptionInput Schema Example (GraphQL) Source: https://api.ezcater.io/menu-schema-reference An example of the OptionInput schema used to customize menu items. This structure defines various fields for caterer-specific labels, customer prompts, and selection constraints. ```graphql { "name": "Cheese Addon", "posId": "cheese-addon-options-id", "catererLabel": "Cheese", "choicePosIds": [ "feta-choice-id", "parmigiano-reggiano-choice-id", "parmesan-choice-id" ], "customerPrompt": "Add Additional Cheese?", "maxChoiceSelections": 1, "minChoiceSelections": 1 } ``` -------------------------------- ### CourierAssignInput Example (GraphQL) Source: https://api.ezcater.io/courier-schema-reference An example of the CourierAssignInput object in GraphQL format. This demonstrates the structure and expected values for assigning a courier to a delivery, including optional fields like clientMutationId and occurredAt. ```graphql { "clientMutationId": "your-mutation-id", "courier": CourierInput, "deliveryId": "ezcater-delivery-id", "occurredAt": "2024-02-05T17:27:55+0000" } ``` -------------------------------- ### CategoryInput Example (GraphQL) Source: https://api.ezcater.io/menu-schema-reference An example of the CategoryInput object used for defining a menu category. It shows how to specify the category's name, description, external ID, sort order, and associated item IDs. ```graphql { "name": "Pizzas", "posId": "margherita-pizza-item-id", "sortOrder": 2, "description": "A selection of our famous pizzas", "itemPosIds": [ "margherita-pizza-item-selection-id" ] } ``` -------------------------------- ### Example Delivery Input for CouriersAssign Source: https://api.ezcater.io/courier-schema-reference This example demonstrates the structure of the 'Delivery' input object, which is used to specify the delivery ID for courier assignments. It requires a globally-unique identifier for the delivery. ```graphql { "id": "ezcater-delivery-id" } ``` -------------------------------- ### CourierInput GraphQL Example Source: https://api.ezcater.io/courier-schema-reference This example demonstrates how to structure a CourierInput object in GraphQL. It includes essential fields like ID, name, phone, and provider details, showing how to represent both in-house and third-party couriers. ```graphql { "id": "your-courier-id", "firstName": "Test", "lastName": "Courier", "phone": "+15555555555", "providerSource": "THIRD_PARTY", "providerName": "DoorDash", "vehicle": CourierVehicleInput } ``` -------------------------------- ### CourierAssignPayload Example (GraphQL) Source: https://api.ezcater.io/courier-schema-reference Example JSON structure for the CourierAssignPayload, returned after assigning a courier to a delivery. It includes fields for a client mutation ID, delivery details, and any user errors. ```graphql { "clientMutationId": "your-mutation-id", "delivery": { "id": "ezcater-delivery-id" }, "userErrors": [CourierAssignUserError!] } ``` -------------------------------- ### Relish Menu Setup and API Integration Source: https://api.ezcater.io/menu-sync Guidelines for syncing menus with Relish locations, including required item and choice level tags, and considerations for API order submission timing. ```APIDOC ## Relish Menu Setup and API Integration ### Description This section provides instructions for synchronizing menus with Relish locations via the API. It outlines the necessary tagging conventions for items and choices, and explains potential timing issues related to order finalization. ### Method N/A (Configuration Guide) ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) N/A #### Response Example N/A ### Relish Integration Guidelines: - **API Orders**: Relish orders must be sent through the API. - **Timing Caveats**: Orders may fail if the "Relish Finalized" status is active (approx. 90 minutes before event time). - **ezCater Items**: Using ezCater-specific menu items in Olo can help manage lead times for Relish items. ### Item Level Tags (Required): - `RelishChannel`: 'T' - `Marketplacechannel`: 'T' (Required if shared with Marketplace; cannot be standalone) - `CateringServeSize` - `TaxCategory` - `QuantityUnit` - `FoodLabelingTags` (when applicable) - `ItemTypeTags` (when applicable) ### Choice Level Tags (Required when applicable): - `FoodLabelingTags` - `ChoiceTypeTags` (for Drinks, Desserts) - `INDIVIDUALLY_PACKAGED_RELISH_SIDE`: 'T' (for Sides, required when applicable) ### Relish Tagging Logic: - **`INDIVIDUALLY_PACKAGED_RELISH_SIDE`**: Use for items not part of the main item and not included within it (e.g., a side mac and cheese ordered separately). - **`ChoiceTypeTags`**: Generates an additional label for Drinks or Desserts included with the package. - **Utensils**: Not required for Relish items, even if duplicated/added specifically for Relish. ``` -------------------------------- ### OrderItem Schema Example (GraphQL) Source: https://api.ezcater.io/order-schema-reference An example of the OrderItem schema in GraphQL format. This snippet illustrates the structure and potential values for each field within an order item, including customizations, item details, and pricing. ```graphql { "customizations": [OrderItemCustomization!]!, "labelFor": null, "menuItemSizeId": "ezcater-menu-version-size-12-inch-pizza-item-selection-id", "menuItemSizeName": "12\" Pizza", "name": "Margherita Pizza", "noteToCaterer": "12\" thin crust Margherita Pizza", "posItemId": "12-inch-pizza-item-selection-id", "quantity": 10, "specialInstructions": "Please be careful not to burn crust", "totalInSubunits": Money, "uuid": "83ec5c82-fa68-437c-90d7-ad861a2c151b" } ``` -------------------------------- ### OrderCustomer Schema Example Source: https://api.ezcater.io/order-schema-reference This snippet illustrates the structure of an OrderCustomer object, containing the customer's first name, last name, and full name. ```graphql { "firstName": "Jane", "lastName": "Doe", "fullName": "Jane Doe" } ``` -------------------------------- ### OrderItemCustomization Example (GraphQL) Source: https://api.ezcater.io/order-schema-reference Defines the structure for customizations applied to an order item. Includes IDs for customization and type, names, POS ID, and quantity. This is a GraphQL representation. ```graphql { "customizationId": "ezcater-menu-version-customization-parmigiano-reggiano-choice-12-inch-selection-id", "customizationTypeId": "ezcater-menu-version-customization-type-cheese-addon-options-id", "customizationTypeName": "Cheese Addon", "name": "Parmigiano Reggiano", "posCustomizationId": "parmigiano-reggiano-choice-12-inch-selection-id", "quantity": 10 } ``` -------------------------------- ### Delivery API Migration - Meeting Deadline with Deprecated Flow Source: https://api.ezcater.io/migration-guide This section provides an example of how to meet the January 5th, 2026 deadline using the deprecated `courierEventCreate` flow by including the new provider details within the courier object. ```APIDOC ## Meeting the Deadline with courierEventCreate (Deprecated Flow) ### Description This example demonstrates how to comply with the deadline requirements using the `courierEventCreate` mutation, even though it's a deprecated flow. It shows the inclusion of `providerSource` within the `courier` object. ### Method POST (Implied by mutation) ### Endpoint `courierEventCreate` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **courier** (object) - Required - The courier object, including: - **providerSource** (enum: `IN_HOUSE`, `THIRD_PARTY`) - Required - Specifies who is fulfilling the delivery. - **id** (string) - Required - The courier's ID. - **firstName** (string) - Required - The courier's first name. - **lastName** (string) - Required - The courier's last name. - **phone** (string) - Required - The courier's phone number. - **deliveryId** (string) - Required - The ID of the delivery. - **eventType** (string) - Required - The type of courier event (e.g., "PICKED_UP"). - **occurredAt** (string) - Required - The timestamp when the event occurred. ### Request Example ```json { "input": { "courier": { "id": "your-courier-id", "firstName": "Jane", "lastName": "Doe", "phone": "+16175551234", "providerSource": "IN_HOUSE" }, "deliveryId": "ezcater-delivery-id", "eventType": "PICKED_UP", "occurredAt": "2025-11-01T22:03:03Z" } } ``` ### Response #### Success Response (200) Details of the success response depend on the specific mutation used. Typically includes confirmation of the event creation. #### Response Example (Example not provided in source text) ``` -------------------------------- ### CourierUnassignInput GraphQL Example Source: https://api.ezcater.io/courier-schema-reference Provides an example of the input fields for the CourierUnassign mutation. This includes clientMutationId and deliveryId. The 'courier' field is deprecated and replaced by 'courierId'. ```graphql { "clientMutationId": "your-mutation-id", "courier": CourierInput, "deliveryId": "ezcater-delivery-id" } ``` -------------------------------- ### GraphQL Menu Variables Example Source: https://api.ezcater.io/menu-create This snippet demonstrates the structure of variables used to define a menu in the ezcater.io API. It includes details about menu properties, categories, items with their selections, and available options. ```graphql { "menu": { "name": "Your Menu Name", "locationId": "ezcater-caterer-id", "posId": "your-menu-version-id", "startDate": "2025-05-01", "endDate": "2025-06-01", "categories": [ { "name": "Pizzas", "posId": "pizzas-category-id", "sortOrder": 2, "description": "A selection of our famous pizzas", "itemPosIds": [ "margherita-pizza-item-id" ] }, { "name": "Desserts", "posId": "desserts-category-id", "sortOrder": 3, "description": "A selection of our amazing desserts", "itemPosIds": [ "chocolate-cake-item-id" ] }, { "name": "Drinks", "posId": "drinks-category-id", "sortOrder": 4, "description": null, "itemPosIds": [ "assorted-sodas-item-id" ] } ], "items": [ { "name": "Margherita Pizza", "posId": "margherita-pizza-item-id", "channels": ["MARKETPLACE"], "imageUrl": "https://your-domain.com/menu-item-images/margherita-pizza.jpg", "selections": [ { "price": 16.75, "posId": "12-inch-pizza-item-selection-id", "size": "12\" Pizza", "serves": 2, "minCalories": 512, "maxCalories": 1024, "sortOrder": 1 }, { "price": 24.75, "posId": "16-inch-pizza-item-selection-id", "size": "16\" Pizza", "serves": 4, "minCalories": 512, "maxCalories": 1024, "sortOrder": 1 }, { "price": 32.75, "posId": "20-inch-pizza-item-selection-id", "size": "20\" Pizza", "serves": 8, "minCalories": 512, "maxCalories": 1024, "sortOrder": 1 } ], "description": "Thin crust margherita pizza", "taxCategory": "PREPARED_FOOD", "quantityUnit": "PIZZA", "itemTypeTags": [], "optionPosIds": [ "cheese-addon-options-id" ], "foodLabelingTags": ["POPULAR","VEGETARIAN"], "individualWrapStatus": "NEVER" }, { "name": "Chocolate Cake", "posId": "chocolate-cake-item-id", "channels": ["MARKETPLACE"], "imageUrl": null, "selections": [ { "price": 5.75, "posId": "chocolate-cake-item-selection-id", "size": "1", "serves": 5, "sortOrder": 1 } ], "description": "Rich and creamy flourless dark chocolate cake", "taxCategory": "CAKES_AND_PIES", "quantityUnit": "CAKE", "itemTypeTags": ["DESSERT"], "optionPosIds": [], "foodLabelingTags": ["GLUTEN_FREE"] }, { "name": "Assorted Sodas", "posId": "assorted-sodas-item-id", "channels": ["MARKETPLACE"], "imageUrl": null, "selections": [ { "price": 2.75, "posId": "assorted-sodas-item-selection-id", "size": "2ltr Soda", "serves": 4, "sortOrder": 1 } ], "description": "Assorted 2 liter soda bottles", "taxCategory": "SODA", "quantityUnit": "TWO_LITER", "itemTypeTags": ["DRINKS"], "optionPosIds": [ "soda-options-id" ], "foodLabelingTags": ["GLUTEN_FREE", "VEGAN", "VEGETARIAN"] } ], "options": [ { "name": "Cheese Addon", "posId": "cheese-addon-options-id", "catererLabel": "Cheese", "choicePosIds": [ "feta-choice-id", "parmigiano-reggiano-choice-id", "parmesan-choice-id" ], "customerPrompt": "Add Additional Cheese?", "maxChoiceSelections": null, "minChoiceSelections": 2 }, { "name": "Soda", "posId": "soda-options-id", "catererLabel": "Soda", "choicePosIds": [ "brand-name-soda-choice-id", "diet-brand-name-soda-choice-id" ], "customerPrompt": "Select Soda", "maxChoiceSelections": 1, "minChoiceSelections": 1 } ], "choices": [ { "name": "Feta", "posId": "feta-choice-id", "selections": [ { "price": 1.75, "posId": "feta-choice-12-inch-selection-id", "sortOrder": 1 }, { "price": 3.75, "posId": "feta-choice-16-inch-selection-id", "sortOrder": 2 }, { "price": 5.75, "posId": "feta-choice-20-inch-selection-id", "sortOrder": 3 } ], "description": "Feta cheese", "choiceTypeTags": [] } ] } } ``` -------------------------------- ### CourierImagesCreatePayload Example (GraphQL) Source: https://api.ezcater.io/courier-schema-reference Example JSON structure for the CourierImagesCreatePayload, returned after creating courier images. This payload includes a client mutation ID and a list of user errors. ```graphql { "clientMutationId": "your-mutation-id", "userErrors": [CourierAssignUserError!] } ``` -------------------------------- ### Order Accept Variables Source: https://api.ezcater.io/order-accept These are example variables for the 'acceptOrder' mutation. The first set shows initial acceptance, while the second demonstrates how to accept an order modification by setting 'acceptModification' to true. ```json { "orderId": "your-ezcater-order-id", "acceptModification": false } ``` ```json { "orderId": "your-ezcater-order-id", "acceptModification": true } ``` -------------------------------- ### Menu Data Structure Example Source: https://api.ezcater.io/menu-create This JSON snippet illustrates the structure of menu data, including categories, items, and their associated choices and selections. It shows how different food items and their options are represented. ```json { "foodLabelingTags": [ "VEGETARIAN" ], "enableSubQuantities": false }, { "name": "Parmigiano Reggiano", "posId": "parmigiano-reggiano-choice-id", "selections": [ { "price": 1.75, "posId": "parmigiano-reggiano-choice-12-inch-selection-id", "sortOrder": 1 }, { "price": 3.75, "posId": "parmigiano-reggiano-choice-16-inch-selection-id", "sortOrder": 2 }, { "price": 5.75, "posId": "parmigiano-reggiano-choice-20-inch-selection-id", "sortOrder": 3 } ], "description": "Parmigiano Reggiano cheese", "choiceTypeTags": [], "foodLabelingTags": [ "VEGETARIAN" ], "enableSubQuantities": false }, { "name": "Parmesan", "posId": "parmesan-choice-id", "selections": [ { "price": 1.75, "posId": "parmesan-choice-12-inch-selection-id", "sortOrder": 1 }, { "price": 3.75, "posId": "parmesan-choice-16-inch-selection-id", "sortOrder": 2 }, { "price": 5.75, "posId": "parmesan-choice-20-inch-selection-id", "sortOrder": 3 } ], "description": "Parmesan cheese", "choiceTypeTags": [], "foodLabelingTags": [ "VEGETARIAN" ], "enableSubQuantities": false }, { "name": "Brand Name Soda", "posId": "brand-name-soda-choice-id", "selections": [ { "price": 0.0, "posId": "brand-name-soda-selection-id", "sortOrder": 1 } ], "description": "Refreshing Brand Name Soda", "choiceTypeTags": [ "DRINKS" ], "foodLabelingTags": [], "enableSubQuantities": false }, { "name": "Diet Brand Name Soda", "posId": "diet-brand-name-soda-choice-id", "selections": [ { "price": 0.0, "posId": "diet-brand-name-soda-choice-selection-id", "sortOrder": 1 } ], "description": "Refreshing Diet Brand Name Soda", "choiceTypeTags": [ "DRINKS" ], "foodLabelingTags": [], "enableSubQuantities": false } ``` -------------------------------- ### Order Notification Payloads Source: https://api.ezcater.io/subscribing-to-order-notifications Examples of notification payloads received when subscribing to order events. These examples illustrate the structure and data included for different order statuses. ```APIDOC ## Order Event Notifications ### Description These are examples of the notification payloads you will receive for various order events after subscribing. ### Notification Examples #### Submitted Notification ```json { "id": "notification-id", "parent_type": "Caterer", "parent_id": "ezcater-caterer-id", "entity_type": "Order", "entity_id": "your-ezcater-order-id", "key": "submitted", "created_at": "2025-04-15 23:48:23 UTC", "occurred_at": "2025-04-15 23:48:21 UTC", "updated_at": "2025-04-15 23:48:23 UTC", "payload": null } ``` #### Accepted Notification ```json { "id": "notification-id", "parent_type": "Caterer", "parent_id": "ezcater-caterer-id", "entity_type": "Order", "entity_id": "your-ezcater-order-id", "key": "accepted", "created_at": "2025-04-15 23:48:23 UTC", "occurred_at": "2025-04-15 23:48:21 UTC", "updated_at": "2025-04-15 23:48:23 UTC", "payload": null } ``` #### Rejected Notification ```json { "id": "notification-id", "parent_type": "Caterer", "parent_id": "ezcater-caterer-id", "entity_type": "Order", "entity_id": "your-ezcater-order-id", "key": "rejected", "created_at": "2025-04-15 23:48:23 UTC", "occurred_at": "2025-04-15 23:48:21 UTC", "updated_at": "2025-04-15 23:48:23 UTC", "payload": null } ``` #### Cancelled Notification Example ```json { "id": "notification-id", "parent_type": "Caterer", "parent_id": "ezcater-caterer-id", "entity_type": "Order", "entity_id": "your-ezcater-order-id", "key": "rejected", "created_at": "2025-04-15 23:48:23 UTC", "occurred_at": "2025-04-15 23:48:21 UTC", "updated_at": "2025-04-15 23:48:23 UTC", "payload": null } ``` ``` -------------------------------- ### GraphQL Response: Menu Creation with Warnings Source: https://api.ezcater.io/menu-creation-request This example shows a successful menu creation response that includes warnings. The `errors` field is empty, but the `warnings` field contains details about non-critical issues encountered during creation. ```json { "data": { "menuCreationRequest": { "errors": [], "menuUuid": "your-ezcater-menu-version-id", "outcome": "success_with_warnings", "status": "completed", "warnings": [ { "details": {}, "message": "Item with pos_id assorted-sodas-item-selection-id has a price of $0.00. It will not be displayed." } ] } } } ``` -------------------------------- ### Create Subscription Source: https://api.ezcater.io/setting-up-your-integration This mutation allows you to create subscriptions for various events related to orders and menus. You can subscribe to events like 'accepted', 'cancelled', or 'updated'. ```APIDOC ## POST /subscriptions ### Description Creates a subscription to receive event notifications. ### Method POST ### Endpoint /subscriptions ### Parameters #### Query Parameters - **subscriberId** (string) - Required - The ID of the subscriber. - **eventKey** (string) - Required - The key of the event to subscribe to (e.g., 'accepted', 'cancelled', 'updated'). - **eventEntity** (string) - Required - The entity the event is related to (e.g., 'Order', 'Menu'). - **parentEntity** (string) - Required - The parent entity of the event (e.g., 'Caterer'). - **parentId** (string) - Required - The ID of the parent entity. ### Request Example ```json { "query": "mutation createSubscription($subscriptionParams: SubscriptionParamsInput!) { createSubscription(subscriptionParams: $subscriptionParams) { subscription { parentEntity parentId eventKey eventEntity } } }", "variables": { "subscriptionParams": { "subscriberId": "your-subscriber-id", "eventKey": "accepted", "eventEntity": "Order", "parentEntity": "Caterer", "parentId": "your-caterer-id" } } } ``` ### Response #### Success Response (200) - **subscription** (object) - Details of the created subscription. - **parentEntity** (string) - The parent entity of the subscription. - **parentId** (string) - The ID of the parent entity. - **eventKey** (string) - The key of the subscribed event. - **eventEntity** (string) - The entity related to the event. #### Response Example ```json { "data": { "createSubscription": { "subscription": { "parentEntity": "Caterer", "parentId": "your-caterer-id", "eventKey": "accepted", "eventEntity": "Order" } } } } ``` ``` -------------------------------- ### Zero Dollar Parent Items Configuration Source: https://api.ezcater.io/menu-sync Details on configuring menu items that have zero dollar base price, with pricing determined by options. This includes specific rules for option groups and metadata. ```APIDOC ## Zero Dollar Parent Items Configuration ### Description This section describes how to set up menu items where the price is determined by selected options rather than a base item price. It outlines the specific conditions for option groups to function correctly. ### Method N/A (Configuration Guide) ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) N/A #### Response Example N/A ### Configuration Rules: - **Pricing**: Price is determined at the option level, not the base item level. - **Option Group**: Priced options must be within the first option group (sortOrder = 0). - **Option Group Requirements**: The option group must have `minSelects = 1` and `maxSelects = 1`, and be mandatory. - **Metadata**: The `IsSelectionSizeGroup` metadata should not be added to the "Option Group". ``` -------------------------------- ### API Ezcater IO Success Response (GraphQL) Source: https://api.ezcater.io/menu-create This snippet shows the expected JSON response when a `menuCreate` mutation is successful. It includes an empty errors array, a menu creation request ID, and a success flag. ```graphql { "data": { "menuCreate": { "errors": [], "menuCreationRequestId": "your-ezcater-menu-creation-request-id", "success": true } } } ``` -------------------------------- ### GraphQL Example: Delivery Validation Error Source: https://api.ezcater.io/courier-schema-reference This snippet shows an example of a DeliveryValidationError object, which details a validation error that occurred during mutation execution. It includes a user-friendly message and the path to the erroneous input value. ```graphql { "message": "It's too early to add the event for courier en route to pickup", "path": [ "input", "occurredAt" ] } ``` -------------------------------- ### Create Subscription Fields Example (GraphQL) Source: https://api.ezcater.io/subscription-schema-reference This snippet demonstrates the structure of an input object required for creating new subscriptions. It specifies the event entity, event key, parent entity, parent ID, and subscriber ID needed to configure notifications. ```graphql { "eventEntity": "Order", "eventKey": "accepted", "parentEntity": "Caterer", "parentId": "ezcater-caterer-id", "subscriberId": "your-subscriber-id" } ``` -------------------------------- ### Rails Visibility Settings Source: https://api.ezcater.io/menu-sync Instructions on how to configure category-level settings to control visibility across different ordering channels, specifically for ezCater menu categories. ```APIDOC ## Rails Visibility Settings ### Description This guide explains how to adjust the "Rails Visibility" settings at the category level to ensure that ezCater-specific menu categories are only visible on the ezCater ordering channel, filtering out other channels. ### Method N/A (Configuration Guide) ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) N/A #### Response Example N/A ### Category Level Settings: 1. **Navigate**: Go to the "Edit Category" button for a specific category. 2. **Configure Visibility**: Under the "Category Visibility" section, deselect all ordering channels *except* for ezCater. ``` -------------------------------- ### Order Notification Examples Source: https://api.ezcater.io/subscribing-to-order-notifications Examples of order notifications for different event keys like submitted, accepted, rejected, and cancelled. These structures show the data payload received for each order event. ```graphql { "id": "notification-id", "parent_type": "Caterer", "parent_id": "ezcater-caterer-id", "entity_type": "Order", "entity_id": "your-ezcater-order-id", "key": "submitted", "created_at": "2025-04-15 23:48:23 UTC", "occurred_at": "2025-04-15 23:48:21 UTC", "updated_at": "2025-04-15 23:48:23 UTC", "payload":null } ``` ```graphql { "id": "notification-id", "parent_type": "Caterer", "parent_id": "ezcater-caterer-id", "entity_type": "Order", "entity_id": "your-ezcater-order-id", "key": "accepted", "created_at": "2025-04-15 23:48:23 UTC", "occurred_at": "2025-04-15 23:48:21 UTC", "updated_at": "2025-04-15 23:48:23 UTC", "payload":null } ``` ```graphql { "id": "notification-id", "parent_type": "Caterer", "parent_id": "ezcater-caterer-id", "entity_type": "Order", "entity_id": "your-ezcater-order-id", "key": "rejected", "created_at": "2025-04-15 23:48:23 UTC", "occurred_at": "2025-04-15 23:48:21 UTC", "updated_at": "2025-04-15 23:48:23 UTC", "payload":null } ``` ```graphql { "id": "notification-id", "parent_type": "Caterer", "parent_id": "ezcater-caterer-id", "entity_type": "Order", "entity_id": "your-ezcater-order-id", "key": "rejected", "created_at": "2025-04-15 23:48:23 UTC", "occurred_at": "2025-04-15 23:48:21 UTC", "updated_at": "2025-04-15 23:48:23 UTC", "payload":null } ``` -------------------------------- ### RejectOrderInput Schema Example (GraphQL) Source: https://api.ezcater.io/order-schema-reference Defines the input parameters required for rejecting an order. It includes an explanation for the rejection and a specific reason code. This is used to formally decline an order request. ```graphql { "explanation": "This location can't accept any more orders for that delivery date", "reason": "AT_DAILY_CAPACITY" } ``` -------------------------------- ### CourierTrackingEventCreateInput Example (GraphQL) Source: https://api.ezcater.io/courier-schema-reference An example of the CourierTrackingEventCreateInput object in GraphQL format. This demonstrates the structure and expected values for creating a courier tracking event, including client mutation ID, coordinates, courier details (deprecated), delivery ID, and the event's occurrence timestamp. ```graphql { "clientMutationId": "your-mutation-id", "coordinates": Coordinates, "courier": CourierInput, "deliveryId": "ezcater-delivery-id", "occurredAt": "2024-02-05T17:27:55+0000" } ``` -------------------------------- ### GraphQL API Endpoint Source: https://api.ezcater.io/caterer-schema-reference This section details the main GraphQL API endpoint and provides an example query. ```APIDOC ## GraphQL API ### Description This is the main endpoint for interacting with the GraphQL API. It allows you to fetch data using GraphQL queries. ### Method POST ### Endpoint /api/graphql ### Request Body - **query** (String) - Required - The GraphQL query string. - **variables** (Object) - Optional - Variables to be used in the query. ### Request Example ```json { "endpoint": "https://app.archbee.com/api/graphql", "query": "{\n status,\n people\n}" } ``` ### Response #### Success Response (200) - **data** (Object) - The result of the GraphQL query. - **errors** (Array) - An array of errors, if any occurred during query execution. #### Response Example ```json { "data": { "status": "ok", "people": ["Alice", "Bob"] } } ``` ``` -------------------------------- ### Error Handling: Courier Not Found Source: https://api.ezcater.io/migration-guide This section details the error response when a provided `courierId` does not exist. ```APIDOC ## Error Cases ### Courier Does Not Exist If the courier for the provided `courierId` does not exist, the mutation will fail with a 404 status code. #### Response Example ```json { "errors": [ { "message": "Courier not found", "path": [ "courierEventCreate" ], "extensions": { "type": "request", "statusCode": 404, "serviceName": "delivery-public", "code": "DOWNSTREAM_SERVICE_ERROR", "exception": { "message": "Courier not found", "locations": [ { "line": 1, "column": 72 } ], "path": [ "courierEventCreate" ] } } } ], "data": { "courierEventCreate": null } } ``` ``` -------------------------------- ### Lead Time for Menu Items Source: https://api.ezcater.io/menu-sync Information on setting item-specific lead times that are longer than the store's default lead time. Supported values and conversion to minutes are provided. ```APIDOC ## Lead Time for Menu Items ### Description This section details how to configure item-specific lead times for menu items when they require a longer preparation or ordering window than the general store lead time. It emphasizes the impact on customer discoverability and provides supported time values. ### Method N/A (Configuration Guide) ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) N/A #### Response Example N/A ### Lead Time Details: - **Purpose**: To indicate how far in advance an order for a specific item must be placed relative to its ready time. - **Usage**: Use only when an item's lead time is *longer* than the ezCater Marketplace store's lead time. - **Customer Impact**: Shorter item lead times improve customer visibility and ordering ease. - **Supported Values**: Lead times are supported in minutes, ranging from 5 hours (300 minutes) up to 72 hours (4320 minutes). Only whole hours are supported. | **Hours** | **Minutes** | | --------- | ----------- | | 5 | 300 | | 6 | 360 | | ... | ... | | 72 | 4320 | ``` -------------------------------- ### Get Subscribers Source: https://api.ezcater.io/setting-up-your-integration Retrieves a list of existing subscribers. This can be used to find a subscriber ID if needed for other operations. ```APIDOC ## GET /graphql ### Description Retrieves a list of existing subscribers, useful for finding subscriber IDs. ### Method GET ### Endpoint /graphql ### Parameters #### Query Parameters - **query** (string) - The GraphQL query string. ### Request Example ```graphql query allSubscribers { subscribers { id } } ``` ### Response #### Success Response (200) - **data** (object) - The response data. - **subscribers** (array) - A list of subscriber objects. - **id** (string) - The unique identifier for the subscriber. #### Response Example ```json { "data": { "subscribers": [ { "id": "0fc73833-fac0-4a4b-be38-b0a9baea4507" } ] } } ``` ```