Skip to content
Loyvo

API reference

Wallet API

Apple Wallet and Google Wallet loyalty cards, kept up to date from your POS.

Issue loyalty cards that live in your customers' Apple Wallet and Google Wallet, and keep their points balance up to date from your point-of-sale.

Authenticate every request with a live Loyvo API key (app.loyvo.lk → Settings → API keys) with loyalty:pos for the POS endpoints or wallet:issue for cards:

Authorization: Bearer lvo_live_xxxxxxxxxxxxxxxxxxxxxxxx

The POS endpoints combine both systems in one call: they award or redeem points in Loyvo Loyalty and update the customer's wallet card, which then refreshes on their phone within seconds.

Customers are identified by phone (any Sri Lankan format) or by the barcodeValue scanned from their wallet card.

Errors look like {"error": "message"} with a 4xx status. Validation errors return 422 with an issues list.

Base URL
https://api.loyvo.lk
Authentication
Authorization: Bearer lvo_live_xxxxxxxxxxxxxxxxxxxxxxxx

Use a live Loyvo API key with loyalty:pos (POS) or wallet:issue (passes), sent as a bearer token. More about keys · Download OpenAPI

POS

Customer lookup, enrolment, purchases and redemptions at the counter.

Find a customer

post/v1/wallet/pos/customers/resolve

Looks the customer up by phone or scanned card barcode. Returns their loyalty profile and wallet card, if they have one.

Body parameters

  • phonestring
  • barcodeValuestring

    Scanned from the wallet card's QR code.

Returns

  • 200Customer found (or not yet enrolled: exists is false).
  • 404The endpoint or the object doesn't exist.

Errors use the standard format. See Errors.

POST /v1/wallet/pos/customers/resolve
curl -X POST "https://api.loyvo.lk/v1/wallet/pos/customers/resolve" \
  -H "Authorization: Bearer lvo_live_xxxxxxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
  "phone": "0771234567"
}'
Response 200
{
  "exists": true,
  "hasLocalPass": true,
  "member": {
    "id": "cmw3k9p1a0000",
    "fullName": "Kamal Perera",
    "phone": "94771234567",
    "email": null,
    "createdAt": "2026-11-17T10:00:00+05:30"
  },
  "pass": {
    "id": "cmw3k9q2d0001",
    "cardTemplateId": "…",
    "memberId": "…",
    "serialNumber": "…",
    "status": "ACTIVE",
    "pointsBalance": 250,
    "stampCount": 1,
    "barcodeValue": "…",
    "expiresAt": "2026-11-17T10:00:00+05:30",
    "updatedAt": "2026-11-17T10:00:00+05:30"
  },
  "onePayLoyalty": {
    "points_balance": 250,
    "name": "Kamal"
  }
}

Enrol a customer and issue a card

post/v1/wallet/pos/customers/enroll

Enrols the customer in Loyvo Loyalty and issues their wallet card. The response includes publicInstallUrl, a page where the customer adds the card to Apple or Google Wallet (Loyvo also texts it to them).

Body parameters

  • phonestringRequired

    Customer's mobile number.

  • firstNamestringRequired
  • cardTemplateIdstringRequired

    Which card design to issue (from your Loyalty dashboard).

  • branchIdinteger

    Branch where the customer enrolled.

Returns

  • 201Enrolled; card issued.
  • 404The endpoint or the object doesn't exist.
  • 422Validation failed: a field is missing or invalid.

Errors use the standard format. See Errors.

POST /v1/wallet/pos/customers/enroll
curl -X POST "https://api.loyvo.lk/v1/wallet/pos/customers/enroll" \
  -H "Authorization: Bearer lvo_live_xxxxxxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
  "phone": "0771234567",
  "firstName": "Kamal",
  "cardTemplateId": "cmv960es90000i5xl50iyz9p2-loyalty-points",
  "branchId": 1
}'
Response 201
{
  "member": {
    "id": "cmw3k9p1a0000",
    "fullName": "Kamal Perera",
    "phone": "94771234567",
    "email": null,
    "createdAt": "2026-11-17T10:00:00+05:30"
  },
  "pass": {
    "id": "cmw3k9q2d0001",
    "cardTemplateId": "…",
    "memberId": "…",
    "serialNumber": "…",
    "status": "ACTIVE",
    "pointsBalance": 250,
    "stampCount": 1,
    "barcodeValue": "…",
    "expiresAt": "2026-11-17T10:00:00+05:30",
    "updatedAt": "2026-11-17T10:00:00+05:30"
  },
  "publicInstallUrl": "https://one-wallet-uat-e3hua2b8ejd8ehce.southeastasia-01.azurewebsites.net/v1/public/passes/cmw3k9q2d0001"
}

