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

# Start a withdrawal to a bank account

> Creates the withdrawal's funding account and the payout with the provider. Send exactly `funding.amount` of `funding.token` on `funding.chain` to `funding.address` before `session.expiresAt`; anything else, and any refund or bank return, goes back to `source`.



## OpenAPI

````yaml https://raw.githubusercontent.com/rhinestonewtf/openapi/refs/heads/main/deposit-service.json post /offramp/sessions
openapi: 3.1.0
info:
  title: Deposit Service API
  version: 1.0.0
  description: >-
    Rhinestone Deposits API: accept deposits from any chain, asset or payment
    method, and settle them as one token on one chain.
servers:
  - url: https://v1.orchestrator.rhinestone.dev/deposit-processor
security: []
paths:
  /offramp/sessions:
    post:
      tags:
        - Offramp
      summary: Start a withdrawal to a bank account
      description: >-
        Creates the withdrawal's funding account and the payout with the
        provider. Send exactly `funding.amount` of `funding.token` on
        `funding.chain` to `funding.address` before `session.expiresAt`;
        anything else, and any refund or bank return, goes back to `source`.
      parameters:
        - schema:
            type: string
            description: 'Integrator API key: the project’s orders'
          required: false
          description: 'Integrator API key: the project’s orders'
          name: x-api-key
          in: header
        - schema:
            type: string
            description: >-
              Customer bearer from `POST /compliance/sessions`: that customer’s
              orders, and every order on its bound account
            example: Bearer eyJhbGciOi...
          required: false
          description: >-
            Customer bearer from `POST /compliance/sessions`: that customer’s
            orders, and every order on its bound account
          name: authorization
          in: header
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateOfframpSession'
      responses:
        '201':
          description: The session, where to send the funds, and the estimate
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OfframpSessionCreated'
        '400':
          description: AMOUNT_TOO_SMALL or INVALID_BENEFICIARY
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OfframpError'
        '401':
          description: Missing or invalid bearer
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
                    enum:
                      - VERIFICATION_REQUIRED
                    description: >-
                      The customer must resume hosted verification for this
                      currency, then retry
                required:
                  - error
        '403':
          description: >-
            The bearer no longer matches its customer, or an API key was sent:
            payout rails are per customer
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
                    enum:
                      - VERIFICATION_REQUIRED
                    description: >-
                      The customer must resume hosted verification for this
                      currency, then retry
                required:
                  - error
        '404':
          description: Payouts are not enabled for this project
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
                    enum:
                      - VERIFICATION_REQUIRED
                    description: >-
                      The customer must resume hosted verification for this
                      currency, then retry
                required:
                  - error
        '409':
          description: 'VERIFICATION_REQUIRED, or UNKNOWN_METHOD: list the methods again'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OfframpError'
        '500':
          description: Internal failure serving the request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
                    enum:
                      - VERIFICATION_REQUIRED
                    description: >-
                      The customer must resume hosted verification for this
                      currency, then retry
                required:
                  - error
        '502':
          description: The provider refused or failed the request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
                    enum:
                      - VERIFICATION_REQUIRED
                    description: >-
                      The customer must resume hosted verification for this
                      currency, then retry
                required:
                  - error
        '503':
          description: No payout provider is configured
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
                    enum:
                      - VERIFICATION_REQUIRED
                    description: >-
                      The customer must resume hosted verification for this
                      currency, then retry
                required:
                  - error
