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

# Request a Customer's Crypto Refund

> Requests the return of the crypto deposited for an off-ramp order that could not be completed (for example, because the trade could not be executed).

Check `refundable` on the order before calling: it tells you whether a refund can be requested right now. Whether the request must name a destination is given by `refundDestinationRequired` — `true` means `refundAddress` is required (unless the order already carries one from its creation), `false` means the crypto returns to the on-chain origin address and `refundAddress` is rejected.

The request is idempotent: `202` when the refund is registered, `200` when one already exists for the deposit.

Registering the refund, its approval and a rejection are all silent; only a **completed** refund emits an event, `OFF-RAMP.ORDER.REFUNDED` (see [Off-Ramp Events](/ramps-api/webhooks/off-ramp-events)). Follow progress — and learn of a rejection — through the `latestRefund` block on the order.

See [Refunds](/ramps-api/refunds/overview) for the full model.

Same operation as `POST /offramp/{orderId}/refund/`, scoped to the customer that owns the order — use it when your integration is organised per end customer.



## OpenAPI

````yaml ramps-api/openapi.json POST /api/v1/customers/{customerId}/transactions/offramp/{orderId}/refund/
openapi: 3.1.0
info:
  title: Ripio Ramp API
  version: v1
  description: >-
    API for Ripio ramp services, enabling partners to integrate On-Ramp,
    Off-Ramp, customer management, KYC processes, and other financial
    functionalities. This API is RESTful, uses JSON for requests and responses,
    and standard HTTP status codes. This document is based on the
    'onramp-api.pdf' provided and aims to be compliant with OpenAPI
    Specification v3.1.0. The PDF indicates that the API documentation is a
    draft and subject to change.
servers:
  - url: https://skala-sandbox.ripio.com
    description: Sandbox environment
  - url: https://skala.ripio.com
    description: Production environment
security:
  - BearerToken: []
tags:
  - name: Authentication
    description: Operations related to API authentication and authorization.
  - name: Support Tickets
    description: >-
      Operations for raising and tracking customer support tickets with Ripio's
      support team. This feature must be enabled for your account by the Ripio
      team.
  - name: Customers
    description: Operations related to customer management.
  - name: KYC
    description: Operations related to Know Your Customer processes.
  - name: Fiat Accounts
    description: Operations related to managing fiat accounts and their requirements.
  - name: Quotes
    description: Operations related to obtaining and managing conversion quotes.
  - name: On-Ramp
    description: Operations related to fiat-to-crypto (on-ramp) processes.
  - name: Off-Ramp
    description: Operations related to crypto-to-fiat (off-ramp) processes.
  - name: Refunds
    description: >-
      Operations for returning the money of an on-ramp or off-ramp operation
      that could not be completed. Each ramp must be enabled for your account by
      the Ripio team.
  - name: Transactions
    description: Operations related to listing and managing all transaction types.
  - name: Networks
    description: >-
      Operations related to retrieving available deposit and withdrawal
      networks.
  - name: Rates
    description: Operations related to retrieving market rates.
  - name: Transaction Limits
    description: >-
      Operations related to retrieving per-transaction limits by currency and
      ramp operation.
  - name: Sandbox
    description: Operations specific to the sandbox environment for testing purposes.
  - name: Webhooks
    description: Webhook event notifications from Ripio Ramp API.
  - name: Sell and Pay
    description: >-
      Endpoints for managing Sell and Pay transactions, which allow customers to
      convert cryptocurrency to fiat currency and pay merchants via QR codes
