Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.fluveo.com/llms.txt

Use this file to discover all available pages before exploring further.

Checkout Links are reusable, shareable payment URLs. Each time a customer visits the link, a new Checkout Session is created automatically. No code required on your end — just share the URL.
curl -X POST https://api.leanrails.com/v1/checkout_links \
  -u "sk_test_xxx:" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "title": "Premium Headphones",
    "line_items": [
      {
        "price": "price_3fg6hj9km1np",
        "quantity": 1
      }
    ]
  }'
Response:
{
  "id": "cl_4de6fg8hi0jk",
  "object": "checkout_link",
  "active": true,
  "mode": "payment",
  "url": "https://checkout.leanrails.com/cl/cl_4de6fg8hi0jk",
  "title": "Premium Headphones",
  "description": null,
  "currency": "usd",
  "after_completion": {
    "type": "hosted_confirmation"
  },
  "billing_address_collection": "auto",
  "allow_promotion_codes": false,
  "restrictions": null,
  "submit_type": "auto",
  "metadata": {},
  "livemode": false,
  "created": 1742025600
}
Share the url anywhere — email, social media, QR codes, or embed it on your website.

After-completion behavior

Control what happens after a customer completes payment:

Redirect to your site

curl -X POST https://api.leanrails.com/v1/checkout_links \
  -u "sk_test_xxx:" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "title": "Workshop Registration",
    "line_items": [
      {
        "price": "price_9ab3cd5ef7gh",
        "quantity": 1
      }
    ],
    "after_completion": {
      "type": "redirect",
      "redirect": {
        "url": "https://yoursite.com/thank-you"
      }
    }
  }'

Show a hosted confirmation page

curl -X POST https://api.leanrails.com/v1/checkout_links \
  -u "sk_test_xxx:" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "title": "Donation",
    "line_items": [
      {
        "price": "price_3fg6hj9km1np",
        "quantity": 1
      }
    ],
    "after_completion": {
      "type": "hosted_confirmation",
      "hosted_confirmation": {
        "custom_message": "Thank you for your generous donation!"
      }
    },
    "submit_type": "donate"
  }'

Enable promotion codes

Allow customers to enter promo codes at checkout:
curl -X POST https://api.leanrails.com/v1/checkout_links \
  -u "sk_test_xxx:" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "title": "Online Course",
    "line_items": [
      {
        "price": "price_3fg6hj9km1np",
        "quantity": 1
      }
    ],
    "allow_promotion_codes": true
  }'
Promo-code configuration is outside the MVP public API surface.

Set restrictions

Limit the number of completed checkouts through a link:
curl -X POST https://api.leanrails.com/v1/checkout_links \
  -u "sk_test_xxx:" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "title": "Limited Edition Print",
    "line_items": [
      {
        "price": "price_3fg6hj9km1np",
        "quantity": 1
      }
    ],
    "restrictions": {
      "completed_sessions": {
        "limit": 50
      }
    }
  }'

Customize the submit button

Change the checkout button text with submit_type:
ValueButton text
autoDetermined automatically
pay”Pay”
book”Book”
donate”Donate”

Require billing address

curl -X POST https://api.leanrails.com/v1/checkout_links \
  -u "sk_test_xxx:" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "title": "Physical Product",
    "line_items": [
      {
        "price": "price_3fg6hj9km1np",
        "quantity": 1
      }
    ],
    "billing_address_collection": "required"
  }'

Line items with inline prices

You can use price_data instead of referencing an existing price:
curl -X POST https://api.leanrails.com/v1/checkout_links \
  -u "sk_test_xxx:" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "title": "Custom Amount Product",
    "line_items": [
      {
        "price_data": {
          "currency": "usd",
          "product": "prod_8mn4qr7vw2xz",
          "unit_amount": 3500
        },
        "quantity": 1
      }
    ]
  }'
Update properties like after_completion, active status, or metadata:
curl -X POST https://api.leanrails.com/v1/checkout_links/cl_4de6fg8hi0jk \
  -u "sk_test_xxx:" \
  -H "Content-Type: application/json" \
  -d '{
    "after_completion": {
      "type": "redirect",
      "redirect": {
        "url": "https://yoursite.com/updated-thank-you"
      }
    },
    "metadata": {
      "campaign": "spring-2026"
    }
  }'
Set active to false to disable a link. Customers visiting the URL will see the inactive_message:
curl -X POST https://api.leanrails.com/v1/checkout_links/cl_4de6fg8hi0jk \
  -u "sk_test_xxx:" \
  -H "Content-Type: application/json" \
  -d '{
    "active": false,
    "inactive_message": "This offer has ended. Check back soon for new deals!"
  }'
curl https://api.leanrails.com/v1/checkout_links/cl_4de6fg8hi0jk \
  -u "sk_test_xxx:"
curl "https://api.leanrails.com/v1/checkout_links?limit=10&active=true" \
  -u "sk_test_xxx:"
curl https://api.leanrails.com/v1/checkout_links/cl_4de6fg8hi0jk/line_items \
  -u "sk_test_xxx:"
Response:
{
  "object": "list",
  "data": [
    {
      "id": "clli_2ab3cd4ef5gh",
      "object": "item",
      "price": "price_3fg6hj9km1np",
      "product": "prod_8mn4qr7vw2xz",
      "quantity": 1,
      "amount_subtotal": 49900,
      "amount_total": 49900,
      "currency": "usd",
      "description": "Premium Headphones"
    }
  ],
  "has_more": false,
  "next_cursor": null,
  "url": "/v1/checkout_links/cl_4de6fg8hi0jk/line_items"
}

Next steps

  • Listen for checkout webhooks to trigger fulfillment and customer emails
  • Learn about Checkout Sessions for server-driven checkout flows
  • Set up Webhooks to handle checkout_link.created events