> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rigaly.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Issue your first loyalty points in five minutes

Businesses can create loyalty programs effortlessly with the Rigaly API. This guide takes you from zero to issuing points.

## 1. Create an API key

In the [Rigaly business dashboard](https://rigaly.com), go to **Tools → API Management** and click **Create API key**. Copy the key (`rgly_sk_...`) immediately — it is shown only once.

<Warning>
  Treat API keys like passwords: keep them server-side, never in mobile apps or browser code. If a key leaks, roll it from the dashboard — the replacement is issued instantly.
</Warning>

## 2. Verify your key

<CodeGroup>
  ```bash curl theme={null}
  curl https://api.rigaly.com/api/v1/me \
    -H "Authorization: Bearer rgly_sk_YOUR_KEY"
  ```

  ```javascript Node.js theme={null}
  const response = await fetch("https://api.rigaly.com/api/v1/me", {
    headers: { Authorization: `Bearer ${process.env.RIGALY_API_KEY}` },
  });
  const { data } = await response.json();
  console.log(data.business.name); // Your business name
  ```

  ```python Python theme={null}
  import os, requests

  response = requests.get(
      "https://api.rigaly.com/api/v1/me",
      headers={"Authorization": f"Bearer {os.environ['RIGALY_API_KEY']}"},
  )
  print(response.json()["data"]["business"]["name"])
  ```

  ```php PHP theme={null}
  <?php
  $ch = curl_init("https://api.rigaly.com/api/v1/me");
  curl_setopt($ch, CURLOPT_HTTPHEADER, ["Authorization: Bearer " . getenv("RIGALY_API_KEY")]);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  $data = json_decode(curl_exec($ch), true);
  echo $data["data"]["business"]["name"];
  ```
</CodeGroup>

## 3. Issue points

Identify the customer by email, phone, or [your own customer ID](/guides/issue-and-validate#use-your-own-customer-ids). Rigaly's convention is **100 points per USD**.

<CodeGroup>
  ```bash curl theme={null}
  curl -X POST https://api.rigaly.com/api/v1/points/issue \
    -H "Authorization: Bearer rgly_sk_YOUR_KEY" \
    -H "Content-Type: application/json" \
    -d '{"identifier": "customer@example.com", "points": 500, "description": "Order #1042"}'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch("https://api.rigaly.com/api/v1/points/issue", {
    method: "POST",
    headers: {
      Authorization: `Bearer ${process.env.RIGALY_API_KEY}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      identifier: "customer@example.com",
      points: 500, // $5.00 purchase → 500 points
      description: "Order #1042",
    }),
  });
  const { data } = await response.json();
  console.log(`Issued ${data.points_issued} points, new balance ${data.balance}`);
  ```

  ```python Python theme={null}
  response = requests.post(
      "https://api.rigaly.com/api/v1/points/issue",
      headers={"Authorization": f"Bearer {os.environ['RIGALY_API_KEY']}"},
      json={"identifier": "customer@example.com", "points": 500, "description": "Order #1042"},
  )
  data = response.json()["data"]
  print(f"Issued {data['points_issued']} points, new balance {data['balance']}")
  ```

  ```php PHP theme={null}
  <?php
  $ch = curl_init("https://api.rigaly.com/api/v1/points/issue");
  curl_setopt_array($ch, [
      CURLOPT_POST => true,
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_HTTPHEADER => [
          "Authorization: Bearer " . getenv("RIGALY_API_KEY"),
          "Content-Type: application/json",
      ],
      CURLOPT_POSTFIELDS => json_encode([
          "identifier" => "customer@example.com",
          "points" => 500,
          "description" => "Order #1042",
      ]),
  ]);
  $data = json_decode(curl_exec($ch), true)["data"];
  echo "Issued {$data['points_issued']} points, new balance {$data['balance']}";
  ```
</CodeGroup>

The response includes the final `points_issued` — tier multipliers and signup bonuses apply automatically, so it may be higher than what you sent.

## Next steps

<CardGroup cols={2}>
  <Card title="Most used routes" icon="star" href="/guides/most-used-routes">
    The endpoints most integrations need, with example cases.
  </Card>

  <Card title="Issue points & validate rewards" icon="gift" href="/guides/issue-and-validate">
    The complete earn → redeem loop.
  </Card>

  <Card title="Mass codes" icon="qrcode" href="/guides/mass-codes">
    Print tens of thousands of loyalty codes on physical products.
  </Card>

  <Card title="API Reference" icon="book" href="/api-reference">
    Every endpoint, schema, and error.
  </Card>
</CardGroup>
