Payment Methods
Create, read, update and delete payment methods (FormaDePago).
📄️ Get payment method by ID
Returns a single payment method by its primary key, including the per-company ledger account mapping (`associatedAccounts`). The response carries a strong `ETag` header with the current version.
📄️ Update payment method
Full replacement of an existing payment method. Send the `If-Match` header with the current ETag for optimistic concurrency control. `associatedAccounts` follows collection semantics: null leaves the ledger mapping untouched, [] clears it, a non-empty list replaces it.
📄️ Delete payment method
Deletes a payment method. Send the `If-Match` header with the current ETag for optimistic concurrency control. Payment methods that are referenced by existing payments cannot be deleted (`409`).
📄️ Merge-patch payment method
RFC 7396 merge-patch over `application/merge-patch+json`. Send only the fields you want to change; include a field with value `null` to remove it. Use the `If-Match` header for optimistic concurrency control.
📄️ List payment methods
Returns a paginated list of payment methods with envelope `{data, totalCount, skip, limit, hasMore}`. Supports optional RSQL `filter`, `sort` (default `lastModifiedAt:desc`), `skip`/`limit` pagination and `modifiedAfter`/`modifiedBefore` bookends.
📄️ Create payment method
Creates a new payment method. Behaviour flags that do not apply to the selected `paymentKind` are rejected with `400` (e.g. `requiresChange` outside cash kinds, `cardTerminal` outside card kinds, `taxPct` outside the foreign-currency kind). Business logic runs in the legacy WAR.
📄️ Prototype payment method for a creation form
Returns a non-persisted payment method pre-populated with backend defaults (current company, next free `code`, `enabled=true`, ledger posting enabled, usable for incoming documents). Optional JSON hints: `companyId`, `copyFromId`. Call `POST /api/v2/payment-methods` to persist.