Loyalty API Smart Passes

Official documentation v1.0. Programmatically manage all aspects of your loyalty programs for mobile wallets.

🚀 Getting Started

Welcome to the official Smart Passes Loyalty API documentation. This API allows you to programmatically manage all aspects of your loyalty programs for mobile wallets.

🌐 Base URL

All URLs referenced in this documentation have the following base URL:

https://pass.smartpasses.io/api/v1/loyalty/

🔐 Authentication

All API requests must be authorized with a valid App Key. The key must be sent in the Authorization header of each request.

Example Header:

Authorization: TU_APP_KEY_AQUI

📋 Format and Status Codes

The API uses JSON for all requests and responses. Standard HTTP methods (GET, POST, PUT, DELETE) are applied.

✅ Successful Responses

200 OK Code

❌ Client Errors

400 Bad Request or 422 Unprocessable Entity codes

🔒 Authentication Errors

403 Forbidden Code

🔍 Resource Not Found

404 Not Found Code

👥 Customers

GET

List Customers

Returns a list of all customers from a specific loyalty program.

Endpoint:

GET /programs/{programId}/customers

Example Request:

GET /programs/4886905521176576/customers

Example Response:

[ { "id": 1869, "firstName": "", "lastName": "", "email": "", "phone": "", "points": 0, "humanName": "Anónimo #1869" }, { "id": 1870, "firstName": "Juan", "lastName": "Pérez", "email": "juan.perez@example.com", "phone": "+529994116533", "points": 5, "humanName": "Juan Pérez" } ]
GET

Get a Customer

Returns the details of a specific customer.

Endpoint:

GET /programs/{programId}/customers/{customerId}

Example Request:

GET /programs/4886905521176576/customers/6629146321223680
POST

Create a Customer

Creates a new customer in a loyalty program.

Endpoint:

POST /programs/{programId}/customers

Request Body (JSON):

{ "firstName": "Ana", "lastName": "García", "email": "ana.garcia@example.com", "phone": "+525551234567" }
PUT

Update a Customer

Updates an existing customer's data.

Endpoint:

PUT /programs/{programId}/customers/{customerId}

Request Body (JSON):

{ "firstName": "Ana", "lastName": "García López", "points": 25 }
DELETE

Delete a Customer

Permanently deletes a customer.

Endpoint:

DELETE /programs/{programId}/customers/{customerId}
POST

Add Points to a Customer

Adds a specific amount of points to a customer.

Endpoint:

POST /programs/{programId}/customers/{customerId}/points/add

Request Body (JSON):

{ "points": 10 }

🎁 Offers

GET

List Offers

Returns a list of all offers (rewards) from a program.

Endpoint:

GET /programs/{programId}/offers
POST

Create an Offer

Creates a new offer or reward.

Endpoint:

POST /programs/{programId}/offers

Request Body (JSON):

{ "name": "Café Gratis", "description": "Canjea 10 puntos por un café americano.", "pointsCost": 10, "autoClaim": true }
POST

Update an Offer

Updates an existing offer.

Endpoint:

POST /programs/{programId}/offers/{offerId}
DELETE

Delete an Offer

Deletes an offer. Note: Only offers in "Draft" status can be deleted.

Endpoint:

DELETE /programs/{programId}/offers/{offerId}
POST

Publish an Offer

Changes an offer status from "Draft" to "Published".

Endpoint:

POST /programs/{programId}/offers/{offerId}/publish
POST

Cancel an Offer

Changes a "Published" offer status to deactivate it.

Endpoint:

POST /programs/{programId}/offers/{offerId}/cancel