Skip to main content
These are explicit permissions: they must be checked one by one in External integrations; existing integrations do not receive them automatically.
Query purchases with an outstanding balance and apply payments to suppliers. It uses the same logic as Accounts payable in FileXpress.
Bank, petty cash and checkbook IDs are obtained with Banks, petty cash funds and checkbooks (treasury permission).

Pending documents

Includes non-deleted purchases with an outstanding balance, from the business environment.
Sorted from the oldest to the most recent document. Errors: 404 Branch not found; 422 validation.
Document currency. The amounts in the list (total_amount, amount_paid, pending_amount, total_pending) and the collections/payments are always in the base currency. The fields currency_code, base_currency_code, exchange_rate, foreign_total and foreign_balance are a reference added per row: for a document issued in a foreign currency (for example GTQ with a rate of 0.128) they show how much the document was and how much remains in its currency. For documents in the base currency, exchange_rate, foreign_total and foreign_balance are null. Foreign-currency documents are issued with the API v2; this route remains on v1.
Example of a row for a document issued in GTQ (rate 0.128, total 1,130.00 GTQ = 144.64 USD, no partial payments):

Current / overdue summary

current adds up the documents with days_overdue = 0; overdue, the overdue ones. branch_id is required: without it (or from another business) it responds 404 Branch not found.

Payment history

Includes all payments of the document in date order, including reversed ones (status other than applied). Errors: 404 Bill not found (nonexistent or from another business).

Register payment

There are two ways to indicate which documents the payment applies to:
You specify each purchase and the amount to apply to it.
Rules
  • All or nothing: payments are applied in a single transaction. If one document fails, none is applied.
  • The amount for each document cannot exceed its pending balance; when it is fully covered it becomes payed, otherwise partial.
  • The bank, petty cash fund and checkbook, if sent, must belong to the business. The petty cash rules (funds) and checkbook rules are validated the same way as on the web; if they fail, it responds 422 with the corresponding message.
  • cost_center_id is stored on each payment for reports. When posted to the books, it only passes to the lines of income statement accounts (for example, exchange differences); the bank, cash and supplier lines are left without a center. A nonexistent, inactive center or one with sub-centers responds 422 and no payment is applied.
  • We recommend sending Idempotency-Key so you don’t duplicate the payment if you retry.
  • Registered payments are ready to be posted in Process documents (type Pagos a proveedores, supplier payments).
Response 201
Errors

Reverse payment

Cancels an applied payment. Requires the payables.payments permission. The payment_id is the one returned when registering the payment or the id from the history.
Response 200
Rules
  • The payment is left with status: "reversed" and no longer counts toward the balance; the purchase’s payment_status is recalculated (pending, partial or payed).
  • The effect on the bank, petty cash fund or checkbook that generated the payment is offset.
  • accounting indicates what happened to the payment’s journal entry (see Payment reversal and its journal entry): none (not yet posted; journal_entry_id, entry_code and status are null), deleted (the entry was in Draft and was marked ELIMINADA) or reversed (a mirror entry was created with reference payment_made_reversal, dated today; status according to the corresponding Status when processing setting).
  • Without reason, reversal_reason is Payment reversed.
  • We recommend sending Idempotency-Key.
Errors