> ## 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.

# Refund a payment intent



## OpenAPI

````yaml openapi/payments.yaml post /v1/paymentIntents/{id}/refund
openapi: 3.0.2
info:
  version: ${version}
  title: Crypto Deposits API
  description: >
    The Circle Payments API allows you to take payments from your end users via
    traditional methods such as debit & credit cards and receive settlement in
    USDC.


    The Circle Payments API has been designed with any business or internet
    commerce in mind, not just crypto applications, and it's based on Circle's
    extensive experience processing millions of card payments since 2014.
servers:
  - url: https://api-sandbox.circle.com
  - url: https://api.circle.com
security: []
tags:
  - name: Payments
    description: Create, cancel, refund, and get updates on card payments.
  - name: Crypto Payment Intents
    description: Create and track intent for end user to pay via crypto.
  - name: Crypto Payment Customers
    description: >-
      Create and manage Travel Rule customers and customer wallets for crypto
      payment attribution.
  - name: Crypto Payment Refund Addresses
    description: Create refund address-book entries for crypto payment refunds.
paths:
  /v1/paymentIntents/{id}/refund:
    post:
      tags:
        - Crypto Payment Intents
      summary: Refund a payment intent
      operationId: refundPaymentIntent
      parameters:
        - $ref: '#/components/parameters/IdPath'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CryptoRefundCreationRequest'
      responses:
        '201':
          description: Crypto refund successfully created for the given payment intent.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
          content:
            application/json:
              schema:
                title: CreateCryptoRefundResponse
                properties:
                  data:
                    $ref: '#/components/schemas/CryptoPayment'
              examples:
                response:
                  value:
                    data:
                      id: 3389f4ba-aafd-4eef-aaa2-3292df8f62e6
                      type: refund
                      status: pending
                      amount:
                        currency: USD
                      merchantId: 5ffea093-d210-44b4-a7ca-ad33b9498188
                      merchantWalletId: '1000999922'
                      paymentIntentId: 77c91fe9-e603-4e7b-9672-1ef8ac502cf6
                      settlementAmount:
                        amount: '1.00'
                        currency: ETH
                      fromAddresses:
                        chain: ETH
                        addresses:
                          - '0x0d4344cFF68F72A5B9Abded37CA5862941a62050'
                      depositAddress:
                        chain: ETH
                        address: '0x97de855690955e0da79ce5c1b6804847e7070c7f'
                      paymentId: 2e7b6557-1967-4348-ad81-daf3cee4c175
                      createDate: '2022-07-21T20:16:35.092852Z'
                      updateDate: '2022-07-21T20:19:24.719313Z'
                failedRefund:
                  value:
                    data:
                      id: 4489f4ba-aafd-4eef-aaa2-3292df8f62e7
                      type: refund
                      status: failed
                      errorCode: insufficient_funds
                      amount:
                        currency: USD
                      merchantId: 5ffea093-d210-44b4-a7ca-ad33b9498188
                      merchantWalletId: '1000999922'
                      paymentIntentId: 77c91fe9-e603-4e7b-9672-1ef8ac502cf6
                      settlementAmount:
                        amount: '1.00'
                        currency: ETH
                      fromAddresses:
                        chain: ETH
                        addresses:
                          - '0x0d4344cFF68F72A5B9Abded37CA5862941a62050'
                      depositAddress:
                        chain: ETH
                        address: '0x97de855690955e0da79ce5c1b6804847e7070c7f'
                      paymentId: 2e7b6557-1967-4348-ad81-daf3cee4c175
                      createDate: '2022-07-21T20:16:35.092852Z'
                      updateDate: '2022-07-21T20:19:24.719313Z'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/NotAuthorized'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - bearerAuth: []
