> ## Documentation Index
> Fetch the complete documentation index at: https://walletconnect-pay-docs-wcagent-webview-integration-docs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Mark a payment as refunded

> Request a full refund for a payment. Calling a second time on the same payment returns 409.



## OpenAPI

````yaml api/2026-02-18.json POST /v1/refunds
openapi: 3.1.0
info:
  title: WalletConnect Pay API
  version: '2026-02-18'
servers:
  - url: https://api.pay.walletconnect.com
security:
  - API Key: []
  - ApiKey: []
  - AppId: []
tags:
  - name: Gateway
  - name: Payments
  - name: Refunds
  - name: Merchant Management
  - name: Settlements
  - name: Crypto Settlement
paths:
  /v1/refunds:
    post:
      tags:
        - Refunds
      summary: Mark a payment as refunded
      description: >-
        Request a full refund for a payment. Calling a second time on the same
        payment returns 409.
      operationId: Refunds_create
      parameters:
        - name: Merchant-Id
          in: header
          required: true
          description: Merchant identifier.
          schema:
            type: string
            examples:
              - acme-store-1
        - name: WCP-Version
          in: header
          required: false
          description: >-
            Optional WalletConnect Pay API version override. If omitted, the
            partner's pinned version is used.
          schema:
            type: string
            examples:
              - '2026-02-18'
              - 2026-02-19.preview
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                paymentId:
                  type: string
                  minLength: 1
                  maxLength: 64
                  pattern: ^pay_[A-Za-z0-9]+$
                  description: Payment ID to refund
                  examples:
                    - pay_a1a2ecc101KGF210FP7PN3BK08PZARS1CZ
              required:
                - paymentId
      responses:
        '200':
          description: Payment marked as refunded
          headers:
            WCP-Version:
              description: WalletConnect Pay API version resolved for this request.
              schema:
                type: string
          content:
            application/json:
              schema:
                type: object
                properties:
                  paymentId:
                    type: string
                    description: Payment ID that was marked as refunded
                required:
                  - paymentId
              example:
                paymentId: pay_a1a2ecc101KGF210FP7PN3BK08PZARS1CZ
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Human-readable error message
                  code:
                    type: string
                    enum:
                      - params_validation
                      - payment_not_succeeded
                      - invalid_api_version
                      - unknown_api_version
                      - api_version_downgrade
                    description: Machine-readable error code
                  details:
                    description: Additional structured error details
                    type: object
                    propertyNames:
                      type: string
                    additionalProperties: {}
                  issues:
                    type: array
                    description: >-
                      Field-level validation issues (present on validation
                      errors)
                    items:
                      type: object
                      required:
                        - field
                        - message
                      properties:
                        field:
                          type: string
                        message:
                          type: string
                required:
                  - message
                  - code
              examples:
                params_validation:
                  summary: Validation failed
                  value:
                    code: params_validation
                    message: Validation failed
                payment_not_succeeded:
                  summary: Payment is not in a refundable state
                  value:
                    code: payment_not_succeeded
                    message: Payment is not in a refundable state
                invalid_api_version:
                  summary: Invalid API version
                  value:
                    code: invalid_api_version
                    message: Invalid API version
                unknown_api_version:
                  summary: Unknown API version
                  value:
                    code: unknown_api_version
                    message: Unknown API version
                api_version_downgrade:
                  summary: Requested API version is older than the partner pin
                  value:
                    code: api_version_downgrade
                    message: Requested API version is older than the partner pin
        '401':
          description: Unauthorized — missing or invalid API key, or missing merchant id
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Human-readable error message
                  code:
                    type: string
                    enum:
                      - missing_api_key
                      - invalid_api_key
                      - missing_merchant_id
                    description: Machine-readable error code
                  details:
                    description: Additional structured error details
                    type: object
                    propertyNames:
                      type: string
                    additionalProperties: {}
                required:
                  - message
                  - code
              examples:
                missing_api_key:
                  summary: Missing API key
                  value:
                    code: missing_api_key
                    message: Missing API key
                invalid_api_key:
                  summary: Invalid API key
                  value:
                    code: invalid_api_key
                    message: Invalid API key
                missing_merchant_id:
                  summary: Missing Merchant ID
                  value:
                    code: missing_merchant_id
                    message: Missing Merchant ID
        '404':
          description: Payment not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Human-readable error message
                  code:
                    type: string
                    const: not_found
                    description: Machine-readable error code
                  details:
                    description: Additional structured error details
                    type: object
                    propertyNames:
                      type: string
                    additionalProperties: {}
                required:
                  - message
                  - code
              examples:
                not_found:
                  summary: Not Found
                  value:
                    code: not_found
                    message: Not Found
        '409':
          description: Payment is already refunded
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Human-readable error message
                  code:
                    type: string
                    const: already_refunded
                    description: Machine-readable error code
                  details:
                    description: Additional structured error details
                    type: object
                    propertyNames:
                      type: string
                    additionalProperties: {}
                required:
                  - message
                  - code
              examples:
                already_refunded:
                  summary: Payment is already refunded
                  value:
                    code: already_refunded
                    message: Payment is already refunded
        '500':
          description: Internal error
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Human-readable error message
                  code:
                    type: string
                    const: internal_error
                    description: Machine-readable error code
                  details:
                    description: Additional structured error details
                    type: object
                    propertyNames:
                      type: string
                    additionalProperties: {}
                required:
                  - message
                  - code
              examples:
                internal_error:
                  summary: Internal Server Error
                  value:
                    code: internal_error
                    message: Internal Server Error
        '502':
          description: Bad gateway
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Human-readable error message
                  code:
                    type: string
                    const: bad_gateway
                    description: Machine-readable error code
                  details:
                    description: Additional structured error details
                    type: object
                    propertyNames:
                      type: string
                    additionalProperties: {}
                required:
                  - message
                  - code
              examples:
                bad_gateway:
                  summary: Bad Gateway
                  value:
                    code: bad_gateway
                    message: Bad Gateway
components:
  securitySchemes:
    API Key:
      type: apiKey
      in: header
      name: Api-Key
    ApiKey:
      type: apiKey
      in: header
      name: Api-Key
      description: Private API key for wallet authentication
    AppId:
      type: apiKey
      in: header
      name: App-Id
      description: >-
        Public App ID for wallet authentication. When using this auth mode, the
        Client-Id header is also required.

````