# `Weavr.Transfers`
[🔗](https://github.com/iamkanishka/weavr/blob/main/lib/weavr/resources/transfers.ex#L1)

Transfer transactions — move funds between instruments within the same identity.

All paths confirmed from `weavr-multi-api.redoc.ly` and Weavr's published docs.

A Transfer moves funds between managed accounts and/or managed cards that
belong to the **same** Corporate or Consumer identity. For sending funds to a
**different** identity, use `Weavr.Sends` (Outgoing Wire Transfers).

Transfers can be scheduled for future execution and can be performed in bulk
operations (see `Weavr.Bulk`).

## Confirmed endpoints

  * `POST /transfers` — create a transfer
  * `GET  /transfers/{id}` — get transfer details
  * `GET  /transfers` — list transfers

## Source and destination

Both `"source"` and `"destination"` are objects with `"type"` and `"id"`:
- `"type"` — `"managed_accounts"` or `"managed_cards"`
- `"id"` — the instrument id

## Important notes

  * Amounts are in **minor units** (e.g. 1000 = £10.00).
  * `"profileId"` is required — find it in Multi Portal > API Credentials.
  * Transfers support `idempotency-ref`.

# `create`

```elixir
@spec create(Weavr.Config.t(), map(), keyword()) ::
  {:ok, map()} | {:error, Weavr.Error.t()}
```

Creates a transfer between two instruments owned by the same identity.

`POST /transfers`

Required fields in `attrs`:
- `"profileId"` — from Multi Portal
- `"source"` — object: `%{"type" => "managed_accounts", "id" => "..."}`
- `"destination"` — object: `%{"type" => "managed_cards", "id" => "..."}`
- `"destinationAmount"` — object: `%{"currency" => "GBP", "amount" => 1000}`

Optional: `"description"`, `"tag"`, `"scheduledTimestamp"` (epoch ms for scheduled transfers).

# `get`

```elixir
@spec get(Weavr.Config.t(), String.t(), keyword()) ::
  {:ok, map()} | {:error, Weavr.Error.t()}
```

Fetches a transfer by id. `GET /transfers/{id}`.

# `list`

```elixir
@spec list(
  Weavr.Config.t(),
  keyword()
) :: {:ok, map()} | {:error, Weavr.Error.t()}
```

Lists transfers for the authenticated identity.

`GET /transfers` — supports `opts[:filters]` for `offset`, `limit`,
`profileId`, `state`, `createdFrom`, `createdTo`, `tag`.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
