/api/logout2
End the current session (logout), optionally unregister the customer.
Change Note: new API
Parameters
| Name | Description | Type |
|---|---|---|
| confirmed | if true, log out even when an unsaved cart exists | bool |
| clearAuth | if true, also clear the cookie ('remember me') authentication | bool |
| unregister | if true, block/unregister the customer on logout | bool |
| uregmsg | optional message sent to the shop owner when unregistering | string |
| unregreasons | goodbye reasons the customer picked when unregistering: ids of /api/system/goodbye_reasons, comma separated; unknown ids are ignored | string |
| oo-rf | optionally define the response-format for this call. One of: compact (default) | compacts | full | fulls | json | md | html | js | openapi | yaml | String |
| oo-auth | optionally force the API to check against the role (instead of silently not returning data). For guests or public access, the default is -1. 0 (regular customer) and above define the role for which the current session is expected to be authorized. | int |
Error Responses
| HTTP Status | Error Code | Description |
|---|---|---|
| 403 | not_auth | User is not authenticated |
| 409 | hascart | Logout denied: an unsaved cart exists. Resend with confirmed=true to discard it. |
Response Types
| Type | Version | Description |
|---|---|---|
| LogoutResult | 1 | Result of a logout/unregister action |
OpenAPI
See logout2.yaml