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

# Migrate from Your Existing Rewards System

> Move your customers' current loyalty points into the Shakesco managed token system

<span style={{display:"none"}}>For the complete documentation index, see [llms.txt](/llms.txt).</span>

## Why Migrate?

If you already run a loyalty program with points stored in a database, a third-party platform, or a custom system, you can move your customers into the Shakesco managed token system without losing their accumulated balances.

After migration:

* Existing points become Shakesco managed tokens with the same balance
* Customers keep their balance and can immediately earn, spend, and stake
* You get all Shakesco features: happy hours, tiers, cashback, vesting, and governance

## How Migration Works

Migration is done one customer at a time. For each customer, call `POST /upgrade-to-shakesco` with their `customer_ref` and current point balance. Shakesco credits that amount to the customer's managed balance.

<Info>
  `customer_ref` is your own unique identifier for this customer (UUID, account number, phone, email, your primary key). Whatever you pick here is what you must keep passing on every subsequent call for the same customer. See the [Tokens API overview](/api-reference/tokens/overview) for guidance.
</Info>

```javascript theme={null}
await fetch("https://tokens.shakesco.com/upgrade-to-shakesco", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    customer_ref: "customer-123",
    amount: 250, // their legacy points balance
  }),
});
```

### Response

```json theme={null}
{ "tx_hash": "0xabc123..." }
```

Once Shakesco records the credit, the customer's managed balance is updated and they can start earning, spending, or staking immediately.

## Migrating Your Customers

Loop through your customer list and call the endpoint for each one. Use whatever stable internal ID you already have as the `customer_ref`:

```javascript theme={null}
const customers = [
  { ref: "user-alice-001", points: 500 },
  { ref: "user-bob-002", points: 120 },
  { ref: "user-carol-003", points: 80 },
  // ...
];

for (const customer of customers) {
  await fetch("https://tokens.shakesco.com/upgrade-to-shakesco", {
    method: "POST",
    headers: {
      Authorization: `Bearer ${API_KEY}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      customer_ref: customer.ref,
      amount: customer.points,
    }),
  });
}
```

<Note>
  Each call migrates one customer. Once Shakesco returns a `tx_hash` for that
  customer, you can remove them from your legacy system and keep only their
  Shakesco-managed balance going forward.
</Note>

## Cutover Process

The recommended approach is to remove your old loyalty system entirely and replace it with the Shakesco API:

1. Pick a stable `customer_ref` for each customer (your DB primary key is usually a good choice)
2. Call `/upgrade-to-shakesco` for each customer to preserve their balance
3. Verify migration with the balance check below
4. Once a customer's record is confirmed in Shakesco, delete their record from your legacy system
5. Add the Shakesco API calls to your backend to handle all future earning and redemption, always sending the same `customer_ref`

This keeps things simple with one system and one source of truth.

## Verifying Migration

After migrating, check a customer's balance to confirm it was credited correctly:

```javascript theme={null}
const res = await fetch(
  "https://tokens.shakesco.com/balance?customer_ref=customer-123",
  { headers: { Authorization: `Bearer ${API_KEY}` } }
);
const { balance } = await res.json();
// balance is a plain decimal string like "250.0"
```

## Next Steps

<CardGroup cols={2}>
  <Card title="Manage Rewards" icon="sliders" href="/loyalty-program/manage-rewards">
    Configure events, happy hours, and tiers from the dashboard
  </Card>

  <Card title="Integrate via API" icon="code" href="/loyalty-program/integrate">
    Start calling the Tokens API from your backend
  </Card>
</CardGroup>
