createFulfillment( ) doesn't mark order as "Fulfilled"

hi,

I’m trying to implement an interface with my fulfillment center. They use EDI XML file transfers which I’ve managed to implement as a dashboard page.
Once all order information is sent to the fulfillment center, I want to mark the orders as fulfilled.
I’m using createFulfillment() function under Wix-Stores-Backend API.
The function is executing without errors and creates the fulfillment.
The problem is the order fulfillmentStatus doesn’t change from “NOT_FULFILLED”.

This is the main code:

import { createFulfillment } from 'backend/fulfillment';
import { deleteFulfillment } from 'backend/fulfillment';  
  ...
  $w("#repeaterOrders").forEachItem(async ($item, itemData, index) => {
 if ($item("#checkboxSelected").checked) {
            orderId=$item("#textOrderId").text;
            lineItemsArray=JSON.parse($item("#textBoxLineItems").value);
            fulfillmentsArray=JSON.parse($item("#textBoxFulfillments").value);
            console.log("before delete");
            console.log(fulfillmentsArray);
 if (fulfillmentsArray.length>0) {
                fulfillmentsArray.forEach(async element => {
 //console.log("Fulfillment Id: "+element.id)
                    fulfillmentId=element.id;
                    results= await deleteFulfillment(orderId,fulfillmentId);
                    console.log("after delete");
 //console.log(results);
                } );
            }           
            lineItemsArray.forEach(async element => {
                toFulfill= {
 "index":    element.index,
 "quantity": element.quantity
                }
                fulfillmentLineItems.push(toFulfill);
            } );
 //console.log(fulfillmentLineItems);
 //console.log(orderId);
            results= await createFulfillment(orderId,lineItemsArray);
            console.log("After Create");
            console.log(results);
 
            totalOrders--;
            totalRevenue=totalRevenue-parseFloat($item("#textValue").text);         
 let tempData = $w("#repeaterOrders").data;
            tempData.splice(index,1);
 //$w("#repeaterOrders").data = tempData;
        }
    } );

and the backend code:

import wixStoresBackend from 'wix-stores-backend'

export async function createFulfillment(orderId,lineItemsArray) {
 let newFulfillment= await wixStoresBackend.createFulfillment(
    orderId,
    {
 "fulfillment": {
 "lineItems": lineItemsArray,
      }
    });
 // Fulfillment created
 const fulfillmentId = newFulfillment.id
 const fulfillmentStatus = newFulfillment.order.fulfillmentStatus
    console.log("(backend create) fulfillmentId: "+fulfillmentId);
    console.log("(backend create) fulfillmentStatus: "+fulfillmentStatus);
 return newFulfillment;
}

export async function deleteFulfillment(orderId, fulfillmentId) {
  console.log("(backend delete) before delete ");  
 let updatedOrderObject= await wixStoresBackend.deleteFulfillment(orderId, fulfillmentId);
 return updatedOrderObject;
}

What am I missing?

This is what the order looks like after running createFulfillment().

Fulfillment information is there:
“fulfillments”: [
{
“id”: “e19af932-1b67-483e-8274-789913d46f9f”,
“dateCreated”: “2020-10-29T18:33:32.552Z”,
“lineItems”: [
{
“index”: 1,
“quantity”: 2
},
{
“index”: 2,
“quantity”: 1
}
]
}
],

But :
“fulfillmentStatus”: “NOT_FULFILLED”,

Order JSON:

