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

# Refund an off-ramp

> Refunds a **failed** off-ramp payment. Choose how the funds are returned:

- `credit`: Return the funds to the user's Spritz balance.
- `account`: Reissue the payout to a bank account — pass `accountId`, or omit it to reuse the original destination account.

Only failed Modern Treasury and Checkbook off-ramps can be refunded.

**Recommended:** send an `Idempotency-Key` header (a unique key per refund, reused verbatim on retries) so a timed-out request that is retried replays the original response instead of returning a stale "not refundable" error.



## OpenAPI

````yaml https://platform.spritz.finance/openapi.json post /v1/off-ramps/{offRampId}/refund
openapi: 3.0.3
info:
  title: Spritz Finance API
  version: 1.0.0
  description: API for the Spritz Finance platform with RFC 9457 error handling
servers:
  - url: https://platform.spritz.finance
    description: Production
  - url: https://sandbox.spritz.finance
    description: Sandbox
security: []
tags:
  - name: Users
    description: User management endpoints
  - name: Bank Accounts
    description: Manage bank accounts for off-ramp destinations
  - name: Bills
    description: Manage bill pay accounts
  - name: Cards
    description: Spritz-issued debit cards
  - name: Auto-Ramp Accounts
    description: Virtual bank accounts that automatically convert fiat deposits to crypto
  - name: Spritz App
    description: >-
      Endpoints used by the Spritz app and internal SDKs. Excluded from the
      public partner spec.
