This guide walks you from zero to a working API call against the LoyaltyDog REST API.
Prerequisites
- A LoyaltyDog merchant account. Contact us if you don’t have one.
- An API token (bearer token) for that account.
curl or any HTTP client.
1. Set your credentials
Export your token so the examples below pick it up:
export LOYALTYDOG_API_TOKEN="your_token_here"
export LOYALTYDOG_API_URL="https://api.loyalty.dog/api/v2"
Never commit tokens to source control. Use a secrets manager, environment variables, or your CI/CD provider’s secret store.
2. Verify your token
List the loyalty programs your token has access to:
curl -sS "$LOYALTYDOG_API_URL/loyalty/programs" \
-H "Authorization: Bearer $LOYALTYDOG_API_TOKEN" \
-H "Accept: application/json"
A successful call returns a JSON array of program objects scoped to your merchant.
3. Create your first customer
Most workflows start with a customer record. Create one in a program you own:
curl -sS -X POST "$LOYALTYDOG_API_URL/customers" \
-H "Authorization: Bearer $LOYALTYDOG_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"programId": "YOUR_PROGRAM_ID",
"email": "[email protected]",
"firstName": "Ada",
"lastName": "Lovelace"
}'
The response includes the new customerId, which you’ll use to issue points, gift cards, or wallet passes.
4. Explore the API
Full API reference
Every endpoint, request, and response.
Authentication
Bearer tokens, app keys, and rotation.
MCP server
Query the same data from Claude, Cursor, or Windsurf.
Webhooks
React to events in real time.