> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # Package: onlineOrders # Namespace: fulfillmentMethods # Webhook link: https://dev.wix.com/docs/api-reference/business-solutions/restaurants/online-orders/fulfillment-methods/fulfillment-method-created.md ## Introduction # Webhook Permissions Scopes IDs: Manage Restaurants - all permissions: SCOPE.RESTAURANTS.MEGA-SCOPES --- ## REST API ### Schema ``` Webhook: Fulfillment Method Created Description: Event body: - name: id | type: string | description: Unique event ID. Allows clients to ignore duplicate events. - name: entityFqdn | type: string | description: Fully qualified domain name of the entity associated with the event. - name: slug | type: string | description: Event name. - name: entityId | type: string | description: ID of the entity associated with the event. - name: eventTime | type: string (date-time) | description: Event timestamp. - name: triggeredByAnonymizeRequest | type: boolean | description: Whether the event was triggered as a result of a privacy regulation application such as GDPR. - name: originatedFrom | type: string | description: If present, indicates the action that triggered the event. - name: createdEvent | type: object | description: Created event details. - name: entity | type: FulfillmentMethod | description: The created entity. - ONE-OF: - name: pickupOptions | type: PickupInfo | description: Data specific for pickup fulfillment method. - name: instructions | type: string | description: Instructions for the pickup. - name: address | type: Address | description: Pickup address. This is set to the address of the restaurant. - ONE-OF: - name: streetAddress | type: StreetAddress | description: Street name and number. - name: number | type: string | description: Street number. - name: name | type: string | description: Street name. - name: apt | type: string | description: Apartment number. - name: formattedAddressLine | type: string | description: Optional address line 1 - name: addressLine | type: string | description: Main address line, usually street and number as free text. - name: country | type: string | description: Country code. - name: subdivision | type: string | description: Subdivision. Usually a state, region, prefecture, or province code, according to [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2). - name: city | type: string | description: City name. - name: postalCode | type: string | description: Zip/postal code. - name: addressLine2 | type: string | description: Free text providing more detailed address info. Usually contains Apt, Suite, and Floor. - name: formattedAddress | type: string | description: A string containing the full address of this location. - name: hint | type: string | description: Free text to help find the address. - name: geocode | type: AddressLocation | description: Coordinates of the physical address. - name: latitude | type: number | description: Address latitude. - name: longitude | type: number | description: Address longitude. - name: countryFullname | type: string | description: Country full name. - name: subdivisionFullname | type: string | description: Subdivision full name. - name: subdivisions | type: array | description: Multi-level subdivisions from top to bottom. - name: code | type: string | description: Short subdivision code. - name: name | type: string | description: Subdivision full name. - name: deliveryOptions | type: DeliveryInfo | description: Data specific for delivery fulfillment method. - name: deliveryTimeInMinutes | type: integer | description: Estimated delivery time in minutes. - name: freeDeliveryThreshold | type: string | description: Threshold for offering free delivery. If the order price exceeds this threshold, the delivery fee is waived. - name: deliveryArea | type: DeliveryArea | description: Delivery area supported by this delivery fulfillment method. - ONE-OF: - name: radiusOptions | type: Radius | description: Settings for a radius delivery area. - name: minDistance | type: string | description: Minimum distance value. The unit of the radius is specified in the `unit` field. - name: maxDistance | type: string | description: Maximum distance value. The unit of the radius is specified in the `unit` field. - name: centerPointAddress | type: Address | description: Address at the center of the circle. - name: unit | type: Unit | description: Unit of measurement of the radius. - enum: - UNKNOWN_UNIT: Unknown unit. - MILES: Miles. - KILOMETERS: Kilometers. - name: postalCodeOptions | type: PostalCode | description: Settings for a postal code delivery area. - name: countryCode | type: string | description: Country code in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format. - name: postalCodes | type: array | description: List of postal codes and postal code regexes. For example, `10001`, `10002` or `1000*`. A postal code regex will enable you to define a range of postal codes using an asterisk (*). For example, to include the postal codes in the range of `10001`-`10009`, use `1000*`. - name: customOptions | type: CustomArea | description: Settings for a custom delivery area. - name: geocodes | type: array | description: Geocodes of the polygon defining the delivery area. - name: type | type: Type | description: Type of delivery area. - enum: - UNKNOWN_DELIVERY_AREA: Unknown delivery area type. - RADIUS: Delivery area defined by a radius around the restaurant's address. - POSTAL_CODE: Delivery area defined by a list of postal codes. - CUSTOM: Delivery area defined by a custom polygon. - PROVIDER_DEFINED: Delivery area that is determined by the provider. Setting this option, you must also provide `delivery_provider_app_id`. - name: deliveryProviderAppId | type: string | description: Delivery provider app id. - name: courierPickupInstructions | type: string | description: Pickup instructions for couriers. - name: id | type: string | description: Fulfillment method GUID. - name: revision | type: string | description: The current state of an item. Each time the item is modified, its `revision` changes by the server. for an update operation to succeed, you MUST pass the latest revision. - name: createdDate | type: string | description: Date and time the fulfillment method was created. - name: updatedDate | type: string | description: Date and time the fulfillment method was last updated. - name: type | type: Type | description: Type of fulfillment method. - enum: - UNKNOWN_FULFILLMENT_TYPE: Unknown fulfillment type. - PICKUP: The customer must pick up the order from the restaurant. - DELIVERY: The restaurant, or someone on behalf of the restaurant, must deliver the order to the customer. - name: name | type: string | description: Fulfillment method name. - name: enabled | type: boolean | description: Whether the fulfillment method is enabled. - name: fee | type: string | description: Fee for using this fulfillment method. - name: availability | type: Availability | description: Availability of this fulfillment method. - name: availableTimes | type: array | description: A list of availability times for the days of the week. - name: dayOfWeek | type: DayOfWeek | description: The day of week this availability relates to. - enum: - MON: Monday. - TUE: Tuesday. - WED: Wednesday. - THU: Thursday. - FRI: Friday. - SAT: Saturday. - SUN: Sunday. - name: timeRanges | type: array | description: A list of time ranges during which the fulfillment should be available. - name: startTime | type: TimeOfDay | description: The start time in time of day representation. - name: hours | type: integer | description: Hours.
Min: `0`.
Max: `23`. - name: minutes | type: integer | description: Minutes.
Min: `0`.
Max: `23`. - name: endTime | type: TimeOfDay | description: The end time in time of day representation. - name: timeZone | type: string | description: The timezone in which the availability times are given. - name: minOrderPrice | type: string | description: Minimum order price to qualify for using this fulfillment method. - name: businessLocationId | type: string | description: Business location GUID ([SDK](https://dev.wix.com/docs/sdk/backend-modules/restaurants/wix-restaurants-new/about-business-locations.md) | [REST](https://dev.wix.com/docs/rest/business-solutions/restaurants/wix-restaurants-new/about-business-locations.md)) of the operation this fulfillment method belongs to. - name: extendedFields | type: ExtendedFields | description: Extended fields. - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured. You can only access fields for which you have the appropriate permissions. Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md). - name: tags | type: Tags | description: Tags used to classify and sort different types of fulfillment methods. - name: privateTags | type: TagList | description: Tags that require an additional permission in order to access them, normally not given to site members or visitors. - name: tagIds | type: array | description: List of tag GUIDs - name: tags | type: TagList | description: Tags that are exposed to anyone who has access to the labeled entity itself, including site members and visitors. ``` ### Examples ```curl { "id": "f3ef0f88-b98b-463e-8ab2-651836ac0d4a", "entityFqdn": "wix.restaurants.v1.fulfillment_method", "slug": "created", "entityId": "76b19c05-58a6-45f2-ad8c-b464858e3911", "createdEvent": { "entity": { "id": "76b19c05-58a6-45f2-ad8c-b464858e3911", "revision": "1", "createdDate": "2024-01-28T13:27:19.788Z", "updatedDate": "2024-01-28T13:27:19.788Z", "type": "DELIVERY", "deliveryOptions": { "deliveryTimeInMinutes": 30, "deliveryArea": { "type": "RADIUS", "radiusOptions": { "value": "1", "max_distance": "1", "centerPointAddress": { "country": "US", "subdivision": "CA", "city": "San Francisco", "postalCode": "94158", "addressLine": "500 Terry Francine Street", "formattedAddress": "500 Terry Francine Street, San Francisco, CA 94158, USA", "geocode": { "latitude": 37.774836, "longitude": -122.387258 }, "countryFullname": "United States", "subdivisions": [] }, "unit": "MILES" } } }, "min_order_price": "0", "name": "Delivery Area #4", "enabled": true, "fee": "0", "availability": { "availableTimes": [ { "dayOfWeek": "SUN", "timeRanges": [ { "startTime": { "hours": 0, "minutes": 0 }, "endTime": { "hours": 23, "minutes": 45 } } ] }, { "dayOfWeek": "MON", "timeRanges": [ { "startTime": { "hours": 0, "minutes": 0 }, "endTime": { "hours": 23, "minutes": 45 } } ] }, { "dayOfWeek": "TUE", "timeRanges": [ { "startTime": { "hours": 0, "minutes": 0 }, "endTime": { "hours": 23, "minutes": 45 } } ] }, { "dayOfWeek": "WED", "timeRanges": [ { "startTime": { "hours": 0, "minutes": 0 }, "endTime": { "hours": 23, "minutes": 45 } } ] }, { "dayOfWeek": "THU", "timeRanges": [ { "startTime": { "hours": 0, "minutes": 0 }, "endTime": { "hours": 23, "minutes": 45 } } ] }, { "dayOfWeek": "FRI", "timeRanges": [ { "startTime": { "hours": 0, "minutes": 0 }, "endTime": { "hours": 23, "minutes": 45 } } ] }, { "dayOfWeek": "SAT", "timeRanges": [ { "startTime": { "hours": 0, "minutes": 0 }, "endTime": { "hours": 23, "minutes": 45 } } ] } ], "exceptions": [], "timeZone": "Europe/Dublin" }, "minOrderPrice": "0" } }, "eventTime": "2024-01-28T13:27:19.826863553Z", "triggeredByAnonymizeRequest": false, "entityEventSequence": "1" } ``` --- ## JavaScript SDK ### Schema ``` Webhook: onFulfillmentMethodCreated Description: Payload: FulfillmentMethodCreatedEnvelope - name: entity | type: FulfillmentMethod | description: none - ONE-OF: - name: pickupOptions | type: PickupInfo | description: Data specific for pickup fulfillment method. - name: instructions | type: string | description: Instructions for the pickup. - name: address | type: Address | description: Pickup address. This is set to the address of the restaurant. - name: city | type: string | description: none - name: subdivision | type: string | description: none - name: country | type: string | description: none - name: postalCode | type: string | description: none - name: addressLine1 | type: string | description: none - name: addressLine2 | type: string | description: none - name: deliveryOptions | type: DeliveryInfo | description: Data specific for delivery fulfillment method. - name: deliveryTimeInMinutes | type: integer | description: Estimated delivery time in minutes. - name: freeDeliveryThreshold | type: string | description: Threshold for offering free delivery. If the order price exceeds this threshold, the delivery fee is waived. - name: deliveryArea | type: DeliveryArea | description: Delivery area supported by this delivery fulfillment method. - ONE-OF: - name: radiusOptions | type: Radius | description: Settings for a radius delivery area. - name: minDistance | type: string | description: Minimum distance value. The unit of the radius is specified in the `unit` field. - name: maxDistance | type: string | description: Maximum distance value. The unit of the radius is specified in the `unit` field. - name: centerPointAddress | type: Address | description: Address at the center of the circle. - name: unit | type: Unit | description: Unit of measurement of the radius. - enum: - UNKNOWN_UNIT: Unknown unit. - MILES: Miles. - KILOMETERS: Kilometers. - name: postalCodeOptions | type: PostalCode | description: Settings for a postal code delivery area. - name: countryCode | type: string | description: Country code in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format. - name: postalCodes | type: array | description: List of postal codes and postal code regexes. For example, `10001`, `10002` or `1000*`. A postal code regex will enable you to define a range of postal codes using an asterisk (*). For example, to include the postal codes in the range of `10001`-`10009`, use `1000*`. - name: customOptions | type: CustomArea | description: Settings for a custom delivery area. - name: geocodes | type: array | description: Geocodes of the polygon defining the delivery area. - name: latitude | type: number | description: Address latitude. - name: longitude | type: number | description: Address longitude. - name: type | type: Type | description: Type of delivery area. - enum: - UNKNOWN_DELIVERY_AREA: Unknown delivery area type. - RADIUS: Delivery area defined by a radius around the restaurant's address. - POSTAL_CODE: Delivery area defined by a list of postal codes. - CUSTOM: Delivery area defined by a custom polygon. - PROVIDER_DEFINED: Delivery area that is determined by the provider. Setting this option, you must also provide `delivery_provider_app_id`. - name: deliveryProviderAppId | type: string | description: Delivery provider app id. - name: courierPickupInstructions | type: string | description: Pickup instructions for couriers. - name: _id | type: string | description: Fulfillment method GUID. - name: revision | type: string | description: The current state of an item. Each time the item is modified, its `revision` changes by the server. for an update operation to succeed, you MUST pass the latest revision. - name: _createdDate | type: Date | description: Date and time the fulfillment method was created. - name: _updatedDate | type: Date | description: Date and time the fulfillment method was last updated. - name: type | type: Type | description: Type of fulfillment method. - enum: - UNKNOWN_FULFILLMENT_TYPE: Unknown fulfillment type. - PICKUP: The customer must pick up the order from the restaurant. - DELIVERY: The restaurant, or someone on behalf of the restaurant, must deliver the order to the customer. - name: name | type: string | description: Fulfillment method name. - name: enabled | type: boolean | description: Whether the fulfillment method is enabled. - name: fee | type: string | description: Fee for using this fulfillment method. - name: availability | type: Availability | description: Availability of this fulfillment method. - name: availableTimes | type: array | description: A list of availability times for the days of the week. - name: dayOfWeek | type: DayOfWeek | description: The day of week this availability relates to. - enum: - MON: Monday. - TUE: Tuesday. - WED: Wednesday. - THU: Thursday. - FRI: Friday. - SAT: Saturday. - SUN: Sunday. - name: timeRanges | type: array | description: A list of time ranges during which the fulfillment should be available. - name: startTime | type: TimeOfDay | description: The start time in time of day representation. - name: hours | type: integer | description: Hours.
Min: `0`.
Max: `23`. - name: minutes | type: integer | description: Minutes.
Min: `0`.
Max: `23`. - name: endTime | type: TimeOfDay | description: The end time in time of day representation. - name: timeZone | type: string | description: The timezone in which the availability times are given. - name: minOrderPrice | type: string | description: Minimum order price to qualify for using this fulfillment method. - name: businessLocationId | type: string | description: Business location GUID ([SDK](https://dev.wix.com/docs/sdk/backend-modules/restaurants/wix-restaurants-new/about-business-locations.md) | [REST](https://dev.wix.com/docs/rest/business-solutions/restaurants/wix-restaurants-new/about-business-locations.md)) of the operation this fulfillment method belongs to. - name: extendedFields | type: ExtendedFields | description: Extended fields. - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured. You can only access fields for which you have the appropriate permissions. Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md). - name: tags | type: Tags | description: Tags used to classify and sort different types of fulfillment methods. - name: privateTags | type: TagList | description: Tags that require an additional permission in order to access them, normally not given to site members or visitors. - name: tagIds | type: array | description: List of tag GUIDs - name: tags | type: TagList | description: Tags that are exposed to anyone who has access to the labeled entity itself, including site members and visitors. - name: metadata | type: EventMetadata | description: none - name: instanceId | type: string | description: App instance GUID. - name: eventType | type: string | description: Event type. - name: identity | type: IdentificationData | description: The identification type and identity data. - ONE-OF: - name: anonymousVisitorId | type: string | description: GUID of a site visitor that has not logged in to the site. - name: memberId | type: string | description: GUID of a site visitor that has logged in to the site. - name: wixUserId | type: string | description: GUID of a Wix user (site owner, contributor, etc.). - name: appId | type: string | description: GUID of an app. - name: identityType | type: WebhookIdentityType | description: - enum: UNKNOWN, ANONYMOUS_VISITOR, MEMBER, WIX_USER, APP - name: accountInfo | type: AccountInfo | description: Details related to the account - name: accountId | type: string | description: GUID of the Wix account associated with the event. - name: parentAccountId | type: string | description: GUID of the parent Wix account. Only included when accountId belongs to a child account. - name: siteId | type: string | description: GUID of the Wix site associated with the event. Only included when the event is tied to a specific site. - name: _id | type: string | description: Event GUID. With this GUID you can easily spot duplicated events and ignore them. - name: entityFqdn | type: string | description: Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities. For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`. - name: slug | type: string | description: Event action name, placed at the top level to make it easier for users to dispatch messages. For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`. - name: entityId | type: string | description: GUID of the entity associated with the event. - name: eventTime | type: Date | description: Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. - name: triggeredByAnonymizeRequest | type: boolean | description: Whether the event was triggered as a result of a privacy regulation application (for example, GDPR). - name: originatedFrom | type: string | description: If present, indicates the action that triggered the event. - name: entityEventSequence | type: string | description: A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number. You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it. ``` ### Examples ```javascript import { fulfillmentMethods } from '@wix/restaurants'; fulfillmentMethods.onFulfillmentMethodCreated((event) => { // handle your event here }); ``` ```javascript import { createClient, AppStrategy } from '@wix/sdk'; import { fulfillmentMethods } from '@wix/restaurants'; const wixClient = createClient({ auth: AppStrategy({ appId: 'MY-APP-ID', publicKey: 'YOUR_APP_PUBLIC_KEY', }), modules: { fulfillmentMethods, }, }); wixClient.fulfillmentMethods.onFulfillmentMethodCreated((event) => { // handle your event here }); ``` ---