components:
  schemas:
    CreateOfframpSession:
      type: object
      properties:
        methodId:
          type: string
          format: uuid
          description: From GET /offramp/options
        beneficiary:
          $ref: '#/components/schemas/Beneficiary'
        amount:
          type: string
          maxLength: 40
          pattern: ^(0|[1-9]\d*)(\.\d{1,6})?$
          description: Decimal token units (USDC), never base units
        source:
          type: string
          pattern: ^0x[a-fA-F0-9]{40}$
          description: The account the withdrawal comes from; refunds go back to it
          example: '0x742d35Cc6634C0532925a3b844Bc9e7595f5bE91'
        refundTo:
          type: object
          properties:
            chain:
              type: string
              pattern: ^[a-z0-9]+:[a-zA-Z0-9]+$
              description: CAIP-2 chain identifier (e.g. "eip155:8453")
              example: eip155:8453
            token:
              type: string
              pattern: ^0x[a-fA-F0-9]{40}$
              description: Ethereum address (0x followed by 40 hex characters)
              example: '0x742d35Cc6634C0532925a3b844Bc9e7595f5bE91'
          required:
            - chain
            - token
          additionalProperties: false
          description: Chain and token refunds are returned as; defaults to `funding`
      required:
        - methodId
        - beneficiary
        - amount
        - source
      additionalProperties: false
    OfframpSessionCreated:
      type: object
      properties:
        session:
          $ref: '#/components/schemas/OfframpSession'
        funding:
          type: object
          properties:
            address:
              type: string
              pattern: ^0x[a-fA-F0-9]{40}$
              description: Ethereum address (0x followed by 40 hex characters)
              example: '0x742d35Cc6634C0532925a3b844Bc9e7595f5bE91'
            chain:
              type: string
              description: CAIP-2
            token:
              type: string
              pattern: ^0x[a-fA-F0-9]{40}$
              description: Ethereum address (0x followed by 40 hex characters)
              example: '0x742d35Cc6634C0532925a3b844Bc9e7595f5bE91'
            amount:
              type: string
              maxLength: 40
              pattern: ^(0|[1-9]\d*)(\.\d{1,6})?$
              description: Decimal token units (USDC), never base units
          required:
            - address
            - chain
            - token
            - amount
          additionalProperties: false
        estimate:
          type: object
          properties:
            fiatAmount:
              type:
                - string
                - 'null'
              description: What the bank receives, after every fee
            currency:
              type: string
            totalFee:
              type:
                - string
                - 'null'
            rate:
              type:
                - string
                - 'null'
          required:
            - fiatAmount
            - currency
            - totalFee
            - rate
          additionalProperties: false
      required:
        - session
        - funding
        - estimate
      additionalProperties: false
    OfframpError:
      type: object
      properties:
        error:
          type: string
        code:
          type: string
          enum:
            - VERIFICATION_REQUIRED
            - UNKNOWN_METHOD
            - AMOUNT_TOO_SMALL
            - INVALID_BENEFICIARY
        fields:
          type: array
          items:
            type: string
          description: 'INVALID_BENEFICIARY: our beneficiary paths, e.g. `account.iban`'
        estimate:
          type: object
          properties:
            totalFee:
              type:
                - string
                - 'null'
            currency:
              type: string
          required:
            - totalFee
            - currency
          description: 'AMOUNT_TOO_SMALL: the fees that exceed the amount'
      required:
        - error
    Beneficiary:
      type: object
      properties:
        holder:
          oneOf:
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - individual
                firstName:
                  type: string
                  minLength: 1
                  maxLength: 100
                lastName:
                  type: string
                  minLength: 1
                  maxLength: 100
              required:
                - type
                - firstName
                - lastName
              additionalProperties: false
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - business
                name:
                  type: string
                  minLength: 1
                  maxLength: 200
              required:
                - type
                - name
              additionalProperties: false
        address:
          type: object
          properties:
            line1:
              type: string
              minLength: 1
              maxLength: 200
            city:
              type: string
              minLength: 1
              maxLength: 100
            state:
              type: string
              minLength: 1
              maxLength: 100
            postalCode:
              type: string
              minLength: 1
              maxLength: 20
            country:
              type: string
              pattern: ^[A-Z]{2}$
          required:
            - line1
            - city
            - state
            - postalCode
            - country
          additionalProperties: false
          description: Required by US and SWIFT accounts
        account:
          oneOf:
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - us
                routingNumber:
                  type: string
                  pattern: ^\d{9}$
                accountNumber:
                  type: string
                  minLength: 1
                  maxLength: 34
                accountType:
                  type: string
                  enum:
                    - checking
                    - savings
              required:
                - type
                - routingNumber
                - accountNumber
                - accountType
              additionalProperties: false
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - iban
                iban:
                  type: string
                  minLength: 1
                  maxLength: 34
              required:
                - type
                - iban
              additionalProperties: false
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - swift
                swiftCode:
                  type: string
                  pattern: ^[A-Z0-9]{8}([A-Z0-9]{3})?$
                accountNumber:
                  type: string
                  minLength: 1
                  maxLength: 34
                accountType:
                  type: string
                  enum:
                    - checking
                    - savings
              required:
                - type
                - swiftCode
                - accountNumber
                - accountType
              additionalProperties: false
        reference:
          type: string
          minLength: 1
          maxLength: 140
          description: Shown on the bank statement; defaults to "Withdrawal"
      required:
        - holder
        - account
      additionalProperties: false
      description: >-
        The bank account to pay. Passed to the provider only: never stored or
        logged.
    OfframpSession:
      type: object
      properties:
        id:
          type: string
          format: uuid
        provider:
          type: string
          enum:
            - noah
            - swapped
        status:
          type: string
          enum:
            - pending
            - processing
            - completed
            - failed
            - refunded
        terminal:
          type: boolean
          description: No stage will change again
        stages:
          type: object
          properties:
            receipt:
              $ref: '#/components/schemas/OnrampReceiptStage'
            conversion:
              $ref: '#/components/schemas/OnrampConversionStage'
            delivery:
              $ref: '#/components/schemas/OnrampDeliveryStage'
            return:
              $ref: '#/components/schemas/OnrampReturnStage'
          required:
            - receipt
            - conversion
            - delivery
            - return
          additionalProperties: false
        rail:
          oneOf:
            - type: object
              properties:
                kind:
                  type: string
                  enum:
                    - fiat
                method:
                  type: string
              required:
                - kind
                - method
              additionalProperties: false
            - type: object
              properties:
                kind:
                  type: string
                  enum:
                    - exchange
                connection:
                  type: string
              required:
                - kind
                - connection
              additionalProperties: false
          description: '`provider_selected` / `unknown` when the provider did not say'
        fiat:
          type: object
          properties:
            charged:
              type:
                - object
                - 'null'
              properties:
                total:
                  type:
                    - string
                    - 'null'
                  description: Including fees
                net:
                  type:
                    - string
                    - 'null'
                  description: Before fees
                currency:
                  type: string
              required:
                - total
                - net
                - currency
              additionalProperties: false
              description: What the customer paid, in their own currency
            eur:
              type:
                - object
                - 'null'
              properties:
                total:
                  type:
                    - string
                    - 'null'
                  description: Including fees
                net:
                  type:
                    - string
                    - 'null'
                  description: Before fees
              required:
                - total
                - net
              additionalProperties: false
              description: Comparable across every order
            usd:
              type:
                - object
                - 'null'
              properties:
                total:
                  type:
                    - string
                    - 'null'
                  description: Including fees
                net:
                  type:
                    - string
                    - 'null'
                  description: Before fees
              required:
                - total
                - net
              additionalProperties: false
          required:
            - charged
            - eur
            - usd
          additionalProperties: false
          description: >-
            Each figure in a fixed currency; null when the provider did not
            state it
        crypto:
          type:
            - object
            - 'null'
          properties:
            asset:
              type: string
            network:
              type: string
            amount:
              type: string
          required:
            - asset
            - network
            - amount
          additionalProperties: false
        providerStatus:
          type: string
          description: The provider’s own status; informational
        createdAt:
          type: string
          format: date-time
          description: When the provider says the order began
        updatedAt:
          type: string
          format: date-time
        fundingAccount:
          type: string
          pattern: ^0x[a-fA-F0-9]{40}$
          description: Where the withdrawal is sent; it pays the provider once
          example: '0x742d35Cc6634C0532925a3b844Bc9e7595f5bE91'
        expiresAt:
          type: string
          format: date-time
          description: Funds arriving after this go back to the source account
      required:
        - id
        - provider
        - status
        - terminal
        - stages
        - rail
        - fiat
        - crypto
        - providerStatus
        - createdAt
        - updatedAt
        - fundingAccount
        - expiresAt
      additionalProperties: false
    OnrampReceiptStage:
      oneOf:
        - type: object
          properties:
            status:
              type: string
              enum:
                - not_started
          required:
            - status
          additionalProperties: false
        - type: object
          properties:
            status:
              type: string
              enum:
                - pending
          required:
            - status
          additionalProperties: false
        - type: object
          properties:
            status:
              type: string
              enum:
                - on_hold
            reason:
              type: string
              enum:
                - kyc_required
                - rfi_open
                - review
          required:
            - status
            - reason
          additionalProperties: false
        - type: object
          properties:
            status:
              type: string
              enum:
                - processing
          required:
            - status
          additionalProperties: false
        - type: object
          properties:
            status:
              type: string
              enum:
                - completed
          required:
            - status
          additionalProperties: false
        - type: object
          properties:
            status:
              type: string
              enum:
                - failed
            reason:
              type: string
              enum:
                - cancelled
                - declined
                - expired
                - provider_error
          required:
            - status
            - reason
          additionalProperties: false
    OnrampConversionStage:
      oneOf:
        - type: object
          properties:
            status:
              type: string
              enum:
                - not_started
          required:
            - status
          additionalProperties: false
        - type: object
          properties:
            status:
              type: string
              enum:
                - processing
          required:
            - status
          additionalProperties: false
        - type: object
          properties:
            status:
              type: string
              enum:
                - on_hold
            reason:
              type: string
              enum:
                - rfi_open
                - review
          required:
            - status
            - reason
          additionalProperties: false
        - type: object
          properties:
            status:
              type: string
              enum:
                - completed
          required:
            - status
          additionalProperties: false
        - type: object
          properties:
            status:
              type: string
              enum:
                - failed
            reason:
              type: string
              enum:
                - sub_fee
                - provider_error
          required:
            - status
            - reason
          additionalProperties: false
    OnrampDeliveryStage:
      oneOf:
        - type: object
          properties:
            status:
              type: string
              enum:
                - not_started
          required:
            - status
          additionalProperties: false
        - type: object
          properties:
            status:
              type: string
              enum:
                - pending
          required:
            - status
          additionalProperties: false
        - type: object
          properties:
            status:
              type: string
              enum:
                - on_hold
            reason:
              type: string
              enum:
                - rfi_open
                - review
          required:
            - status
            - reason
          additionalProperties: false
        - type: object
          properties:
            status:
              type: string
              enum:
                - submitted
            txHash:
              type: string
              pattern: ^0x[0-9a-f]{64}$
          required:
            - status
            - txHash
          additionalProperties: false
          description: The provider reported the transfer; not yet seen on chain
        - type: object
          properties:
            status:
              type: string
              enum:
                - completed
            txHash:
              type: string
              pattern: ^0x[0-9a-f]{64}$
            depositId:
              type: string
              description: The deposit it landed as
          required:
            - status
            - txHash
            - depositId
          additionalProperties: false
          description: The transfer landed on chain as a deposit
        - type: object
          properties:
            status:
              type: string
              enum:
                - failed
            reason:
              type: string
              enum:
                - sub_fee
                - provider_error
          required:
            - status
            - reason
          additionalProperties: false
    OnrampReturnStage:
      oneOf:
        - type: object
          properties:
            status:
              type: string
              enum:
                - none
          required:
            - status
          additionalProperties: false
        - type: object
          properties:
            status:
              type: string
              enum:
                - pending
          required:
            - status
          additionalProperties: false
        - type: object
          properties:
            status:
              type: string
              enum:
                - processing
          required:
            - status
          additionalProperties: false
        - type: object
          properties:
            status:
              type: string
              enum:
                - completed
            outcome:
              type: string
              enum:
                - full_refund
                - adjustment
                - unresolved
          required:
            - status
            - outcome
          additionalProperties: false
        - type: object
          properties:
            status:
              type: string
              enum:
                - failed
          required:
            - status
          additionalProperties: false

````

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