Shopware 6 Store API vs Admin API: Can an Admin API Client Take Over an In-Progress Customer Cart?
0 reputation · 02 Jul 2021, 04:45 UTC
0 reputation · 02 Jul 2021, 04:45 UTC
We are designing a headless integration against Shopware 6 that uses the two supported HTTP components: the sales-channel-scoped Store API (authenticated with the sw-access-key header) for storefront browsing and cart operations, and the Admin API (OAuth2 over /api/oauth/token) for a backend service that needs to inspect and adjust orders.
Our storefront creates customer carts through the Store API, where cart state is bound to a sales-channel context token. The backend service would like to read or modify that same in-progress cart through the Admin API, for example to apply a service-side discount or pre-fill line items before checkout. It is unclear to us whether cart state can cross this boundary at all, or whether the Admin API client must re-create the cart contents independently, duplicating business logic such as price calculation and promotion handling.
We also need to decide which API should own catalog reads, since both support criteria-based querying, but the Store API applies sales-channel visibility rules that the Admin API bypasses.
A thoughtful contribution can make all the difference. Be the first to share one.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.