Core Resources

Credit and Collection

Commercial terms, credit limits, collection discounts and the account statement of a customer.

Overview

Each customer has commercial terms (commercial_terms on the customer object): a default payment term, a salesperson and a price list for new documents. Credit limits are set per currency and checked when an invoice is issued, following the company policy in Settings > Customers > Credit and collection (off, warn or block).

Endpoints

MethodPathPermissionDescription
POST/v1/customers/{id}writeSet payment_term_id, salesperson_id and price_list_id (null clears them)
GET/v1/customers/{id}/creditreadCredit policy and limit per currency with used and available
POST/v1/customers/{id}/credit_limitsadminSet the limit of one currency (credit_limit null removes it)
GET/v1/customers/{id}/statementreadAccount statement (currency, from, to)
GET/v1/invoices/{id}/discountsreadCollection discounts of an invoice
POST/v1/invoices/{id}/discountswriteApply a collection discount
DELETE/v1/invoices/{id}/discounts/{discountId}adminRemove a collection discount

Account Statement

1curl "https://api.corebill.io/v1/customers/acme-corp/statement?currency=PEN&from=2026-01-01" \
2 -H "Authorization: Bearer sk_live_your_api_key"
  • Charges: invoices, debit notes, refunds and credit sent to the wallet. Credits: payments, credit notes, collection discounts and write-offs
  • Each line carries the running balance. open_invoices and aging are as of today
  • Without from the statement starts at the first movement; one currency per statement (currencies lists the others)

Collection Discounts

1curl -X POST "https://api.corebill.io/v1/invoices/inv_a1b2c3/discounts" \
2 -H "Authorization: Bearer sk_live_your_api_key" \
3 -H "Content-Type: application/json" \
4 -d '{ "amount": 0.4, "reason": "rounding" }'
  • A discount is not a payment: it does not count as income and does not go to cash or treasury
  • Reasons: rounding (default), early_payment, withholding, other
  • The company limits (max amount and percent) apply unless the key has admin permission. Disabled discounts return 403 discount_disabled