Skip to content
StampyWalletDocs
API and webhooks / Reference / Cancel a visit

Cancel a visit

DELETE /v1/passages/:id removes a customer's last visit, for example after a receipt is voided or refunded at the register.

DELETE/v1/passages/:id

Removes a visit, with a manager's rights: the stamps or points it added are taken off, and a reward it had unlocked disappears with it. :id is the UUID returned by POST /v1/passages.

Optional body: { "motif": "Voided receipt" } (or ?motif= in the address). By default, the reason is "API".

Example

curl
curl -X DELETE https://app.stampywallet.com/v1/passages/226fdea1-ba59-49fb-93e6-60a14a765134 \
  -H "Authorization: Bearer sw_live_your_key" \
  -H "Content-Type: application/json" \
  -d '{"motif": "Refunded receipt"}'

Response

200 OK
{
  "annule": true,
  "recompenses_retirees": 1,
  "client": { "id": "c2a91f3e-7d40-4b8a-a3c5-91e0d6f4b2c7", "prenom": "Léa", "etat": { "tampons": 9, "objectif": 10 } }
}

Refusals

As at the counter, only a customer's last visit can be cancelled, and never twice.

StatuscodeWhen
404passage_introuvableThe visit does not exist in this business
409pas_dernierIt is not the customer's last visit
409deja_annuleThe visit is already cancelled
409recompense_offerteThe reward unlocked by this visit has already been given (the response carries a recompense field)

Updated

Was this page helpful?