intents.fi
Intents Checkout API · REST · Webhooks

A crypto checkout API built around one invoice per order

The Intents crypto checkout API: one POST creates a USD invoice with a hosted checkout URL. Customers pay in any token; USDC, USDT or BTC settles to you.

const res = await fetch("https://api.intents.fi/v0/invoices", {
  method: "POST",
  headers: {
    authorization: `Bearer ${process.env.INTENTS_SECRET_KEY}`,
    "content-type": "application/json",
  },
  body: JSON.stringify({
    amount: "49.00",
    currency: "USD",
    reference: order.id,                 // your ID, and the idempotency key
    description: "Annual plan",
    successUrl: "https://shop.example/thanks",
    expiresInSec: 1800,
    metadata: { plan: "annual" },
  }),
});
const invoice = await res.json();
await db.orders.update(order.id, { invoiceId: invoice.id });
return Response.redirect(invoice.url, 303);
Short answerUpdated · Facts checked

A crypto checkout API creates a payment request from your server and gives you a checkout URL to send the customer to. With Intents Checkout that is one call, POST /v0/invoices, priced in USD. The customer pays in the token they hold, and a signed webhook tells you when USDC, USDT or BTC has settled to your wallet.

Our takeIf you already know Stripe Checkout Sessions, an Intents invoice is the same shape: create on the server, redirect, fulfil on the webhook.

Code

Create an invoice, then redirect · ts
const res = await fetch("https://api.intents.fi/v0/invoices", {
  method: "POST",
  headers: {
    authorization: `Bearer ${process.env.INTENTS_SECRET_KEY}`,
    "content-type": "application/json",
  },
  body: JSON.stringify({
    amount: "49.00",
    currency: "USD",
    reference: order.id,                 // your ID, and the idempotency key
    description: "Annual plan",
    successUrl: "https://shop.example/thanks",
    expiresInSec: 1800,
    metadata: { plan: "annual" },
  }),
});
const invoice = await res.json();
await db.orders.update(order.id, { invoiceId: invoice.id });
return Response.redirect(invoice.url, 303);

The one call

A crypto checkout API lets your server ask for a payment and get back a page to send the customer to. With Intents Checkout that is one call: POST /v0/invoices with a price in USD. The customer pays in whatever token they hold, on any chain we can route, and you receive USDC, USDT or native BTC at your own address, confirmed by a signed webhook.

This page covers the invoice itself: what goes into the create call, how it compares with checkout sessions from Stripe and Coinbase, and the decisions to make before you write the integration. The endpoint reference is in the API docs, and webhooks are covered in the webhooks guide.

Create the invoice on your server, store its id against your order, then redirect, as in the code at the top of this page.

The response carries the invoice id, the hosted url, settlement amounts as integer strings in base units, the fee in basis points, and a clientSecret that is shown once. The quickstart has the full response and the webhook handler.

Here is the page invoice.url opens, on test fixtures:

Interactive demo · the hosted checkout an invoice opens, in test mode. A $49 invoice paid with USDT on Tron, settled as USDC on Base. No funds move.Build this →

Loading the payment

The create request, field by field

Only amount is required. Everything else is a decision about your integration.

Field Type Default What to decide
amount string, USD required Send a decimal string like "49.00", never a float
currency "USD" "USD" USD is the only currency today
reference string, up to 200 chars none Your order ID. Unique per merchant; a repeat returns the existing invoice
description string, up to 500 chars none Shown to the customer on the checkout
customerEmail email none For the receipt
successUrl, cancelUrl https:// URL none Where the customer returns. Not proof of payment
expiresInSec integer 1800 300 to 86,400 seconds (5 minutes to 24 hours)
settlement { asset, address } your default Pick one of your registered targets; cannot add a new address
metadata string map {} Up to 20 keys, values up to 500 characters; echoed in every webhook

Three of these deserve a closer look.

reference is the idempotency key. If your create call times out and you retry it with the same reference, you get the first invoice back, with clientSecret set to null because only its hash is stored. You cannot accidentally charge one order twice. A genuine second attempt needs a new reference, such as order_1042.2.

expiresInSec sets how long the price holds. The customer’s route is quoted against the invoice, so a short expiry suits a cart and a long one suits an invoice you email. A payment that settles after expiry still becomes paid, with late: true and a review flag, so a long expiry is not the only way to avoid losing a slow payer.

settlement can only choose, never add. If you settle USDC on Base by default but want one large invoice in USDT on Tron, pass that target, provided it is registered. Adding a settlement address takes a dashboard session with a fresh one-time code and a 24-hour wait. That is deliberate: an API key that can create invoices cannot redirect your money.

Invoice or checkout session: how the models compare

Most checkout APIs share one shape: create on the server, redirect, wait for a webhook. The differences are in what can be paid and where the money ends up.

