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

# Create transfer

> Transfers funds from the authenticated account to a mobile money destination or another Sarafa account.



## OpenAPI

````yaml /openapi.json post /v3/transfer
openapi: 3.1.0
info:
  title: Sarafa Merchant API
  summary: Enterprise API for Sarafa merchants.
  description: >-
    The Sarafa Merchant API is mounted under `/v3` and authenticated with a
    merchant API secret.
  version: 0.1.0
servers:
  - url: https://serviceapi.sarafa.ss
    description: Production
security:
  - ApiKeyAuth: []
tags:
  - name: Profile
  - name: Wallets
  - name: Money movement
  - name: Transactions
  - name: Rates
paths:
  /v3/transfer:
    post:
      tags:
        - Money movement
      summary: Create transfer
      description: >-
        Transfers funds from the authenticated account to a mobile money
        destination or another Sarafa account.
      operationId: createTransfer
      parameters:
        - $ref: '#/components/parameters/EnvironmentHeader'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TransferRequest'
            examples:
              mobileQuote:
                summary: Mobile transfer quote
                value:
                  currency: USD
                  amount: 10
                  destination: mobile
                  destination_currency: KES
                  account_number: '+254700000000'
                  external_reference: trf-001
                  callback_url: https://merchant.example/webhooks
                  quote: true
              mobileExecution:
                summary: Mobile transfer execution
                value:
                  currency: USD
                  amount: 10
                  destination: mobile
                  destination_currency: KES
                  account_number: '+254700000000'
                  external_reference: trf-002
                  callback_url: https://merchant.example/webhooks
                  quote: false
              sarafaExecution:
                summary: Sarafa transfer execution
                value:
                  currency: SSP
                  amount: 1000
                  destination: sarafa
                  account_number: '6020260000001'
                  external_reference: trf-003
                  callback_url: https://merchant.example/webhooks
                  quote: false
      responses:
        '200':
          description: Quote, mobile transfer transaction, or Sarafa transfer legs.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/QuoteResponse'
                  - $ref: '#/components/schemas/TransactionResponse'
                  - $ref: '#/components/schemas/TransferLegsResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '500':
          $ref: '#/components/responses/ServerError'
      callbacks:
        transferPending:
          '{$request.body#/callback_url}':
            post:
              summary: Transfer pending callback
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: '#/components/schemas/TransferPendingCallback'
              responses:
                '200':
                  description: Callback accepted.
              method: post
              type: path
            path: '{$request.body#/callback_url}'
components:
  parameters:
    EnvironmentHeader:
      name: environment
      in: header
      required: false
      description: Target environment. Defaults to `production` when omitted.
      schema:
        type: string
        enum:
          - production
          - sandbox
        default: production
  schemas:
    TransferRequest:
      type: object
      additionalProperties: false
      required:
        - currency
        - amount
        - destination
        - account_number
        - external_reference
        - callback_url
      properties:
        currency:
          $ref: '#/components/schemas/SarafaTransferCurrency'
        amount:
          $ref: '#/components/schemas/Amount'
        destination:
          type: string
          enum:
            - mobile
            - sarafa
        destination_currency:
          $ref: '#/components/schemas/MobileTransferCurrency'
        account_number:
          type: string
          minLength: 3
          maxLength: 64
          description: >-
            Phone number for mobile transfers or Sarafa account number for
            Sarafa transfers.
        external_reference:
          $ref: '#/components/schemas/ExternalReference'
        callback_url:
          $ref: '#/components/schemas/CallbackUrl'
        quote:
          type: boolean
          default: true
    QuoteResponse:
      type: object
      required:
        - status
        - data
      properties:
        status:
          type: string
          enum:
            - success
        data:
          type: object
          required:
            - quote
          properties:
            quote:
              $ref: '#/components/schemas/Quote'
    TransactionResponse:
      type: object
      required:
        - status
        - data
      properties:
        status:
          type: string
          enum:
            - success
        data:
          $ref: '#/components/schemas/Transaction'
    TransferLegsResponse:
      type: object
      required:
        - status
        - data
      properties:
        status:
          type: string
          enum:
            - success
        data:
          type: object
          required:
            - debit
            - credit
          properties:
            debit:
              $ref: '#/components/schemas/Transaction'
            credit:
              $ref: '#/components/schemas/Transaction'
    TransferPendingCallback:
      type: object
      required:
        - event
        - status
        - data
      properties:
        event:
          type: string
          enum:
            - transfer.pending
        status:
          type: string
          enum:
            - pending
        data:
          $ref: '#/components/schemas/Transaction'
      example:
        event: transfer.pending
        status: pending
        data:
          product: disburse_mobile
          status: processing
          external_reference: trf-001
    SarafaTransferCurrency:
      type: string
      enum:
        - USD
        - SSP
    Amount:
      type: number
      exclusiveMinimum: 0
      maximum: 1000000000
    MobileTransferCurrency:
      type: string
      enum:
        - UGX
        - KES
        - SSP
    ExternalReference:
      type: string
      minLength: 3
      maxLength: 120
      pattern: ^[A-Za-z0-9._:-]+$
    CallbackUrl:
      type: string
      format: uri
      maxLength: 500
    Quote:
      type: object
      required:
        - from_currency
        - to_currency
        - amount
        - rate
        - fee
        - platform_fee
        - receive_amount
        - quoted_at
      properties:
        from_currency:
          $ref: '#/components/schemas/Currency'
        to_currency:
          $ref: '#/components/schemas/Currency'
        amount:
          type: number
        rate:
          type: number
        fee:
          type: number
        platform_fee:
          type: number
        receive_amount:
          type: number
        deposit_currency:
          $ref: '#/components/schemas/Currency'
        deposit_amount:
          type: number
        quoted_at:
          type: string
          format: date-time
    Transaction:
      type: object
      required:
        - total_amount
        - total_fee
        - product
        - description
        - status
        - created_at
        - updated_at
        - completed_at
        - external_reference
        - customer_meta
      properties:
        total_amount:
          type: number
        total_fee:
          type: number
        product:
          type: string
          examples:
            - collect_mobile
            - disburse_mobile
        description:
          type:
            - string
            - 'null'
        status:
          $ref: '#/components/schemas/Status'
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        completed_at:
          type:
            - string
            - 'null'
          format: date-time
        external_reference:
          type:
            - string
            - 'null'
        customer_meta:
          type:
            - object
            - 'null'
          additionalProperties: true
    ErrorResponse:
      type: object
      required:
        - status
        - message
      properties:
        status:
          type: string
          enum:
            - error
        message:
          type: string
    Currency:
      type: string
      enum:
        - USD
        - SSP
        - UGX
        - KES
        - NGN
        - USDT
        - USDC
    Status:
      type: string
      examples:
        - pending
        - processing
        - completed
        - failed
  responses:
    BadRequest:
      description: >-
        Invalid request data, unsupported currency, unsupported pair, or invalid
        phone number.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            status: error
            message: Invalid request data
    Unauthorized:
      description: Missing or invalid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            missingApiKey:
              value:
                status: error
                message: API key is required
            invalidApiKey:
              value:
                status: error
                message: Invalid API key
    Forbidden:
      description: Organization or account context could not be resolved.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            status: error
            message: Organization account not found
    NotFound:
      description: Requested wallet or resource was not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            status: error
            message: Wallet not found
    Conflict:
      description: '`external_reference` already exists.'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            status: error
            message: External reference already exists
    ServerError:
      description: Unexpected server error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            status: error
            message: Something went wrong. Request could not be processed
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: Merchant API secret.

````