{
“_id”: “51b34c94-694f-421a-abf3-7ca445b53049”,
“_updatedDate”: “Thu Oct 29 2020 18:33:32 GMT+0000 (Western European Standard Time)”,
“cartId”: “e934f20f-719f-41b6-be5a-ad378751cfcb”,
“channelInfo”: {
“type”: “WEB”
},
“enteredBy”: {
“id”: “a843353a-ab6b-41fd-b396-2b6abc4876f7”,
“identityType”: “MEMBER”
},
“billingInfo”: {
“address”: {
“formatted”: “Rua do Lidador, 251\nPorto, Porto 4100 307\nPortugal\n+351927130410”,
“city”: “Porto”,
“country”: “PRT”,
“addressLine”: “Rua do Lidador, 251”,
“postalCode”: “4100 307”,
“subdivision”: “13”
},
“firstName”: “José”,
“lastName”: “Caeiro”,
“email”: “jacaeiro@icloud.com”,
“phone”: “+351927130410”,
“paidDate”: “2020-10-28T17:45:26.571Z”,
“paymentMethod”: “offline”,
“paymentGatewayTransactionId”: “2b91ef73-58dc-4434-8863-ddac200db36a”
},
“buyerInfo”: {
“id”: “a843353a-ab6b-41fd-b396-2b6abc4876f7”,
“type”: “MEMBER”,
“identityType”: “MEMBER”,
“firstName”: “José”,
“lastName”: “Caeiro”,
“phone”: “+351927130410”,
“email”: “jacaeiro@icloud.com
},
“buyerNote”: “Please don’t break”,
“_dateCreated”: “Fri Jun 19 2020 11:37:16 GMT+0100 (Western European Summer Time)”,
“currency”: “GBP”,
“fulfillmentStatus”: “NOT_FULFILLED”,
“archived”: false,
“activities”: [
{
“type”: “ORDER_PLACED”,
“timestamp”: “2020-06-19T10:37:16.122Z”
},
{
“type”: “ORDER_FULFILLED”,
“timestamp”: “2020-08-15T12:04:11.289Z”
},
{
“type”: “ORDER_NOT_FULFILLED”,
“timestamp”: “2020-08-15T20:54:10.302Z”
},
{
“type”: “ORDER_PAID”,
“timestamp”: “2020-10-28T17:45:26.571Z”
},
{
“type”: “SHIPPING_CONFIRMATION_EMAIL_SENT”,
“timestamp”: “2020-10-29T16:37:22.029Z”
},
{
“type”: “SHIPPING_CONFIRMATION_EMAIL_SENT”,
“timestamp”: “2020-10-29T17:14:42.334Z”
},
{
“type”: “SHIPPING_CONFIRMATION_EMAIL_SENT”,
“timestamp”: “2020-10-29T17:28:29.760Z”
},
{
“type”: “SHIPPING_CONFIRMATION_EMAIL_SENT”,
“timestamp”: “2020-10-29T17:37:08.555Z”
},
{
“type”: “SHIPPING_CONFIRMATION_EMAIL_SENT”,
“timestamp”: “2020-10-29T17:47:22.746Z”
},
{
“type”: “SHIPPING_CONFIRMATION_EMAIL_SENT”,
“timestamp”: “2020-10-29T17:55:45.116Z”
},
{
“type”: “SHIPPING_CONFIRMATION_EMAIL_SENT”,
“timestamp”: “2020-10-29T18:33:32.638Z”
}
],
“number”: 10001,
“paymentStatus”: “PAID”,
“shippingInfo”: {
“deliveryOption”: “DHL Express Shipping”,
“estimatedDeliveryTime”: “1 - 2 Business Days”,
“shipmentDetails”: {
“address”: {
“formatted”: “Big Ben\nLondon, England SW1A 0AA\nUnited Kingdom\n+351927130410”,
“city”: “London”,
“country”: “GBR”,
“addressLine”: “Big Ben”,
“postalCode”: “SW1A 0AA”,
“subdivision”: “ENG”
},
“firstName”: “José”,
“lastName”: “Caeiro”,
“email”: “jacaeiro@icloud.com”,
“phone”: “+351927130410”,
“tax”: 0,
“discount”: 0,
“priceData”: {
“price”: 20.34,
“taxIncludedInPrice”: false
}
},
“pickupDetails”: “null”
},
“lineItems”: [
{
“index”: 1,
“quantity”: 2,
“price”: 20.2,
“name”: “Tã Somente Red”,
“translatedName”: “Tã Somente Red”,
“productId”: “179c4599-9751-8b59-7fed-8d0e858e4658”,
“totalPrice”: 40.4,
“lineItemType”: “PHYSICAL”,
“options”: [
{
“option”: “Bottle Size”,
“selection”: “Regular - 0.75 cl”
}
],
“customTextFields”: [],
“weight”: 1.5,
“mediaItem”: {
“id”: “a84335_0f3ec0894c8746598676865b13f4adeb~mv2.png”,
“src”: “wix:image://v1/a84335_0f3ec0894c8746598676865b13f4adeb~mv2.png/file.png#originWidth=1838&originHeight=1866”,
“type”: “IMAGE”
},
“sku”: “PTAL001010”,
“variantId”: “00000000-0000-0000-0000-000000000000”,
“discount”: 0,
“tax”: 8.08,
“taxIncludedInPrice”: false,
“priceData”: {
“price”: 20.2,
“totalPrice”: 40.4,
“taxIncludedInPrice”: false
}
},
{
“index”: 2,
“quantity”: 1,
“price”: 23.71,
“name”: “Nã Te Rales Red”,
“translatedName”: “Nã Te Rales Red”,
“productId”: “d4335652-4495-1928-0c98-45052c03fdc2”,
“totalPrice”: 23.71,
“lineItemType”: “PHYSICAL”,
“options”: [
{
“option”: “Bottle Size”,
“selection”: “Magnum - 1.5 lt”
}
],
“customTextFields”: [],
“weight”: 3,
“mediaItem”: {
“id”: “a84335_a0fd43eadc37482ba4befa87d21ae16c~mv2.png”,
“src”: “wix:image://v1/a84335_a0fd43eadc37482ba4befa87d21ae16c~mv2.png/file.png#originWidth=1838&originHeight=1801”,
“type”: “IMAGE”
},
“sku”: “PTAL001003B”,
“variantId”: “00000000-0000-0002-0005-a85dda7d7810”,
“discount”: 0,
“tax”: 4.74,
“taxIncludedInPrice”: false,
“priceData”: {
“price”: 23.71,
“totalPrice”: 23.71,
“taxIncludedInPrice”: false
}
}
],
“totals”: {
“discount”: 0,
“quantity”: 3,
“shipping”: 20.34,
“subtotal”: 64.11,
“tax”: 12.82,
“total”: 97.27,
“weight”: 6
},
“weightUnit”: “KG”,
“fulfillments”: [
{
“id”: “e19af932-1b67-483e-8274-789913d46f9f”,
“dateCreated”: “2020-10-29T18:33:32.552Z”,
“lineItems”: [
{
“index”: 1,
“quantity”: 2
},
{
“index”: 2,
“quantity”: 1
}
]
}
],
“discount”: “null”
}