List invoices
GET
client/invoices
API Token required
read
access_invoices
Returns a list of invoices
Query-Parameter
| Feld | Datentyp | Beschreibung |
|---|---|---|
| status | string | Only return invoices with a specified status. Examples: Paid, Unpaid. |
| type | string | Only return invoices with items of a specific type. Values: Hosting, Donation. |
| transactions | boolean | Only return invoices with transactions. |
Response-Params
| Feld | Datentyp | Beschreibung |
|---|---|---|
| data[].id | int | Invoice ID |
| data[].duedate | string | Invoice due date |
| data[].date | date | Invoice date |
| data[].subtotal | float | Invoice subtotal |
| data[].total | float | Invoice total |
| data[].status | string | Invoice status |
| data[].items[].type | string | The invoice type |
curl -X GET \
-G 'https://api.pph.sh/client/invoices' \
-H 'Authorization: Bearer ${ACCESS_TOKEN}' \
-H 'Content-Type=application/json' \
-H 'Accept=application/json' \
-H 'Accept-Language=de; *;q=0.5' | jq
-G 'https://api.pph.sh/client/invoices' \
-H 'Authorization: Bearer ${ACCESS_TOKEN}' \
-H 'Content-Type=application/json' \
-H 'Accept=application/json' \
-H 'Accept-Language=de; *;q=0.5' | jq
{
"data": [
{
"id": 212032,
"duedate": "2022-12-26T23:00:00.000000Z",
"datepaid": "2022-11-17T03:00:32.000000Z",
"date": "2022-11-16T23:00:00.000000Z",
"subtotal": 0,
"credit": 0,
"tax": 0,
"taxrate": 19,
"total": 0,
"status": "Paid",
"status_label": "Bezahlt",
"is_open": false,
"items": [
{
"id": 246676,
"invoiceid": 212032,
"type": "Domain",
"short_description": "Domain Verl\u00e4ngerung - pph.sh - 1 Jahr(e) (27.12.2022 - 26.12.2023)",
"description": "Domain Verl\u00e4ngerung - pph.sh - 1 Jahr(e) (27.12.2022 - 26.12.2023)",
"relid": 5373,
"amount": "0.00",
"taxed": 1
}
],
"resources": {
"invoice": "https:\/\/api.pph.sh\/client\/invoices\/212032",
"download": "https:\/\/api.pph.sh\/client\/invoices\/212032\/download"
}
}
]
}
Get single invoice
GET
client/invoices/:invoiceId
API Token required
read
access_invoices
Returns a single invoice
URL-Parameter
| Feld | Datentyp | Beschreibung |
|---|---|---|
| invoiceId | int | The invoice id. required |
curl -X GET \
-G 'https://api.pph.sh/client/invoices/<invoiceId>' \
-H 'Authorization: Bearer ${ACCESS_TOKEN}' \
-H 'Content-Type=application/json' \
-H 'Accept=application/json' \
-H 'Accept-Language=de; *;q=0.5' | jq
-G 'https://api.pph.sh/client/invoices/<invoiceId>' \
-H 'Authorization: Bearer ${ACCESS_TOKEN}' \
-H 'Content-Type=application/json' \
-H 'Accept=application/json' \
-H 'Accept-Language=de; *;q=0.5' | jq
{
"data": {
"id": 130348,
"duedate": "2020-06-26T22:00:00.000000Z",
"datepaid": "-000001-11-29T23:06:32.000000Z",
"date": "2020-06-27T22:00:00.000000Z",
"subtotal": 6.68,
"credit": 1,
"tax": 1.27,
"taxrate": 19,
"total": 7.95,
"status": "Cancelled",
"status_label": "Storniert",
"is_open": false,
"items": [
{
"id": 140373,
"invoiceid": 130348,
"type": "Hosting",
"short_description": "KVM Konfigurierbar (SSD) - 23633-41003.pph-server.de (27.06.2020 - 26.07.2020)",
"description": "KVM Konfigurierbar (SSD) - 23633-41003.pph-server.de (27.06.2020 - 26.07.2020)\nBetriebssystem: Windows (Log-In ready)\nProzessor: 2 Kerne\nRAM: 4GB RAM\nNVMe SSD Speicher: 50GB SSD\nNetzwerkgeschwindigkeit: bis zu 200 MBit\/s",
"relid": 23633,
"amount": 7.95,
"taxed": 1,
"donation": false
}
],
"donation_invoice": false,
"resources": {
"invoice": "https:\/\/api.pph.sh\/client\/invoices\/130348",
"download": "https:\/\/api.pph.sh\/client\/invoices\/130348\/download"
}
}
}
Download invoice pdf
GET
client/invoices/:invoiceId/download
API Token required
read
access_invoices
Returns an invoice as application/pdf attachment
curl -X GET \
-G 'https://api.pph.sh/client/invoices/<invoiceId>/download' \
-H 'Authorization: Bearer ${ACCESS_TOKEN}' \
-H 'Content-Type=application/json' \
-H 'Accept=application/json' \
-H 'Accept-Language=de; *;q=0.5' | jq
-G 'https://api.pph.sh/client/invoices/<invoiceId>/download' \
-H 'Authorization: Bearer ${ACCESS_TOKEN}' \
-H 'Content-Type=application/json' \
-H 'Accept=application/json' \
-H 'Accept-Language=de; *;q=0.5' | jq
Pay invoice with credit
POST
client/invoices/:invoiceId/pay
API Token required
read
access_invoices
URL-Parameter
| Feld | Datentyp | Beschreibung |
|---|---|---|
| id | int | The invoice id. required |
curl -X POST \
-G 'https://api.pph.sh/client/invoices/<invoiceId>/pay' \
-H 'Authorization: Bearer ${ACCESS_TOKEN}' \
-H 'Content-Type=application/json' \
-H 'Accept=application/json' \
-H 'Accept-Language=de; *;q=0.5' | jq
-G 'https://api.pph.sh/client/invoices/<invoiceId>/pay' \
-H 'Authorization: Bearer ${ACCESS_TOKEN}' \
-H 'Content-Type=application/json' \
-H 'Accept=application/json' \
-H 'Accept-Language=de; *;q=0.5' | jq
Remove credit from unpaid invoice.
POST
client/invoices/:invoiceId/remove-credit
API Token required
read
access_invoices
URL-Parameter
| Feld | Datentyp | Beschreibung |
|---|---|---|
| id | int | The invoice id. required |
curl -X POST \
-G 'https://api.pph.sh/client/invoices/<invoiceId>/remove-credit' \
-H 'Authorization: Bearer ${ACCESS_TOKEN}' \
-H 'Content-Type=application/json' \
-H 'Accept=application/json' \
-H 'Accept-Language=de; *;q=0.5' | jq
-G 'https://api.pph.sh/client/invoices/<invoiceId>/remove-credit' \
-H 'Authorization: Bearer ${ACCESS_TOKEN}' \
-H 'Content-Type=application/json' \
-H 'Accept=application/json' \
-H 'Accept-Language=de; *;q=0.5' | jq
Download invoice archive
GET
client/invoices/download/archive
API Token required
read
access_invoices
Creates and responds with a zip archive containing invoices. Can have all invoices, specific hosting invoices, domain invoices or just invoices with transactions. Content-Type: application/zip
curl -X GET \
-G 'https://api.pph.sh/client/invoices/download/archive' \
-H 'Authorization: Bearer ${ACCESS_TOKEN}' \
-H 'Content-Type=application/json' \
-H 'Accept=application/json' \
-H 'Accept-Language=de; *;q=0.5' | jq
-G 'https://api.pph.sh/client/invoices/download/archive' \
-H 'Authorization: Bearer ${ACCESS_TOKEN}' \
-H 'Content-Type=application/json' \
-H 'Accept=application/json' \
-H 'Accept-Language=de; *;q=0.5' | jq