Hello,
I am desperately trying for 8 hours to create a cart with custom line items. Document here -> https://dev.wix.com/docs/velo/api-reference/wix-ecom-backend/cart/create-cart
So I created the object below (A simple custom line item based on the documentation and also on the wix platform logs)
So, trying to create the cart using the custom Line Items, I receive the following message:
Line 19 is basically the console.error from the function to create the cart. I don't understand what is the problem here and the error log doesn't give me any indication what is wrong in the code.
Please help me with some advices here :(
Thanks!
"insertId":"..........E2t48_U2W5zNsMqB5XQ8s6""timestamp":"2024-08-27T11:01:14.442Z""labels":{"siteUrl":"https://www.premium-pet-shop.com""revision":"3248""namespace":"Velo""tenantId":"5f617db5-adaa-41fc-aaef-2aae13948ebb""viewMode":"Site"}"sourceLocation":{"file":"backend/cart.web.js""line":119"column":20}"operation":{"id":"1724756471.6962201592661128422""producer":"backend"}"jsonPayload":{"message":"message: '' details: applicationError: description: Forbidden code: FORBIDDEN data: {}"}"severity":"ERROR""receiveTimestamp":"2024-08-27T11:01:14.594Z"
const customLineItem = {
customLineItems: [{
catalogReference: {
appId: APP_ID,
catalogItemId: productId,
},
itemType: {
custom: "test"
},
price: "200",
productName: {
original: "test",
},
quantity: 1,
}],
Hi Eitan,
the APP_ID is the one that I received from logs after I published the site with the custom catalog API and the product ID is the one from customCatalog reference. I managed to find an workaround by creating a custom cart instead of working with the wix store one. In this way I was able to use the custom catalog but yeah, a lot of work had to be done for cart page, checkout page and so on. But to be honest it worth it because now I have every single step of a payment flow with my custom code and I don’t use anything from Wix. Only some events feedbacks.