Here's a short description how to register a sender and send an invoice via the API. Full documentation can be found here: www.storecove.com/docs
❶ Create a legal entity that will send an invoice (and will be able to receive invoices).
{
"party_name": "Sender 1",
"line1": "Addressstreet 1",
"city": "Cityname",
"zip": "10000",
"country": "NL",
"public": true,
"advertisements": "invoice"
}
curl -X POST "https://api.storecove.com/api/v2/legal_entities" -H "accept: application/json" -H "Authorization: Bearer <APIKEY>" -H "Content-Type: application/json" -d @legal_entity.json
Response:
{
"id": 999999,
"party_name": "Sender 1",
"line1": "Addressstreet 1",
"line2": null,
"zip": "10000",
"city": "Cityname",
"county": null,
"country": "NL",
"tenant_id": null,
"public": true,
"peppol_identifiers": []
}
Note how the legal entity was created without any Peppol identifiers. Note down the id!
❷ Add a legal identifier for Peppol.
Create a file peppol_legal_id.json with the following content:
{
"identifier": "SC123456789",
"scheme": "NL:KVK",
"superscheme": "iso6523-actorid-upis"
}
(Change the number in red to something more real.)
curl -X POST "https://api.storecove.com/api/v2/legal_entities/999999/peppol_identifiers" -H "accept: application/json" -H "Authorization: Bearer <APIKEY>" -H "Content-Type: application/json" -d @peppol_legal_id.json
Change the 999999 to the actual id!
Response:
{
"superscheme": "iso6523-actorid-upis",
"scheme": "NL:KVK",
"identifier": "SC123456789"
}
❸ Add a tax identifier for Peppol.
Create a file peppol_tax_id.json with the following content:
{
"identifier": "NLSC123456789B01",
"scheme": "NL:VAT",
"superscheme": "iso6523-actorid-upis"
}
(Change the number in red to something more real.)
curl -X POST "https://api.storecove.com/api/v2/legal_entities/999999/peppol_identifiers" -H "accept: application/json" -H "Authorization: Bearer <APIKEY>" -H "Content-Type: application/json" -d @peppol_tax_id.json
Change the 999999 to the actual id!
response:
{
"superscheme": "iso6523-actorid-upis",
"scheme": "NL:VAT",
"identifier": "NLSC123456789B01"
}
❹ Send an invoice to Storecove.
Create a file invoice.json with the following content:
{
"legalEntityId": 999999,
"routing":{
"eIdentifiers":[
{
"scheme":"NL:KVK",
"id":"60881119"
}
],
"emails":[
"no_peppol_so_email@example.com"
]
},
"document": {
"documentType": "invoice",
"invoice":{
"taxSystem":"tax_line_percentages",
"taxSubtotals":[
{
"taxableAmount":8.07,
"taxAmount":1.69,
"percentage":21,
"country":"NL"
}
],
"invoiceNumber":"202110001",
"issueDate":"2020-08-08",
"documentCurrencyCode":"EUR",
"accountingCustomerParty":{
"party":{
"companyName":"Storecove TEST",
"address":{
"street1":"Oude Enghweg 8",
"zip":"1217JC",
"city":"Amsterdam Hilversum",
"country":"NL"
}
},
"publicIdentifiers":[
{
"scheme":"NL:KVK",
"id":"60881119"
},
{
"scheme":"NL:VAT",
"id":"NL854101263B01"
}
]
},
"invoiceLines":[
{
"description":"InvoiceLine 1",
"amountExcludingVat":8.07,
"tax":{
"percentage":21,
"category":"standard",
"country":"NL"
}
}
],
"amountIncludingVat":9.76
}
}
}
Change the 999999 to the actual id!
curl -X POST "https://api.storecove.com/api/v2/document_submissions" -H "accept: application/json" -H "Authorization: Bearer <APIKEY>" -H "Content-Type: application/json" -d @invoice.json
Response:
{
"guid": "ad4dbc7f-be80-480f-92c2-5c93a75bbf9a"
}
Alternative way with the invoice data not via JSON, but via a Base64 encoded UBL or CII (or custom format):
{
"legalEntityId":999999,
"routing":{
"eIdentifiers":[
{
"scheme":"NL:KVK",
"id":"60881119"
}
],
"emails":[
"no_peppol_so_email@example.com"
]
},
"document": {
"documentType": "invoice",
"rawDocumentData":{
"document": "PEludm9pY2U+PC9JbnZvaWNlPg==",
"parse": true,
"parseStrategy": "ubl"
}
}
}
❺ Preflight:
Create a file preflight.json with the following content:
{
"publicIdentifiers":[
{
"scheme":"NL:KVK",
"id":"60881119"
}
]
}
curl -X POST "https://api.storecove.com/api/v2/invoice_submissions/preflight" -H "accept: application/json" -H "Authorization: Bearer <APIKEY>" -H "Content-Type: application/json" -d @preflight.json
Response:
{"code":"ok"}