paths:
  /v1/off-ramps/{offRampId}/refund:
    post:
      tags:
        - Off-Ramps
      summary: Refund an off-ramp
      description: >-
        Refunds a **failed** off-ramp payment. Choose how the funds are
        returned:


        - `credit`: Return the funds to the user's Spritz balance.

        - `account`: Reissue the payout to a bank account — pass `accountId`, or
        omit it to reuse the original destination account.


        Only failed Modern Treasury and Checkbook off-ramps can be refunded.


        **Recommended:** send an `Idempotency-Key` header (a unique key per
        refund, reused verbatim on retries) so a timed-out request that is
        retried replays the original response instead of returning a stale "not
        refundable" error.
      operationId: postV1Off-rampsByOffRampIdRefund
      parameters:
        - name: offRampId
          in: path
          required: true
          schema:
            description: The off-ramp ID
            type: string
            example: 6a749a054c3b8fc5da595d21
      requestBody:
        description: >-
          How to refund the off-ramp.


          - `credit`: Return the funds to the user's Spritz balance.

          - `account`: Reissue the payout to a bank account (`accountId`, or the
          original account if omitted).
        required: true
        content:
          application/json:
            schema:
              description: >-
                How to refund the off-ramp.


                - `credit`: Return the funds to the user's Spritz balance.

                - `account`: Reissue the payout to a bank account (`accountId`,
                or the original account if omitted).
              anyOf:
                - description: Refund by crediting the user's Spritz balance.
                  type: object
                  properties:
                    method:
                      description: Return the funds to the user's Spritz balance as credit.
                      type: string
                      enum:
                        - credit
                  required:
                    - method
                - description: >-
                    Refund by reissuing the payout to a bank account (the
                    original account if `accountId` is omitted).
                  type: object
                  properties:
                    method:
                      description: Reissue the payout to a bank account.
                      type: string
                      enum:
                        - account
                    accountId:
                      description: >-
                        Destination account to reissue the payout to. Omit to
                        reuse the off-ramp's original destination account.
                      pattern: ^[0-9a-fA-F]{24}$
                      type: string
                      example: 6a749a054c3b8fc5da595d15
                  required:
                    - method
          application/x-www-form-urlencoded:
            schema:
              description: >-
                How to refund the off-ramp.


                - `credit`: Return the funds to the user's Spritz balance.

                - `account`: Reissue the payout to a bank account (`accountId`,
                or the original account if omitted).
              anyOf:
                - description: Refund by crediting the user's Spritz balance.
                  type: object
                  properties:
                    method:
                      description: Return the funds to the user's Spritz balance as credit.
                      type: string
                      enum:
                        - credit
                  required:
                    - method
                - description: >-
                    Refund by reissuing the payout to a bank account (the
                    original account if `accountId` is omitted).
                  type: object
                  properties:
                    method:
                      description: Reissue the payout to a bank account.
                      type: string
                      enum:
                        - account
                    accountId:
                      description: >-
                        Destination account to reissue the payout to. Omit to
                        reuse the off-ramp's original destination account.
                      pattern: ^[0-9a-fA-F]{24}$
                      type: string
                      example: 6a749a054c3b8fc5da595d15
                  required:
                    - method
          multipart/form-data:
            schema:
              description: >-
                How to refund the off-ramp.


                - `credit`: Return the funds to the user's Spritz balance.

                - `account`: Reissue the payout to a bank account (`accountId`,
                or the original account if omitted).
              anyOf:
                - description: Refund by crediting the user's Spritz balance.
                  type: object
                  properties:
                    method:
                      description: Return the funds to the user's Spritz balance as credit.
                      type: string
                      enum:
                        - credit
                  required:
                    - method
                - description: >-
                    Refund by reissuing the payout to a bank account (the
                    original account if `accountId` is omitted).
                  type: object
                  properties:
                    method:
                      description: Reissue the payout to a bank account.
                      type: string
                      enum:
                        - account
                    accountId:
                      description: >-
                        Destination account to reissue the payout to. Omit to
                        reuse the off-ramp's original destination account.
                      pattern: ^[0-9a-fA-F]{24}$
                      type: string
                      example: 6a749a054c3b8fc5da595d15
                  required:
                    - method
      responses:
        '200':
          description: Response for status 200
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    description: Unique off-ramp identifier
                    type: string
                    example: offramp_xyz789
                  status:
                    type: string
                    enum:
                      - awaiting_funding
                      - queued
                      - in_flight
                      - completed
                      - canceled
                      - failed
                      - reversed
                      - refunded
                  createdAt:
                    format: date-time
                    type: string
                  completedAt:
                    description: >-
                      When the off-ramp was completed. Null until status is
                      completed.
                    format: date-time
                    type: string
                    nullable: true
                  input:
                    description: What the user paid — crypto asset and chain.
                    type: object
                    properties:
                      amount:
                        description: Crypto amount sent
                        type: string
                        example: '0.25'
                      token:
                        description: Token symbol
                        type: string
                        example: USDC
                      chain:
                        description: Blockchain network the crypto transaction occurs on
                        anyOf:
                          - type: string
                            enum:
                              - ethereum
                          - type: string
                            enum:
                              - polygon
                          - type: string
                            enum:
                              - arbitrum
                          - type: string
                            enum:
                              - base
                          - type: string
                            enum:
                              - optimism
                          - type: string
                            enum:
                              - avalanche
                          - type: string
                            enum:
                              - binance-smart-chain
                          - type: string
                            enum:
                              - solana
                          - type: string
                            enum:
                              - bitcoin
                          - type: string
                            enum:
                              - dash
                          - type: string
                            enum:
                              - tron
                          - type: string
                            enum:
                              - sui
                          - type: string
                            enum:
                              - hyperevm
                          - type: string
                            enum:
                              - monad
                          - type: string
                            enum:
                              - sonic
                          - type: string
                            enum:
                              - unichain
                        example: ethereum
                    required:
                      - amount
                      - token
                      - chain
                    nullable: true
                  output:
                    description: What the destination receives — fiat delivery details.
                    type: object
                    properties:
                      amount:
                        description: Fiat amount delivered
                        type: string
                        example: '100.00'
                      currency:
                        description: Fiat currency code
                        type: string
                        example: USD
                      accountId:
                        description: Destination account ID
                        type: string
                        example: 6a749a054c3b8fc5da595d14
                      accountName:
                        description: Display name of the destination account
                        type: string
                        nullable: true
                        example: Chase Checking ••4567
                      rail:
                        description: >-
                          Fiat delivery rail.


                          - `ach_standard`: ACH bank transfer, next business
                          day.

                          - `ach_same_day`: ACH same-day transfer, delivered
                          same business day.

                          - `rtp`: Real-time payment, seconds, 24/7.

                          - `wire`: Wire transfer, same/next day.

                          - `eft`: Electronic funds transfer, 1-2 business days.

                          - `sepa`: SEPA transfer (EU), 1-2 business days.

                          - `faster_payments`: UK Faster Payments, near-instant.

                          - `push_to_card`: Push to debit card, minutes.

                          - `bill_pay`: Bill payment rail.

                          - `card_deposit`: Deposit to crypto card.
                        anyOf:
                          - type: string
                            nullable: true
                            enum:
                              - ach_standard
                          - type: string
                            nullable: true
                            enum:
                              - ach_same_day
                          - type: string
                            nullable: true
                            enum:
                              - rtp
                          - type: string
                            nullable: true
                            enum:
                              - wire
                          - type: string
                            nullable: true
                            enum:
                              - eft
                          - type: string
                            nullable: true
                            enum:
                              - sepa
                          - type: string
                            nullable: true
                            enum:
                              - faster_payments
                          - type: string
                            nullable: true
                            enum:
                              - push_to_card
                          - type: string
                            nullable: true
                            enum:
                              - bill_pay
                          - type: string
                            nullable: true
                            enum:
                              - card_deposit
                        example: ach_standard
                    required:
                      - amount
                      - currency
                      - accountId
                      - accountName
                      - rail
                  fiatDestination:
                    description: >-
                      Type of fiat destination.


                      - `bank_account`: Bank account (includes debit card
                      destinations).

                      - `bill`: Bill payment.

                      - `crypto_card`: Crypto card deposit.
                    anyOf:
                      - type: string
                        nullable: true
                        enum:
                          - bank_account
                      - type: string
                        nullable: true
                        enum:
                          - bill
                      - type: string
                        nullable: true
                        enum:
                          - crypto_card
                    example: bank_account
                  fees:
                    type: object
                    properties:
                      amount:
                        description: Fee amount
                        type: string
                        example: '1.25'
                      currency:
                        description: Fee currency code
                        type: string
                        example: USD
                    required:
                      - amount
                      - currency
                    nullable: true
                  transaction:
                    type: object
                    properties:
                      hash:
                        description: Blockchain transaction hash
                        type: string
                        nullable: true
                        example: 0xabc123...
                      explorerUrl:
                        description: Block explorer transaction URL
                        type: string
                        nullable: true
                        example: https://etherscan.io/tx/0xabc123...
                    required:
                      - hash
                      - explorerUrl
                    nullable: true
                required:
                  - id
                  - status
                  - createdAt
                  - completedAt
                  - input
                  - output
                  - fiatDestination
                  - fees
                  - transaction
        '401':
          description: Response for status 401
          content:
            application/json:
              schema:
                type: object
                properties:
                  type:
                    default: about:blank
                    description: A URI reference that identifies the problem type
                    type: string
                    example: urn:problem-type:auth:unauthorized
                  title:
                    description: A short, human-readable summary of the problem type
                    type: string
                    example: Unauthorized
                  status:
                    description: The HTTP status code
                    type: number
                    example: 401
                  detail:
                    description: A human-readable explanation specific to this occurrence
                    type: string
                    example: Bearer token required
                  instance:
                    description: A URI reference that identifies the specific occurrence
                    type: string
                  realm:
                    description: The authentication realm
                    type: string
                    example: API
                  scope:
                    description: The required scope for this resource
                    type: string
                    example: read:users
                required:
                  - title
                  - status
                additionalProperties: false
        '404':
          description: Response for status 404
          content:
            application/json:
              schema:
                type: object
                properties:
                  type:
                    default: about:blank
                    description: A URI reference that identifies the problem type
                    type: string
                  title:
                    description: A short, human-readable summary of the problem type
                    type: string
                  status:
                    description: The HTTP status code
                    type: number
                    example: 404
                  detail:
                    description: A human-readable explanation specific to this occurrence
                    type: string
                  instance:
                    description: A URI reference that identifies the specific occurrence
                    type: string
                  resourceType:
                    description: The type of resource that was not found
                    type: string
                    example: user
                  resourceId:
                    description: The identifier of the resource that was not found
                    type: string
                required:
                  - title
                  - status
                  - resourceType
                  - resourceId
                additionalProperties: false
        '500':
          description: Response for status 500
          content:
            application/json:
              schema:
                type: object
                properties:
                  type:
                    default: about:blank
                    description: A URI reference that identifies the problem type
                    type: string
                    example: urn:problem-type:auth:unauthorized
                  title:
                    description: A short, human-readable summary of the problem type
                    type: string
                    example: Unauthorized
                  status:
                    description: The HTTP status code
                    type: number
                    example: 400
                  detail:
                    description: A human-readable explanation specific to this occurrence
                    type: string
                  instance:
                    description: A URI reference that identifies the specific occurrence
                    type: string
                    example: /errors/1234567890
                  code:
                    description: >-
                      Machine-readable cause, present when exactly one thing
                      failed. Branch on this, never on `detail`, which is
                      human-facing copy and may change. For deposit limits the
                      vocabulary matches the `reason` values the limits API
                      returns pre-flight.
                    type: string
                    example: transaction_limit
                  field:
                    description: The offending request field, present alongside `code`.
                    type: string
                    example: amountUsd
                  retryable:
                    description: >-
                      Whether retrying the same request later may succeed
                      without changing its inputs.
                    type: boolean
                    example: true
                required:
                  - title
                  - status
                additionalProperties: false
      security:
        - bearerAuth: []
        - integratorJwt: []
        - hmacAuth: []
          integratorKey: []
          timestamp: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Cognito JWT token for regular user authentication
    integratorJwt:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Integrator JWT token (prefix: spr_) for frontend integrator
        authentication. Obtained via token exchange endpoint.
    hmacAuth:
      type: apiKey
      in: header
      name: X-Signature
      description: >-
        HMAC signature authentication for backend integrators.


        **Required Headers:**

        - X-Integrator-Key: Integrator API key (format: int_...)

        - X-Signature: HMAC signature (format: sha256={hex})

        - X-Timestamp: Unix timestamp in milliseconds

        - Authorization: Bearer {user-api-key}


        **Signature Algorithm:** HMAC-SHA256


        **Signature Format:** {timestamp}.{METHOD}.{path}.{bodyHash}

        - timestamp: Unix timestamp in milliseconds

        - METHOD: HTTP method in UPPERCASE (GET, POST, etc.)

        - path: Request path (e.g., /v1/transactions)

        - bodyHash: SHA256 hex digest of request body (empty string if no body)


        **Timestamp Tolerance:** ±5 minutes (300 seconds)


        **Example:**

        For POST /v1/transactions with body {"amount":100} and timestamp
        1234567890000:

        Payload: 1234567890000.POST./v1/transactions.{sha256(body)}

        Signature: sha256=abc123...
    integratorKey:
      type: apiKey
      in: header
      name: X-Integrator-Key
      description: 'Integrator API key (format: int_...) used with HMAC authentication'
    timestamp:
      type: apiKey
      in: header
      name: X-Timestamp
      description: >-
        Unix timestamp in milliseconds for replay attack prevention. Must be
        within 5 minutes of server time.

````