> ## 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.

# API Reference

> Complete reference for all Shakesco APIs - invoices, analytics, loyalty tokens, and auto-payments

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

## Welcome to Shakesco API

Build crypto payment solutions with the Shakesco API suite. Create invoices, query customer analytics, manage store items, and run full-featured loyalty token programs, all on Ethereum and Polygon.

## API Products

<CardGroup cols={2}>
  <Card title="Payment Links API" icon="link" href="/api-reference/payment-links/invoices/create">
    Create invoices, query analytics, and browse store items
  </Card>

  <Card title="Tokens API" icon="gift" href="/api-reference/tokens/overview">
    Manage loyalty tokens: rewards, staking, vesting, cashback, and more
  </Card>

  <Card title="Auto-Payments API (Beta)" icon="rotate" href="/api-reference/auto-payments/request">
    Accept recurring crypto subscriptions with automated billing
  </Card>

  <Card title="Currency Codes" icon="globe" href="/api-reference/general/codes">
    List all supported currency codes used across APIs
  </Card>
</CardGroup>

## Base URLs

| API            | Base URL                        |
| -------------- | ------------------------------- |
| Payment Links  | `https://payments.shakesco.com` |
| Loyalty Tokens | `https://tokens.shakesco.com`   |
| Auto-Payments  | `https://payments.shakesco.com` |

## Authentication

All API requests require your API key in the `Authorization` header:

```bash theme={null}
Authorization: Bearer YOUR_API_KEY
```

Get your API key from the [Shakesco Dashboard](https://users.shakesco.com/user/api-tokens).

## Quick Start

**1. Get your API key:** Sign up and retrieve it from the [dashboard](https://users.shakesco.com/user/api-tokens).

**2. Make your first request**

**Create an invoice:**

```javascript theme={null}
const response = await fetch("https://payments.shakesco.com/invoices", {
  method: "POST",
  headers: {
    Authorization: "Bearer YOUR_API_KEY",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    type: "public",
    currency: "USD",
    payer_email: "customer@example.com",
    payer_name: "John Doe",
    items: [{ description: "Consulting", unit: 1, price: 150 }],
  }),
});
```

**Claim loyalty tokens for a customer:**

```javascript theme={null}
const response = await fetch("https://tokens.shakesco.com/claim-tokens", {
  method: "POST",
  headers: {
    Authorization: "Bearer YOUR_API_KEY",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    event_name: "signup",
    customer_ref: "customer-123",
  }),
});
```

## Supported Networks

| Network          | Chain ID   | Use Case                        |
| ---------------- | ---------- | ------------------------------- |
| Ethereum Mainnet | `1`        | Production deployments          |
| Polygon Mainnet  | `137`      | Lower fees, faster transactions |
| Sepolia Testnet  | `11155111` | Testing and development         |

## Rate Limits

Rate limits vary by plan. Check your [pricing tier](https://shakesco.com/pricing) for details.

## Common Error Codes

| Code | Meaning                                    |
| ---- | ------------------------------------------ |
| 400  | Bad request, check parameter formatting    |
| 401  | Unauthorized, invalid or missing API key   |
| 403  | Forbidden, invalid address or permissions  |
| 404  | Not Found, resource does not exist         |
| 409  | Conflict, action already performed         |
| 429  | Too Many Requests, daily cap or rate limit |
| 500  | Internal Server Error, contact support     |

## Need Help?

<CardGroup cols={2}>
  <Card title="Contact Support" icon="headset" href="https://shakesco.com/contact">
    Get help from our team
  </Card>

  <Card title="View Pricing" icon="dollar-sign" href="https://shakesco.com/pricing">
    Check plans and limits
  </Card>

  <Card title="Transaction Fees" icon="file-invoice-dollar" href="https://shakesco.com/charges">
    See fee structure
  </Card>

  <Card title="Dashboard" icon="gauge" href="https://users.shakesco.com/login">
    Manage your API keys
  </Card>
</CardGroup>
