Skip to main content
POST
Register purchase (v2)

Authorizations

X-API-Key
string
header
required

Integration API Key (Integrations → New Integration).

Headers

Idempotency-Key
string

Optional. Unique key per operation (max. 120 characters; more than 120 returns 422 validation_error). Valid for 24 h per integration. A retry with the same key and the same body returns the original response (same code and body) with the header Idempotent-Replay: true, without issuing again. With a different body or endpoint it returns 422 idempotency_key_reused; while the first request is still in progress, 409 idempotency_in_progress. Only 2xx and 422 responses are stored; a 5xx, 401, 403, 404 or 429 error is not stored and can be retried with the same key.

Maximum string length: 120

Body

application/json
branch_id
string<uuid>
required

Branch.

provider_id
string<uuid>
required

Supplier.

document_type
enum<string>
required

Document type.

Available options:
ccf,
fse,
ticket
date
string<date>
required

Date.

is_credit
boolean
required

On credit.

products
object[]
required
credit_days
integer

Credit days.

observation
string

Notes.

number_control
string

DTE control number.

generation_code
string

Generation code.

stamp
string

Stamp.

cost_center_id
string<uuid>

Cost center of the purchase (leaf and active; GET /accounting/cost-centers).

totals
object

Calculated mode: if totals.expenseTotalToPayment is omitted, the server calculates line amounts, VAT (IVA), fixed charges and total; totalRetein and totalRent are sent by you.

cost_center_distribution_id
string<uuid> | null

Active distribution: the expense is split among its centers by percentage. Mutually exclusive with cost_center_id at the same level (422 Indique centro de costo o distribución, no ambos.).

currency_code
string

Document currency (3 letters, for example GTQ). Must be active for the business (GET /v2/currencies). If omitted or equal to the base currency, the document is in base currency. All amounts are in this currency.

Required string length: 3
exchange_rate
number

Units of base currency per 1 unit of currency_code. If omitted, the rate in effect on the document date is used.

Required range: x > 0

Response

Purchase registered