Record a purchase and award points

post/v1/wallet/pos/transactions

Awards points for a purchase using your earning rule (for example 1 point per LKR 100) and updates the wallet card. If the phone number has no card yet and you pass cardTemplateId, a card is issued automatically.

Body parameters

  • phonestring
  • barcodeValuestring

    Scanned from the wallet card's QR code.

  • amountnumberRequired

    Bill total in LKR.

  • invoiceIdstring

    Your invoice number, so the purchase can be traced.

  • branchIdinteger
  • getOfferboolean

    Apply the customer's available reward to this bill.

  • cardTemplateIdstring

    Issue this card automatically if the customer has none.

Returns

  • 201Points awarded; pass is the updated card.
  • 400The request is malformed, or a business rule failed.
  • 404The endpoint or the object doesn't exist.

Errors use the standard format. See Errors.

POST /v1/wallet/pos/transactions
curl -X POST "https://api.loyvo.lk/v1/wallet/pos/transactions" \
  -H "Authorization: Bearer lvo_live_xxxxxxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
  "phone": "0771234567",
  "amount": 2500,
  "invoiceId": "INV-2026-001",
  "branchId": 1
}'
Response 201
{
  "transaction_uuid": "6c0f2b9e-1d2a-4c7e-9a51-0b7e4d2f3a10",
  "invoice_id": "INV-1055",
  "amount": 2500,
  "net_amount": 2500,
  "points_awarded": 25,
  "previous_balance": 250,
  "new_points_balance": 275,
  "customer_name": "Kamal",
  "offer_redeemed": false,
  "pass": {
    "id": "cmw3k9q2d0001",
    "cardTemplateId": "…",
    "memberId": "…",
    "serialNumber": "…",
    "status": "ACTIVE",
    "pointsBalance": 250,
    "stampCount": 1,
    "barcodeValue": "…",
    "expiresAt": "2026-11-17T10:00:00+05:30",
    "updatedAt": "2026-11-17T10:00:00+05:30"
  }
}

Start a points redemption

post/v1/wallet/pos/redemptions/initiate

Sends the customer a 4-digit PIN by SMS. Confirm it with Confirm a redemption.

Body parameters

  • phonestring
  • barcodeValuestring

    Scanned from the wallet card's QR code.

  • pointsToRedeemintegerRequired
  • branchIdinteger
  • invoiceIdstring

Returns

  • 200PIN sent. Keep redemption_id for the next step.
  • 404The endpoint or the object doesn't exist.

Errors use the standard format. See Errors.

POST /v1/wallet/pos/redemptions/initiate
curl -X POST "https://api.loyvo.lk/v1/wallet/pos/redemptions/initiate" \
  -H "Authorization: Bearer lvo_live_xxxxxxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
  "phone": "0771234567",
  "barcodeValue": "…",
  "pointsToRedeem": 200,
  "branchId": 1,
  "invoiceId": "INV-2026-002"
}'
Response 200
{
  "redemption_id": "a3f1c2e4-…",
  "expires_in": 300
}

Confirm a redemption

post/v1/wallet/pos/redemptions/confirm

Checks the PIN the customer read out, deducts the points and updates the wallet card.

Body parameters

  • phonestring
  • barcodeValuestring

    Scanned from the wallet card's QR code.

  • redemptionIdstringRequired
  • pinstringRequired

Returns

  • 200Points deducted; pass is the updated card.
  • 400The request is malformed, or a business rule failed.
  • 404The endpoint or the object doesn't exist.

Errors use the standard format. See Errors.

