#Manage eCommerce - Admin Permissions

26 messages · Page 1 of 1 (latest)

spare vigil
#

Hi, have anyone managed to get add customLineItem working for addTocart
The instruction say you need to add additional permissions to your app. I have done that but i still get
This action requires the following permission scope: Manage eCommerce - Admin Permissions (SCOPE.ECOM.MANAGE-ADMIN)

I am running the function in backend in blocks.

My code:

import { currentCart, cart } from "wix-ecom-backend";
export async function buyButton() {

try {
    const res = await currentCart.addToCurrentCart({
        customLineItems: [{
            catalogReference: { appId: "215238eb-22a5-4c36-9e7b-e7c08025e04e", catalogItemId: "517118e5-d949-6376-eb64-6f1cdeba634e" },
            descriptionLines: [{
                name: {
                    original: "Length"
                },
                plainText: {
                    original: "500cm"
                }
            }],
            itemType: { custom: "Bag" },
            price: "5000",
            productName: {
                original: "Bag"
            },
            quantity: 1
        }]
    });
    console.log("Added line items", res);
    return res;
} catch (error) {
    console.log("Error", error);
    return error;
}

}

amber onyxBOT
#

👀 Looks like you’re trying to post some code? I can help... probably more eagerly than I should.
-# FYI: My humans sent me back to the Academy to spend more time training my unformatted code detection skills. And now I'm back 😎. This is a friendly test. 🛠️

vernal shuttle
#

@spare vigil Did you publish a major version and update the app in the test site?

spare vigil
#

I have not done publish only done "Test in Editor" But I have confirmed that if get all the premissions for the app that the correct is there for my app.

vernal shuttle
spare vigil
#

I listed the permissions using import { appPermissions } from "@wix/app-management";

vernal shuttle
#

And what does that return?

spare vigil
#

Depending on if use the wix store appID 215238eb-22a5-4c36-9e7b-e7c08025e04e it will not have the correct permission. But If I use the ID for my blocks app the permission is there

vernal shuttle
spare vigil
#

I am testing right now with a major version

#

I think it is very hard to know what version is running after updating the blocks code.

#

I am getting the same error even after a major version

vernal shuttle
spare vigil
vernal shuttle
spare vigil
#

I have created an ticket but it is so slow getting a response

vernal shuttle
spare vigil
#

I talked to support over Chat and then they created an email thread

vernal shuttle
spare vigil
#

human

#

or a very good chatbot 🙂

vernal shuttle
spare vigil
#

alright thanks

#

Will keep testing and see if I get an answer

#

Thanks for your input

vernal shuttle