Elune Connections

Partner API Documentation

Complete reference for integrating Apple Wallet and Google Wallet notifications

1

Authentication

All requests go to https://api.eluneconnections.com and carry your API key in the X-API-Key header (except POST /api/partner/register).

X-API-Key: tu_api_key
Content-Type: application/json
If you already have an Elune account, ask us for your API key and card ID (referenceId) at info@eluneconnections.com. If you are a platform onboarding businesses, use POST /api/partner/register: the key is shown only once.
The API key gives access to your account: use it only from your server, never in a browser or app.
2

Points and rewards

Add and subtract customer points from your system (online store, POS, CRM). The customer’s card updates on their phone automatically.

Without externalReference, a card gets at most one add every 2 minutes (meant for Instagram comments). With externalReference there is no limit: each different reference adds, a repeated one does not.
POST /api/points/add

Adds points to a customer.

Field Type Required Description
referenceId string Yes Your card ID in Elune (we give it to you with the API key). referenciaId also works.
findBy object Yes* Finds the customer by a form field: { "field": "email", "value": "ana@example.com" }.
serialNumber string Yes* Alternative to findBy: the serial number of the customer’s card.
amount integer Yes Points (greater than 0).
concept string No Movement text. If sent, the customer gets a phone notification ("+10 pts: Order #1001"); if not, it is added silently.
externalReference string No Your operation ID (e.g. the order number), up to 100 characters. The same reference on the same card is applied only once: resending it returns 200 without repeating it. Highly recommended.

* Send findBy or serialNumber. With findBy the value is matched as is and, for phone fields, with or without the country prefix.

Example Request
{
  "referenceId": "TU_REFERENCE_ID",
  "findBy": { "field": "email", "value": "ana@example.com" },
  "amount": 25,
  "concept": "Pedido #1001",
  "externalReference": "order-1001"
}
Response
{
  "success": true,
  "message": "Points added successfully",
  "previousBalance": 100,
  "balance": 125,
  "transaction": { "id": 8812, "amount": 25, "type": "EARN", "externalReference": "order-1001", ... }
}
POST /api/points/subtract

Subtracts points (refunds, adjustments). Returns 400 if the balance is not enough.

Field Type Required Description
referenceId string Yes Your card ID in Elune (we give it to you with the API key). referenciaId also works.
findBy object Yes* Finds the customer by a form field: { "field": "email", "value": "ana@example.com" }.
serialNumber string Yes* Alternative to findBy: the serial number of the customer’s card.
amount integer Yes Points (greater than 0).
concept string No Movement text. If sent, the customer gets a phone notification ("+10 pts: Order #1001"); if not, it is added silently.
externalReference string No Your operation ID (e.g. the order number), up to 100 characters. The same reference on the same card is applied only once: resending it returns 200 without repeating it. Highly recommended.

* Send findBy or serialNumber. With findBy the value is matched as is and, for phone fields, with or without the country prefix.

Example Request
{
  "referenceId": "TU_REFERENCE_ID",
  "findBy": { "field": "email", "value": "ana@example.com" },
  "amount": 25,
  "externalReference": "refund-1001"
}
GET /api/points/balance

A customer’s balance. Params: referenciaId + field + value, or serialNumber.

Example Request
GET /api/points/balance?referenciaId=TU_REFERENCE_ID&field=email&value=ana@example.com
Response
{ "balance": 125, "serialNumber": "a1b2c3d4-0000-4000-8000-000000000000" }
GET /api/points/history

A customer’s movements, newest first. Same params as /balance plus limit (default 20, max 100).

Response
{ "balance": 125, "serialNumber": "a1b2c3d4-...", "transactions": [ { "amount": 25, "type": "EARN", "concept": "Pedido #1001", "externalReference": "order-1001", "createdAt": "..." } ] }
GET /api/points/rewards/{referenceId}

Active rewards of the card, cheapest first.

Response
[ { "id": 12, "name": "Café gratis", "pointsCost": 100, "stock": null, "maxPerCustomer": null, ... } ]
POST /api/points/redeem

Redeems a reward: subtracts the points and leaves it pending delivery in the dashboard.

