Payment updates and deletes
New: Update and delete a payment by its own id
You can now edit or remove a recorded payment directly — these are the first payment endpoints that aren’t scoped under an invoice or bill.
Update a payment
All fields are optional, but at least one is required: amount, paymentMethod, paymentDate, notes, paymentReference — the same set accepted on create. status is not exposed here, matching the Coperniq UI’s edit form.
Notes
- If the payment is external (processed by Stripe),
PATCHonly acceptsnotes— any other field returns400.DELETEis rejected outright for external payments; use a refund instead. - Changing
amountcan return400if the new total would exceed the parent invoice’s or bill’s outstanding balance. - Updating or deleting a payment recalculates the parent invoice’s/bill’s
amountPaidand status automatically (e.g. back toPARTIALLY_PAIDorSENTafter a delete). - Responses use the same
Payment/BillPaymentshape as the existing list/get endpoints —billNumberfor a bill payment,invoiceNumberfor an invoice payment.
Choose the company for a new API key
POST /api-keys (and its legacy alias GET /token) now accepts an optional company_id query parameter, for accounts where the same login belongs to more than one company. Your company ID can be found in the URL after logging in to the Coperniq UI: https://app.coperniq.io/{company_id}/inbox.
- If you belong to more than one company and pass
company_id, the new key is created against that company. You must belong to it, or the request is rejected. - If
company_idis omitted, the company is now chosen deterministically: your first non-collaborator company, falling back to your first company. Previously this could disagree with which company the key actually got created against, occasionally surfacing as aFailed to fetch tokenerror even though a key had been created — just against an unexpected company. - Single-company accounts are unaffected either way.
