Stamp cards

GET /stamp-cards

List the stamp cards members are collecting on, newest first by default. Supports search, filtering and cursor pagination.

Requires the loyalty:read permission.

Query Parameters

limitnumber

The number of records to return.

cursorstring

A pagination cursor. Fetch the next page by passing the nextCursor value from the previous response.

sortstampCount | -stampCount | createdAt | -createdAt

The sort order. Prefix a field with - to sort descending. Defaults to -createdAt.

searchstring

A free-text search term, matched case-insensitively against the record's most identifying fields. Combined with filter using AND.

filterstring

A JSON-encoded filter document, for example {"createdAt":{"$gte":"2025-01-01T00:00:00Z"}}. Filterable fields: id, stampCardTypeId, loyaltyMembershipId, stampCount, completedAt, createdAt. See Filtering for the syntax.

includestring

A comma-separated list of extra fields to compute and return. Each one costs an additional query, so ask only for what you need. Available: stampCardType, customer, rewardsCount, rewards.

Request
curl \
  "https://api.cascade.dev/stamp-cards" \
  -H "Authorization: Bearer sk_YOUR_SECRET_KEY"
Response
{
  "data": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "stampCardTypeId": "550e8400-e29b-41d4-a716-446655440000",
      "loyaltyMembershipId": "550e8400-e29b-41d4-a716-446655440000",
      "stampCount": 0,
      "completedAt": "2025-01-15T09:30:00Z",
      "createdAt": "2025-01-15T09:30:00Z",
      "updatedAt": "2025-01-15T09:30:00Z",
      "stampCardType": {
        "id": "...",
        "loyaltyProgramId": "...",
        "name": "...",
        "earningType": "...",
        "overflowPolicy": "...",
        "allowMultipleOpenCards": "...",
        "availableFrom": "...",
        "availableTo": "...",
        "createdAt": "...",
        "updatedAt": "...",
        "completionThreshold": "..."
      },
      "customer": {
        "id": "...",
        "email": "...",
        "phone": "...",
        "firstName": "...",
        "lastName": "...",
        "country": "...",
        "birthday": "...",
        "metadata": "...",
        "notes": "...",
        "emailOptOut": "...",
        "emailOptOutAt": "...",
        "emailOptOutSource": "...",
        "createdAt": "...",
        "updatedAt": "..."
      },
      "rewardsCount": 0,
      "rewards": ["..."]
    }
  ],
  "nextCursor": "string"
}

POST /stamp-cards/{id}/adjustments

Manually add stamps to an open card or take them off, with a required reason stored on the activity feed. Added stamps behave like earned ones: stampsEarned rules fire and the card completes when it reaches its threshold. A deduction only corrects the count and cannot take it below zero. Triggers the stampCard.updated webhook, plus stampCard.completed if the award fills the card.

Requires the loyalty:write permission.

Path Parameters

idstring (uuid)required

The ID of the stamp card to adjust.

Body Parameters

dataobjectrequired

The adjustment to apply.