Field Type Required Description
referenceId string Yes Your card ID in Elune (we give it to you with the API key). referenciaId also works.
findBy object Yes* Finds the customer by a form field: { "field": "email", "value": "ana@example.com" }.
serialNumber string Yes* Alternative to findBy: the serial number of the customer’s card.
rewardId integer Yes Reward ID (from GET /api/points/rewards).

* Send findBy or serialNumber. With findBy the value is matched as is and, for phone fields, with or without the country prefix.

3

Online stores (Shopify, WooCommerce…)

Connect your store with a webhook or automation (Shopify Flow, Make, Zapier or your own server):

  1. Order paid (Shopify: orders/paid) → POST /api/points/add with findBy email = the order email, amount = the points earned and externalReference = "order-" + order id.
  2. Refund (refunds/create) → POST /api/points/subtract with externalReference = "refund-" + refund id.
  3. If Shopify resends the same event, nothing happens: with the same externalReference it is never added or subtracted twice.
  4. A 404 "Card not found" means that customer has no card yet (the email matches none).
curl -X POST https://api.eluneconnections.com/api/points/add \
  -H "X-API-Key: $ELUNE_API_KEY" -H "Content-Type: application/json" \
  -d '{"referenceId":"TU_REFERENCE_ID","findBy":{"field":"email","value":"ana@example.com"},"amount":25,"concept":"Pedido #1001","externalReference":"order-1001"}'
4

Issued cards

Create the card for a user of your system (externalId) and give them the link to save it in Apple or Google Wallet. {id} accepts the externalId or the serialNumber.

POST /api/partner/cards

Creates the card (if it already exists for that externalId, returns it with status EXISTING).

Example Request
{ "externalId": "user-42", "referenceId": "opcional" }
Response
{ "serialNumber": "…", "externalId": "user-42", "downloadUrl": "https://api.eluneconnections.com/api/notification-card/i/{referenceId}/{serialNumber}", "status": "CREATED" }
GET /api/partner/cards

Paginated list. Params: status (ACTIVE, CREATED, DISABLED), referenceId, page, size (max 200).

GET /api/partner/cards/{id}

Status of one card (ACTIVE when installed).

DELETE /api/partner/cards/{id}

Disables the card and removes it from phones.

5

Notifications

Send notifications to installed cards. They count towards your plan usage.

POST /api/partner/notify

Send to several cards (1 to 1000). Returns 202 and calls your webhook with notification.completed when done.

Example Request
{ "message": "Hoy 2x1 en cafés", "title": "Mi tienda", "url": "https://…", "recipients": ["user-42", "user-43"] }
Response
{ "success": true, "notificationId": 991, "status": "SENDING", "accepted": 2 }
POST /api/partner/cards/{id}/notify

Send to one card. Body: message, title, url.

6

Card models and settings

For platforms managing card design through the API.

POST /api/partner/register

Creates a company and returns its apiKey (only this once). Fields: companyName and email (required), logoUrl, colorCode, textColor, webhookUrl, cardLanguage…

PUT /api/partner/config

Changes name, colors, logo, banner, webhookUrl and language. Only what you send changes.

PUT /api/partner/config/logo

Uploads the logo (multipart, field logo).

PUT /api/partner/config/banner

Uploads the banner (multipart, field banner).

POST /api/partner/references

Creates a notification card model (name required).

GET /api/partner/references

Lists your notification card models.

PUT /api/partner/references/{id}

Updates a model (name, cardLanguage, pointsEnabled, logoUrl, bannerUrl…).

DELETE /api/partner/references/{id}

Deletes a model (not the last one).

7

Webhooks

If you set webhookUrl (at registration or with PUT /api/partner/config), Elune sends you a JSON POST { "event", "data", "timestamp" }:

  1. card.installed: a user saves a card created with POST /api/partner/cards. data: serialNumber, externalId, platform, installedAt.
  2. card.uninstalled: removed from an iPhone (Android does not report it).
  3. notification.completed: a /api/partner/notify send finished. data: notificationId, summary { total, sent, failed }, results.
Reply 2xx within 15 seconds. Events are not retried or signed: verify with the API anything you need before acting.
8

Errors

/api/partner routes return { "error": "…" }. /api/points routes return { "success": false, "message": "…" }.

