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

# Change Fiat Account and Reprocess

> Points a cancelled off-ramp order at a different destination account and reprocesses the payout. Use it when the order was cancelled because the fiat could not be delivered — `failureReason: INVALID_DESTINATION` on the order — for example a closed, mistyped or unreachable account.

**This is the counterpart of a refund, not an alternative to it.** The order must be `CANCELLED` with its crypto already traded and no payout completed. Because the crypto was already sold there is nothing to send back, so these orders come back with `refundable: false` and reprocessing to a corrected account is how they are resolved. Orders whose trade never executed are the refundable ones and cannot be reprocessed — see [Refunds](/ramps-api/refunds/overview).

The replacement account must belong to the same customer and its `paymentMethodType` must match the one the order was created with. A `suspended` account is accepted and reactivated, which moves the account that was active for that payment method to `suspended` — see [Fiat account lifecycle](/ramps-api/fiat-accounts/lifecycle). The customer's active off-ramp session is repointed to the new account as well, so later deposits to that session's addresses are paid there too.

The response is an acknowledgement, not a completed payout: the order returns to `PROCESSING` and the payout is retried in the background. The deposit and the trade are not replayed, so no `OFF-RAMP.DEPOSIT.RECEIVED` or `OFF-RAMP.TRADE.COMPLETED` event is re-sent — you see `OFF-RAMP.WITHDRAWAL.PROCESSING` → `OFF-RAMP.WITHDRAWAL.COMPLETED`, or `OFF-RAMP.ORDER.CANCELLED` again if the new destination also fails. See [Off-Ramp Events](/ramps-api/webhooks/off-ramp-events).

<Note>
  A cancelled off-ramp order has exactly one way out, and `refundable` tells you which:

  | `refundable` | What happened                                              | How to resolve it                                                   |
  | ------------ | ---------------------------------------------------------- | ------------------------------------------------------------------- |
  | `false`      | The crypto was already sold and the **fiat payout** failed | Retry the payout against another account with this endpoint         |
  | `true`       | The **trade** never executed, so the crypto is still there | [Request a crypto refund](/ramps-api/refunds/request-crypto-refund) |

  The two never apply to the same order. An order Ripio is still retrying on its own is neither: it reports `status: PENDING` rather than `CANCELLED`, is retried against the same account, and this endpoint answers `400` (`20035`) while that lasts.
</Note>


## OpenAPI

````yaml ramps-api/openapi.json POST /api/v1/offramp/{orderId}/changeFiatAccount/
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/offramp/{orderId}/changeFiatAccount/:
    post:
      tags:
        - Off-Ramp
      summary: Change Fiat Account and Reprocess
      description: >-
        Points a cancelled off-ramp order at a different destination account and
        reprocesses the payout. Use it when the order was cancelled because the
        fiat could not be delivered — `failureReason: INVALID_DESTINATION` on
        the order — for example a closed, mistyped or unreachable account.


        **This is the counterpart of a refund, not an alternative to it.** The
        order must be `CANCELLED` with its crypto already traded and no payout
        completed. Because the crypto was already sold there is nothing to send
        back, so these orders come back with `refundable: false` and
        reprocessing to a corrected account is how they are resolved. Orders
        whose trade never executed are the refundable ones and cannot be
        reprocessed — see [Refunds](/ramps-api/refunds/overview).


        The replacement account must belong to the same customer and its
        `paymentMethodType` must match the one the order was created with. A
        `suspended` account is accepted and reactivated, which moves the account
        that was active for that payment method to `suspended` — see [Fiat
        account lifecycle](/ramps-api/fiat-accounts/lifecycle). The customer's
        active off-ramp session is repointed to the new account as well, so
        later deposits to that session's addresses are paid there too.


        The response is an acknowledgement, not a completed payout: the order
        returns to `PROCESSING` and the payout is retried in the background. The
        deposit and the trade are not replayed, so no
        `OFF-RAMP.DEPOSIT.RECEIVED` or `OFF-RAMP.TRADE.COMPLETED` event is
        re-sent — you see `OFF-RAMP.WITHDRAWAL.PROCESSING` →
        `OFF-RAMP.WITHDRAWAL.COMPLETED`, or `OFF-RAMP.ORDER.CANCELLED` again if
        the new destination also fails. See [Off-Ramp
        Events](/ramps-api/webhooks/off-ramp-events).
      operationId: changeOffRampFiatAccount
      parameters:
        - $ref: '#/components/parameters/OrderId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChangeFiatAccountRequest'
      responses:
        '200':
          description: >-
            The order was repointed to the new account and queued for
            reprocessing.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChangeFiatAccountResponse'
        '400':
          description: >-
            Bad Request - one of:


            - `20035` (`InvalidOrderStateException`): the order is not
            reprocessable. It is not `CANCELLED`, its trade never executed (that
            order is refundable instead), or a payout already completed for it.

            - `20005` (`ExternalFiatAccountNotEnabledException`): the
            replacement account cannot receive a payout yet — it is
            `processing`, `unconfirmed`, `disabled` or `revalidation_required`.
            Only `enabled` and `suspended` accounts are accepted.

            - `20060` (`IncompatibleFiatAccountTypeException`): the replacement
            account's `paymentMethodType` differs from the one the order was
            created with.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                code: 20035
                type: InvalidOrderStateException
                detail:
                  message: Order is in an invalid state for this operation.
                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
        '404':
          description: >-
            Not Found - the order does not exist, is not an off-ramp order or
            does not belong to your account (`40004`); its customer is
            deactivated (`40004`); or the replacement account does not exist or
            belongs to another customer (`40011`,
            `ExternalFiatAccountNotFoundException`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                code: 40011
                type: ExternalFiatAccountNotFoundException
                detail:
                  message: External fiat account not found.
                status: 404
components:
  parameters:
    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:
    ChangeFiatAccountRequest:
      type: object
      description: Body of a change-of-destination request for a cancelled off-ramp order.
      required:
        - externalFiatAccountId
      properties:
        externalFiatAccountId:
          type: string
          format: uuid
          description: >-
            Fiat account the payout is retried to. It must belong to the same
            customer as the order and share its `paymentMethodType`. An
            `enabled` account is used as is; a `suspended` one is reactivated
            first.
          example: a1b2c3d4-e5f6-7890-abcd-ef1234567890
    ChangeFiatAccountResponse:
      type: object
      description: >-
        Acknowledgement that the order was repointed and queued for
        reprocessing. The payout itself is retried in the background.
      properties:
        orderId:
          type: string
          format: uuid
          description: Identifier of the off-ramp order being reprocessed.
          example: 9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d
        status:
          type: string
          description: Status the order was moved to. Always `PROCESSING`.
          example: PROCESSING
    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>`.

````