POST /v1/loyalty/memberships/{id}/upgrade
Hand a full stamps card in for a membership in the program it upgrades to.
POST
Subir de programa con la tarjeta de sellos completa
Turns a full stamps card into a membership in another program. A stamps program can name the program it upgrades to in
Membership objects are abbreviated here. They have the same shape as GET /v1/loyalty/memberships/.
rules.stamps.upgrades_to_program_id. For example, a Club card with six visits can be exchanged for the VIP card. When the card is complete, this call deletes it, including its movements, and gives the customer the target membership.
The customer’s wallet card follows automatically. If the target membership had no pass yet, the same card in Apple Wallet or Google Wallet turns into the target program’s card, with its design and data. If the customer already had a pass for the target program, the old card is voided, because Apple and Google do not let a server remove a pass from a phone.
Endpoint
Required scope
loyalty:write
Headers
Path parameters
The request has no body.
Example request
Response
201 Created
400 Bad Request
The program is not a stamps program, or it has noupgrades_to_program_id.
401 Unauthorized
The token is missing, invalid, revoked, or expired.403 Forbidden
The token does not have theloyalty:write scope.
404 Not Found
There is no membership with that id in your company, or the target program no longer exists.409 Conflict
The card is not full yet, the card is not active (for example, it was already handed in), or the target program is not active. Nothing changes.Operational notes
- The upgrade happens only once. Claiming the full card is a single conditional update. If two calls race, one succeeds and the other gets
409. - The old card is gone. It is deleted the same way as DELETE /v1/loyalty/memberships/.
- Partial redemptions use the ledger. To pay out what a card has accumulated without upgrading, record
kind: "redeem"with POST …/ledger. Withreset_on_redeem, the card goes back to0. - The cash value of a stamp is
rules.stamps.value_per_stamp. The wallet binding{{stampsValue}}shows the stamp count multiplied by that value, for example the cashback accumulated so far.
Authorizations
Subir de programa con la tarjeta de sellos completa