Comparison: Intents Checkout invoice, Stripe Checkout Session, Coinbase Business checkout
Intents Checkout invoiceStripe Checkout SessionCoinbase Business checkout
Created withPOST /v0/invoices, Bearer secret keyServer-side create, secret keyPOST /api/v1/checkouts, Bearer JWT
Priced inUSDYour currency, with line itemsAmount and currency, e.g. USDC
One payment or many triesOne invoice, several attempts allowedStripe recommends a new session per attemptSingle-use: one payment, then terminal
Customer pays withMany tokens on many chains, routed to one settlement assetCards and other methods; USDC on Tempo, Ethereum, Solana, Polygon and Base where eligibleUSDC in its examples
Where the money landsYour own wallet, as USDC, USDT or native BTCYour Stripe balance, in local currencyYour Coinbase Business account
Paid signalinvoice.paid webhook, HMAC-SHA256checkout.session.completed eventcheckout.payment.success webhook
RefundsTo the payer’s refund address if a payment cannot completeBack to the original wallet for stablecoinsRefund endpoint, full or partial

If you run Stripe today, the mental model carries over almost unchanged. The main change is that settlement is a stablecoin transfer to an address you control, not a balance you are paid out from. Stripe’s stablecoin acceptance is generally available to US businesses and in private preview elsewhere, per its docs.

Show the checkout your way

The invoice is the same whichever surface shows it.

  • Redirect to invoice.url. Nothing to build.
  • Embed with <PayButton> or <CheckoutEmbed> from @intents-fi/react, covered on the React crypto checkout page, or with checkout.js on any site.
  • Build your own with the headless hook or the public checkout endpoints, which carry every customer-safety element pre-formatted. See headless checkout.
  • Skip the API for fixed prices: a crypto payment link creates an invoice per visit without any server code.

Before you write the integration

0 of 6 done

Test mode, and what changes when you go live

Every endpoint works with a test key. The point of test mode is to run your real code paths, including the webhook handler, without moving money.

Test key (ik_test_…) Live key (ik_live_…)
Invoices Real invoices, marked mode: "test" Real invoices, real money
Paying A Complete the test payment button; nothing to send or sign The customer sends or signs a real transaction
Webhooks The real invoice.paid event, signed the same way The same events
Webhook endpoints Registered per mode Registered per mode
Settlement No transfer USDC, USDT or native BTC to your address

Three habits catch most problems before customers do:

  1. Pay a test invoice end to end and check your order moved to paid only after the webhook arrived, not when the customer returned to successUrl.
  2. Replay the same webhook twice and confirm nothing ships twice.
  3. Let a test invoice expire and confirm your order is cancelled or left pending, not marked paid.

A test key cannot touch live invoices and the reverse is also true, so a mixed-up key fails loudly with an error code that has its own page under errors. When you switch to live, register a live webhook endpoint as well; endpoints do not carry over between modes. Then pay yourself $5 for real, from a phone, on the network your customers use most.

Let an agent write it

If a coding agent writes your integration, the agent setup guide gives Claude Code, Cursor or Codex one prompt that adds a test-mode checkout to an existing app, including the webhook handler. The MCP server lets the agent create and inspect test invoices while it works. The output is ordinary code against the same API, so review it as you would any other change.

Limits, and what it costs

Limit Value
Minimum invoice $1
Currency USD
Settlement USDC on Base, Arbitrum, Ethereum, Solana or Polygon; USDT on Tron, Ethereum, Arbitrum or BSC
Same-asset payments Paying in the exact token and chain you settle in is not supported yet
Subscriptions Out of scope; create an invoice per period

Every settled invoice costs 0.4% with no fixed fee, shown on the invoice as fee.bps: 40, and amountNet is exactly what lands at your address. See pricing, or check what that rate means at your ticket size with the fee calculator.

Questions

Short answers. The docs go deeper.

What is a crypto checkout API?

An HTTP API your server calls to create a payment request for a crypto payment. It returns a hosted checkout URL and an ID, and tells you through webhooks or status reads when the payment has settled.

Is an invoice the same as a checkout session?

For most purposes, yes. Both are created server-side for one purchase, carry a URL to send the customer to, expire, and end in a paid or expired state. Intents calls it an invoice because it can take more than one attempt, for example when the customer switches token.

How do I create a crypto invoice with the API?

POST /v0/invoices with your secret key and a JSON body containing at least the amount in USD. Add your order ID as reference, a successUrl, an expiry and metadata as needed. The response has the invoice id, the hosted url and a one-time clientSecret.

How long does a crypto invoice stay open?

30 minutes by default. You can set expiresInSec from 300 seconds (5 minutes) to 86,400 seconds (24 hours) when you create it.

Can I choose which stablecoin I receive per invoice?

Yes, among the settlement targets you registered in the dashboard. An API key can pick between them but cannot add a new address, so a leaked key cannot redirect your money.

Can I create invoices in EUR or another currency?

Not yet. Invoices are priced in USD only. The currency field exists so other currencies can be added later.

Is there a test mode for the checkout API?

Yes. Keys starting ik_test_ run the same endpoints against recorded fixtures. Test invoices complete with a button instead of a transfer, and fire the real invoice.paid webhook.

Get paid in your own wallet.

Customers pay in what they hold. You receive USDC or USDT on the chain you choose, or native bitcoin. We never hold your funds.