Loyalty Cards API
The Loyalty Cards API allows you to create, manage, and track customer loyalty cards. This is the foundation of the loyalty program system, providing basic card operations for shops and stores.All Shop API endpoints require API Key and Secret authentication. See Authentication Overview for details.
Base URL
Core Concepts
Loyalty Cards
Loyalty Cards
Digital loyalty cards that represent a customer’s participation in your loyalty program. Each card has a unique ID and tracks the customer’s points balance and activity.
Card Numbers
Card Numbers
Human-readable card numbers (e.g., LC001234567890) that customers can reference. Generated automatically but can be customized.
Customer Linking
Customer Linking
Cards can be linked to customers via email, phone, or custom ID. This enables cross-device access and better customer management.
Status Management
Status Management
Cards have statuses:
active
, inactive
, blocked
, expired
. Only active cards can earn or redeem points.Endpoints Overview
Create Card
POST
/loyalty-cards
Create a new loyalty card for a customerGet Card
GET
/loyalty-cards/{id}
Retrieve card details and current balanceList Cards
GET
/loyalty-cards
List all loyalty cards with filtering optionsUpdate Card
PUT
/loyalty-cards/{id}
Update card information and settingsBlock/Unblock
POST
/loyalty-cards/{id}/block
Block or unblock a loyalty cardCard History
GET
/loyalty-cards/{id}/history
Get card transaction historyCreate Loyalty Card
Create a new loyalty card for a customer. This is typically done when a customer first joins your loyalty program.Request Parameters
Customer’s email address. Used for card identification and communication.
Customer’s full name as it should appear on the card.
Customer’s phone number in international format (e.g., +1234567890).
Initial points to award to the card upon creation.
Card design template:
default
, premium
, seasonal
, or custom design ID.Whether to automatically activate the card upon creation.
Additional custom data to store with the card (max 1KB).
Get Loyalty Card
Retrieve detailed information about a specific loyalty card, including current points balance and recent activity.Response Fields
Unique card identifier
Human-readable card number
Current available points balance
Total points ever earned on this card
Total points redeemed from this card
Customer tier:
bronze
, silver
, gold
, platinum
Last 5 point transactions (award/redeem)
List Loyalty Cards
Retrieve a paginated list of loyalty cards with optional filtering and sorting.Query Parameters
Filter by card status:
active
, inactive
, blocked
, expired
Filter by customer email (exact match)
Filter by customer tier:
bronze
, silver
, gold
, platinum
Filter cards created after this date (ISO 8601 format)
Filter cards created before this date (ISO 8601 format)
Page number for pagination
Number of items per page (max 100)
Sort order:
created_at:desc
, created_at:asc
, points_balance:desc
, points_balance:asc
, last_activity:desc
Update Loyalty Card
Update card information such as customer details, status, or metadata.Updatable Fields
Update customer’s display name
Update customer’s phone number
Change card design template
Update custom metadata (replaces existing metadata)
Customer email cannot be updated once set. Card status should be changed using the block/unblock endpoints.
Block/Unblock Card
Block or unblock a loyalty card. Blocked cards cannot earn or redeem points.Request Parameters
Reason for blocking/unblocking the card (shown to customer)
Internal note for staff reference (not shown to customer)
Card Transaction History
Retrieve detailed transaction history for a loyalty card, including points awarded, redeemed, and expired.Query Parameters
Filter by transaction type:
all
, award
, redeem
, expire
, adjust
Start date for transaction history (ISO 8601 format)
End date for transaction history (ISO 8601 format)
Page number for pagination
Number of transactions per page (max 100)
Error Handling
Card Not Found
Card Not Found
Status Code: 404
Invalid Customer Email
Invalid Customer Email
Status Code: 400
Duplicate Customer
Duplicate Customer
Status Code: 409
Card Blocked
Card Blocked
Status Code: 403
Best Practices
Customer Identification
- Use email as primary identifier
- Store phone numbers for backup identification
- Implement duplicate detection logic
- Validate customer data before card creation
Card Management
- Set appropriate initial points for new signups
- Use meaningful card designs for branding
- Implement card blocking for security
- Regularly audit inactive cards
Data Management
- Use metadata for custom tracking
- Implement proper pagination for large lists
- Filter by relevant criteria for performance
- Cache frequently accessed card data
Security
- Validate all input parameters
- Implement rate limiting for card creation
- Log all card status changes
- Monitor for suspicious patterns
Integration Examples
E-commerce Integration
E-commerce Integration
Scenario: Create loyalty card when customer creates account
- Customer completes account registration
- Create loyalty card with customer details
- Award welcome bonus points
- Send confirmation email with card details
- Display card information in customer account
Point-of-Sale Integration
Point-of-Sale Integration
Scenario: Look up customer card at checkout
- Cashier asks for customer phone/email
- Search for existing loyalty card
- Display current points balance
- Process point earning/redemption
- Print receipt with updated balance
Mobile App Integration
Mobile App Integration
Scenario: Display loyalty card in mobile app
- Customer logs into mobile app
- Retrieve card details via API
- Display QR code for scanning
- Show points balance and recent activity
- Enable push notifications for updates