# Transfers

External TED, internal transfer between partner accounts, status, favorites and received TED credits with client-commanded refund. Input values in **cents**.

## Send TED

```http
POST /api/partner/v1/transfers/ted
Authorization: Bearer {{access_token}}
Content-Type: application/json
Idempotency-Key: a13c...

{
  "account_id": 1042,
  "amount": 25000,
  "recipientBankCode": "12345678",
  "recipientName": "Sample Recipient",
  "recipientDocument": "12345678901",
  "recipientBranch": "0001",
  "recipientAccount": "98765-4"
}
```

- **Scope:** `transfer:write` · **Required:** `account_id`, `amount` (cents) · `recipientBankCode` is the destination bank ISPB.

**Response `202`:**

```json
{ "status": "accepted", "transactionId": "...", "amount": 25000 }
```

## Internal transfer

Moves money between two partner accounts. Both source and destination are authorized against the partner before the operation.

```http
POST /api/partner/v1/transfers/internal
Authorization: Bearer {{access_token}}
Content-Type: application/json

{ "account_id": 1042, "destination_account_id": 1099, "amount": 5000 }
```

- **Scope:** `transfer:write` · **Required:** `account_id`, `destination_account_id`, `amount` (cents)

## Transfer status

```http
GET /api/partner/v1/transfers/{id}
Authorization: Bearer {{access_token}}
```

- **Scope:** `transfer:read`

## Received TED (credits)

TED credits received from other institutions, with a client-commanded return to the sender.

```http
GET  /api/partner/v1/ted/credits?account_id=1042        # list (transfer:read)
POST /api/partner/v1/ted/credits/{id}/refund             # refund (transfer:write)
Authorization: Bearer {{access_token}}
```

The listing returns `{ "data": { "credits": [ { id, numCtrlStr, amount, senderName, senderDocument, senderIspb, status, refundable, settlementDate, receivedAt } ], "total": 1 } }`, newest first (up to 50), amounts in **cents**; optional `status` filter. `refundable` stays `true` while the credit can be returned by the client.

The refund commands the FULL return of the credit to the sender through the STR0010 message (no partial amount). Body: `{ "account_id": 1042, "reason": "70" }`; `reason` is optional (default `70`) and restricted to the codes `1`, `2`, `3`, `4`, `5`, `9`, `31`, `70`, `72` and `84`. Response `202` with `data` (`refundId`, `numCtrlStr`, `amount` in cents, `status` `processing`). The amount stays reserved in the account until the outcome, which arrives through the `ted.refund.requested`, `ted.refund.completed` and `ted.refund.failed` webhooks described in [Webhooks](/en/endpoints/webhooks). A credit of another account or unknown responds `404`; a return already in flight, an already returned credit, an invalid reason or insufficient balance respond `422`.

## Favorites

```http
POST /api/partner/v1/transfers/favorites      # create (transfer:write)
GET  /api/partner/v1/transfers/favorites       # list (transfer:read)
DELETE /api/partner/v1/transfers/favorites/{id}  # delete (transfer:write)
```

Recipient favorite scoped to a partner account. **Required on creation:** `account_id`, `name`.
