2026-10-05
USDC Payment API: A Developer's Guide to the Integration

Accepting USDC in your own product takes about seven decisions, made roughly in this order. We've written a separate post on each, and this page puts them in sequence so you can read the one you need now and skip the rest.
If you only read one thing first, make it the custody section. Every later step works differently depending on who can move the money after the customer pays.
1. Decide who holds the money
The chain settles USDC in seconds for a fraction of a cent. What slows a team down is the tooling around it: custody, integration time, and primitives that don't exist yet.
Custody is the first question because it decides what a "paid" status even means. With a custodial processor, the customer pays the processor and you get a balance in its ledger. With direct on-chain settlement, the transfer goes to an address that pays out to your wallet, and the payment provider only detects and reports it. What a non-custodial payments API does covers how to evaluate a provider on this, and what self-custody payments actually require covers the part that becomes your job: keys, treasury, and recovery.
2. Model the payment as a charge
A wallet address on a page isn't a payment API. It's a request for money that has no idea whether it got paid, by whom, or for which order. A USDC payment API starts with a charge your backend creates:
const charge = await klap.charges.create({amount: 49.0,acceptedPayments: [{ token: 'USDC', network: 'base' },{ token: 'USDC', network: 'optimism' },],expiresIn: 3600,externalRef: `order_${order.id}`,})
amount is priced in USD. acceptedPayments lists the token and network pairs you'll take for it. expiresIn is a lifetime in seconds, between one minute and one hour, because an open-ended payment request is a liability. externalRef is your own order ID, and it comes back on the charge and on every webhook event, so you never have to guess which order a payment belongs to.
Each charge gets its own deterministic address, so matching a transfer to an order never depends on the amount or a memo field. The charge also has a fixed lifecycle: pending, partially_paid, confirmed, expired, underpaid. Payout to your wallet is tracked separately in settlementStatus (pending, completed, failed, below_minimum), because a confirmed payment and a completed payout are two different facts. If you're working in Node.js, what to look for in a crypto payments SDK goes through how @klappay/node exposes all of this.
Events drive the flow (step 4), but you'll still want a lookup for the gaps: a webhook endpoint that was down past its retries, a checkout that reloads after the customer paid from their phone, a support agent checking an order. klap.charges.get(id) returns the current charge. klap.charges.check(id, { txHash, network }) asks Klap to look for that transaction on-chain right away instead of waiting for the next reconciliation pass. It doesn't trust the caller, either: the charge only changes state if a matching transfer is really there.
That's also the rule for your own code. Don't fulfill on a transaction hash the browser sent you. A hash proves a transaction exists, not that it pays your charge in the right token, on the right network, for the right amount. The official USDC and USDT contract addresses on each supported network are listed with their decimals.
3. Choose who draws the checkout
You can send the customer to a hosted page, build the screen yourself, or use components in between. Hosted checkout vs payment API compares the three and explains why custody is a separate question from any of them.
For building your own, how to build a custom crypto checkout flow covers the architecture and @klappay/checkout-kit covers the code, wallet discovery included. If your customers don't have a wallet extension, checkout without a browser extension shows the OTP-plus-linked-wallet flow. And when there's no checkout page at all, only a URL to share, start with crypto payment links.
4. Let events drive the order
The browser never decides that an order is paid. Your backend does, from a verified event. How crypto payment webhooks work explains the payload, the signature, and the difference between charge.confirmed (the transfer landed) and charge.settled (the payout reached your wallet).
Webhooks are for the business action. For the screen the customer is watching, the same post covers the live event stream and how your backend relays it to the browser. And before any of it, how to verify crypto payments lists what to check on-chain that a wallet's "success" message won't tell you.
5. Make the handler safe to run twice
Webhook delivery is at least once. Retries, a second endpoint, or two events about the same charge can all reach your handler with the same payment. Idempotent payment webhook handlers shows how to put that guarantee in database constraints instead of a lookup that races, and how to keep emails and fulfillment calls in an outbox.
6. Route the money: splits, escrow, recurring
Marketplaces and platforms rarely pay one wallet. How to split USDC payments between wallets defines up to five recipients on the charge itself, and how split distributions settle covers what happens between charge.confirmed and each recipient actually getting paid.
When money should wait for a condition, like a delivery confirmation or a dispute window, non-custodial escrow holds it in a per-charge Safe that Klap can't release on its own. For subscriptions, designing a USDC recurring billing API works through the authorization model, since a connected wallet isn't a standing debit order, and crypto payment gateway for SaaS puts plans, renewals and access together.
7. Test the failures, not the 200
A charge endpoint returning 200 proves very little. How to test crypto payments without real funds uses the sandbox to push a test charge into underpaid, overpaid and expired states, with duplicate and out-of-order events on top, so you see how your handler behaves before a real customer finds out. Crypto underpayments and overpayments covers what to do in each of those cases.
Not writing code?
If you're a freelancer who wants to send an invoice and get paid in USDC to your own wallet, skip all of the above and read how to get paid in USDC as a freelancer. For a nonprofit taking donations, how nonprofits can accept crypto donations compares the options.
When you're ready to build, the developer docs have the API reference and SDK quickstart.