Prerequisites
Before you begin this tutorial, ensure you’ve:- Obtained a Circle Mint sandbox API key with access to the Crypto Deposits API (stablecoin payins).
- Obtained a
merchantWalletIdfor the wallet that receives settled funds. - Installed cURL for API calls.
- (Optional) Configured webhook notifications.
Step 1: Create a payment intent
Call Create a payment intent when the customer chooses to pay with USDC or EURC onchain. Choose continuous or transient mode. Expected result: a response with a payment intentid and timeline
including created.
- Continuous (default mode)
- Transient
Continuous payment intents are the default type. You do not include an Example response:
amount
at creation.Example request:cURL
JSON
Step 2: Obtain the deposit address
Circle does not return the deposit address in the create response. Use webhooks or poll Get a payment intent untilpaymentMethods.address is set.
Expected result: you have the onchain deposit address to show the customer.
- Webhooks
- Polling
After you
subscribe to notifications
for
paymentIntents, you receive updates when the payment intent changes. When
paymentMethods.address is set, the payload includes an updated timeline of
the historical payment intent statuses and timestamps.Expected result: the notification includes paymentIntent.paymentMethods
with address and timeline with pending after the address is assigned.Example paymentIntents notification after the deposit address is assigned:Step 3: Have the customer pay onchain
Display the deposit address and have the customer send USDC or EURC on the chosen chain. Expected result: an onchain transfer to the deposit address is submitted (you confirm settlement in Step 4).3.1. Display the deposit address
Give the customer the deposit address, the stablecoin to send (USDC or EURC), and for transient intents the amount. Plain text or a QR code is fine. Expected result: the customer can send funds from their wallet.For transient payment intents, you can display the
expiresOn time to show the
customer how long they have to pay.If the customer does not send funds before expiresOn, the payment intent moves
to a complete status with context expired. You cannot reuse an expired
intent. Create a new payment intent to retry the checkout.3.2. Customer sends funds onchain
The customer sends USDC or EURC to the deposit address on the specified blockchain. Expected result: the transfer appears onchain against that address.Step 4: Confirm payment completion
After Circle confirms the transfer, it updates the payment intent and creates a payment record for that inbound transfer. Confirm the intent and the payment match what you expect using webhooks or polling. Expected result: payment intenttimeline shows complete with context
paid, and the linked payment has status paid.
4.1. Inspect the payment intent
- Webhooks
- Polling
Subscribe to
paymentIntents notifications. After the customer pays, the
payload includes an updated timeline, amountPaid, and paymentIds.Expected result: paymentIntent in the notification includes:timelinewithcompleteand contextpaidpaymentIdslisting the payin payment for this transferamountPaidreflecting the settled amount
4.2. Inspect the payment for the same transfer
The payment record holds the onchaintransactionHash and the customer’s
fromAddresses for that transfer.
- Webhooks
- Polling
Subscribe to
payments notifications to receive the updated payment object
when the transfer settles.Expected result: payment in the notification has status paid, a
populated transactionHash, and fromAddresses for the sender.JSON
For blockchains that use a memo or address tag (for example, XLM or HBAR), the
addressTag field can appear on depositAddress in payment payloads.status is paid.