BagsBags Docs
Getting Started

Choose Your Integration

Pick the right Bags integration path — hosted checkout, payment links, custom sessions, or x402 agents.

Bags offers several ways to accept USDC. Pick the path that matches how much control you need over checkout UI and flow.


Checkout endpoints (don't mix these up)

Bags exposes three different "checkout" surfaces. They look similar in name but serve different actors:

EndpointWho calls itWhat it creates
POST /api/v1/checkoutsMerchant (API key)A hosted checkout session for one buyer attempt — returns id, url, and webhook sessionId. Primary server-side path.
POST /api/payment-linksMerchant (API key or dashboard)A reusable payment link (/pay/{linkId}) you can share with many customers. Not a per-buyer session.
POST /api/checkout/sessionBuyer-facing app (often unauthenticated)Locks a single payment attempt for custom/embedded checkout after a tax quote. Requires linkId, quoteToken, walletAddress, network, and walletType from your UI — not an API-key catalog call.

Use V1 Checkouts or Payment Links when integrating from your backend. Use Checkout Sessions only when you control the payer's wallet UI and already have a linkId + signed tax quote.


Integration paths

PathBest forFrontend workAPI surface
V1 CheckoutsFastest launch, Polar-like flow, agentsNone — redirect to hosted pagePOST /api/v1/checkouts
Payment LinksReusable products, shareable URLs, dashboard-firstNone — share a linkPOST /api/payment-links
Custom CheckoutEmbedded wallet UX, your own checkout pageFull — you build the UICheckout Sessions API
x402 AgenticPay-per-call APIs, AI agentsMinimal — HTTP 402 paywall/api/agent/{id}

Decision guide

Start with V1 Checkouts (POST /api/v1/checkouts) if you want one API call → one hosted URL with session binding → webhooks when paid. This is the Polar-like primary path.

Use Payment Links when you sell fixed products or plans from the dashboard and want stable, shareable URLs (/pay/{id}) you can email or embed. Set syncProduct: true on one-liner agent requests to auto-create catalog entries.

Use Custom Checkout when customers never leave your site and you control wallet connection, tax quote display, and transaction submission.

Use x402 when monetizing API endpoints per request — agents and automation pay before accessing your upstream resource.


What's live in v0

FeatureStatus
Payment links & hosted checkoutLive
V1 Checkouts (POST /api/v1/checkouts)Live
V1 Checkout alias (POST /api/v1/checkout, deprecated)Live
Custom checkout sessionsLive
Tax quotes (regional providers)Live
Webhooks & eventsLive
KYB & USDC payoutsLive
x402 agentic paywallsLive
Agents & MCP (preview + tax quote)Live
REST API (fetch / cURL / any HTTP client)Live

Coming soon

FeatureDocs
TypeScript SDKSDKs
Card paymentsPayment Methods
SubscriptionsSubscriptions
Discounts / promo codesDiscounts
Customer portalCustomer Portal
Ethereum mainnetEnvironments
Fiat bank payouts (Q2)Payouts
Self-serve refunds (dashboard)Refunds
Usage-based / metered billingUsage-Based Billing

Each coming-soon page includes a waitlist link. The dashboard marks Subscriptions and Discounts with a SOON badge today.


Migrating from POST /api/v1/checkout

The deprecated one-liner (POST /api/v1/checkout) creates a reusable payment link and returns the link id. The primary path is session-based:

  1. Create a catalog product once (POST /api/v1/products or dashboard).
  2. For each purchase, call POST /api/v1/checkouts with productId, optional externalCustomerId and metadata.
  3. Redirect to data.url (includes ?session= binding).
  4. Poll GET /api/v1/checkouts/{id} or listen for checkout.completed.

Webhook checkout.completed now includes productId, externalCustomerId, customerId, and metadata when supplied at session creation. The deprecated alias still works but will not receive new fields on the link object itself — migrate to checkouts for reconciliation.


Quickstart

Create your first test checkout and receive a webhook in under 10 minutes.

Sample Integration

Copy-paste a full Node.js example with checkout + webhook verification.

Handle Webhooks

Make webhooks your source of truth for payment status.

Go Live

Complete KYB, switch to live keys, and accept real USDC.


What's next

On this page