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

# Create Transfer Request

Create a new transfer request to move funds between Fiat and Crypto. This endpoint supports both:

* **On-ramp (Fiat → Crypto):** You pay in fiat (e.g., NGN), and your recipient receives cryptocurrency.
* **Off-ramp (Crypto → Fiat):** You send crypto (e.g., USDT) over a specified network, and your recipient receives fiat in their bank account.


## OpenAPI

````yaml POST /v1/transfer-requests
openapi: 3.1.0
info:
  title: Hashrails API
  description: >-
    Comprehensive API documentation for Hashrails – easily create, manage, and
    query virtual accounts, recipients, and bank integrations. Secure, scalable,
    and developer-friendly.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.railsfromthecrypt.com
  - url: https://api.hashrails.com
security: []
paths:
  /v1/transfer-requests:
    post:
      tags:
        - Transfer Requests
      summary: Create a transfer request (on-ramp or off-ramp)
      operationId: PublicTransferRequestController_createTransferRequest
      parameters:
        - name: x-api-key
          in: header
          description: API key for authentication
          required: true
          schema:
            type: string
        - name: x-idempotency-key
          in: header
          description: UUID v4 idempotency key to prevent duplicate transfers.
          required: true
          schema:
            type: string
            example: 550e8400-e29b-41d4-a716-446655440000
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - title: On-ramp (Fiat → Crypto)
                  type: object
                  description: >-
                    Convert fiat currency to crypto. You pay in fiat and your
                    recipient receives crypto.
                  properties:
                    type:
                      type: string
                      description: Transfer direction.
                      enum:
                        - onramp
                      example: onramp
                    amount:
                      type: number
                      description: Amount to send in the source currency.
                      example: 10000
                    from_currency:
                      type: string
                      description: Source fiat currency.
                      enum:
                        - NGN
                        - KES
                        - UGX
                        - GHS
                        - ZAR
                      example: NGN
                    to_currency:
                      type: string
                      description: Destination crypto currency.
                      enum:
                        - USDC
                        - USDT
                      example: USDC
                    recipient_id:
                      type: string
                      description: Crypto recipient ID where settlement will be sent.
                      example: rec_01J8V9ZP3A7
                  required:
                    - type
                    - amount
                    - from_currency
                    - to_currency
                    - recipient_id
                - title: Off-ramp (Crypto → Fiat)
                  type: object
                  description: >-
                    Convert crypto to fiat currency. You send crypto and your
                    recipient receives fiat.
                  properties:
                    type:
                      type: string
                      description: Transfer direction.
                      enum:
                        - offramp
                      example: offramp
                    amount:
                      type: number
                      description: Amount to send in the source currency.
                      example: 100
                    from_currency:
                      type: string
                      description: Source crypto currency.
                      enum:
                        - USDC
                        - USDT
                      example: USDC
                    to_currency:
                      type: string
                      description: Destination fiat currency.
                      enum:
                        - NGN
                        - KES
                        - UGX
                        - GHS
                        - ZAR
                      example: NGN
                    recipient_id:
                      type: string
                      description: Fiat recipient ID where settlement will be sent.
                      example: rec_02K9W0AQ4B8
                    network:
                      type: string
                      description: Blockchain network to receive crypto on.
                      enum:
                        - Polygon
                        - Ethereum
                        - BSC
                        - Arbitrum
                        - TRC20
                      example: Polygon
                  required:
                    - type
                    - amount
                    - from_currency
                    - to_currency
                    - recipient_id
                    - network
      responses:
        '201':
          description: Transfer created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: Transfer created successfully
                  data:
                    $ref: '#/components/schemas/PublicTransferResponseDto'
        '400':
          description: Invalid request data
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: network is required for offramp transfers
components:
  schemas:
    PublicTransferResponseDto:
      type: object
      properties:
        id:
          type: string
          description: Unique transfer request ID.
          example: c17d2777-e604-45e2-b6d5-7743652eadf1
        reference:
          type: string
          description: Human-readable transfer reference.
          example: TXN-2Z82FVYO6BW22RC7
        type:
          type: string
          description: Transfer direction.
          enum:
            - onramp
            - offramp
          example: onramp
        status:
          type: string
          description: Current transfer status.
          enum:
            - fetching_rates
            - rate_received
            - awaiting_payment
            - completed
            - cancelled
          example: fetching_rates
        source:
          type: object
          description: Source amount and currency.
          properties:
            amount:
              type: number
              example: 10000
            currency:
              type: string
              example: NGN
        destination:
          type: object
          description: Destination amount and currency.
          properties:
            amount:
              type: number
              example: 0
            currency:
              type: string
              example: USDC
        rate:
          type: object
          nullable: true
          description: >-
            Exchange rate applied to this transfer. Populated after rate is
            received.
          properties:
            value:
              type: number
              example: 0
            expires_at:
              type: string
              format: date-time
              nullable: true
              example: null
        recipient:
          title: Recipient Details
          description: >-
            The recipient receiving the settlement. The structure depends on the
            transfer type.
          nullable: true
          oneOf:
            - title: Crypto Recipient (On-ramp)
              type: object
              properties:
                id:
                  type: string
                  example: rec_01J8V9ZP3A7
                type:
                  type: string
                  enum:
                    - crypto
                  example: crypto
                name:
                  type: string
                  example: My USDT Wallet
                details:
                  type: object
                  properties:
                    network:
                      type: string
                      example: Polygon
                    wallet_address:
                      type: string
                      example: 0xABC123DEF456...
                    symbol:
                      type: string
                      example: USDT
                  required:
                    - network
                    - wallet_address
              required:
                - id
                - type
                - name
                - details
            - title: Fiat Recipient (Off-ramp)
              type: object
              properties:
                id:
                  type: string
                  example: rec_02K9W0AQ4B8
                type:
                  type: string
                  enum:
                    - fiat
                  example: fiat
                name:
                  type: string
                  example: HashRails Ltd
                details:
                  type: object
                  properties:
                    account_number:
                      type: string
                      example: '1234567890'
                    account_name:
                      type: string
                      example: HashRails Ltd
                    bank_name:
                      type: string
                      example: Wema Bank
                  required:
                    - account_number
                    - account_name
                    - bank_name
              required:
                - id
                - type
                - name
                - details
        payment_instructions:
          title: Payment Instructions
          description: >-
            Instructions for the integrator to send payment. The structure
            depends on the transfer type. Empty until payment details are
            assigned.
          nullable: true
          example: {}
          oneOf:
            - title: Fiat Bank Transfer (On-ramp)
              type: object
              properties:
                type:
                  type: string
                  description: Payment method type.
                  enum:
                    - bank_transfer
                  example: bank_transfer
                bank_transfer:
                  type: object
                  description: Bank account to send fiat payment to (on-ramp).
                  properties:
                    account_number:
                      type: string
                      example: '1234567890'
                    account_name:
                      type: string
                      example: HashRails Ltd
                    bank_name:
                      type: string
                      example: Wema Bank
                    bank_code:
                      type: string
                      example: '035'
                  required:
                    - account_number
                    - account_name
                    - bank_name
              required:
                - type
                - bank_transfer
            - title: Crypto Deposit (Off-ramp)
              type: object
              properties:
                type:
                  type: string
                  description: Payment method type.
                  enum:
                    - crypto_deposit
                  example: crypto_deposit
                crypto_deposit:
                  type: object
                  description: Wallet address to send crypto payment to (off-ramp).
                  properties:
                    address:
                      type: string
                      example: 0xABC123DEF456...
                    network:
                      type: string
                      example: Polygon
                    asset:
                      type: string
                      example: USDC
                  required:
                    - address
                    - network
                    - asset
              required:
                - type
                - crypto_deposit
        events:
          type: array
          description: Status change history.
          items:
            type: object
            properties:
              status:
                type: string
                example: pending
              timestamp:
                type: string
                format: date-time
              completed_at:
                type: string
                format: date-time
                nullable: true
        payments:
          type: array
          description: Payment events received for this transfer.
          example: []
          items:
            type: object
            properties:
              id:
                type: string
              amount:
                type: number
              currency:
                type: string
              session_id:
                type: string
              status:
                type: string
              received_at:
                type: string
                format: date-time
              created_at:
                type: string
                format: date-time
        created_at:
          type: string
          format: date-time
          example: '2025-10-10T09:15:21Z'
      required:
        - id
        - type
        - status
        - source
        - destination
        - events
        - payments
        - created_at

````