> ## Documentation Index
> Fetch the complete documentation index at: https://developers.circle.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Before reading these docs, install the relevant Circle Skill to get pre-loaded context — skills are LLM-optimized and cover architecture decisions, correct flows, and common pitfalls. In Claude Code: run /plugin marketplace add circlefin/skills then /plugin install circle-skills@circle. With Vercel Skills CLI: run npx skills add circlefin/skills. Available skills: use-usdc https://github.com/circlefin/skills/blob/master/plugins/circle/skills/use-usdc/SKILL.md (balances, transfers, approvals on EVM and Solana); EURC has no skill — see https://developers.circle.com/stablecoins/what-is-eurc.md; bridge-stablecoin https://github.com/circlefin/skills/blob/master/plugins/circle/skills/bridge-stablecoin/SKILL.md (crosschain transfers via CCTP, USDC, EURC, and third-party assets); use-arc https://github.com/circlefin/skills/blob/master/plugins/circle/skills/use-arc/SKILL.md (Arc chain config, contract deployment, USDC bridging — Arc docs: https://docs.arc.io/llms.txt); use-circle-wallets https://github.com/circlefin/skills/blob/master/plugins/circle/skills/use-circle-wallets/SKILL.md (choose wallet type); use-developer-controlled-wallets https://github.com/circlefin/skills/blob/master/plugins/circle/skills/use-developer-controlled-wallets/SKILL.md (custodial wallets for payouts and treasury); use-user-controlled-wallets https://github.com/circlefin/skills/blob/master/plugins/circle/skills/use-user-controlled-wallets/SKILL.md (embedded wallets with Web2 login); use-modular-wallets https://github.com/circlefin/skills/blob/master/plugins/circle/skills/use-modular-wallets/SKILL.md (smart contract wallets with passkeys and ERC-4337); use-gateway https://github.com/circlefin/skills/blob/master/plugins/circle/skills/use-gateway/SKILL.md (unified USDC balance, nanopayments); use-smart-contract-platform https://github.com/circlefin/skills/blob/master/plugins/circle/skills/use-smart-contract-platform/SKILL.md (deploy, interact, monitor contracts). Pair any skill with the Circle MCP server for live SDK signatures, contract addresses, and chain IDs: {"mcpServers":{"circle":{"url":"https://api.circle.com/v1/codegen/mcp"}}}.
> Read the product overview first. Each product has an overview explaining when and why to use it. Read it before quickstarts.
> Pick the right wallet type. Developer-controlled (you hold keys), user-controlled (end user holds keys via PIN/social login), or modular (smart contract wallets with passkeys). See https://developers.circle.com/wallets.md.
> Use CCTP V2 for crosschain transfers. CCTP natively transfers USDC and EURC via burn-and-mint, and supports permissionless wrapping of third-party assets via lock-and-mint. V1 is legacy; always use V2 unless V1 is specified or the chain requires it (Noble, Sui, and Aptos still require V1). Migration guide: https://developers.circle.com/cctp/migration-from-v1-to-v2.md.
> Use Bridge Kit for frontend bridging. Wraps CCTP with a simpler SDK for user-facing apps. Use CCTP directly for backend transfers.
> Gas Station vs Paymaster. Gas Station sponsors gas for Circle Wallet transactions. Paymaster lets users pay gas in USDC. Different use cases — read both overviews.
> Gateway Nanopayments for sub-cent payments. Gasless USDC micropayments down to $0.000001 via x402 and batched settlement. For pay-per-request APIs, AI agent payments, streaming.
> Look up USDC addresses per chain. Never hardcode — use https://developers.circle.com/stablecoins/usdc-contract-addresses.md.
> Prefer SDKs over raw API calls. Node.js and Python SDKs handle auth, retries, and errors.
> API key required. Bearer token in Authorization header. Testnet and mainnet use separate keys and may use different base URLs depending on the product.
> Set up webhooks when available. Most operations are async. Webhooks deliver transaction confirmations and state changes.
> When calling list endpoints, paginate using pageSize and pageAfter until no nextPageAfter cursor is returned—stopping at the first page silently misses records.
> Building an AI agent? Start with the Agent Stack—Circle CLI, agent wallets, and nanopayments built for autonomous use cases: https://developers.circle.com/agent-stack.md.

