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

# Start Checkout Session

> Create a hosted checkout session for payment collection

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

Generate a checkout URL for users to complete payment requests. Session expires after 5 minutes.

## Request Body

<ParamField body="auto_address" type="string" required>
  Your Business Auto account address
</ParamField>

<ParamField body="delegate_address" type="string">
  Leave empty for checkout - user enters their own address
</ParamField>

<ParamField body="network" type="string" required>
  * `1` = Ethereum - `137` = Polygon - `11155111` = Sepolia testnet
</ParamField>

<ParamField body="period" type="string" required>
  Payment interval in seconds
</ParamField>

<ParamField body="description" type="string" required>
  Subscription description shown to user
</ParamField>

<ParamField body="redirect_url" type="string" required>
  URL to redirect after successful checkout
</ParamField>

<ParamField body="number" type="string">
  Number of allowed splitters. Empty string to disable
</ParamField>

<ParamField body="currency_code" type="string" required>
  Currency code (e.g., USD, EUR)
</ParamField>

<ParamField body="amount" type="string" required>
  Payment amount
</ParamField>

<ParamField body="token_address" type="array">
  Array of accepted tokens (e.g., `["Ethereum", "USDT"]`)
</ParamField>

<ParamField body="should_split" type="boolean">
  Enable split payments
</ParamField>

## Response

<ResponseField name="id" type="integer">
  Session ID
</ResponseField>

<ResponseField name="url" type="string">
  Checkout URL (expires in 5 minutes)
</ResponseField>

<RequestExample>
  ```javascript Node.js 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: "0x309E7d835ccE6E74BC72A2E523fa7f79FFC0d413",
      delegate_address: "",
      network: "137",
      period: "2592000",
      description: "Premium Subscription",
      redirect_url: "https://yoursite.com/success",
      number: "",
      currency_code: "USD",
      amount: "20",
      token_address: ["Polygon", "USDC"],
      should_split: false,
    }),
  });

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

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

  response = requests.post(
      "https://payments.shakesco.com/start_session",
      headers={
          "Authorization": f"Bearer {API_KEY}",
          "Content-Type": "application/json"
      },
      json={
          "auto_address": "0x309E7d835ccE6E74BC72A2E523fa7f79FFC0d413",
          "delegate_address": "",
          "network": "137",
          "period": "2592000",
          "description": "Premium Subscription",
          "redirect_url": "https://yoursite.com/success",
          "number": "",
          "currency_code": "USD",
          "amount": "20",
          "token_address": ["Polygon", "USDC"],
          "should_split": False
      }
  )

  data = response.json()
  ```
</RequestExample>

<ResponseExample>
  ```json Success theme={null}
  {
    "id": 1,
    "url": "https://checkout.shakesco.com?ZXlKaGJH..."
  }
  ```
</ResponseExample>

<Note>
  Sessions expire after **5 minutes**. Generate a new session if needed.
</Note>
