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

# Transfer a prepayment to another purchase order

> Move all or part of a prepayment's credit to another purchase order or production-run work
order of the same vendor. Send exactly one target: `purchase_order_id` or `work_order_id`.

- Omit `amount` to move everything still on the source. To another purchase order, from the
  home purchase order, the prepayment is repointed to the target (`purchase_order_id`
  changes).
- Send a smaller `amount` to move part of it, or move any amount to a work order: the
  prepayment stays one record on its home PO and the moved slice is returned in `allocations`.
- Send `from_work_order_id` to move credit off a production-run work order instead of off the
  home purchase order: the slices already moved onto that run, or the whole deposit when it
  was recorded straight onto that one run. A prepayment that is not on a purchase order can
  only be moved this way. Credit on a run settles no payment milestone, so it lands
  unscheduled on the target.

A prepayment that settles a payment milestone on its PO moves onto the target's earliest
open milestone of the same type; if the target has none, the transfer is refused (`422`).
No over-value warning is raised for the target PO. QuickBooks is not called (the
deposit is vendor-level and does not change).




## OpenAPI

````yaml /api-reference/build.yaml post /prepayments/{id}/transfer
openapi: 3.0.0
info:
  title: Luminous API
  version: 1.0.0
  description: API documentation for Luminous
servers:
  - url: https://{companyName}.api.joinluminous.com/external/api/v1
    variables:
      companyName:
        default: companyName
        description: Your company-specific subdomain
