Stamp card types

GET /stamp-card-types

List the stamp card types defined across the organization's loyalty programs. Pass availableAt to get only the ones collectible at a given moment, and include=completionThreshold to see the derived card size.

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.

sortname | -name | createdAt | -createdAt

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

filterstring

A JSON-encoded filter document, for example {"createdAt":{"$gte":"2025-01-01T00:00:00Z"}}. Filterable fields: id, loyaltyProgramId, name, availableFrom, availableTo, 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: completionThreshold.

availableAtstring (date-time)

Return only card types that are collectible at this moment in time.

Request
curl \
  "https://api.cascade.dev/stamp-card-types" \
  -H "Authorization: Bearer sk_YOUR_SECRET_KEY"
Response
{
  "data": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "loyaltyProgramId": "550e8400-e29b-41d4-a716-446655440000",
      "name": "string",
      "earningType": {
        "type": "...",
        "stamps": "..."
      },
      "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
    }
  ],
  "nextCursor": "string"
}

POST /stamp-card-types

Create a stamp card type. Cards of the type complete at the threshold set by its highest live stampsEarned rule; without such a rule they collect stamps open-endedly and never complete.

Requires the loyalty:write permission.

Body Parameters

dataobjectrequired

The stamp card type to create.

Request
curl \
  -X POST \
  "https://api.cascade.dev/stamp-card-types" \
  -H "Authorization: Bearer sk_YOUR_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "data": {
    "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"
  }
}'
Response
{
  "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"
}

GET /stamp-card-types/{id}

Get a single stamp card type by ID.

Requires the loyalty:read permission.

Path Parameters

idstring (uuid)required

The ID of the stamp card type.

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: completionThreshold.

Request
curl \
  "https://api.cascade.dev/stamp-card-types/550e8400-e29b-41d4-a716-446655440000" \
  -H "Authorization: Bearer sk_YOUR_SECRET_KEY"
Response
{
  "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
}

PUT /stamp-card-types/{id}

Update a stamp card type. The loyalty program it belongs to cannot change.

Requires the loyalty:write permission.

Path Parameters

idstring (uuid)required

The ID of the stamp card type to update.

Body Parameters

dataobjectrequired

The fields to update.

Request
curl \
  -X PUT \
  "https://api.cascade.dev/stamp-card-types/550e8400-e29b-41d4-a716-446655440000" \
  -H "Authorization: Bearer sk_YOUR_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "data": {
    "name": "string",
    "earningType": {
      "type": "stampsPerOrder",
      "stamps": 0
    },
    "overflowPolicy": "carry",
    "allowMultipleOpenCards": true,
    "availableFrom": "2025-01-15T09:30:00Z",
    "availableTo": "2025-01-15T09:30:00Z"
  }
}'
Response
{
  "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"
}

DELETE /stamp-card-types/{id}

Delete a stamp card type. Every card of the type, open or complete, is deleted with it; rewards already earned are kept.

Requires the loyalty:write permission.

Path Parameters

idstring (uuid)required

The ID of the stamp card type to delete.

Request
curl \
  -X DELETE \
  "https://api.cascade.dev/stamp-card-types/550e8400-e29b-41d4-a716-446655440000" \
  -H "Authorization: Bearer sk_YOUR_SECRET_KEY"
Response
{
  "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"
}