POST /v1/wallet/pos/redemptions/confirm
curl -X POST "https://api.loyvo.lk/v1/wallet/pos/redemptions/confirm" \
  -H "Authorization: Bearer lvo_live_xxxxxxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
  "phone": "0771234567",
  "barcodeValue": "…",
  "redemptionId": "a3f1c2e4-…",
  "pin": "4821"
}'
Response 200
{
  "redemption_id": "a3f1c2e4-7b1d-4e8a-9c2f-5d6e7f8a9b0c",
  "customer_name": "Kamal",
  "points_redeemed": 100,
  "discount_applied_amount": 100,
  "previous_balance": 275,
  "new_points_balance": 175,
  "ledger_reference": "…",
  "confirmed_at": "2026-11-17T10:00:00+05:30",
  "pass": {
    "id": "cmw3k9q2d0001",
    "cardTemplateId": "…",
    "memberId": "…",
    "serialNumber": "…",
    "status": "ACTIVE",
    "pointsBalance": 250,
    "stampCount": 1,
    "barcodeValue": "…",
    "expiresAt": "2026-11-17T10:00:00+05:30",
    "updatedAt": "2026-11-17T10:00:00+05:30"
  }
}

Resend the redemption PIN

post/v1/wallet/pos/redemptions/resend-pin

Body parameters

  • redemptionIdstringRequired

Returns

  • 200PIN sent again.
  • 404The endpoint or the object doesn't exist.

Errors use the standard format. See Errors.

POST /v1/wallet/pos/redemptions/resend-pin
curl -X POST "https://api.loyvo.lk/v1/wallet/pos/redemptions/resend-pin" \
  -H "Authorization: Bearer lvo_live_xxxxxxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
  "redemptionId": "a3f1c2e4-…"
}'

Cancel or reverse a redemption

post/v1/wallet/pos/redemptions/cancel

Cancels a pending redemption, or gives the points back if it was already confirmed.

Body parameters

  • redemptionIdstringRequired

Returns

  • 200Cancelled.
  • 404The endpoint or the object doesn't exist.

Errors use the standard format. See Errors.

POST /v1/wallet/pos/redemptions/cancel
curl -X POST "https://api.loyvo.lk/v1/wallet/pos/redemptions/cancel" \
  -H "Authorization: Bearer lvo_live_xxxxxxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
  "redemptionId": "a3f1c2e4-…"
}'

Cards

Your loyalty card designs. Use a design's id as cardTemplateId when enrolling customers.

List your loyalty card designs

get/v1/wallet/card-templates

Every card design, newest first. Only PUBLISHED designs can issue cards. Needs loyalty:pos or wallet:issue.

Returns

  • 200Your card designs.
  • 401No key, or the key is invalid or revoked.
  • 403The key is valid but not allowed to do this.

Errors use the standard format. See Errors.

GET /v1/wallet/card-templates
curl "https://api.loyvo.lk/v1/wallet/card-templates" \
  -H "Authorization: Bearer lvo_live_xxxxxxxxxxxxxxxxxxxxxxxx"
Response 200
[
  {
    "id": "cmw3k9q2d0001-loyalty-points",
    "name": "QUBA Rewards",
    "type": "POINTS",
    "status": "PUBLISHED",
    "backgroundColor": "#1e293b",
    "foregroundColor": "#ffffff",
    "labelColor": "#94a3b8",
    "config": {},
    "locationIds": [
      "…"
    ],
    "createdAt": "2026-11-17T10:00:00+05:30",
    "updatedAt": "2026-11-17T10:00:00+05:30"
  }
]

Retrieve a card design

get/v1/wallet/card-templates/{id}

Path parameters

  • idstringRequired

    The card design's ID.

Returns

  • 200The card design.
  • 404The endpoint or the object doesn't exist.

Errors use the standard format. See Errors.

GET /v1/wallet/card-templates/{id}
curl "https://api.loyvo.lk/v1/wallet/card-templates/abc123" \
  -H "Authorization: Bearer lvo_live_xxxxxxxxxxxxxxxxxxxxxxxx"
Response 200
{
  "id": "cmw3k9q2d0001-loyalty-points",
  "name": "QUBA Rewards",
  "type": "POINTS",
  "status": "PUBLISHED",
  "backgroundColor": "#1e293b",
  "foregroundColor": "#ffffff",
  "labelColor": "#94a3b8",
  "config": {},
  "locationIds": [
    "…"
  ],
  "createdAt": "2026-11-17T10:00:00+05:30",
  "updatedAt": "2026-11-17T10:00:00+05:30"
}

Passes

Individual wallet cards.

Retrieve a card

get/v1/wallet/passes/{id}

