I am using Wix ecom backend’s API to add a product to cart but this isn’t working almost since last 24 hours.
My Backend code -
/*****************************************
* Backend code - my-backend-file.web.js *
****************************************/
import { Permissions, webMethod } from "wix-web-module";
import { currentCart } from "wix-ecom-backend";
export const addToCart = webMethod(
Permissions.Anyone,
async (options) => {
console.log('Data received in backend - ', options);
try {
const updatedCurrentCart = await currentCart.addToCurrentCart(options);
console.log("Success! Updated current cart:", updatedCurrentCart);
return updatedCurrentCart;
} catch (error) {
console.error('Error in backend - ', error);
// console.error(error);
// Handle the error
}
},
);
Params passing -
{
"options": {
"lineItems": [{
"catalogReference": {
"appId": "215238eb-22a5-4c36-9e7b-e7c08025e04e",
"catalogItemId": "35a4733e-a7b2-9cd1-06ad-1015c5578eb5",
"options": {
"variantId": "00000000-0000-0000-0000-000000000000"
}
},
"quantity": 1
} ]
}
}
Response from API -
{
"lineItems": [],
"buyerInfo": {
"contactId": "7d5dd924-ee63-42c7-bc79-05c69e232534",
"memberId": "bda2acda-906d-4a14-9115-6846812a75de"
},
"currency": "INR",
"conversionCurrency": "INR",
"buyerLanguage": "en",
"siteLanguage": "en",
"taxIncludedInPrices": false,
"weightUnit": "KG",
"subtotal": {
"amount": "0",
"convertedAmount": "0",
"formattedAmount": "₹0.00",
"formattedConvertedAmount": "₹0.00"
},
"subtotalAfterDiscounts": {
"amount": "0",
"convertedAmount": "0",
"formattedAmount": "₹0.00",
"formattedConvertedAmount": "₹0.00"
},
"discount": {
"amount": "0",
"convertedAmount": "0",
"formattedAmount": "₹0.00",
"formattedConvertedAmount": "₹0.00"
},
"appliedDiscounts": [],
"purchaseFlowId": "8cf31f9e-fc94-4679-892e-7febf3800f3c",
"paymentCurrency": "INR",
"managedByV2": false,
"_id": "a27abf31-f837-4f64-ada4-af6eed0edaf6",
"_createdDate": "2025-07-04T09:40:34.206Z",
"_updatedDate": "2025-07-05T03:49:38.890Z"
}
I see line items 0 and I don’t know why.
This used to work before!
Can anyone tell me if this API is working on your end or am I the only one facing this issue. Even Wix Stores Frontend (depreciated) API is not working
Note -
Do not look for published site with code already written, try a test now because in a website already live, the API looks working but the new code isn’t responding with line items.
Also, I have tried 2 different sites, same issue