# Transfer type


A transfer: goods moved from one warehouse (or bin) to another.

## Fields

### stockVersion

`String`

This document's version for [`confirmStockInExternalSystem`](/chameleoon-max/mutation/confirm-stock-in-external-system). Read it, write the
document to the external system, then confirm that version. Null before the transfer has moved
any stock.

### id

[`UUID!`](/chameleoon-max/type/uuid)

The transfer's MAX id.

### number

`String!`

The transfer's number. Every returned transfer has one.

### status

[`TransferStatus!`](/chameleoon-max/type/transfer-status)

The transfer's status.

### version

`Int`

The transfer's last event version, as in the events feed.

- Null before its first event.
- Null when an event newer than this read was committed while the transfer was being read.
  Read it again.

### effectiveAt

[`Time!`](/chameleoon-max/type/time)

When the goods count as moved.

### completedAt

[`Time`](/chameleoon-max/type/time)

When the transfer was completed. Null while it is not completed.

### cancelledAt

[`Time`](/chameleoon-max/type/time)

When the transfer was cancelled. Null while it is not cancelled.

### revision

`Int!`

How many times the completed transfer has been revised. 0 when it has not been revised.

### sourceWarehouseId

[`UUID!`](/chameleoon-max/type/uuid)

The MAX id of the warehouse the goods left.

### sourceWarehouse

[`Warehouse`](/chameleoon-max/type/warehouse)

The warehouse the goods left.

- Requires the `warehouse.read` permission. Without it, null with a `FORBIDDEN_ROLE` error at
  its path (`extensions.permission`).
- A warehouse outside your API key's warehouse scope is null with a `FORBIDDEN_SCOPE` error at
  its path (`extensions.scope` `WAREHOUSE`). This happens for the far end of a transfer that
  your API key sees from its other end.
- The rest of the transfer is returned.

### targetWarehouseId

[`UUID!`](/chameleoon-max/type/uuid)

The MAX id of the warehouse the goods went to.

### targetWarehouse

[`Warehouse`](/chameleoon-max/type/warehouse)

The warehouse the goods went to. The same access rules apply as for `sourceWarehouse`.

### legalEntityId

[`UUID`](/chameleoon-max/type/uuid)

The MAX id of the company the transfer belongs to. Null when it belongs to none.

### origin

[`TransferOrigin!`](/chameleoon-max/type/transfer-origin)

What the transfer was created from.

### externalReference

`String`

The external reference the transfer was recorded with. Null when it has none, and null without
an error when the transfer's partner is outside your API key's partner scope.

### currencyCode

`String!`

The ISO 4217 code of the transfer's currency.

### totalValue

[`Decimal`](/chameleoon-max/type/decimal)

What the moved goods were worth, without VAT, as a positive number. It is the sum of the
lines' values.

- Null while the costing of any line is pending. A completed transfer can still be pending:
  read it again later.
- Inside one valuation area, a transfer moves no value. Between two areas, it moves this much
  value out of the source warehouse's area and into the target warehouse's.
- It reads every stock movement of the document.
- Costs 10 points.

### costingPending

`Boolean!`

`true` while the costing of any line is pending.

- A completed transfer can still be pending. No event is sent when its costing is resolved:
  read it again later.
- It reads every stock movement of the document.
- Costs 10 points.

### lines

[`TransferLineConnection`](/chameleoon-max/type/transfer-line-connection)

Arguments:

- `first`: `Int`
- `after`: `String`
- `last`: `Int`
- `before`: `String`

The goods lines, by line number, then by `id`. A connection, paged with `first`/`after` or
`last`/`before`, at most 250 a page. Its cursors belong to this transfer's lines and are
refused anywhere else.

Null, with an error at its path, when its page cannot be read, for example because of a cursor
of another parent. The rest of the response is returned.

A page costs 2 + first (or last) × the cost of one node.

### transferAdvices

[`LinkedTransferAdviceConnection`](/chameleoon-max/type/linked-transfer-advice-connection)

Arguments:

- `first`: `Int`
- `after`: `String`
- `last`: `Int`
- `before`: `String`

The transfer advices this transfer carries out, linked by its header or by a line. They always
have the transfer's own two warehouses. Newest issued first. A connection, paged with
`first`/`after` or `last`/`before`, at most 250 a page.

- Requires the `transferAdvice.read` permission. Without it, null with `FORBIDDEN_ROLE` at its
  path.
- Null, with an error at its path, when its page cannot be read, for example because of a
  cursor of another parent. The rest of the response is returned.
- A page costs 2 + first (or last) × the cost of one node.

### externalRefs

[`ExternalRefConnection`](/chameleoon-max/type/external-ref-connection)

Arguments:

- `first`: `Int`
- `after`: `String`
- `last`: `Int`
- `before`: `String`

The records that other systems made of this transfer ([`setTransferExternalRef`](/chameleoon-max/mutation/set-transfer-external-ref)), at
most one per external source and side. A connection, paged with `first`/`after` or
`last`/`before`, at most 250 a page. Its cursors belong to this transfer's references and are
refused anywhere else.

- It is read with the transfer, so it requires the `transfer.read` permission, not
  `integration.read`. Without it, null with `FORBIDDEN_ROLE` at its path.
- Null, with an error at its path, when its page cannot be read, for example because of a
  cursor of another parent. The rest of the response is returned.
- A page costs 2 + first (or last) × the cost of one node.

## Used by

- [`AdviceTransferConnection`](/chameleoon-max/type/advice-transfer-connection)
- [`TransferConnection`](/chameleoon-max/type/transfer-connection)
- [`TransferEdge`](/chameleoon-max/type/transfer-edge)
- [`TransferExternalRefResult`](/chameleoon-max/type/transfer-external-ref-result)