security: []
tags:
  - name: Products
    description: Get and manage products
  - name: Pricing
    description: Manage price schedules, levels, and customizations
  - name: BOMs
    description: Manage Bills of Materials (BOMs)
  - name: Labels
    description: Label rendering via Labelary ZPL service
  - name: Companies
    description: Manage business accounts and their associated data
  - name: Contacts
    description: Manage contact information for individuals
  - name: Suppliers
    description: Manage suppliers (factories) — vendors used on purchase orders
  - name: Supplier SKUs
    description: Manage per-supplier SKU and unit-cost overrides for products
  - name: Locations
    description: Manage warehouses and locations
  - name: Inventory
    description: Get and adjust product stock levels
  - name: Lots
    description: Create, update, and delete product lots (batches)
  - name: Transfer Orders
    description: Manage transfer orders
  - name: Fulfillment Orders
    description: Manage fulfillment orders and picklists
  - name: Freight
    description: >-
      Freightview LTL freight — quotes, booking and documents for fulfillment
      orders
  - name: Fulfillment Priority Lists
    description: Configure fulfillment routing priority lists
  - name: Purchase Orders
    description: Get and modify purchase orders
  - name: Supplier Portal
    description: >-
      Read a supplier's response to a purchase order and control the one-click
      portal link
  - name: Receiving Reports
    description: Manage receiving reports
  - name: Defective Reports
    description: >-
      Record and list defective units received on purchase orders (Inventory >
      Defectives)
  - name: Payment Obligations
    description: Manage payment obligations for purchase orders
  - name: Sales Orders
    description: Manage sales orders and sales order shipments
  - name: Purgatory
    description: >-
      Inspect and resolve non-posted sales orders in the purgatory staging
      workflow
  - name: PickFlow Warehouse
    description: >-
      Warehouse-floor lookups for PickFlow — barcode resolution, bin and product
      stock, bin search, and receivables
  - name: PickFlow Shipping
    description: >-
      Provider-agnostic shipping rates, services, packages, and label purchase
      for PickFlow
  - name: Cycle Counts
    description: >-
      Create, drive, and post PickFlow cycle counts — batches, per-warehouse
      sessions, and CSV import/export
  - name: Print Stations
    description: List paired print stations and enqueue print jobs to them
  - name: Invoices
    description: Get and manage invoices
  - name: Work Orders
    description: >-
      Manage work orders — production lifecycle, steps, materials, links,
      shipments, and comments
  - name: Production Batches
    description: Group and manage work orders as production batches
  - name: Bills
    description: >-
      Accounts payable bill management, payments, attachments, allocations, and
      variance
  - name: Prepayments
    description: Manage vendor prepayments and applications
  - name: Vendor Credits
    description: Manage vendor credits and applications
  - name: Vendor Returns
    description: Manage vendor returns and credit generation
  - name: Customer Returns
    description: Manage customer returns (sales returns), receiving, and restock behavior
  - name: Stock Snapshot
    description: Point-in-time stock snapshots with export support
  - name: Consumption
    description: Consumption reports and exports
  - name: Inventory Aging
    description: Cost-layer-based inventory aging reports
  - name: Bills Reports
    description: Accounts payable bills aging reports
  - name: Forecast
    description: Materialized forecast data
  - name: Reports
    description: Close the books, inventory discrepancy, transaction COGS, and EDI reports
  - name: Tags
    description: Add/remove tags across various resources
  - name: Custom Fields
    description: Get and set custom fields across various resources
  - name: Approvals
    description: >-
      Approval rules that hold sales orders and supplier POs for sign-off, and
      their approver templates
  - name: Currency
    description: Currency configuration, exchange rates, and conversion
  - name: Drive
    description: >
      Browse, upload, tag and manage files in your Luminous Drive. An API token
      sees the shared

      drive only, never My Files or restricted folders and files. Every write
      and download made

      through the API is recorded in the file's activity log (`GET
      /file-cabinet/files/{id}/activity`)

      with `actor_kind: api_token`.
  - name: Integration Mappings
    description: Manage integration mappings for external systems
  - name: Integration Field Mappings
    description: Manage field-level mappings between Luminous and external systems
  - name: Automations
    description: Create, test, and inspect automation rules and their runs
paths:
  /prepayments/{id}/transfer:
    post:
      tags:
        - Prepayments
      summary: Transfer a prepayment to another purchase order
      description: >
        Move all or part of a prepayment's credit to another purchase order or
        production-run work

        order of the same vendor. Send exactly one target: `purchase_order_id`
        or `work_order_id`.


        - Omit `amount` to move everything still on the source. To another
        purchase order, from the
          home purchase order, the prepayment is repointed to the target (`purchase_order_id`
          changes).
        - Send a smaller `amount` to move part of it, or move any amount to a
        work order: the
          prepayment stays one record on its home PO and the moved slice is returned in `allocations`.
        - Send `from_work_order_id` to move credit off a production-run work
        order instead of off the
          home purchase order: the slices already moved onto that run, or the whole deposit when it
          was recorded straight onto that one run. A prepayment that is not on a purchase order can
          only be moved this way. Credit on a run settles no payment milestone, so it lands
          unscheduled on the target.

        A prepayment that settles a payment milestone on its PO moves onto the
        target's earliest

        open milestone of the same type; if the target has none, the transfer is
        refused (`422`).

        No over-value warning is raised for the target PO. QuickBooks is not
        called (the

        deposit is vendor-level and does not change).
      operationId: transferPrepayment
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: Prepayment ID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                purchase_order_id:
                  type: integer
                  description: >-
                    Target purchase order. Must be from the same vendor and not
                    deleted. Required unless `work_order_id` is sent; send this
                    or `work_order_id`, not both.
                work_order_id:
                  type: integer
                  description: >-
                    Target production-run work order. Must be from the same
                    vendor and not cancelled. Required unless
                    `purchase_order_id` is sent; send this or
                    `purchase_order_id`, not both. Prepayments can be linked to
                    work orders only on accounts where that is enabled;
                    otherwise the transfer is refused (`422`).
                amount:
                  type: number
                  nullable: true
                  exclusiveMinimum: true
                  minimum: 0
                  description: >-
                    Amount to move. Must be more than 0 and no more than what is
                    still on the source (the prepayment's purchase order, or the
                    work order named in `from_work_order_id`). Omit (or `null`)
                    to move all of it.
                from_work_order_id:
                  type: integer
                  nullable: true
                  description: >-
                    Move credit off this production-run work order instead of
                    off the prepayment's purchase order. The run must hold
                    slices moved onto it, or the whole deposit when it was
                    recorded straight onto that one run.
      responses:
        '200':
          description: >-
            The transferred prepayment (top-level object, not wrapped in
            `data`).
          content:
            application/json:
              schema:
                type: object
                description: A vendor prepayment (deposit).
                properties:
                  id:
                    type: integer
                  vendor_id:
                    type: integer
                  purchase_order_id:
                    type: integer
                    nullable: true
                    description: The prepayment's home purchase order.
                  purchase_order_shipment_id:
                    type: integer
                    nullable: true
                    description: >-
                      Purchase order shipment the deposit was paid for; `null`
                      when none was given.
                  currency_code:
                    type: string
                  amount:
                    type: number
                  base_amount:
                    type: number
                  exchange_rate:
                    type: number
                  unapplied_amount:
                    type: number
                  base_unapplied_amount:
                    type: number
                  payment_date:
                    type: string
                    format: date
                    nullable: true
                  reference:
                    type: string
                    nullable: true
                  notes:
                    type: string
                    nullable: true
                  auto_apply:
                    type: boolean
                  voided_at:
                    type: string
                    format: date-time
                    nullable: true
                  void_reason:
                    type: string
                    nullable: true
                  is_voided:
                    type: boolean
                  quickbooks_sync_status:
                    type: string
                    nullable: true
                  quickbooks_detailed_message:
                    type: string
                    nullable: true
                  quickbooks_purchase_id:
                    type: string
                    nullable: true
                  quickbooks_last_synced_at:
                    type: string
                    format: date-time
                    nullable: true
                  bill_pay_owned:
                    type: boolean
                    nullable: true
                    description: Set by the list endpoint only; `null` on other responses.
                  created_at:
                    type: string
                    format: date-time
                    nullable: true
                  purchase_order_shipment:
                    type: object
                    nullable: true
                    description: >-
                      The linked purchase order shipment, or `null` when none.
                      Present on the list and create responses.
                    properties:
                      id:
                        type: integer
                      reference_number:
                        type: string
                        nullable: true
                  vendor:
                    type: object
                    nullable: true
                    description: Present only when loaded.
                    properties:
                      id:
                        type: integer
                      factory_name:
                        type: string
                        nullable: true
                  applications:
                    type: array
                    description: >-
                      Bill applications. Present only when loaded (list and
                      show).
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                        bill_id:
                          type: integer
                        bill_number:
                          type: string
                          nullable: true
                        amount:
                          type: number
                        applied_at:
                          type: string
                          nullable: true
                        reversed_at:
                          type: string
                          nullable: true
                  purchase_orders:
                    type: array
                    description: Linked purchase orders. Present only when loaded.
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                        po_number:
                          type: string
                        linked_at:
                          type: string
                          nullable: true
                        linked_by:
                          type: integer
                          nullable: true
                        amount:
                          type: number
                          nullable: true
                          description: >-
                            This purchase order's share of the deposit; `null`
                            when the deposit was never split.
                  work_orders:
                    type: array
                    description: >-
                      Linked production-run work orders. Present only when
                      loaded.
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                        work_order_number:
                          type: string
                        production_batch_id:
                          type: integer
                          nullable: true
                        linked_at:
                          type: string
                          nullable: true
                        linked_by:
                          type: integer
                          nullable: true
                        amount:
                          type: number
                          nullable: true
                          description: >-
                            This work order's share of the deposit; `null` when
                            never split.
                  allocations:
                    type: array
                    description: >-
                      Slices of the credit moved off the home purchase order by
                      a partial transfer. `amount` minus the sum of these is
                      what is still on `purchase_order_id`. Present only when
                      loaded (e.g. on the transfer response).
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                        purchase_order_id:
                          type: integer
                          nullable: true
                        work_order_id:
                          type: integer
                          nullable: true
                        payment_obligation_id:
                          type: integer
                          nullable: true
                          description: >-
                            The payment milestone the slice settles on its
                            target, if any.
                        amount:
                          type: number
                        created_at:
                          type: string
                          format: date-time
                          nullable: true
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
        '404':
          description: >-
            Prepayment not found, or the target purchase order, target work
            order or `from_work_order_id` work order not found.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
        '409':
          description: >-
            The prepayment changed while it was being transferred. Reload and
            try again.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
        '422':
          description: >-
            Validation error (sending neither or both of `purchase_order_id` and
            `work_order_id`), or the transfer is refused: the prepayment is
            voided, not on a purchase order (and no `from_work_order_id` was
            sent), still applied to a live bill, or managed by a disconnected /
            unmapped bill-pay connection; the target PO is deleted, from another
            vendor, or already the prepayment's PO; the target work order is
            cancelled, from another vendor, or already holds the credit being
            moved; the amount is out of range; or the prepayment settles a
            milestone and the target has no open milestone of that type.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
      security:
        - BearerAuth: []
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        Authenticate using a bearer token. To create a token, navigate to
        /settings/api-tokens and click Create API Token.

````

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