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.

An event that fires when an order fulfillment is created.

The onFulfillmentCreated() event handler runs when one of the following occurs:

Note: Backend events don't work when previewing your site.

Method Declaration
Copy
function onFulfillmentCreated(event: FulfillmentCreatedEvent): void;
Method Parameters
eventFulfillmentCreatedEventRequired

Information about a fulfillment that was created.

An event when a fulfillment is created
JavaScript
// Place this code in the events.js file // of your site's Backend section. export function wixStores_onFulfillmentCreated(event) { const orderId = event.orderId; const fulfillmentId = event.fulfillmentId; const trackingNumber = event.trackingInfo.trackingNumber; } /* Full event object: * * { * "orderId": "2c6ce6e5-8b40-4d2c-882a-edeb30fb3ec2", * "fulfillmentId": "4afd9175-b3c5-41b9-b3cc-e65b7544e84b", * "dateCreated": "2020-02-22T10:41:32.487Z", * "buyerInfo": { * "id": "a158c93a-2f1e-4e86-a38f-475931a337ce", * "identityType": "MEMBER", * "firstName": "John", * "lastName": "Doe", * "phone": "5555555555", * "email": "john@doe.com" * }, * "fulfillmentStatus": "FULFILLED", * "trackingInfo": { * "trackingNumber": "1234", * "shippingProvider": "fedex", * "trackingLink": "https://www.fedex.com/apps/fedextrack/?action=track&trackingnumber=1234" * } * } * */
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?