Skip to content

Customer Logout

End the customer's authenticated session and invalidate their token.

Endpoint

POST /api/shop/customers/logout

Request Headers

HeaderRequiredDescription
Content-TypeYesapplication/json
X-STOREFRONT-KEYYesYour storefront API key
AuthorizationYesBearer token (customer login required)

Request Body

json
{}

No body parameters required.

Response Fields (200 OK)

FieldTypeDescription
messagestringSuccess 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

Released under the MIT License.