# Quickstart: Reserve and repay a settlement advance

> Check your credit line, reserve funds, send a wire and upload proof, and observe disbursement and repayment for a Settlement Advance draw.

This quickstart walks through a complete Settlement Advance draw lifecycle: you
check the credit line, reserve funds, send a wire and upload proof, observe
disbursement and accrued fees, and then repay by wire and confirm the repayment.
For the conceptual model behind these calls, see the
[Credit API](https://developers.circle.com/circle-mint/concepts/credit-api.md) concept page.

## Prerequisites

Before you begin, make sure that you've:

* Contacted your Circle representative to activate Settlement Advance on your
  Circle Mint account.
* Confirmed your Circle Mint wallet holds the required USDC `minBalance` for
  your credit line.
* Configured API authentication per
  [Getting Started](https://developers.circle.com/circle-mint/quickstarts/getting-started.md). Examples below
  use `$API_KEY` and the base URL `https://api-sandbox.circle.com`.
* Identified the `fiatAccountId` of the wire bank account from which you'll send
  the inbound wire to Circle.
* Reviewed the Settlement Advance agreement under the **Agreement** tab in the
  [Mint Console](https://app.circle.com/credit/agreement). Your use of
  Settlement Advance is governed by this agreement.

## Step 1. Check the credit line

Call `GET /v1/credit` to confirm your credit line is active and has sufficient
capacity for the draw.

```bash theme={null}
curl https://api-sandbox.circle.com/v1/credit \
  -H "Authorization: Bearer $API_KEY"
```

```json theme={null}
{
  "data": {
    "id": "fc988ed5-c129-4f70-a064-e5beb7eb8e32",
    "product": "settlementAdvance",
    "feeCadence": "daily",
    "status": "active",
    "limit": { "amount": "500000.00", "currency": "USD" },
    "used": { "amount": "100000.00", "currency": "USD" },
    "available": { "amount": "400000.00", "currency": "USD" },
    "outstandingTransfers": 1,
    "feeRates": { "drawFee": "0.0001", "recurringFee": "0.0003" },
    "unpaidFees": { "amount": "0.00", "currency": "USD" },
    "minBalance": { "amount": "50000.00", "currency": "USD" },
    "validationErrors": [],
    "createDate": "2024-01-15T10:30:00.000Z",
    "updateDate": "2024-03-20T14:22:00.000Z"
  }
}
```

Before proceeding, confirm:

* `product` is `settlementAdvance`.
* `available.amount` covers the draw amount you plan to reserve.
* `validationErrors` is an empty array.

For the meaning of each field, see the
[credit-line model](https://developers.circle.com/circle-mint/concepts/credit-api.md#the-credit-line-model).

## Step 2. Get wire repayment instructions

Call `GET /v1/credit/repaymentAccounts/{fiatAccountId}` to retrieve wire
instructions for the repayment account tied to your wire bank account.

```bash theme={null}
curl https://api-sandbox.circle.com/v1/credit/repaymentAccounts/b8627ae8-732b-4d25-b947-1df8f4007a29 \
  -H "Authorization: Bearer $API_KEY"
```

```json theme={null}
{
  "data": {
    "id": "c9f2a1b3-6d84-4e0f-b512-9a8c7e3d4f01",
    "description": "WELLS FARGO BANK, NA ****1111",
    "status": "unverified",
    "wireInstructions": {
      "trackingRef": "CIR3XBZZ4N",
      "beneficiary": {
        "name": "CIRCLE INTERNET FINANCIAL INC",
        "address1": "1 Main Street",
        "address2": "Suite 1"
      },
      "beneficiaryBank": {
        "swiftCode": "CRYPTO99",
        "routingNumber": "999999999",
        "accountNumber": "3302726104",
        "currency": "USD",
        "name": "CIRCLE BANKING PARTNER",
        "address": "100 MAIN STREET",
        "city": "NEW YORK",
        "postalCode": "10001",
        "country": "US"
      }
    }
  }
}
```

The repayment account is `unverified` until Circle matches the first incoming
wire repayment to it, after which it transitions to `active`. Cache the
`wireInstructions` block—you reuse it when repaying in Step 6.

> [!TIP]
>
> In the sandbox, simulate a matching wire and verify the account by posting a
> mock repayment.
>
> > [accordion] Sandbox mock repayment example
> >
> > ```bash theme={null}
> > curl -X POST https://api-sandbox.circle.com/v1/credit/mocks/repayments \
> >   -H "Authorization: Bearer $API_KEY" \
> >   -H "Content-Type: application/json" \
> >   -d '{
> >     "fiatAccountId": "b8627ae8-732b-4d25-b947-1df8f4007a29",
> >     "amount": { "amount": "100000.00", "currency": "USD" }
> >   }'
> > ```
> >
> > ```json theme={null}
> > {
> >   "data": {
> >     "trackingRef": "CIR3XBZZ4N",
> >     "amount": { "amount": "100000.00", "currency": "USD" },
> >     "status": "pending"
> >   }
> > }
> > ```

## Step 3. Reserve funds for the advance

Call `POST /v1/credit/transfers/reserveFunds` to hold capacity against your
credit line while you initiate the supporting wire. To use Credit Express,
include the optional `destination` field to disburse directly to a verified
address from your Circle Mint recipient address book; omit it to land the
disbursement in your Mint wallet.

```bash theme={null}
curl -X POST https://api-sandbox.circle.com/v1/credit/transfers/reserveFunds \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "idempotencyKey": "ba943ff1-ca16-49b2-ba55-1057e70ca5c7",
    "amount": { "amount": "100000.00", "currency": "USD" },
    "destination": {
      "type": "verified_blockchain",
      "addressId": "a1b2c3d4-5678-90ab-cdef-1234567890ab"
    }
  }'
```

```json theme={null}
{
  "data": {
    "id": "b3d9d2d5-4c12-4946-a09d-953e82fae2b0",
    "amount": { "amount": "100000.00", "currency": "USD" },
    "status": "funds_reserved",
    "expiresAt": "2024-03-20T15:00:00.000Z",
    "outstanding": { "amount": "100000.00", "currency": "USD" },
    "blockchainDestination": {
      "addressId": "a1b2c3d4-5678-90ab-cdef-1234567890ab",
      "status": "pending"
    },
    "createDate": "2024-03-20T14:30:00.000Z",
    "updateDate": "2024-03-20T14:30:00.000Z"
  }
}
```

Save the transfer `id` from the response—it identifies this draw for the
remaining steps. Reservations expire 30 minutes after creation and only one can
be open per credit line at a time; for the full set of constraints, see
[Settlement Advance lifecycle](https://developers.circle.com/circle-mint/concepts/credit-api.md#settlement-advance-lifecycle).
If you can't send the wire before the reservation expires, cancel it with
[`PUT /v1/credit/transfers/{id}/cancelReserve`](https://developers.circle.com/api-reference/circle-mint/credit/cancel-credit-transfer-reserve)
to free the capacity immediately.

> [!WARNING]
>
> Settlement Advance cannot use `POST /v1/credit/transfers` to create a draw.
> That endpoint is for Line of Credit only and returns HTTP 400 for Settlement
> Advance credit lines. Use `reserveFunds` followed by `requestReservedFunds`.

## Step 4. Send the wire and upload wire proof

Using the wire instructions from Step 2, instruct your bank to send a wire to
Circle for the reserved amount. Then upload proof of the wire to request
disbursement by calling `PUT /v1/credit/transfers/{id}/requestReservedFunds`
with a `multipart/form-data` request. Accepted file types are `application/pdf`,
`image/jpeg`, and `image/png`.

```bash theme={null}
curl -X PUT https://api-sandbox.circle.com/v1/credit/transfers/b3d9d2d5-4c12-4946-a09d-953e82fae2b0/requestReservedFunds \
  -H "Authorization: Bearer $API_KEY" \
  -F "fileName=wire-proof.pdf" \
  -F "file=@wire-proof.pdf"
```

```json theme={null}
{
  "data": {
    "id": "b3d9d2d5-4c12-4946-a09d-953e82fae2b0",
    "amount": { "amount": "100000.00", "currency": "USD" },
    "status": "requested",
    "createDate": "2024-03-20T14:30:00.000Z",
    "updateDate": "2024-03-20T14:45:00.000Z"
  }
}
```

The transfer moves from `funds_reserved` to `requested`. Circle's Treasury team
manually reviews the wire proof. In the sandbox the request auto-approves
quickly; in production, approval typically takes 20 minutes to 2 hours.

### RWA Redemption Advance

If your credit line is an RWA Redemption Advance (`rwaRedemptionAdvance`),
include the required `transactionHash` form field with the 0x-prefixed 32-byte
Arc burn transaction hash:

```bash theme={null}
curl -X PUT https://api-sandbox.circle.com/v1/credit/transfers/b3d9d2d5-4c12-4946-a09d-953e82fae2b0/requestReservedFunds \
  -H "Authorization: Bearer $API_KEY" \
  -F "fileName=receipt.pdf" \
  -F "file=@receipt.pdf" \
  -F "transactionHash=0x5ba3602c1ffcbac77db82bf1360fe44f2042042c782e9114ea29ecb1708c239f"
```

```json theme={null}
{
  "data": {
    "id": "b3d9d2d5-4c12-4946-a09d-953e82fae2b0",
    "amount": { "amount": "100000.00", "currency": "USD" },
    "status": "requested",
    "transactionHash": "0x5ba3602c1ffcbac77db82bf1360fe44f2042042c782e9114ea29ecb1708c239f",
    "createDate": "2024-03-20T14:30:00.000Z",
    "updateDate": "2024-03-20T14:45:00.000Z"
  }
}
```

For RWA lines, the transaction must be an onchain burn mined within 24 hours of
request time and have reached finality on Arc. Circle's Treasury team reviews
the uploaded receipt against the onchain burn data and approves the
disbursement.

## Step 5. Observe disbursement and fee accrual

Once Treasury approves the request, the transfer moves to `disbursed` and
`recurringFee` begins accruing daily against the outstanding balance.

### 5.1. Poll the transfer

Call `GET /v1/credit/transfers/{id}` to inspect the disbursement, due date, and
accrued fees.

```bash theme={null}
curl https://api-sandbox.circle.com/v1/credit/transfers/b3d9d2d5-4c12-4946-a09d-953e82fae2b0 \
  -H "Authorization: Bearer $API_KEY"
```

```json theme={null}
{
  "data": {
    "id": "b3d9d2d5-4c12-4946-a09d-953e82fae2b0",
    "amount": { "amount": "100000.00", "currency": "USD" },
    "status": "disbursed",
    "outstanding": { "amount": "100040.00", "currency": "USD" },
    "fees": {
      "total": { "amount": "40.00", "currency": "USD" },
      "unpaid": { "amount": "40.00", "currency": "USD" }
    },
    "dueDate": "2024-03-28T10:00:00.000Z",
    "disbursedDate": "2024-03-21T10:00:00.000Z",
    "blockchainDestination": {
      "addressId": "a1b2c3d4-5678-90ab-cdef-1234567890ab",
      "status": "complete",
      "transferId": "f9e8d7c6-b5a4-3210-fedc-ba0987654321"
    },
    "createDate": "2024-03-20T14:30:00.000Z",
    "updateDate": "2024-03-21T10:00:00.000Z"
  }
}
```

The `outstanding` amount is the principal plus accrued fees. Each day the credit
line is open with an outstanding balance, `recurringFee` is applied to the
principal and added to `fees.total`. The `dueDate` is 7 days after
`disbursedDate` for Settlement Advance.

If you reserved with a Credit Express `destination`, the `blockchainDestination`
block tracks the onchain leg separately from the credit transfer. The
`blockchainDestination.transferId` references the underlying Circle Mint
transfer once disbursement initiates onchain.

### 5.2. Subscribe to webhooks

For asynchronous updates, subscribe to `creditTransfers`, `creditFees`, and
`creditRepayments` in the Circle Mint Console. Webhook payloads mirror the
corresponding `GET` endpoints. See
[webhook topics](https://developers.circle.com/circle-mint/concepts/credit-api.md#webhook-topics) for what each
topic publishes.

## Step 6. Repay by wire

Send a wire from the bank account from Step 2 to Circle for the outstanding
amount (principal plus accrued fees). Use the `wireInstructions` you cached from
Step 2.

In the sandbox, simulate the wire by posting a mock repayment:

```bash theme={null}
curl -X POST https://api-sandbox.circle.com/v1/credit/mocks/repayments \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "fiatAccountId": "b8627ae8-732b-4d25-b947-1df8f4007a29",
    "amount": { "amount": "100040.00", "currency": "USD" }
  }'
```

```json theme={null}
{
  "data": {
    "trackingRef": "CIR3XBZZ4N",
    "amount": { "amount": "100040.00", "currency": "USD" },
    "status": "pending"
  }
}
```

## Step 7. Confirm the repayment

List repayments filtered to your transfer by calling
`GET /v1/credit/repayments?transferId={id}` and confirm a record exists with
`type: fiat` and `status: completed`.

```bash theme={null}
curl "https://api-sandbox.circle.com/v1/credit/repayments?transferId=b3d9d2d5-4c12-4946-a09d-953e82fae2b0" \
  -H "Authorization: Bearer $API_KEY"
```

```json theme={null}
{
  "data": [
    {
      "id": "c3d4e5f6-a7b8-9012-cdef-123456789012",
      "transferId": "b3d9d2d5-4c12-4946-a09d-953e82fae2b0",
      "repaymentAccountId": "b8627ae8-732b-4d25-b947-1df8f4007a29",
      "amountApplied": { "amount": "100040.00", "currency": "USD" },
      "paymentAmount": { "amount": "100040.00", "currency": "USD" },
      "type": "fiat",
      "status": "completed",
      "settlementDate": "2024-03-22T09:30:00.000Z",
      "createDate": "2024-03-22T09:30:00.000Z",
      "updateDate": "2024-03-22T09:30:00.000Z"
    }
  ]
}
```

`paymentAmount` is the total wire received and `amountApplied` is the portion
applied to this transfer's outstanding balance (principal plus fees).
`repaymentAccountId` is the fiat account the wire was matched to—the same
account whose wire instructions you retrieved in Step 2.

Then call `GET /v1/credit/transfers/{id}` again and confirm the transfer is
`paid`.

```bash theme={null}
curl https://api-sandbox.circle.com/v1/credit/transfers/b3d9d2d5-4c12-4946-a09d-953e82fae2b0 \
  -H "Authorization: Bearer $API_KEY"
```

```json theme={null}
{
  "data": {
    "id": "b3d9d2d5-4c12-4946-a09d-953e82fae2b0",
    "amount": { "amount": "100000.00", "currency": "USD" },
    "status": "paid",
    "outstanding": { "amount": "0.00", "currency": "USD" },
    "fees": {
      "total": { "amount": "40.00", "currency": "USD" },
      "unpaid": { "amount": "0.00", "currency": "USD" }
    },
    "dueDate": "2024-03-28T10:00:00.000Z",
    "paidDate": "2024-03-22T09:30:00.000Z",
    "disbursedDate": "2024-03-21T10:00:00.000Z",
    "createDate": "2024-03-20T14:30:00.000Z",
    "updateDate": "2024-03-22T09:30:00.000Z"
  }
}
```

The transfer now shows `status: paid`, `outstanding` is zero, and `fees.unpaid`
is zero—the draw lifecycle is complete.

> [!WARNING]
>
> Settlement Advance does not support crypto repayment. `POST
>     /v1/credit/cryptoRepayment` returns HTTP 400 for Settlement Advance credit
> lines. Repay by wire only.

* [Getting Started](https://developers.circle.com/circle-mint/quickstarts/getting-started.md): API
  authentication and account setup.