Request
curl \
  -X POST \
  "https://api.cascade.dev/stamp-cards/550e8400-e29b-41d4-a716-446655440000/adjustments" \
  -H "Authorization: Bearer sk_YOUR_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "data": {
    "count": 0,
    "reason": "string"
  }
}'
Response
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "stampCardTypeId": "550e8400-e29b-41d4-a716-446655440000",
  "loyaltyMembershipId": "550e8400-e29b-41d4-a716-446655440000",
  "stampCount": 0,
  "completedAt": "2025-01-15T09:30:00Z",
  "createdAt": "2025-01-15T09:30:00Z",
  "updatedAt": "2025-01-15T09:30:00Z",
  "stampCardType": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "loyaltyProgramId": "550e8400-e29b-41d4-a716-446655440000",
    "name": "string",
    "earningType": {
      "type": "stampsPerOrder",
      "stamps": 0
    },
    "overflowPolicy": "carry",
    "allowMultipleOpenCards": true,
    "availableFrom": "2025-01-15T09:30:00Z",
    "availableTo": "2025-01-15T09:30:00Z",
    "createdAt": "2025-01-15T09:30:00Z",
    "updatedAt": "2025-01-15T09:30:00Z",
    "completionThreshold": 0
  },
  "customer": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "email": "[email protected]",
    "phone": "string",
    "firstName": "string",
    "lastName": "string",
    "country": "string",
    "birthday": "string",
    "metadata": "...",
    "notes": "string",
    "emailOptOut": true,
    "emailOptOutAt": "2025-01-15T09:30:00Z",
    "emailOptOutSource": "customer",
    "createdAt": "2025-01-15T09:30:00Z",
    "updatedAt": "2025-01-15T09:30:00Z"
  },
  "rewardsCount": 0,
  "rewards": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "reward": {
        "type": "...",
        "amount": "..."
      },
      "status": "pending",
      "code": "string",
      "redeemedAt": "2025-01-15T09:30:00Z",
      "expiresAt": "2025-01-15T09:30:00Z",
      "revokedAt": "2025-01-15T09:30:00Z",
      "metadata": "...",
      "createdAt": "2025-01-15T09:30:00Z",
      "updatedAt": "2025-01-15T09:30:00Z"
    }
  ]
}

GET /stamp-cards/{id}

Get a single stamp card by ID.

Requires the loyalty:read permission.

Path Parameters

idstring (uuid)required

The ID of the stamp card.

Query Parameters

includestring

A comma-separated list of extra fields to compute and return. Each one costs an additional query, so ask only for what you need. Available: stampCardType, customer, rewardsCount, rewards.

Request
curl \
  "https://api.cascade.dev/stamp-cards/550e8400-e29b-41d4-a716-446655440000" \
  -H "Authorization: Bearer sk_YOUR_SECRET_KEY"
Response
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "stampCardTypeId": "550e8400-e29b-41d4-a716-446655440000",
  "loyaltyMembershipId": "550e8400-e29b-41d4-a716-446655440000",
  "stampCount": 0,
  "completedAt": "2025-01-15T09:30:00Z",
  "createdAt": "2025-01-15T09:30:00Z",
  "updatedAt": "2025-01-15T09:30:00Z",
  "stampCardType": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "loyaltyProgramId": "550e8400-e29b-41d4-a716-446655440000",
    "name": "string",
    "earningType": {
      "type": "stampsPerOrder",
      "stamps": 0
    },
    "overflowPolicy": "carry",
    "allowMultipleOpenCards": true,
    "availableFrom": "2025-01-15T09:30:00Z",
    "availableTo": "2025-01-15T09:30:00Z",
    "createdAt": "2025-01-15T09:30:00Z",
    "updatedAt": "2025-01-15T09:30:00Z",
    "completionThreshold": 0
  },
  "customer": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "email": "[email protected]",
    "phone": "string",
    "firstName": "string",
    "lastName": "string",
    "country": "string",
    "birthday": "string",
    "metadata": "...",
    "notes": "string",
    "emailOptOut": true,
    "emailOptOutAt": "2025-01-15T09:30:00Z",
    "emailOptOutSource": "customer",
    "createdAt": "2025-01-15T09:30:00Z",
    "updatedAt": "2025-01-15T09:30:00Z"
  },
  "rewardsCount": 0,
  "rewards": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "reward": {
        "type": "...",
        "amount": "..."
      },
      "status": "pending",
      "code": "string",
      "redeemedAt": "2025-01-15T09:30:00Z",
      "expiresAt": "2025-01-15T09:30:00Z",
      "revokedAt": "2025-01-15T09:30:00Z",
      "metadata": "...",
      "createdAt": "2025-01-15T09:30:00Z",
      "updatedAt": "2025-01-15T09:30:00Z"
    }
  ]
}