Order & Customer API Endpoint Error

Just setting up an instance of SW6 for a client but need to integrate with their existing ERP - using Integromat to create the necessary API connections but struggling with the endpoints for Orders and Customers - both constantly error:

„status“: „403“,
„code“: „CHECKOUT__CUSTOMER_NOT_LOGGED_IN“,
„title“: „Forbidden“,
„detail“: „Customer is not logged in.“,

There’s one test customer with one test order and the customer has an account created. Wasted hours on this now. Can anyone shed any light?

Guess you are using the storefront api not the admin api. for the storefront api you need the customer session to get the data.

I was… however, using the order endpoint in the admin API, I am completely unable to get the line items in the output using the associations request.

{
„id“: „25d2bf073f08442daa036e9c06e29792“,
„associations“: {
„lineItems“: {},
„addresses“: {},
„transactions“: {}
},
„includes“: {
„order_line_item“: [„id“, „label“, „quantity“]
}
}

Okay, using a GET request on the Admin API you need to add any filter/association/include requests etc as an HTTP Query String directly to the URL.

I had been adding it as a JSON request. If you’re using Integromat HTTP modules - it doesn’t even seem to recognise the Query String Parameters - so just add straight to the URL.

So for example for this:

{
associations: {
lineItems: {
limit: 50
}
}

add this to the end of the URL:

?associations[lineItems][limit]=50

Even if you don’t want to ‚limit‘ or ‚filter‘ or ‚include‘ - you will not get the payload for associations unless you add some parameter - ie this on its own won’t work: ?associations[lineItems]

I am having am issue which i have tired to resolve for some time now, I am using the storefront api to expose endpoints for consumption, currently the official api documentation is guiding me shopware wishlist
First of all, i made sure i was logged in and provided by the application with a response

{
    "apiAlias": "array_struct",
    "contextToken": "pUMQzlkGuZcXXwfhbtdiDY8mYbOiDJIN",
    "redirectUrl": null
}

And then in the headers of http://localhost/store-api/customer/wishlist i am providing these data

sw-access-key: "i_provided_a_shopware_apikey_here",
sw-context-token:  "pUMQzlkGuZcXXwfhbtdiDY8mYbOiDJIN"

and the body

{
  "page": 1,
  "limit": 10
}

But still got the error

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

from postman. Any suggestions and help ?

1 „Gefällt mir“