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

# Transfer miles into a Rove account

> Transfers miles from an external source into a Rove Miles account. Requires either account ID or phone number to identify the recipient account.



## OpenAPI

````yaml https://api.staging.rovemiles.com/functions/v1/openapi post /miles/transfer/create
openapi: 3.0.3
info:
  title: Rove Miles API
  version: 0.1.0
  description: Data Utils, Flights, Hotels & Miles endpoints.
servers:
  - url: https://api.staging.rovemiles.com/functions/v1
security:
  - bearerAuth: []
tags:
  - name: Data
    description: Operations related to reference data like airports and places
  - name: Flights
    description: Operations related to flight search and booking
  - name: Hotels
    description: Operations related to hotel search and booking
  - name: Miles
    description: Operations related to miles and points management
  - name: Deals
    description: Operations related to special offers and promotions for flights and hotels
paths:
  /miles/transfer/create:
    post:
      tags:
        - Miles
      summary: Transfer miles into a Rove account
      description: >-
        Transfers miles from an external source into a Rove Miles account.
        Requires either account ID or phone number to identify the recipient
        account.
      operationId: transferMiles
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - amount
                - reference_id
              properties:
                account_id:
                  type: string
                  format: uuid
                  description: >-
                    Rove Miles account UUID of the recipient (required if
                    phone_number not provided)
                phone_number:
                  type: string
                  description: >-
                    Phone number of the recipient account (required if
                    account_id not provided)
                  pattern: ^(\+1|1)[0-9]+$
                amount:
                  type: integer
                  minimum: 1
                  maximum: 999999
                  description: 'Amount of miles to transfer (min: 1, max: 999,999)'
                reference_id:
                  type: string
                  description: Unique reference ID for the transfer (used for idempotency)
              oneOf:
                - required:
                    - account_id
                - required:
                    - phone_number
            example:
              account_id: a1b2c3d4-e5f6-7890-abcd-ef1234567890
              amount: 25000
              reference_id: transfer_1234567890
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  transaction_id:
                    type: string
                    description: Unique ID for the completed miles transfer
                  reference_id:
                    type: string
                    description: The reference ID provided in the request
                  status:
                    type: string
                    enum:
                      - success
                      - pending
                      - failed
                    description: Status of the transfer
              example:
                transaction_id: 01HQXYZ123456789ABCDEFGHIJ
                reference_id: transfer_1234567890
                status: success
        '400':
          description: Bad Request - Invalid parameters or duplicate transaction
          content:
            application/json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        message:
                          type: string
              examples:
                validation:
                  value:
                    errors:
                      - message: >-
                          Either phone_number OR account_id must be provided,
                          but not both
                duplicate:
                  value:
                    errors:
                      - message: Transaction with this reference ID already exists
                userNotFound:
                  value:
                    errors:
                      - message: User not found
        '401':
          $ref: '#/components/responses/Unauthorized'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  responses:
    Unauthorized:
      description: Unauthorized - Invalid or missing token
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            code: 401
            message: Unauthorized - Invalid or missing token
    InternalError:
      description: Internal Server Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            code: 500
            message: Internal Server Error
  schemas:
    Error:
      type: object
      properties:
        code:
          type: integer
        message:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >-
        API key for authentication. Add your API key to the Authorization header
        with this format: 'Bearer your_api_key_here'

````