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.
/v1/passages/:idRemoves 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 -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
{
"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.
| Status | code | When |
|---|---|---|
404 | passage_introuvable | The visit does not exist in this business |
409 | pas_dernier | It is not the customer's last visit |
409 | deja_annule | The visit is already cancelled |
409 | recompense_offerte | The reward unlocked by this visit has already been given (the response carries a recompense field) |
Updated