Skip to content
Get startedQuickstart

Get started

Quickstart

From a test key to a stamp on a wallet pass.

Pilotv1

About ten minutes from a new key to a stamp that shows up on the customer's wallet pass. Use a test key first: it works in an isolated workspace where nothing real is sent, charged or changed.

  1. 01

    Make a test key

    The owner opens Settings, Developers, names the application, picks Read-only or Full access and makes a test key (rvk_test_...). The secret is shown once.

  2. 02

    List the programs

    A read is safe to repeat. Keep the requestId of every answer: support finds your call by it.

  3. 03

    Enroll a customer

    Name the customer with your own id. Enrolling twice answers with the same membership.

  4. 04

    Earn a stamp

    Earn for one of your orders. Send the same request again: you get the first answer with Idempotent-Replay: true and nothing is awarded twice.

  5. 05

    Switch to live

    Make a live key (rvk_live_...) with only the scopes you need and run the same calls. Test and live ids never mix: the other environment's ids answer 404.

First read

List programs
curl "https://app.revisit.cards/v1/developer/programs" \
  -H "Authorization: Bearer $DEVELOPER_API_KEY"
Response
{
  "data": [
    {
      "branchIds": [
        "1915466d-1961-49fe-b213-b5b7f0692d63"
      ],
      "cardType": "stamp",
      "id": "d7595bbd-4342-41b4-9037-2e61a9f8403f",
      "name": "Test coffee card",
      "ownerBranchId": null,
      "rewardName": "Free test coffee",
      "suspended": false
    }
  ],
  "requestId": "3f1c8a2e-6b7d-4e9f-a0c1-2d3e4f5a6b7c",
  "success": true
}

First write

Every business-changing request carries an Idempotency-Key. sourceEventId is your order id: it makes the earn happen once for good, even under a new key.

Enroll, then earn
curl -X POST "https://app.revisit.cards/v1/developer/programs/d7595bbd-4342-41b4-9037-2e61a9f8403f/memberships" \
  -H "Authorization: Bearer $DEVELOPER_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"externalCustomerId":"user-42"}'

curl -X POST "https://app.revisit.cards/v1/developer/programs/d7595bbd-4342-41b4-9037-2e61a9f8403f/actions" \
  -H "Authorization: Bearer $DEVELOPER_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"action":"earn","externalCustomerId":"user-42","sourceEventId":"order-1001"}'