paths:
  /api/v1/customers/{customerId}/transactions/offramp/{orderId}/refund/:
    post:
      tags:
        - Refunds
      summary: Request a Customer's Crypto Refund
      description: >-
        Requests the return of the crypto deposited for an off-ramp order that
        could not be completed (for example, because the trade could not be
        executed).


        Check `refundable` on the order before calling: it tells you whether a
        refund can be requested right now. Whether the request must name a
        destination is given by `refundDestinationRequired` — `true` means
        `refundAddress` is required (unless the order already carries one from
        its creation), `false` means the crypto returns to the on-chain origin
        address and `refundAddress` is rejected.


        The request is idempotent: `202` when the refund is registered, `200`
        when one already exists for the deposit.


        Registering the refund, its approval and a rejection are all silent;
        only a **completed** refund emits an event, `OFF-RAMP.ORDER.REFUNDED`
        (see [Off-Ramp Events](/ramps-api/webhooks/off-ramp-events)). Follow
        progress — and learn of a rejection — through the `latestRefund` block
        on the order.


        See [Refunds](/ramps-api/refunds/overview) for the full model.


        Same operation as `POST /offramp/{orderId}/refund/`, scoped to the
        customer that owns the order — use it when your integration is organised
        per end customer.
      operationId: requestCustomerCryptoRefund
      parameters:
        - $ref: '#/components/parameters/CustomerId'
        - $ref: '#/components/parameters/OrderId'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CryptoRefundRequest'
      responses:
        '200':
          description: A refund already exists for this deposit; nothing new was created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CryptoRefundResponse'
        '202':
          description: Refund requested.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CryptoRefundResponse'
        '400':
          description: >-
            Bad Request - a refund address was supplied for an account that
            refunds to the on-chain origin, or it is missing when the account
            requires one.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                code: 20074
                type: CryptoRefundAddressNotAllowedException
                detail:
                  message: >-
                    A refund address is not allowed for this account: crypto
                    refunds are sent to the on-chain origin address.
                status: 400
        '401':
          description: Unauthorized - Invalid or missing access token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                code: 40001
                type: NotAuthenticated
                detail:
                  message: Authentication credentials were not provided.
                  code: not_authenticated
                status: 401
        '403':
          description: >-
            Forbidden - crypto refunds are not enabled for your account. Contact
            the Ripio team to enable this feature.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                code: 20072
                type: CryptoRefundNotEnabledException
                detail:
                  message: Crypto refunds are not enabled for this account.
                status: 403
        '404':
          description: >-
            Not Found - the resource does not exist or does not belong to your
            account.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                code: 40004
                type: NotFound
                detail:
                  message: Not found.
                  code: not_found
                status: 404
        '409':
          description: >-
            Conflict - the order is not in a state that allows requesting a
            crypto refund, or the deposited amount is too small to be refunded
            (`20055`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                code: 20054
                type: CryptoRefundNotAllowedRequestException
                detail:
                  message: This order cannot be refunded.
                status: 409
components:
  parameters:
    CustomerId:
      name: customerId
      in: path
      required: true
      description: Unique identifier for the customer.
      schema:
        type: string
        format: uuid
      example: 8142b065-79c4-4f48-9e33-11b17bc658d4
    OrderId:
      name: orderId
      in: path
      required: true
      description: Unique identifier for the order.
      schema:
        type: string
        format: uuid
      example: 9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d
  schemas:
    CryptoRefundRequest:
      type: object
      description: >-
        Body of a crypto refund request. Send `refundAddress` only when
        `refundDestinationRequired` is `true` and the order does not already
        carry one.
      properties:
        refundAddress:
          type: string
          minLength: 10
          maxLength: 255
          description: >-
            On-chain address the crypto is returned to. Rejected when the
            account is configured to refund to the deposit's origin address.
          example: '0x2f318C334780961FB129D2a6c30D0763d9a5C970'
    CryptoRefundResponse:
      type: object
      description: >-
        Acknowledgement of a crypto refund request. Follow its progress through
        the `latestRefund` block on the order.
      properties:
        transactionId:
          type: string
          format: uuid
          description: Identifier of the off-ramp order being refunded.
    ErrorResponse:
      type: object
      properties:
        code:
          type: integer
          description: Application-specific error code.
        type:
          type: string
          description: Type of error or exception.
        detail:
          type:
            - object
            - array
          description: >-
            Error details. The shape depends on the error:


            - Most business errors return an object with a `message` key.

            - Field validation errors return an object keyed by field name, each
            holding an array of `{ message, code }`.

            - Request-level validation errors (e.g. a missing query parameter)
            return a bare array of `{ message, code }`.
          properties:
            message:
              type: string
              description: Detailed error message.
          additionalProperties: true
        status:
          type: integer
          description: HTTP status code.
      required:
        - code
        - type
        - detail
        - status
  securitySchemes:
    BearerToken:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Access token obtained via
        [/oauth2/token/](/ramps-api/authentication/acquire-access-token). Use as
        `Authorization: Bearer <access_token>`.

````