# Logout from Customer Account API Logs out the customer from the Customer Account API session. This can be initiated either by the customer clicking logout in the customer portal, or by Shopify's end session callback. What it does: - Deletes stored access and refresh tokens - Initiates Shopify's end session flow (if tokens available) - Redirects to return URL or back to customer portal Two scenarios: 1. App-initiated logout: Customer clicks logout in portal - Portal calls this endpoint with return URL - Tokens deleted, redirects to Shopify end session endpoint - Shopify redirects back to return URL 2. Shopify-initiated logout: Customer logs out globally from Shopify - Shopify calls this endpoint with id_token_hint - Tokens deleted, returns success Important: - This only logs out from Customer Account API, not from Shopify customer account - Customer will need to re-authenticate to use Customer Account API features again - Does not affect regular customer portal access (subscription management) Authentication: Optional - can be called from Shopify without authentication Endpoint: GET /subscriptions/cp/api/customer-account-api/logout Version: 0.0.1 ## Query parameters: - `return_url` (string) URL to redirect to after logout Example: "https://myshop.com/account" - `id_token_hint` (string) ID token for Shopify-initiated logout (optional) - `shop` (string) Shop domain (optional, for Shopify-initiated logout) ## Response 200 fields ## Response 302 fields