Subscription Schema Reference
Subscription Schema Reference
Objects
CreateSubscriberPayload
Return type of CreateSubscriber.
Field Name | Description |
|---|---|
subscriber: NewSubscriber! | The information about a newly created subscriber. |
{
"subscriber": NewSubscriber!
}CreateSubscriptionPayload
Return type of CreateSubscription.
Field Name | Description |
|---|---|
subscription: EventSubscription! | The information about a newly created event subscription. |
{
"subscription": EventSubscription!
}UpdateSubscriberPayload
Return type of UpdateSubscriber.
Field Name | Description |
|---|---|
subscriber: Subscriber! | The information about an updated subscriber. |
{
"subscriber": Subscriber!
}InputObjects
CreateSubscriberFields
Input object for making new subscribers.
{
"name": "Example Provider - Example Brand",
"webhookUrl": "https://example.net/subscriptions"
}CreateSubscriptionFields
Input object for making new subscriptions.
Field Name | Description |
|---|---|
eventEntity: EventEntity! | A EventEntity enum of the entity to receive notifications about (e.g. for notifications each time an order event occurs, this would be Order). |
eventKey: EventKey! | A EventKey enum of the particular event to notify on (e.g. for notifications when an Order is accepted, this would be an accepted event). |
parentEntity: ParentEntity! | A ParentEntity enum indicating the owner of the entity to receive notifications about (e.g. the specific Catering location to receive order accepted notifications for, etc.). |
parentId: UUID! | An ID for the owner of the entity to receive notifications about. For the Menu API the ParentId value should be a Caterer UUID. |
subscriberId: ID! | An ID for the subscriber wanting to receive these events. |
{
"eventEntity": "Order",
"eventKey": "accepted",
"parentEntity": "Caterer",
"parentId": "ezcater-caterer-id",
"subscriberId": "your-subscriber-id"
}EventSubscription
A subscription allows a subscriber to enable notifications for a particular event (e.g. when an order is accepted at a particular catering location). When a subscription is created, all event notifications will be received at the subscriber’s webhook URL.
Field Name | Description |
|---|---|
eventEntity: EventEntity! | A EventEntity enum of the entity to receive notifications about (e.g. for notifications each time an order event occurs, this would be Order). |
eventKey: EventKey! | A EventKey enum of the particular event to notify on (e.g. for notifications when an Order is accepted, this would be an accepted event). |
parentEntity: ParentEntity! | A ParentEntity enum indicating the owner of the entity to receive notifications about (e.g. the specific Catering location to receive order accepted notifications for, etc.). |
parentId: UUID! | An ID for the owner of the entity to receive notifications about. For the Menu API the ParentId value should be a Caterer UUID. |
subscriberId: ID! | An ID for the subscriber wanting to receive these events. |
{
"eventEntity": "Order",
"eventKey": "accepted",
"parentEntity": "Caterer",
"parentId": "ezcater-caterer-id",
"subscriberId": "your-subscriber-id"
}NewSubscriber
This object represents a URL to receive all subscription notifications. One subscriber can be created per access token. A subscriber can have many subscriptions.
Field Name | Description |
|---|---|
id: ID! | The ID for the subscriber |
name: String! | The entity subscribing to event notifications. Naming convention is <provider_using_integration>-<affiliated_brand> |
subscriptions: [EventSubscription!]! | Active Event Subscriptions for the Subscriber |
webhookSecret: String! | The token provided when POSTing events to the webhook to ensure the notification was sent by ezCater. |
webhookUrl: String! | An URL where subscription notification events will be sent to. |
{
"id": "your-subscriber-id",
"name": "Example Provider - Example Brand",
"subscriptions": [EventSubscription!]!,
"webhookSecret": "be6efd0f8e88fec0d51364559ca9a258e70031f7f38448ea2e9705928a929a8d",
"webhookUrl": "https://example.net/subscriptions"
}Subscriber
This object represents a URL to receive all subscription notifications. One subscriber can be created per access token. A subscriber can have many subscriptions.
Field Name | Description |
|---|---|
id: ID! | The ID for the subscriber |
name: String! | The entity subscribing to event notifications. Naming convention is <provider_using_integration>-<affiliated_brand> |
subscriptions: [EventSubscription!]! | Active Event Subscriptions for the Subscriber |
webhookUrl: String! | An URL where subscription notification events will be sent to. |
{
"id": "your-subscriber-id",
"name": "Example Provider - Example Brand",
"subscriptions": [EventSubscription!]!,
"webhookUrl": "https://example.net/subscriptions"
}UpdateSubscriberFields
Input object for updating subscribers.
{
"name": "Example Provider - Example Brand",
"webhookUrl": "https://example.net/subscriptions"
}Enums
EventEntity
The name of the entity to receive subscription notifications about. Applied to the eventEntity type as the field's return type.
Enum Name | Description |
|---|---|
Menu | The Menu event entity is used to receive subscription notifications for menu events. |
MenuCreationRequest | The MenuCreationRequest event entity is used to receive subscription notifications for menu creation request events. |
Order | The Order event entity is used to receive subscription notifications for order events. |
EventKey
The particular event to notify on. Applied to the eventKey type as the field's return type.
As the integration functionality expands, there may be additional event subscription options as well.
Enum Name | Description |
|---|---|
submitted | An Order entity event indicating an order has been placed by the ordering customer. |
accepted | An Order entity event indicating an order has been accepted or an order has been updated & that update is accepted by there caterer or on behalf of a caterer through a partner integration. |
rejected | An Order entity event indicating an order has been rejected by a caterer or on behalf of a caterer through a partner integration. |
cancelled | An Order entity event indicating an order has been cancelled by the ordering customer, or ezCater on behalf of the caterer. |
uncancelled | An Order entity event indicating an order has been uncancelled by the ordering customer, or ezCater on behalf of the caterer. |
relish_finalized | An Order entity event indicating that a Meal Program order has been finalized post-cutoff, and that the order now contains all the items to be delivered that day. |
updated | A Menu entity event indicating that a menu has been changed. |
succeeded | A MenuCreationRequest entity event indicating that a menu creation request has completed successfully. |
succeeded_with_warnings | A MenuCreationRequest entity event indicating that a menu creation request has completed successfully but with warnings that may require review. |
failed | A MenuCreationRequest entity event indicating a menu creation request has failed with errors that require review. |
ParentEntity
The owner of the entity to receive notifications about. Applied to the parentEntity type as the field's return type.
Enum Name | Description |
|---|---|
Caterer | The Caterer is they only owner available today. |
Scalars
ID
The ID scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as "4") or integer (such as 4) input value will be accepted as an ID.
String
The String scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.
UUID
Universally unique identifier as defined by RFC 4122.