Search...
onFulfillmentCreated( )
Deprecated.
This event will continue to work until September 4, 2024, but a newer version is available at
wix-ecom-backend.Events.onFulfillmentsUpdated()
.
We recommend you migrate to the new Wix eCommerce APIs as soon as possible.
Description
An event that fires when an order fulfillment is created.
The onFulfillmentCreated()
event handler runs when one of the following occurs:
- The createFulfillment() function is called.
- A tracking number is added to an order.
Note: Backend events don't work when previewing your site.
Syntax
function onFulfillmentCreated(event: FulfillmentCreatedEvent): void
onFulfillmentCreated Parameters
NAME
TYPE
DESCRIPTION
event
FulfillmentCreatedEvent
Information about a fulfillment that was created.
Returns
This function does not return anything.
Return Type:
void
Was this helpful?
An event when a fulfillment is created
Copy Code
1// Place this code in the events.js file2// of your site's Backend section.34export function wixStores_onFulfillmentCreated(event) {5 const orderId = event.orderId;6 const fulfillmentId = event.fulfillmentId;7 const trackingNumber = event.trackingInfo.trackingNumber;8}910/* Full event object:11 *12 * {13 * "orderId": "2c6ce6e5-8b40-4d2c-882a-edeb30fb3ec2",14 * "fulfillmentId": "4afd9175-b3c5-41b9-b3cc-e65b7544e84b",15 * "dateCreated": "2020-02-22T10:41:32.487Z",16 * "buyerInfo": {17 * "id": "a158c93a-2f1e-4e86-a38f-475931a337ce",18 * "identityType": "MEMBER",19 * "firstName": "John",20 * "lastName": "Doe",21 * "phone": "5555555555",22 * "email": "john@doe.com"23 * },24 * "fulfillmentStatus": "FULFILLED",25 * "trackingInfo": {26 * "trackingNumber": "1234",27 * "shippingProvider": "fedex",28 * "trackingLink": "https://www.fedex.com/apps/fedextrack/?action=track&trackingnumber=1234"29 * }30 * }31 *32 */