Customer Logout
End the customer's authenticated session and invalidate their token.
Endpoint
POST /api/shop/customers/logoutRequest Headers
| Header | Required | Description |
|---|---|---|
Content-Type | Yes | application/json |
X-STOREFRONT-KEY | Yes | Your storefront API key |
Authorization | Yes | Bearer token (customer login required) |
Request Body
json
{}No body parameters required.
Response Fields (200 OK)
| Field | Type | Description |
|---|---|---|
message | string | Success message |
After Logout
- Token is invalidated
- Cannot use token for further requests
- Customer session is ended
- Must login again to access protected endpoints
- Cart may be cleared (depends on configuration)
Use Cases
- End customer session
- Log out from dashboard
- Clear authentication token
- Secure session termination
- Multi-session logout
Important Notes
⚠️ Token is invalidated immediately after logout
- Previously working token will return 401
- Cannot be reversed
- Customer must login again
- Cart state depends on configuration
Security
- Ensures session termination
- Invalidates all tokens for customer
- May clear sensitive data
- Secure way to end session
- Prevents unauthorized access

