Claudiu Stoica
Claudiu Stoica

Reputation: 241

Shopware 6 B2b Suite api authentication

I am using the Shopware 6 B2b Suite and i want to access the budgets api. I call this url http://localhost/store-api/b2b/debtor/{debtorIdentifier}/budget which points to b2b_budget.api_controller::getList

I set the header sw-access-key

But the response is :

{
    "errors": [
        {
            "status": "403",
            "code": "CHECKOUT__CUSTOMER_NOT_LOGGED_IN",
            "title": "Forbidden",
            "detail": "Customer is not logged in.",
            "meta": {
                "parameters": []
            }
        }
    ]
}

Can you tell me what i am missing ? how can i log in as a customer when making an api call (in this case with postman) ?

Upvotes: 0

Views: 141

Answers (1)

elToro
elToro

Reputation: 1022

It seems that you first need to login first.

Use the following endpoint to login: {{host}}/store-api/account/login

You will get a context token: enter image description here

Then pass the context-token in addition to the sw-access-key: enter image description here

Upvotes: 0

Related Questions