components:
  parameters:
    IdPath:
      name: id
      description: Universally unique identifier (UUID v4) of a resource.
      in: path
      required: true
      schema:
        type: string
        format: uuid
        example: b3d9d2d5-4c12-4946-a09d-953e82fae2b0
  schemas:
    CryptoRefundCreationRequest:
      type: object
      required:
        - idempotencyKey
        - destination
        - amount
        - toAmount
      properties:
        idempotencyKey:
          $ref: '#/components/schemas/IdempotencyKey'
        destination:
          $ref: '#/components/schemas/CryptoRefundDestination'
        amount:
          type: object
          description: >-
            The source amount of the refund, it can be in either the original
            payment currency or the settlement currency.
          required:
            - currency
          properties:
            currency:
              description: Currency code.
              type: string
              enum:
                - USD
                - ETH
                - BTC
        toAmount:
          type: object
          description: >-
            The destination amount of the refund, it must be in the original
            payment currency.
          required:
            - amount
            - currency
          properties:
            amount:
              description: Magnitude of the amount, in units of the currency, with a `.`.
              type: string
              example: '3.14'
            currency:
              description: Currency code.
              type: string
              enum:
                - USD
                - ETH
                - BTC
        paymentId:
          type: string
          format: uuid
          description: >-
            ID of the payment to attribute this refund to. Required for
            merchants registered under Circle's Singapore (`CIRCLE_SG`) or
            French (`CIRCLE_FR`) legal entity.
          example: 2e7b6557-1967-4348-ad81-daf3cee4c175
        customerExternalRef:
          $ref: '#/components/schemas/PaymentCustomerExternalRef'
          description: >-
            Optional customer-supplied reference for this refund. Unlike payins,
            it is not inherited from the payment intent and is not part of the
            idempotency key, so a replay with the same idempotencyKey but a
            changed value returns the original refund.
    CryptoPayment:
      type: object
      description: Status information of the related payment.
      required:
        - id
        - type
        - merchantId
        - amount
        - status
      properties:
        id:
          $ref: '#/components/schemas/Id'
        type:
          type: string
          description: Type of the payment object.
          enum:
            - payment
            - refund
        merchantId:
          $ref: '#/components/schemas/IdMerchant'
        merchantWalletId:
          $ref: '#/components/schemas/MerchantWalletId'
        amount:
          $ref: '#/components/schemas/CryptoPaymentsOptionalAmountMoney'
        status:
          $ref: '#/components/schemas/PaymentStatus'
        statusReason:
          $ref: '#/components/schemas/CryptoPaymentStatusReason'
        errorCode:
          $ref: '#/components/schemas/CryptoPaymentErrorCode'
          nullable: true
        fees:
          $ref: '#/components/schemas/FiatMoneyUsd'
        networkFees:
          $ref: '#/components/schemas/CryptoPaymentNetworkFee'
        paymentIntentId:
          type: string
          format: uuid
          example: 6e4d4047-db14-4c09-b238-1215aee50d03
        customerExternalRef:
          $ref: '#/components/schemas/PaymentCustomerExternalRef'
          description: A customer-supplied reference to reconcile transactions.
        settlementAmount:
          $ref: '#/components/schemas/FiatMoneyUsd'
        fromAddresses:
          type: object
          properties:
            chain:
              $ref: '#/components/schemas/Chain'
            addresses:
              type: array
              items:
                $ref: '#/components/schemas/Address'
        depositAddress:
          type: object
          properties:
            chain:
              $ref: '#/components/schemas/Chain'
            address:
              type: string
              example: '0x97de855690955e0da79ce5c1b6804847e7070c7f'
            addressTag:
              $ref: '#/components/schemas/AddressTag'
        transactionHash:
          type: string
          example: '0x7351585460bd657f320b9afa02a52c26d89272d0d10cc29913eb8b28e64fd906'
        refundIds:
          description: >-
            List of refunds associated with this payment. Only populated when
            `type` is `payment`.
          type: array
          items:
            type: string
            format: uuid
            example: 8edc0da8-d086-3051-a393-53f972d16444
        paymentId:
          type: string
          format: uuid
          description: >-
            Identifier of the payment this refund is attributed to. Only
            populated when `type` is `refund` and the refund was attributed to a
            specific payment.
          example: 36a25933-8c2d-3c23-ad07-7fe1e41b5fe5
        createDate:
          $ref: '#/components/schemas/UtcTimestamp'
        updateDate:
          $ref: '#/components/schemas/UtcTimestamp'
        riskEvaluation:
          $ref: '#/components/schemas/RiskEvaluation'
    IdempotencyKey:
      type: string
      description: >-
        Universally unique identifier (UUID v4) idempotency key. This key is
        utilized to ensure exactly-once execution of mutating requests.
      format: uuid
      example: ba943ff1-ca16-49b2-ba55-1057e70ca5c7
    CryptoRefundDestination:
      type: object
      description: The destination of a crypto refund.
      properties:
        address:
          type: string
          description: >-
            The blockchain address. Required when `addressBookId` is not
            provided.
          example: '0x8381470ED67C3802402dbbFa0058E8871F017A6F'
        addressTag:
          $ref: '#/components/schemas/AddressTag'
        chain:
          description: >-
            The blockchain network. Required when `addressBookId` is not
            provided.
          allOf:
            - $ref: '#/components/schemas/Chain'
        addressBookId:
          type: string
          format: uuid
          description: >-
            Identifier of an existing Address Book entry to send the refund to.
            For merchants registered under Circle's Singapore legal entity, use
            this or `useOriginalSender`.
          example: e7f468c7-6a99-5639-b3ed-8c7d477abb47
        useOriginalSender:
          type: boolean
          description: >-
            Set to `true` to refund to the original sender address of the
            attributed source payment. Available for merchants registered under
            Circle's Singapore legal entity. Can be used alongside `paymentId`
            on the refund request.
          example: true
    PaymentCustomerExternalRef:
      type: string
      format: uuid
      description: >-
        A customer-supplied reference for reconciliation purposes, used on
        payment intents, payments, and refunds. Must be a UUID. Payouts and
        transfers use a separate 21-character limit schema.
      example: 310c458a-18eb-4cbd-8a9a-586d9448ae69
    Id:
      type: string
      description: Unique system generated identifier for the entity.
      format: uuid
      example: b8627ae8-732b-4d25-b947-1df8f4007a29
    IdMerchant:
      type: string
      description: Unique system generated identifier for the merchant.
      format: uuid
      example: fc988ed5-c129-4f70-a064-e5beb7eb8e32
    MerchantWalletId:
      type: string
      description: Unique system generated identifier for the wallet of the merchant.
      maxLength: 36
      example: '212000'
    CryptoPaymentsOptionalAmountMoney:
      type: object
      required:
        - currency
      properties:
        amount:
          description: Magnitude of the amount, in units of the currency, with a `.`.
          type: string
          example: '3.14'
        currency:
          description: Currency code.
          type: string
          enum:
            - USD
            - ETH
            - BTC
    PaymentStatus:
      type: string
      description: >-
        Enumerated status of the payment. `pending` means the payment is waiting
        to be processed. `confirmed` means the payment has been approved by the
        bank and the merchant can treat it as successful, but settlement funds
        are not yet available to the merchant.  `paid` means settlement funds
        have been received and are available to the merchant. `failed` means
        something went wrong (most commonly that the payment was denied).
        `action_required` means that additional steps are required to process
        this payment; refer to `requiredAction` for more details. Terminal
        states are `paid` and `failed`.
      enum:
        - pending
        - confirmed
        - paid
        - failed
        - action_required
    CryptoPaymentStatusReason:
      type: string
      description: >
        Provides additional context for certain payment statuses.


        | Status | Status Reason | Description |

        | --- | --- | --- |

        | `pending` | `compliance_review` | Compliance is awaiting PII before
        releasing funds. |

        | `failed` | `compliance_denied` | Funds seized due to sanctions hit. |

        | `failed` | `unsupported_wallet` | Funds are stuck in escrow because
        the sender wallet is not supported (self-hosted wallet or non-VASP). |

        | `paid` | `unsupported_wallet` | Funds have settled but were received
        from an unsupported VASP. |

        | `paid` or `pending` | `pii_not_received` | PII was not received within
        the Travel Rule window. |
      enum:
        - compliance_review
        - compliance_denied
        - unsupported_wallet
        - pii_not_received
      example: compliance_review
    CryptoPaymentErrorCode:
      type: string
      description: >-
        Indicates the failure reason of a crypto payment or refund. Only present
        when a failure reason is available (i.e. the underlying reason code is
        set). Possible values are `insufficient_funds`, `transaction_orphaned`
        and `payment_failed`
      nullable: true
      enum:
        - insufficient_funds
        - transaction_orphaned
        - payment_failed
      example: insufficient_funds
    FiatMoneyUsd:
      type: object
      required:
        - amount
        - currency
      properties:
        amount:
          description: Magnitude of the amount, in units of the currency, with a `.`.
          type: string
          example: '3.14'
        currency:
          description: Currency code.
          type: string
          enum:
            - USD
    CryptoPaymentNetworkFee:
      type: object
      required:
        - amount
        - currency
      properties:
        amount:
          description: Magnitude of the amount, in units of the currency, with a `.`.
          type: string
          example: '3.14'
        currency:
          type: string
          description: Currency code for the amount.
          enum:
            - USD
            - EUR
            - BTC
            - ETH
        feePayer:
          type: string
          description: The party that pays the network fee based on merchant configuration.
          enum:
            - endUser
            - merchant
    Chain:
      type: string
      description: A blockchain that a given currency is available on.
      enum:
        - ALGO
        - APTOS
        - ARB
        - ARC
        - AVAX
        - BASE
        - BTC
        - CELO
        - CODEX
        - ETH
        - HBAR
        - HYPEREVM
        - INK
        - LINEA
        - NEAR
        - NOBLE
        - OP
        - PLUME
        - PAH
        - PLASMA
        - POLY
        - SEI
        - SOL
        - SONIC
        - SUI
        - UNI
        - WORLDCHAIN
        - XLAYER
        - XDC
        - XLM
        - XRP
        - ZKS
    Address:
      type: string
      description: >
        An alphanumeric string representing a blockchain address. Formatting
        varies by blockchain.

        Be sure to preserve the exact formatting and capitalization of the
        address.  

        **Important:** For Ripple (XRP) addresses, only the classic address
        format is supported (for example,
        `rPEPPER7kfTD9w2To4CQk6UCfuHM9c6GDY`).  

        The `x-address` format is NOT supported currently (for example,
        `XV5sbjUmgPpvXv4ixFWZ5ptAYZ6PD2q1qM6owqNbug8W6KV`).
      example: '0x8381470ED67C3802402dbbFa0058E8871F017A6F'
    AddressTag:
      type: string
      description: >-
        The secondary identifier for a blockchain address. An example of this is
        the memo field on the Stellar network, which can be text, id, or hash
        format.
      nullable: true
      example: '123456789'
    UtcTimestamp:
      type: string
      description: ISO-8601 UTC date/time format.
      example: '2020-04-10T02:13:30.000Z'
    RiskEvaluation:
      type: object
      description: >-
        Results of risk evaluation. Present when the payment's risk decision is
        `denied` or `review`. Absent when `decision` is `approved` or when no
        risk evaluation was performed.
      nullable: true
      properties:
        decision:
          description: Enumerated decision of the account.
          type: string
          enum:
            - approved
            - denied
            - review
        reason:
          description: >-
            Risk reason code for the decision. Known values include `3000`
            (transaction involves a sanctioned or unsupported wallet) and `2151`
            (transaction denied on outbound compliance screening; a failed
            refund, for example). Present when `decision` is `denied`; may be
            omitted for `review` decisions.
          type: string
          nullable: true
          example: '3000'
  headers:
    XRequestId:
      description: >-
        Universally unique identifier (UUID v4) for the request. Helpful for
        identifying a request when communicating with Circle support.
      schema:
        type: string
        format: uuid
        example: 2adba88e-9d63-44bc-b975-9b6ae3440dde
  responses:
    BadRequest:
      description: The request cannot be processed due to a client error.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
      content:
        application/json:
          schema:
            type: object
            title: BadRequest
            required:
              - code
              - message
            properties:
              code:
                type: integer
                example: 400
              message:
                type: string
                example: Something went wrong.
            example:
              code: 400
              message: Bad request.
          examples:
            response:
              value:
                code: 400
                message: Bad request.
    NotAuthorized:
      description: >-
        The request has not been applied because it lacks valid authentication
        credentials.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
      content:
        application/json:
          schema:
            type: object
            title: NotAuthorized
            required:
              - code
              - message
            properties:
              code:
                type: integer
                example: 400
              message:
                type: string
                example: Something went wrong.
            example:
              code: 401
              message: Malformed authorization.
          examples:
            response:
              value:
                code: 401
                message: Malformed authorization.
    NotFound:
      description: The specified resource was not found.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
      content:
        application/json:
          schema:
            type: object
            title: NotFound
            required:
              - code
              - message
            properties:
              code:
                type: integer
                example: 400
              message:
                type: string
                example: Something went wrong.
            example:
              code: 404
              message: Not found.
          examples:
            response:
              value:
                code: 404
                message: Not found.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````