Payments

List all payments

GET /api/invoice-payments
<?xml version="1.0" encoding="UTF-8"?>
<invoice-payments type="array" page="1" per_page="100" total="2">
    <invoice-payment>
        ...
    <invoice-payment>
    <invoice-payment>
        ...
    <invoice-payment>
</invoice-payments>

You can filter the result by parameters:

GET /api/invoice-payments?invoice_id=123

List all payments for the invoice with ID 123.
The following filter parameters are available:

ParameterDescription
invoice_idID of the invoice
fromOnly payments since this date (format YYYY-MM-DD)
toOnly payments up to this date (format YYYY-MM-DD)
typePayment type (eg. CASH, BANK_TRANSFER, PAYPAL, …). More than one payment type could be given as a comma separated list. Theses payment types will be logically OR-connected.
user_idID of the user

Get single payment

GET /api/invoice-payments/{id}
<?xml version="1.0" encoding="UTF-8"?>
<invoice-payment>
    <id type="integer">1</id>
    <created type="datetime">2007-12-13T12:12:00+01:00</created>
    <invoice_id type="integer">1</invoice_id>
    <user_id type="integer">1</user_id>
    <date type="date">2009-11-04</date>
    <amount type="float">12.34</amount>
    <comment>via bank transfer</comment>
    <transaction_purpose></transaction_purpose>
    <type>BANK_TRANSFER</type>
</invoice-payment>

type can have the following values:
– INVOICE_CORRECTION
– CREDIT_NOTE
– BANK_CARD
– BANK_TRANSFER
– DEBIT
– CASH
– CHECK
– PAYPAL
– CREDIT_CARD
– COUPON
– MISC

Create payment

POST /api/invoice-payments

Payments can only be booked for invoices in the state OPEN or overdue.

XML elementDescriptionTypeDefault valueMandatory
invoice_idID of the invoiceINTyes
dateDate of paymentDATEtoday
amountPaid amountFLOATyes
commentComment textALNUM
typePayment typeALNUM (“CREDIT_NOTE”, “BANK_CARD”, “BANK_TRANSFER”, “DEBIT”, “CASH”, “CHECK”, “PAYPAL”, “CREDIT_CARD”, “COUPON”, “MISC”)
mark_invoice_as_paidIndicates whether the associated invoice should be marked as paid (set status to PAID).BOOL0 (false)
<invoice-payment>
    <invoice_id>1</invoice_id>
    <date>2009-11-03</date>
    <amount>12.34</amount>
    <comment>via bank transfer</comment>
    <type>BANK_TRANSFER</type>
</invoice-payment>
<?xml version="1.0" encoding="UTF-8"?>
<invoice-payment>
    <id type="integer">1</id>
    <created type="datetime">2007-12-13T12:12:00+01:00</created>
    <invoice_id type="integer">1</invoice_id>
    <user_id type="integer">1</user_id>
    <date type="date">2009-11-03</date>
    <amount type="float">12.34</amount>
    <comment>via bank transfer</comment>
    <transaction_purpose></transaction_purpose>
    <type>BANK_TRANSFER</type>
</invoice-payment>

Delete payment

DELETE /api/invoice-payments/{id}

Deletes a payment and set its status to OPEN or OVERDUE.