Energiemissie facturen API 

API-versie 2.0

 

De facturen API maakt het mogelijk om factuurgegevens op te vragen waartoe u toegang heeft.

 

REST

De facturen api maakt gebruikt van Representational State Transfer (REST) om gegevens via het web te ontsluiten.

 

Heeft u vragen of opmerkingen over de mogelijkheden tot data-ontsluiting of heeft u technische vragen neem dan contact op met 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.

 

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 URI

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.


Voorbeeld rewuest met authenticatie:

curl -XPOST -H "Content-type: application/json"
            -H "X-API-KEY: xxxxx.apikey"
            https://mijnenergiemissie.nl/webservice/v2/path



Resources 

 

Get invoices 

URL:

GET /webservice/v2/invoices

Parameters 


NameDescription
supplierstring (query)
date-startstring (query): yyyy-mm-dd
date-endstring (query): yyyy-mm-dd


Response 

List of invoices (code: 200 - OK) 


Example: 

[
 {
        "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 invoice 

URL:

GET /webservice/v2/invoices/{id}

Parameters

NameDescription
idstring (path)

 

Response

Invoice object (code: 200 - OK) 

Example: 

{
    "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

Namedescription
supplierstring (query)
reference
string (query)
date-startstring (query): yyyy-mm-dd
date-endstring (query): yyyy-mm-dd
eanstring (query)

 

Response

List of invoice products (code:200 – OK)

Example

[
  {
    "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

NameDescription
date-startstring (query) : yyyy-mm-dd
date-endstring (query): yyyy-mm-dd


Response

List of suppliers (code:200 – OK)

Example

[
    {
        "supplier": "string"
    }
]