Opt out

Unsubscribes the user from the commerce's program, without losing the accumulated points.

DELETE/v1/me/subscriptionEnd-user token

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-Idintegerheaderrequired

Id 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

CodeWhen
401The access token is missing, expired, or does not belong to an end user.
404The commerce does not exist, or the user was not subscribed.
422The 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.