List payments
List payments received, newest first, 20 per page by default.
query Parameters
per_pageinteger · min: 1 · max: 250Results per page, maximum 250. The default depends on the endpoint: 25 for invoices and contacts, 50 for products, 20 for payments, purchases and tags, 15 for OCP links. Responses carry
links.next(null on the last page) andmeta.current_page/meta.last_page; request the next page withpage=<n>.Example: 100pageinteger · min: 1The page to return.
customer_idintegerOnly this contact's payments.
startdatestring · datePayments on or after this date (
Y-m-d).enddatestring · datePayments on or before this date (
Y-m-d).paymentmethod_idintegerOnly payments with this payment method.
Headers
Acceptstringapplication/json
Responses
OK
dataobject[]linksobjectmetaobject
Create a new payment
Record a payment received from a customer and settle invoices with it.
Note that invoicesPaid is a JSON-encoded string. Open the request body's Examples dropdown for a payment against an invoice and an advance payment; the 422 tab shows a wrong unpaidAmount.
Headers
Acceptstringapplication/json
Request Body
customerIdinteger · requiredRequired. The contact who paid.
dateOccurredstring · date · requiredRequired. Payment date,
Y-m-d.amountnumber · min: 0.1 · requiredRequired. The amount received.
paymentMethodinteger · requiredRequired. A payment method id from
GET /account→data.relations.paymentMethods.paymentTypeinteger · enum · requiredRequired. 1 or 2: the payment settles the invoices in
invoicesPaid(the two differ only in the web form). 3: no invoices; the whole amount becomes credit on the customer.Enum values:123amountLeftOvernumber · min: 0 · requiredRequired. Part of
amountnot assigned to invoices; it becomes credit on the customer.selectionsAmountnumber · min: 0 · requiredRequired. Total assigned to invoices.
invoicesPaidstringRequired for
paymentType1 or 2. A JSON string (not an array) with one object per invoice:{"id": <invoice id>, "paymentAmount": <amount for this invoice>, "unpaidAmount": <what stays unpaid>}.idis the numeric id fromGET /invoices.unpaidAmountmust equal the invoice's remaining amount minuspaymentAmount, or you get 422.infostringA note, e.g. the bank reference.
transactionIDstringOptional bank or gateway reference; returned as
transactionId.
Responses
Created.
dataobject