---
title: "Emit a purchase invoice (factura de compra)"
method: POST
path: "/v1/erp/payouts/payables/create_buy_invoice"
tags: ["Payable"]
---

# Emit a purchase invoice (factura de compra)

`POST /v1/erp/payouts/payables/create_buy_invoice`

## Request

- Base URL: `https://api.cardda.com`
- URL: `https://api.cardda.com/v1/erp/payouts/payables/create_buy_invoice`
- Auth: HTTP bearer

Emits a purchase invoice to the SII (or via SimpleFactura, depending on the emitting
user's approved integration key) for a source document identified by `source_id` /
`source_type`. The source must belong to the current company and be in CLP or USD.

Emission is routed by the emitting user's approved key: if a SimpleFactura key exists it
is used, otherwise the user's SII signature key is used. Returns `200` on success (no
body).

## Parameters

- `#/paths/~1v1~1erp~1payouts~1rules/get/parameters/0` (unresolved $ref)

## Request body

- object
  - `source_id` string, required: Id of the source document to emit the invoice for.
  - `source_type` string, required: Class name of the source document.
  - `rut` string, required: RUT of the receiver.
  - `name` string, required
  - `address` string, required
  - `municipality` string, required
  - `location` string, required
  - `activity` string, required
  - `issue_date` string, date, required

## Response `200`

The purchase invoice was emitted successfully.

## Other responses

- `401`: Unauthorized — the source does not belong to the current company.
- `412`: Precondition Failed — currency not supported (`payables/currencies_not_supported`) or missing SII signature credentials (`payables/sii_signature_credentials_missing`).
- `422`: Unprocessable Entity — the SII/SimpleFactura rejected the request. Error codes include `payables/sii_credentials_rejected`, `payables/sii_rejected_dte`, and `payables/sii_exchange_rate_unavailable`.
- `502`: Bad Gateway — the SII upstream service is unavailable (`payables/sii_upstream_error`).

---

[API](https://skmtc.dev/cardda/apis/banking-api.md) - [All operations](https://skmtc.dev/cardda/apis/banking-api/llms.txt) - [OpenAPI document](https://skmtc.dev/cardda/apis/banking-api/revisions/ff1aeb3fda8b?raw)
