Invoice payments¶
Current version: 1.0.1
Create¶
- POST /api2/facturen/(int: id)/betalingen¶
Create a new payment for an invoice
Example request:
POST /api2/facturen/42/betalingen HTTP/1.1 Host: demo.recras.nl Accept: application/json { betaalmethode_id: 1, bedrag: 19.95, wanneer: "2018-05-14T17:09:00.000Z" }
Example response:
HTTP/1.1 201 Created Content-Type: application/json Location: /api2/facturen/42/betalingen/1 { "id": 1, "factuur_id": 42, "wanneer": "2018-05-14T19:09:00+02:00", "bedrag": 19.95, "opmerking": "", "betaalmethode_id": 1, "pos_id": null, "location_id": null, "btw": { "6": { "btw": 1.1292452830189, "bedrag": 18.820754716981 } }, "klant": { "id": 666, "naam": "De Vil" } }
- JSON Parameters:
betaalmethode_id (int) – the ID of the used payment method. Default value is
null
bedrag (float) – Required the paid amount
wanneer (date) – an ISO8601 date on which the payment was made. Default value is the current date/time
- Response Headers:
Location – The location of the new payment
- Status Codes:
201 Created – Payment made
406 Not Acceptable – Mistake in the input
403 Forbidden – User does not have the permission
createFactuurBetaling
oreditFactuurBetaling
Update¶
- PUT /api2/facturen/(int: id)/betalingen/(int: id)¶
Update an existing payment on an invoice
Example request:
PUT /api2/facturen/42/betalingen/1 HTTP/1.1 Host: demo.recras.nl Accept: application/json { "id": 1, "factuur_id": 42, "wanneer": "2018-05-14T19:09:00+02:00", "bedrag": 19.95, "opmerking": "", "betaalmethode_id": 2, "pos_id": null, "location_id": null, "btw": { "6": { "btw": 1.1292452830189, "bedrag": 18.820754716981 } }, "klant": { "id": 666, "naam": "De Vil" } }
Read¶
- GET /api2/facturen/(int: id)/betalingen¶
Example request:
GET /api2/facturen/42/betalingen HTTP/1.1 Host: demo.recras.nl Accept: application/json
Example response:
HTTP/1.1 200 OK Content-Type: application/json [ { "id": 1, "factuur_id": 42, "wanneer": "2018-05-14T19:09:00+02:00", "bedrag": 19.95, "opmerking": "", "betaalmethode_id": 1, "pos_id": null, "location_id": null, "btw": { "6": { "btw": 1.1292452830189, "bedrag": 18.820754716981 } }, "klant": { "id": 666, "naam": "De Vil" } }, ]
- Request Headers:
Authorization – mandatory Basic authentication
- Query Parameters:
embed (string) – Comma-separated list of related entities to embed in the result. Accepts
Creator
, andFactuur
(invoice)Factuur.context (string) – Comma-separated list of Invoice contexts to filter the payments by. Implicitly embeds invoice
- Status Codes:
200 OK – no error
- GET /api2/facturen/(int: id)/betalingen/(int: id)¶
A specific payment
Example request:
GET /api2/facturen/42/betalingen/1 HTTP/1.1 Host: demo.recras.nl Accept: application/json
Example response:
HTTP/1.1 200 OK Content-Type: application/json { "id": 1, "factuur_id": 42, "wanneer": "2018-05-14T19:09:00+02:00", "bedrag": 19.95, "opmerking": "", "betaalmethode_id": 1, "pos_id": null, "location_id": null, "btw": { "6": { "btw": 1.1292452830189, "bedrag": 18.820754716981 } }, "klant": { "id": 666, "naam": "De Vil" } }
- Status Codes:
200 OK – OK
404 Not Found – No payment with this
id
Delete¶
- DELETE /api2/facturen/(int: id)/betalingen/(int: id)¶
Example request:
DELETE /facturen/42/betalingen/1 HTTP/1.1 Host: demo.recras.nl
Example response:
HTTP/1.1 200 OK
- Status Codes:
200 OK – Payment deleted
403 Forbidden – User does not have the permission
editFactuurBetaling