200 / 201 / 202OK (202: processed in the background).
400Invalid request (missing field, insufficient balance…).
401Missing or invalid API key.
403The card or reference is not yours, or you exceeded your plan limit.
404Not found (e.g. the customer has no card).
500Our error: retry and, if it persists, contact us.
9

Quick Reference — All Endpoints

Method Path Description
POST/api/points/addAdds points to a customer.
POST/api/points/subtractSubtracts points (refunds, adjustments). Returns 400 if the balance is not enough.
GET/api/points/balanceA customer’s balance. Params: referenciaId + field + value, or serialNumber.
GET/api/points/historyA customer’s movements, newest first. Same params as /balance plus limit (default 20, max 100).
GET/api/points/rewards/{referenceId}Active rewards of the card, cheapest first.
POST/api/points/redeemRedeems a reward: subtracts the points and leaves it pending delivery in the dashboard.
POST/api/partner/cardsCreates the card (if it already exists for that externalId, returns it with status EXISTING).
GET/api/partner/cardsPaginated list. Params: status (ACTIVE, CREATED, DISABLED), referenceId, page, size (max 200).
GET/api/partner/cards/{id}Status of one card (ACTIVE when installed).
DELETE/api/partner/cards/{id}Disables the card and removes it from phones.
POST/api/partner/notifySend to several cards (1 to 1000). Returns 202 and calls your webhook with notification.completed when done.
POST/api/partner/cards/{id}/notifySend to one card. Body: message, title, url.
POST/api/partner/registerCreates a company and returns its apiKey (only this once). Fields: companyName and email (required), logoUrl, colorCode, textColor, webhookUrl, cardLanguage…
PUT/api/partner/configChanges name, colors, logo, banner, webhookUrl and language. Only what you send changes.
PUT/api/partner/config/logoUploads the logo (multipart, field logo).
PUT/api/partner/config/bannerUploads the banner (multipart, field banner).
POST/api/partner/referencesCreates a notification card model (name required).
GET/api/partner/referencesLists your notification card models.
PUT/api/partner/references/{id}Updates a model (name, cardLanguage, pointsEnabled, logoUrl, bannerUrl…).
DELETE/api/partner/references/{id}Deletes a model (not the last one).
POST/api/points/add
Adds points to a customer.
POST/api/points/subtract
Subtracts points (refunds, adjustments). Returns 400 if the balance is not enough.
GET/api/points/balance
A customer’s balance. Params: referenciaId + field + value, or serialNumber.
GET/api/points/history
A customer’s movements, newest first. Same params as /balance plus limit (default 20, max 100).
GET/api/points/rewards/{referenceId}
Active rewards of the card, cheapest first.
POST/api/points/redeem
Redeems a reward: subtracts the points and leaves it pending delivery in the dashboard.
POST/api/partner/cards
Creates the card (if it already exists for that externalId, returns it with status EXISTING).
GET/api/partner/cards
Paginated list. Params: status (ACTIVE, CREATED, DISABLED), referenceId, page, size (max 200).
GET/api/partner/cards/{id}
Status of one card (ACTIVE when installed).
DELETE/api/partner/cards/{id}
Disables the card and removes it from phones.
POST/api/partner/notify
Send to several cards (1 to 1000). Returns 202 and calls your webhook with notification.completed when done.
POST/api/partner/cards/{id}/notify
Send to one card. Body: message, title, url.
POST/api/partner/register
Creates a company and returns its apiKey (only this once). Fields: companyName and email (required), logoUrl, colorCode, textColor, webhookUrl, cardLanguage…
PUT/api/partner/config
Changes name, colors, logo, banner, webhookUrl and language. Only what you send changes.
PUT/api/partner/config/logo
Uploads the logo (multipart, field logo).
PUT/api/partner/config/banner
Uploads the banner (multipart, field banner).
POST/api/partner/references
Creates a notification card model (name required).
GET/api/partner/references
Lists your notification card models.
PUT/api/partner/references/{id}
Updates a model (name, cardLanguage, pointsEnabled, logoUrl, bannerUrl…).
DELETE/api/partner/references/{id}
Deletes a model (not the last one).