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

# Refund a payment

> A refund is a new payment back to the wallet that paid, in the same coin. LuminPay's fee is not refunded and LuminPay pays the network fee. The customer never receives more coins than they paid: if the rate moved 1% or less, or in the customer's favour, they get exactly the coins they paid; if the naira got more than 1% weaker, they get the naira price in coins at today's rate (fewer coins). You are debited the naira you were credited either way.

Requires an owner, admin or manager signed in to the dashboard, and their PIN. Above your approval limit a second owner or admin must approve it; a business can also hold refunds before sending. Check the result in `merchantApprovalStatus`, `scheduledFor` and `status`. Get a quote first with `GET .../quote`.



## OpenAPI

````yaml /openapi.json post /charges/{chargeId}/refunds
openapi: 3.0.3
info:
  title: LuminPay API
  version: 1.0.0
  description: >-
    Accept stablecoin and Bitcoin payments and settle in naira. Use a lmp_test_
    key with the Sandbox server and a lmp_live_ key with the Live server.
servers:
  - url: https://sandbox-api.luminpay.co
    description: Sandbox (testnet)
  - url: https://api.luminpay.co
    description: Live
security:
  - apiKey: []
tags:
  - name: Charges
  - name: Webhooks
  - name: Payment links
  - name: Invoices
  - name: Payouts
  - name: Refunds
paths:
  /charges/{chargeId}/refunds:
    parameters:
      - name: chargeId
        in: path
        required: true
        schema:
          type: string
          format: uuid
    post:
      tags:
        - Refunds
      summary: Refund a payment
      description: >-
        A refund is a new payment back to the wallet that paid, in the same
        coin. LuminPay's fee is not refunded and LuminPay pays the network fee.
        The customer never receives more coins than they paid: if the rate moved
        1% or less, or in the customer's favour, they get exactly the coins they
        paid; if the naira got more than 1% weaker, they get the naira price in
        coins at today's rate (fewer coins). You are debited the naira you were
        credited either way.


        Requires an owner, admin or manager signed in to the dashboard, and
        their PIN. Above your approval limit a second owner or admin must
        approve it; a business can also hold refunds before sending. Check the
        result in `merchantApprovalStatus`, `scheduledFor` and `status`. Get a
        quote first with `GET .../quote`.
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - amount
                - pin
              properties:
                amount:
                  type: string
                  description: Coins to refund, in the coin's smallest unit, as a string.
                pin:
                  type: string
                  description: The signed-in person's 6-digit PIN.
                expectedSendAmount:
                  type: string
                  description: >-
                    The `sendAmount` from the quote you showed. If the rate
                    moved and it would change, the request is refused with 409
                    `REFUND_QUOTE_CHANGED` and the new amount.
      responses:
        '201':
          description: The refund. It may be pending approval or on hold, not yet sent.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Refund'
        '400':
          description: >-
            Invalid amount, more than is left to refund, wrong PIN, or the
            wallet cannot receive refunds.
        '403':
          description: Your role cannot refund.
        '409':
          description: >-
            The rate moved since the quote (`REFUND_QUOTE_CHANGED`), or the
            Idempotency-Key is still in use.
        '422':
          $ref: '#/components/responses/IdempotencyMismatch'
        '503':
          description: >-
            The exchange rate is unavailable, so the refund cannot be priced.
            Try again in a few minutes.
components:
  parameters:
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: false
      description: >-
        A unique value for this request, 8 to 64 characters (letters, numbers,
        dots, dashes, underscores, colons). Send the same value when retrying:
        the first answer is returned with the header `Idempotent-Replayed: true`
        and nothing is created twice. Kept for 24 hours. The same key with a
        different request returns 422; the same key while the first request is
        still running returns 409.
      schema:
        type: string
        minLength: 8
        maxLength: 64
        pattern: ^[A-Za-z0-9._:-]{8,64}$
      example: order_1001_attempt_1
  schemas:
    Refund:
      type: object
      properties:
        refundId:
          type: string
          format: uuid
        chargeId:
          type: string
          format: uuid
        amount:
          type: string
          description: Coins the sale is reduced by, in the coin's smallest unit.
        sendAmount:
          type: string
          description: >-
            Coins actually sent. Never more than amount. Less when the naira got
            more than 1% weaker since the sale.
        asset:
          type: string
        destinationAddress:
          type: string
          description: The wallet that paid. Refunds cannot go anywhere else.
        status:
          type: string
          enum:
            - pending
            - processing
            - completed
            - failed
        merchantApprovalStatus:
          type: string
          nullable: true
          enum:
            - not_required
            - pending
            - approved
            - rejected
            - cancelled
          description: '`pending` means a second owner or admin must approve it.'
        scheduledFor:
          type: string
          format: date-time
          nullable: true
          description: When a hold ends and the refund is sent.
        rateBasis:
          type: string
          nullable: true
          enum:
            - original
            - current
            - capped
        moveBps:
          type: integer
          nullable: true
          description: >-
            How far the market rate moved against the customer since the sale,
            in basis points.
        merchantDebitKobo:
          type: string
          nullable: true
          description: Naira taken from your balance, in kobo.
        failureReason:
          type: string
          nullable: true
        txHash:
          type: string
          nullable: true
        createdAt:
          type: string
          format: date-time
        completedAt:
          type: string
          format: date-time
          nullable: true
  responses:
    IdempotencyMismatch:
      description: >-
        This Idempotency-Key was already used for a different request. Use a new
        key for a different request.
      content:
        application/json:
          schema:
            type: object
            properties:
              statusCode:
                type: integer
                example: 422
              message:
                type: string
              error:
                type: string
                example: Unprocessable Entity
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      bearerFormat: lmp_test_... or lmp_live_...
      description: >-
        Your secret API key from Developers → API keys. A key can be limited in
        the dashboard: read only (GET requests only), allowed IP addresses, and
        an expiry date. A request outside a limit is refused with 401 or 403 and
        a message saying which limit.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.