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

# 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.
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'
                      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
    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'
        fees:
          $ref: '#/components/schemas/FiatMoneyUsd'
        networkFees:
          $ref: '#/components/schemas/CryptoPaymentNetworkFee'
        paymentIntentId:
          type: string
          format: uuid
          example: 6e4d4047-db14-4c09-b238-1215aee50d03
        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'
        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.
      required:
        - address
        - chain
      properties:
        address:
          type: string
          description: The blockchain address.
          example: '0x8381470ED67C3802402dbbFa0058E8871F017A6F'
        addressTag:
          $ref: '#/components/schemas/AddressTag'
        chain:
          $ref: '#/components/schemas/Chain'
    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
    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.


        **Note:** Arc (`ARC`) is only available in the sandbox environment
        (`api-sandbox.circle.com`).
      enum:
        - ALGO
        - APTOS
        - ARB
        - ARC
        - AVAX
        - BASE
        - BTC
        - CELO
        - CODEX
        - ETH
        - HBAR
        - HYPEREVM
        - INK
        - LINEA
        - NEAR
        - NOBLE
        - OP
        - PLUME
        - PAH
        - POLY
        - SEI
        - SOL
        - SONIC
        - SUI
        - UNI
        - WORLDCHAIN
        - XDC
        - XLM
        - XRP
        - ZKS
        - ZKSYNC
    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. Only present if the payment is denied by
        Circle's risk service.
      nullable: true
      properties:
        decision:
          description: Enumerated decision of the account.
          type: string
          enum:
            - approved
            - denied
            - review
        reason:
          description: Risk reason for the definitive decision outcome.
          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

````