---
title: "transaction-out__create-outgoing-payment"
method: POST
path: "/tools/transaction-out__create-outgoing-payment"
tags: ["Gastos"]
---

# transaction-out__create-outgoing-payment

`POST /tools/transaction-out__create-outgoing-payment`

### MCP
`create-outgoing-payment` → `transaction-out__create-outgoing-payment`.

### HTTP
`POST /api/v1/payments`

### Body obligatorio
- **`type`**: `"out"`
- **`date`**: `YYYY-MM-DD`
- **`bankAccount`**: `{ id }` o id escalar

### Asociaciones (al menos una)
- `bills`: `[{ id, amount, retentions? }]`
- `categories`: líneas de gasto (ver `line_models.categories` en fuente)
- `documentLines`: pagos a líneas de mayor (`idJournal`, `documentLineId`, `amount`)

### Opcional
`numberTemplate`, `currency`, `costCenter` (**objeto `{ id }`**, no `idCostCenter` en raíz),
`client`, `paymentMethod`, `observations`, `metadata` (string JSON), `paymentType` (Rep. Dominicana → mayúsculas en metadata).

### Errores
| Código | Significado | Acción |
|--------|-------------|--------|
| 4002 | Cuenta bancaria ausente o inválida | Enviar `bankAccount` válido |
| 4006 | Resolución no es tipo salida (transactionOut) | Elegir numeración correcta |
| 4012 | Mezcla de asociaciones incompatible | No mezclar bills con invoices en mismo pago |
| 4004 | Conflicto entre `number` y `numberTemplate` | Alinear numeración manual vs plantilla |
| 4250 | Aviso/retraso en respuesta de timbre SAT (async) | Ver `error_4250_stamp_failure` en la guía |

### Timbre async
Otros códigos de timbre pueden ir en `error` anidado según país (ver guía pública).

## Request body

- object — Body POST — create_minimum y request_body_shape en la fuente.

## Response `200`

Pago creado con numeración asignada

---

[API](https://skmtc.net/alegra/apis/ingresos.md) · [All operations](https://skmtc.net/alegra/apis/ingresos/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/alegra/ingresos/versions/cd52d3f68f1b/schema)
