Skip to main content
These are explicit permissions: you must select them one by one in External integrations; existing integrations do not receive them automatically.
Bank IDs (bank_id) and petty cash IDs (petty_cash_id) are obtained with Banks, petty cash and checkbooks (permission treasury).
Query customer invoices with an outstanding balance and apply payments. It uses the same logic as Accounts Receivable in FileXpress.

Pending documents

Includes processed invoices of type CCF, FC and FEX with an outstanding balance, from the business’s environment, excluding those invalidated by a related document.
Sorted from the oldest document to the most recent. Errors: 404 Branch not found; 422 validation.
Document currency. The amounts in the list (total_amount, amount_paid, pending_amount, total_pending) and payments always remain 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 rate 0.128) they show what the document amounted to and how much remains in its currency. For documents in the base currency, exchange_rate, foreign_total and foreign_balance come as 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 documents with days_overdue = 0; overdue adds up the overdue ones. branch_id is required: without it (or with one from another business) it responds 404 Branch not found.

Payment history

petty_cash_id indicates the petty cash that received the payment (if applicable) and cost_center_id the payment’s cost center. Includes all of the document’s payments in date order, also reversed ones (status other than applied). Errors: 404 Invoice not found (nonexistent or belonging to another business).

Register payment

There are two ways to indicate which documents the payment applies to:
You specify each invoice 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.
  • Each document’s amount cannot exceed its outstanding balance; when it is fully covered it becomes payed, otherwise partial.
  • If you send bank_id, the bank must belong to the business; the deposit is recorded.
  • If you send petty_cash_id, the payment enters that petty cash: an income is recorded that increases its balance and, when posted, the journal entry debits the petty cash’s ledger account. Bank and petty cash are mutually exclusive.
  • cost_center_id is stored on each payment for reports; when posted, it only carries over to income statement account lines (bank, cash and receivables lines have no center).
  • We recommend sending Idempotency-Key so the payment is not duplicated if you retry.
  • Registered payments are ready to be posted in Process documents (type Customer payments).
201 response
Errors

Reverse payment

Voids an applied payment. Requires the receivables.payments permission. The payment_id is the one returned when the payment was registered or the history’s id.
200 response
Rules
  • The payment is left with status: "reversed" and no longer counts toward the balance; the invoice’s payment_status is recalculated (pending, partial or payed).
  • The bank deposit that the payment generated is offset or, if it entered a petty cash, an adjustment is recorded that deducts that amount from its balance.
  • 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_received_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