Skip to content
LoyaltyMemberships

Loyalty

Memberships

Enroll customers in programs and read their passes.

Pilotv1

A membership is one customer on one program, with one balance shared by the counter, the wallet pass and your service. Enrolling by externalCustomerId is safe to repeat: the same customer and program answer with the same membership.

Paths are relative to https://app.revisit.cards/v1/developer.

Read the issued passes a customer holds

GET/customers/{id}/passes

Scopepasses:read

Requires passes:read, the issued passes feature and the passes plugin. The one read behind the merchant app's "issued passes" panel: every gift card, offer, ticket, boarding pass, transit pass and generic pass linked to the customer (at most 50), with serial, status, uses and, for gift cards, balance and currency in the minor unit. No PIN, link token or contact detail. Passes belong to the whole business, so a key limited to programs or branches is refused (403 INSUFFICIENT_SCOPE). Unknown, erased, other-business and test-workspace customers answer 404.

Path

iduuidRequired

Returns 200

passesobject[]Required
passes[].idstringRequired
passes[].serialstringRequired
passes[].passTypeenumRequired
One of giftCard, offer, eventTicket, boardingPass, transit, generic.
passes[].designNamestringRequired
passes[].statusenumRequired
One of active, used.
passes[].usesintegerRequired
passes[].balanceinteger or nullRequired
Gift cards only
passes[].currencystring or null

Errors

  • 403INSUFFICIENT_SCOPEthis key lacks the scope the route needs.
Request
curl "https://app.revisit.cards/v1/developer/customers/e01b010d-2c65-48e1-83a0-acad79f8d3b4/passes" \
  -H "Authorization: Bearer $DEVELOPER_API_KEY"
Response
{
  "data": {
    "passes": [
      {
        "balance": 7,
        "designName": "Mishti Ghor",
        "id": "d12cc02b-02fe-4a1f-83b0-5414e70fd99c",
        "passType": "giftCard",
        "serial": "•••• 7310",
        "status": "active",
        "uses": 3
      }
    ]
  },
  "requestId": "ef5d8189-ac43-4279-abc9-2c280cc5f152",
  "success": true
}

Enroll a customer, by your own customer id, in a program

POST/programs/{id}/memberships

Scopecustomers:write

Requires customers:write and an Idempotency-Key. Adds the customer first when your id is new, then creates the membership once (a repeat answers created: false with the same ids). A new member gets the program's welcome stamps once. No consent is recorded, and an opt-out the customer made anywhere at the business is kept. The customer appears in the merchant app like any other (by name, or by member code when no name was sent).

Send an Idempotency-Key header. Safe to retry.

Path

iduuidRequired

Body

externalCustomerIdstringRequired
Your own id for the customer. Unique per business and application, and separate in test and live.
namestring
1 to 60 characters.
phonestring
A Bangladesh mobile in any form (01XXXXXXXXX or +8801XXXXXXXXX) or another country as +<country><number> (+447700900123). Stored sealed; never returned.
emailemail
Stored sealed; never returned.
localestring
Language tag such as en, bn or en-BD.
branchIduuid
The branch the customer joins at. Default the program's own branch, or its first branch the key may use.

Returns 200

createdbooleanRequired
True when this request created the membership.
customerIdstringRequired
externalCustomerIdstringRequired
membershipIdstringRequired
programIdstringRequired
Request
curl -X POST "https://app.revisit.cards/v1/developer/programs/e01b010d-2c65-48e1-83a0-acad79f8d3b4/memberships" \
  -H "Authorization: Bearer $DEVELOPER_API_KEY" \
  -H "Idempotency-Key: 5f0c2a8e-7b1d-4c3e-9a6f-0d4b8ee270ea" \
  -H "Content-Type: application/json" \
  -d '{
    "externalCustomerId": "user-42"
  }'
Response
{
  "data": {
    "created": false,
    "customerId": "eb83b9c0-5619-432d-b857-cef7fcf84edb",
    "externalCustomerId": "user-42",
    "membershipId": "b53ca741-1e76-4ddb-b6a5-998b65c4aff3",
    "programId": "d7595bbd-4342-41b4-9037-2e61a9f8403f"
  },
  "requestId": "2e9b31ca-e7d4-407a-8020-59ffebb6014e",
  "success": true
}