Opt out
Unsubscribes the user from the commerce's program, without losing the accumulated points.
Unsubscribes the user from the commerce's program.
The points are not lost
The accumulated points stay where they are: if the user joins again, they are still there.
It is worth saying so on the confirmation screen: it is the difference between opting out and being deleted, and knowing it makes opting out less frightening.
Headers
X-Commerce-IdintegerheaderrequiredId of the commerce integrating the API. Every response is scoped to this commerce.
It carries no body.
Response
200 OK. The response has no defined shape: looking at the status code is enough.
curl -X DELETE https://loybox-public-api-752998171300.southamerica-west1.run.app/v1/me/subscription \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "X-Commerce-Id: 87"After opting out, GET /v1/me returns
subscribed: false.
Errors
| Code | When |
|---|---|
401 | The access token is missing, expired, or does not belong to an end user. |
404 | The commerce does not exist, or the user was not subscribed. |
422 | The X-Commerce-Id header is missing. |
The 404 also covers a repeated opt-out: if the user was no longer subscribed,
there is nothing to unsubscribe.