> For the complete documentation index, see [llms.txt](https://apidocs.akinon.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://apidocs.akinon.com/commerce-openapis/loyalty-card/introduction.md).

# Introduction

This guide outlines the loyalty card management API endpoints in the system. These endpoints allow users to create, retrieve, update, and delete loyalty cards, as well as query loyalty points and integrate with external loyalty programs.

The Loyalty Card API provides functionality for:

**1. Loyalty Card Management**

* Create loyalty cards for authenticated users
* Retrieve loyalty card details and available points
* Update loyalty card information
* Delete/deactivate loyalty cards
* Search for existing loyalty accounts in external systems

**2. Registration Methods**

* Standard registration with SMS verification (OTP)
* Registration without SMS verification (for pre-verified users)
* Search and link existing external loyalty accounts
* Automatic account creation if not found in external system

**3. Points Integration**

* Query available loyalty points from external systems
* Cache loyalty points for performance (2-minute cache)
* Use loyalty points during checkout process
* Track point transactions and redemptions

**4. External System Integration**

* Synchronize user data with external loyalty providers
* Configurable SMS gateway for verification codes
* Automatic account linking and creation

Each endpoint is designed to support loyalty program operations where authenticated users can manage their loyalty cards and redeem points for discounts during checkout.

**NOTE:** All methods require authentication via session cookies. The loyalty card system integrates with external loyalty providers and requires proper configuration of the `CUSTOMER_LOYALTY_CARD_SERVICE` setting.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://apidocs.akinon.com/commerce-openapis/loyalty-card/introduction.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
