German: "Rechnungen / Zahlungen"
- Attributes
- GET /invoices/payments
- GET /invoices/payments/{id}
- POST /invoices/payments
- POST /invoices/payments/bulk
- PUT invoices/payments/{id}
- DELETE /invoices/payments/{id}
The invoice payment representation contains among standard fields also shortened invoice information.
{
"id": 123,
"date": "2017-10-01",
"invoice": {
"id": 12345,
"identifier": "R1710-001",
"title": "Invoice – Website"
},
"paid_total": "17999.00",
"paid_total_in_account_currency": "17999.00",
"currency": "EUR",
"created_at": "2018-10-17T09:33:46Z",
"updated_at": "2018-10-17T09:33:46Z"
}
Retrieve all invoice payments:
curl -X GET \
'https://{domain}.mocoapp.com/api/v1/invoices/payments' \
-H 'Authorization: Token token=YOUR_API_KEY'
Additionally, these parameters can be used to filter the results set:
- invoice_id – 123
- date_from – "2018-01-01"
- date_to – "2018-01-31"
Retrieve a single invoice payment:
curl -X GET \
'https://{domain}.mocoapp.com/api/v1/invoices/payments/{id}' \
-H 'Authorization: Token token=YOUR_API_KEY'
Create an invoice payment:
curl -X POST \
'https://{domain}.mocoapp.com/api/v1/invoices/payments' \
-H 'Authorization: Token token=YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"date": "2018-10-20",
"invoice_id": 123,
"paid_total": 1000,
"currency": "EUR"
}'
Mandatory fields are marked with a star (*):
- date* – "2017-10-20"
- invoice_id* – 12345
- paid_total* – 1000
- currency – "EUR"
- partially_paid – true/false
Create multiple invoice payments in bulk:
curl -X POST \
'https://{domain}.mocoapp.com/api/v1/invoices/payments/bulk' \
-H 'Authorization: Token token=YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"bulk_data": [
{
"date": "2018-10-20",
"invoice_id": 456,
"paid_total": 2000,
"currency": "EUR"
},
{
"date": "2018-10-22",
"invoice_id": 123,
"paid_total": 1000,
"currency": "EUR"
}
]
}'
Mandatory fields are marked with a star (*):
- date* – "2018-10-20"
- invoice_id* – 12345
- paid_total* – 1000
- currency – "EUR"
Update an invoice payment:
curl -X PUT \
'https://{domain}.mocoapp.com/api/v1/invoices/payments/{id}' \
-H 'Authorization: Token token=YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"paid_total": 2000
}'
Fields are analogous to the POST request, except for the invoice_id
.
Delete an invoice payment:
curl -X DELETE \
'https://{domain}.mocoapp.com/api/v1/invoices/payments/{id}' \
-H 'Authorization: Token token=YOUR_API_KEY'