Facturen API (EM v2.0)
Inhoudsopgave
Inleiding
De facturen API maakt het mogelijk om factuurgegevens op te vragen waartoe u toegang heeft. De facturen API maakt gebruikt van Representational State Transfer (REST) om gegevens via het web te ontsluiten.
Heb je vragen of opmerkingen over de mogelijkheden tot data-ontsluiting of andere technische vragen, neem dan contact op met de servicedesk van Energiemissie via support@energiemissie.nl.
Fair use policy
De API wordt beschikbaar gesteld op basis van een ‘fair use’ policy. Bij overmatig gebruik, bijvoorbeeld door in korte tijd meerdere malen de totale historie opnieuw binnen te halen, kunnen wij kosten in rekening brengen of uw account tijdelijk- of geheel intrekken.
Standaardinformatie
Content-Type: application/json
Voor de uitwisseling van gegevens wordt er gebruikt gemaakt van JSON. De webservice accepteert in een POST request uitsluitend een JSON en geeft altijd een JSON-response terug.
Statuscodes
Waar mogelijk wordt gebruikt gemaakt van de juiste http-statuscodes. De statuscodes die gehanteerd worden zijn conform de richtlijnen van W3C.
De statuscodes die de API hanteert zijn:
- 200 - OK
- 401 - Unauthorized
- 403 - Forbidden
- 404 - Not Found
- 500 - Internal Server Error
Base URL
De basis-URI van de webservice is als volgt: https://mijnenergiemissie.nl
Authenticatie
Om gebruik te kunnen maken van de EM webservice v2 dient de api key in de x-api-key header te worden mee gestuurd.
Voorbeeldrequest met authenticatie:
curl -XPOST -H "Content-type: application/json"
-H "X-API-KEY: xxxxx.apikey"
https://mijnenergiemissie.nl/webservice/v2/path
De instructie voor het aanmaken van een API-key vind je hier.
Resources
GET: Invoices
URL:
GET /webservice/v2/invoices
PARAMETERS:
| Name | Description |
|---|---|
| supplier | string (query) |
| date-start | string (query): yyyy-mm-dd |
| date-end | string (query): yyyy-mm-dd |
RESPONSE:
List of invoices (code: 200 - OK)
VOORBEELD:
[
{
"id": 0,
"reference_id": "string",
"type_code": "string",
"date": "2022-01-01T00:00:00+01:00",
"due_date": "2022-01-01T00:00:00+01:00",
"supplier": "string",
"amount_ex_vat": "string",
"amount_in_vat": "string",
"vat_amount": "string",
"period_start": "2022-01-01T00:00:00+01:00",
"period_end": "2022-01-01T00:00:00+01:00",
"created_at": "2022-01-01T00:00:00+01:00"
}
]
GET: Invoices ophalen per ID
URL:
GET /webservice/v2/invoices/{id}
PARAMETERS:
| Name | Description |
|---|---|
| id | string (path) |
RESPONSE:
Invoice object (code: 200 - OK)
VOORBEELD:
{
"id": 0,
"reference_id": "string",
"status": "string",
"type_code": "string",
"date": "2022-01-01T00:00:00+01:00",
"due_date": "2022-01-01T00:00:00+01:00",
"supplier": "string",
"supplier_vat_nr": "string",
"supplier_kvk_nr": "string",
"supplier_city": "string",
"supplier_bic": "string|null",
"supplier_iban": "string|null",
"amount_ex_vat": "string",
"amount_in_vat": "string",
"vat_amount": "string",
"period_start": "2022-01-01T00:00:00+01:00",
"period_end": "2022-01-01T00:00:00+01:00",
"customer_name": "string",
"customer_postbox": "string",
"customer_zip": "string",
"customer_city": "string",
"customer_bic": "string|null",
"customer_iban": "string|null",
"payment_exported": "string|null",
"payment_exported_date": "2022-01-01T00:00:00+01:00|null",
"deliveries": [
{
"id": 0,
"ean_code": "string",
"status": "string",
"delivery_street": "string",
"delivery_street_nr": "string",
"delivery_street_nr_addition": "string",
"delivery_zip": "string",
"delivery_city": "string",
"amount_ex_vat": "string",
"amount_in_vat": "string",
"invoice_products": [
{
"id": 0,
"status": "string",
"period_start": "2022-01-01T00:00:00+01:00",
"period_end": "2022-01-01T00:00:00+01:00",
"name": "string",
"description": "string",
"amount": "string",
"amount_unit_code": "string",
"price_per_unit": "string",
"price_ex_vat": "string",
"price_in_vat": "string",
"vat_pct": int,
"invoice_product_errors": [],
"created_at": "2022-01-01T00:00:00+01:00"
}
],
"delivery_errors": [],
"created_at": "2022-01-01T00:00:00+01:00"
}
],
"invoice_errors": [],
"created_at": "2022-01-01T00:00:00+01:00"
}
GET: Invoice products
URL:
GET /webservice/v2/invoice/products
PARAMETERS:
| Name | Description |
|---|---|
| supplier | string (query) |
| reference | string (query) |
| date-start | string (query): yyyy-mm-dd |
| date-end | string (query): yyyy-mm-dd |
| ean | string (query) |
RESPONSE:
List of invoice products (code: 200 – OK)
VOORBEELD:
[
{
"id": 0,
"status": "string",
"period_start": "2022-01-01T00:00:00+01:00",
"period_end": "2022-01-01T00:00:00+01:00",
"name": "string",
"description": "string",
"amount": "string",
"amount_unit_code": "string",
"price_per_unit": "string",
"price_ex_vat": 0.00,
"price_in_vat": 0.00,
"vat_pct": 0,
"delivery": {
"id": 0,
"ean_code": "string",
"delivery_street": "string",
"delivery_street_nr": "string",
"delivery_street_nr_addition": "string",
"delivery_zip": "string",
"delivery_city": "string",
"invoice": {
"id": 0,
"reference_id": "string",
"type_code": "string",
"date": "2022-01-01T00:00:00+01:00",
"due_date": "2022-01-01T00:00:00+01:00",
"supplier": "string",
"period_start": "2022-01-01T00:00:00+01:00",
"period_end": "2022-01-01T00:00:00+01:00"
}
}
}
]
GET: suppliers
URL:
GET /webservice/v2/invoice/suppliers
PARAMETERS:
| Name | Description |
|---|---|
| date-start | string (query) : yyyy-mm-dd |
| date-end | string (query): yyyy-mm-dd |
RESPONSE:
List of suppliers (code: 200 – OK)
VOORBEELD:
[
{
"supplier": "string"
}
]
Niet in staat om te vinden wat je zoekt?
Neem contact op met de Energiemissie servicedesk.
✉️ : support@energiemissie.nl
☎️ : +31 85 016 0126