createFulfillment() copied from docs shows error

Not sure what am I doing wrong, but the example in here: https://www.wix.com/velo/reference/wix-stores-backend/createfulfillment

does this in the velo editor:

I have a “fulfillment.js” in the backend section and this is error I get when I copy-paste the example code from the docs…?

In spite of the error, the code should actually work. This is just a code parsing issue that is being worked on.

If you plan on calling this function from page code, you should have the code in a .jsw file - and not a .js file.

Example has been updated.
Now the fulfillment object is defined in a variable outside the function, and passed as a createFulfillment() parameter.