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

# Checkout Integration

> Add a hosted checkout page for recurring crypto payments

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

## Overview

Shakesco Checkout provides a hosted payment page for accepting recurring subscriptions. Users complete payment requests in a secure, pre-built interface.

**Two integration options:**

* Redirect users to checkout URL
* Embed checkout in iframe

***

## How It Works

<Steps>
  <Step title="Create checkout session">
    Call `/start_session` API endpoint with payment details
  </Step>

  <Step title="Receive checkout URL">API returns URL valid for 5 minutes</Step>

  <Step title="User completes checkout">
    Redirect or embed the checkout page
  </Step>

  <Step title="User approves in app">User accepts request in Shakesco app</Step>

  <Step title="Verify payment">
    Check payment status via `/has_paid` endpoint
  </Step>
</Steps>

***

## Quick Start

**1. Create session:**

See [Start Session API](/api-reference/auto-payments/start-session) for full documentation.

**2. Redirect user:**

```javascript theme={null}
const response = await fetch("https://payments.shakesco.com/start_session", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    auto_address: YOUR_AUTO_ADDRESS,
    network: "137",
    period: "2592000",
    currency_code: "USD",
    amount: "20",
    redirect_url: "https://yoursite.com/success",
    // ... other params
  }),
});

const { url } = await response.json();
window.location.href = url; // Redirect to checkout
```

**3. Handle redirect:**

User returns to your `redirect_url` after checkout. Verify payment:

```javascript theme={null}
const hasPaid = await checkPaymentStatus(userAddress);
if (hasPaid) {
  // Grant service access
}
```

***

## Configuration Options

### Payment Types

* **Recurring subscriptions** - Set `period` > 0
* **One-time payments** - Set `period: "0"`

### Token Support

Accept multiple tokens by passing array:

```javascript theme={null}
token_address: ["Polygon", "USDT"];
```

See [supported tokens](/auto-payments/how-it-works#supported-tokens).

***

## Session Expiration

<Warning>
  Checkout URLs expire after **5 minutes**. Generate a new session if needed.
</Warning>

***

## API Reference

<CardGroup cols={2}>
  <Card title="Start Session" icon="play" href="/api-reference/auto-payments/start-session">
    Create checkout session endpoint
  </Card>

  <Card title="Verify Payment" icon="check" href="/api-reference/auto-payments/has-paid">
    Check payment status endpoint
  </Card>

  <Card title="All Endpoints" icon="list" href="/api-reference/auto-payments/">
    Complete API documentation
  </Card>

  <Card title="SDK Integration" icon="code" href="/auto-payments/integrate">
    Use JavaScript SDK instead
  </Card>
</CardGroup>