Path parameters

  • idstringRequired

    The card's ID.

Returns

  • 200The card.
  • 404The endpoint or the object doesn't exist.

Errors use the standard format. See Errors.

GET /v1/wallet/passes/{id}
curl "https://api.loyvo.lk/v1/wallet/passes/abc123" \
  -H "Authorization: Bearer lvo_live_xxxxxxxxxxxxxxxxxxxxxxxx"
Response 200
{
  "id": "cmw3k9q2d0001",
  "cardTemplateId": "…",
  "memberId": "…",
  "serialNumber": "…",
  "status": "ACTIVE",
  "pointsBalance": 250,
  "stampCount": 1,
  "barcodeValue": "…",
  "expiresAt": "2026-11-17T10:00:00+05:30",
  "updatedAt": "2026-11-17T10:00:00+05:30"
}

Download the Apple Wallet file

get/v1/wallet/passes/{id}/apple.pkpass

Returns the signed .pkpass file (application/vnd.apple.pkpass). Opening it on an iPhone adds the card to Apple Wallet.

Path parameters

  • idstringRequired

    The card's ID.

Returns

  • 200The .pkpass file.
  • 404The endpoint or the object doesn't exist.

Errors use the standard format. See Errors.

GET /v1/wallet/passes/{id}/apple.pkpass
curl "https://api.loyvo.lk/v1/wallet/passes/abc123/apple.pkpass" \
  -H "Authorization: Bearer lvo_live_xxxxxxxxxxxxxxxxxxxxxxxx"

Get the Google Wallet link

get/v1/wallet/passes/{id}/google-save-url

Path parameters

  • idstringRequired

    The card's ID.

Returns

  • 200A "Save to Google Wallet" link.
  • 404The endpoint or the object doesn't exist.

Errors use the standard format. See Errors.

GET /v1/wallet/passes/{id}/google-save-url
curl "https://api.loyvo.lk/v1/wallet/passes/abc123/google-save-url" \
  -H "Authorization: Bearer lvo_live_xxxxxxxxxxxxxxxxxxxxxxxx"
Response 200
{
  "saveUrl": "https://pay.google.com/gp/v/save/eyJhbGciOi…"
}

Adjust a card's balance

patch/v1/wallet/passes/{id}/balance

Adds or removes points (or stamps) directly on the card, without a purchase. The card refreshes on the customer's phone.

Path parameters

  • idstringRequired

    The card's ID.

Body parameters

  • pointsDeltainteger
  • stampsDeltainteger

Returns

  • 200The updated card.
  • 404The endpoint or the object doesn't exist.

Errors use the standard format. See Errors.

PATCH /v1/wallet/passes/{id}/balance
curl -X PATCH "https://api.loyvo.lk/v1/wallet/passes/abc123/balance" \
  -H "Authorization: Bearer lvo_live_xxxxxxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
  "pointsDelta": 50,
  "stampsDelta": 1
}'
Response 200
{
  "id": "cmw3k9q2d0001",
  "cardTemplateId": "…",
  "memberId": "…",
  "serialNumber": "…",
  "status": "ACTIVE",
  "pointsBalance": 250,
  "stampCount": 1,
  "barcodeValue": "…",
  "expiresAt": "2026-11-17T10:00:00+05:30",
  "updatedAt": "2026-11-17T10:00:00+05:30"
}

Void a card

post/v1/wallet/passes/{id}/void

Marks the card as voided; it shows as no longer valid in the customer's wallet.

Path parameters

  • idstringRequired

    The card's ID.

Returns

  • 200The voided card.
  • 404The endpoint or the object doesn't exist.

Errors use the standard format. See Errors.

POST /v1/wallet/passes/{id}/void
curl -X POST "https://api.loyvo.lk/v1/wallet/passes/abc123/void" \
  -H "Authorization: Bearer lvo_live_xxxxxxxxxxxxxxxxxxxxxxxx"
Response 200
{
  "id": "cmw3k9q2d0001",
  "cardTemplateId": "…",
  "memberId": "…",
  "serialNumber": "…",
  "status": "ACTIVE",
  "pointsBalance": 250,
  "stampCount": 1,
  "barcodeValue": "…",
  "expiresAt": "2026-11-17T10:00:00+05:30",
  "updatedAt": "2026-11-17T10:00:00+05:30"
}