Cover eCom v3 + Contentful
A visitor on your Contentful page clicks Add to Cart. Here's what happens.
Step by step
No JavaScript frameworks, no special SDK. Just a link, a redirect, and one API call.
The browser navigates to Webshop. Just like clicking any normal link.
The item lands in the visitor's real cart, tied to their browser session. Webshop immediately redirects them back.
The page reads the opaque cart token from the URL and fetches cart contents from Webshop's API. No page reload.
Clicking "Go to Cart" takes them to standard Webshop checkout. No extra steps.
Technical reference
Everything this integration needs — one browser navigation and one read-only JSON call.
| Endpoint | What it does | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| GET /cart/add Browser nav |
Browser navigation — not a Query parameters
Response — redirect (302) The controller always issues a 302 redirect. The outcome is encoded in the
cart_status values
cart_token
No authentication required. The session cookie ( |
||||||||||||||||||||||||||||||
| GET /rest/{store_code}/V1/atlas/cart/token-info JSON API |
Read-only cross-origin JSON call. Returns cart contents — items, quantities, subtotal, and currency — for the opaque token received from the redirect. No authentication required; CORS headers are set by Magento's webapi layer. Path parameters
Query parameters
Response 200 — success {
"item_count": 2,
"subtotal": "34.00",
"currency_code": "EUR",
"token": "kTu72CFOcaMbSfYdfEuZfQ3RNRh76Kwm6K1TltVbx4qe13vWS4RrX76ofqkPDcxY",
"items": [
{
"sku": "atempause-magazine",
"name": "Atempause Magazin",
"qty": 2,
"price": "17.00",
"row_total": "34.00"
}
]
}
Response 404 — error { "message": "Invalid or expired cart token." }
Error conditions
No authentication required. |
Interaction diagram
Three actors, six steps — all triggered by a single button click.
?cart_token=TOKEN from URL
Hands-on
This page IS the Contentful page. Click "Add to Cart" — the browser will navigate to the staging Webshop, add the product, and return here with the cart already populated.