E-Invoicing
E-Invoicing
Send invoices and credit notes electronically over the Peppol network.
The E-Invoicing object
Attributes
Sync enrollment
/e-invoicing/enrollment/syncRefresh the entity enrollment state from the Peppol sending provider.
Header parameters
Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.
import SpaceInvoices from '@spaceinvoices/js-sdk';
const sdk = new SpaceInvoices('YOUR_API_KEY');
const response = await sdk.eInvoicing.syncEInvoicingEnrollment();
console.log(response);Returns
{
"enabled": true,
"auto_send": true,
"default_scheme_id": "string",
"enrollment": {
"id": "string",
"entity_id": "string",
"environment": "sandbox",
"state": "not_enabled",
"sending_allowed": true,
"missing_fields": [
"string"
],
"verification_url": "string",
"peppol_registered": true,
"peppol_id": "string",
"peppol_scheme_id": "string",
"provider_error": "string",
"verified_at": "2025-01-15T10:30:00.000Z",
"last_synced_at": "2025-01-15T10:30:00.000Z"
}
}Create verification link
/e-invoicing/enrollment/verification-linkCreate a fresh verification link for the entity enrollment when verification is required.
Header parameters
Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.
import SpaceInvoices from '@spaceinvoices/js-sdk';
const sdk = new SpaceInvoices('YOUR_API_KEY');
const response = await sdk.eInvoicing.create();
console.log(response);Returns
{
"enabled": true,
"auto_send": true,
"default_scheme_id": "string",
"enrollment": {
"id": "string",
"entity_id": "string",
"environment": "sandbox",
"state": "not_enabled",
"sending_allowed": true,
"missing_fields": [
"string"
],
"verification_url": "string",
"peppol_registered": true,
"peppol_id": "string",
"peppol_scheme_id": "string",
"provider_error": "string",
"verified_at": "2025-01-15T10:30:00.000Z",
"last_synced_at": "2025-01-15T10:30:00.000Z"
}
}Register supplier (deprecated)
/e-invoicing/supplierDeprecated compatibility alias. Use PATCH /e-invoicing/settings to enable Peppol sending.
Header parameters
Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.
Body parameters
import SpaceInvoices from '@spaceinvoices/js-sdk';
const sdk = new SpaceInvoices('YOUR_API_KEY');
const response = await sdk.eInvoicing.registerEInvoicingSupplier({
company_name: "string",
vat_number: "string",
company_number: "string",
iban: "string",
address: "string",
city: "string",
post_code: "string",
country_code: "string",
contact_email: "string",
contact_phone: "string"
});
console.log(response);Returns
{
"id": "string",
"entity_id": "string",
"environment": "string",
"status": "string",
"reject_reason": "string",
"verification_url": "string",
"last_synced_at": "2025-01-15T10:30:00.000Z",
"peppol_registered": true,
"peppol_participant_id": "string",
"peppol_scheme_id": "string",
"company_name": "string",
"vat_number": "string",
"company_number": "string",
"iban": "string",
"address": "string",
"city": "string",
"post_code": "string",
"country_code": "string",
"contact_email": "string",
"contact_phone": "string",
"kyc_id_document_url": "string",
"kyc_business_register_url": "string",
"metadata": {},
"onboarded_at": "2025-01-15T10:30:00.000Z",
"created_at": "2025-01-15T10:30:00.000Z",
"updated_at": "2025-01-15T10:30:00.000Z"
}Check Peppol recipient
/e-invoicing/recipients/checkNormalize a Peppol address and check registration and optional document type support.
Header parameters
Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.
Body parameters
Recipient Peppol identifier. May be a plain value or a full scheme:value address.
import SpaceInvoices from '@spaceinvoices/js-sdk';
const sdk = new SpaceInvoices('YOUR_API_KEY');
const response = await sdk.eInvoicing.checkEInvoicingRecipient({
peppol_id: "string",
scheme_id: "string",
document_type: "invoice"
});
console.log(response);Returns
{
"peppol_id": "string",
"scheme_id": "string",
"peppol_address": "string",
"registered": true,
"name": "string",
"document_type": "invoice",
"document_supported": true
}Search Peppol customer (deprecated)
/e-invoicing/customer-searchDeprecated compatibility alias. Use POST /e-invoicing/recipients/check.
Header parameters
Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.
Body parameters
import SpaceInvoices from '@spaceinvoices/js-sdk';
const sdk = new SpaceInvoices('YOUR_API_KEY');
const response = await sdk.eInvoicing.searchEInvoicingCustomer({
peppol_id: "string",
scheme_id: "string"
});
console.log(response);Returns
{
"data": [
{
"peppol_id": "string",
"scheme_id": "string",
"name": "string",
"country_code": "string",
"registered": true
}
]
}Send e-invoice (deprecated)
/e-invoicing/send/:documentType/:documentIdDeprecated compatibility alias. Use POST /e-invoicing/documents/{id}/send.
Header parameters
Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.
Path parameters
Possible values: "invoice", "credit_note"
Body parameters
import SpaceInvoices from '@spaceinvoices/js-sdk';
const sdk = new SpaceInvoices('YOUR_API_KEY');
const response = await sdk.eInvoicing.sendEInvoice({
recipient_peppol_id: "string",
recipient_scheme_id: "string",
recipient_name: "string"
});
console.log(response);Returns
{
"id": "string",
"entity_id": "string",
"supplier_id": "string",
"environment": "string",
"document_id": "string",
"document_type": "string",
"transmission_id": "string",
"recipient_peppol_id": "string",
"recipient_scheme_id": "string",
"recipient_name": "string",
"status": "string",
"error_message": "string",
"metadata": {},
"submitted_at": "2025-01-15T10:30:00.000Z",
"delivered_at": "2025-01-15T10:30:00.000Z",
"created_at": "2025-01-15T10:30:00.000Z",
"updated_at": "2025-01-15T10:30:00.000Z"
}Retry failed submission (deprecated path)
/e-invoicing/submissions/:id/retryRetry failed submission (deprecated path)
Header parameters
Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.
Path parameters
Unique resource identifier
import SpaceInvoices from '@spaceinvoices/js-sdk';
const sdk = new SpaceInvoices('YOUR_API_KEY');
const response = await sdk.eInvoicing.retryEInvoicingSubmission();
console.log(response);Returns
{
"id": "string",
"entity_id": "string",
"supplier_id": "string",
"environment": "string",
"document_id": "string",
"document_type": "string",
"transmission_id": "string",
"recipient_peppol_id": "string",
"recipient_scheme_id": "string",
"recipient_name": "string",
"status": "string",
"error_message": "string",
"metadata": {},
"submitted_at": "2025-01-15T10:30:00.000Z",
"delivered_at": "2025-01-15T10:30:00.000Z",
"created_at": "2025-01-15T10:30:00.000Z",
"updated_at": "2025-01-15T10:30:00.000Z"
}Get e-invoicing settings
/e-invoicing/settingsGet the current e-invoicing settings and enrollment state for the entity.
Header parameters
Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.
import SpaceInvoices from '@spaceinvoices/js-sdk';
const sdk = new SpaceInvoices('YOUR_API_KEY');
const response = await sdk.eInvoicing.list();
console.log(response);Returns
{
"enabled": true,
"auto_send": true,
"default_scheme_id": "string",
"enrollment": {
"id": "string",
"entity_id": "string",
"environment": "sandbox",
"state": "not_enabled",
"sending_allowed": true,
"missing_fields": [
"string"
],
"verification_url": "string",
"peppol_registered": true,
"peppol_id": "string",
"peppol_scheme_id": "string",
"provider_error": "string",
"verified_at": "2025-01-15T10:30:00.000Z",
"last_synced_at": "2025-01-15T10:30:00.000Z"
}
}Get supplier status (deprecated)
/e-invoicing/supplierDeprecated compatibility alias. Use GET /e-invoicing/settings for enrollment state.
Header parameters
Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.
import SpaceInvoices from '@spaceinvoices/js-sdk';
const sdk = new SpaceInvoices('YOUR_API_KEY');
const response = await sdk.eInvoicing.getEInvoicingSupplier();
console.log(response);Returns
{
"id": "string",
"entity_id": "string",
"environment": "string",
"status": "string",
"reject_reason": "string",
"verification_url": "string",
"last_synced_at": "2025-01-15T10:30:00.000Z",
"peppol_registered": true,
"peppol_participant_id": "string",
"peppol_scheme_id": "string",
"company_name": "string",
"vat_number": "string",
"company_number": "string",
"iban": "string",
"address": "string",
"city": "string",
"post_code": "string",
"country_code": "string",
"contact_email": "string",
"contact_phone": "string",
"kyc_id_document_url": "string",
"kyc_business_register_url": "string",
"metadata": {},
"onboarded_at": "2025-01-15T10:30:00.000Z",
"created_at": "2025-01-15T10:30:00.000Z",
"updated_at": "2025-01-15T10:30:00.000Z"
}List submissions
/e-invoicing/submissionsList e-invoice submissions with pagination.
Header parameters
Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.
Query parameters
Number of results per request.
Default: 10
Opaque cursor to fetch the next page of results. Reuse only with the same effective ordering. Use the value from pagination.next_cursor in the previous response.
Opaque cursor to fetch the previous page of results. Reuse only with the same effective ordering. Use the value from pagination.prev_cursor in the previous response.
Whether to include the total count of items in pagination.total.
Default is true.
When false, pagination.total returns -1 for better performance.
import SpaceInvoices from '@spaceinvoices/js-sdk';
const sdk = new SpaceInvoices('YOUR_API_KEY');
const response = await sdk.eInvoicing.listEInvoicingSubmissions();
console.log(response);Returns
{
"data": [
{
"id": "string",
"entity_id": "string",
"supplier_id": "string",
"environment": "string",
"document_id": "string",
"document_type": "string",
"transmission_id": "string",
"recipient_peppol_id": "string",
"recipient_scheme_id": "string",
"recipient_name": "string",
"status": "string",
"error_message": "string",
"metadata": {},
"submitted_at": "2025-01-15T10:30:00.000Z",
"delivered_at": "2025-01-15T10:30:00.000Z",
"created_at": "2025-01-15T10:30:00.000Z",
"updated_at": "2025-01-15T10:30:00.000Z"
}
],
"pagination": {
"total": 0,
"next_cursor": "string",
"prev_cursor": "string",
"has_more": true
}
}Get submission detail (deprecated path)
/e-invoicing/submissions/:idGet submission detail (deprecated path)
Header parameters
Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.
Path parameters
Unique resource identifier
import SpaceInvoices from '@spaceinvoices/js-sdk';
const sdk = new SpaceInvoices('YOUR_API_KEY');
const response = await sdk.eInvoicing.getEInvoicingSubmission();
console.log(response);Returns
{
"id": "string",
"entity_id": "string",
"supplier_id": "string",
"environment": "string",
"document_id": "string",
"document_type": "string",
"transmission_id": "string",
"recipient_peppol_id": "string",
"recipient_scheme_id": "string",
"recipient_name": "string",
"status": "string",
"error_message": "string",
"ubl_xml": "string",
"metadata": {},
"submitted_at": "2025-01-15T10:30:00.000Z",
"delivered_at": "2025-01-15T10:30:00.000Z",
"created_at": "2025-01-15T10:30:00.000Z",
"updated_at": "2025-01-15T10:30:00.000Z"
}Get submission detail
/e-invoicing/submissions/{id}Get detailed submission status including UBL XML.
Header parameters
Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.
Path parameters
Unique resource identifier
import SpaceInvoices from '@spaceinvoices/js-sdk';
const sdk = new SpaceInvoices('YOUR_API_KEY');
const response = await sdk.eInvoicing.get("inv_6595a27b5d35015c3ef0c3fd");
console.log(response);Returns
{
"id": "string",
"entity_id": "string",
"supplier_id": "string",
"environment": "string",
"document_id": "string",
"document_type": "string",
"transmission_id": "string",
"recipient_peppol_id": "string",
"recipient_scheme_id": "string",
"recipient_name": "string",
"status": "string",
"error_message": "string",
"ubl_xml": "string",
"metadata": {},
"submitted_at": "2025-01-15T10:30:00.000Z",
"delivered_at": "2025-01-15T10:30:00.000Z",
"created_at": "2025-01-15T10:30:00.000Z",
"updated_at": "2025-01-15T10:30:00.000Z"
}Update e-invoicing settings
/e-invoicing/settingsEnable or disable Peppol sending and configure automatic sending for the entity.
Header parameters
Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.
Body parameters
import SpaceInvoices from '@spaceinvoices/js-sdk';
const sdk = new SpaceInvoices('YOUR_API_KEY');
const response = await sdk.eInvoicing.update({
enabled: true,
auto_send: true,
default_scheme_id: "string"
});
console.log(response);Returns
{
"enabled": true,
"auto_send": true,
"default_scheme_id": "string",
"enrollment": {
"id": "string",
"entity_id": "string",
"environment": "sandbox",
"state": "not_enabled",
"sending_allowed": true,
"missing_fields": [
"string"
],
"verification_url": "string",
"peppol_registered": true,
"peppol_id": "string",
"peppol_scheme_id": "string",
"provider_error": "string",
"verified_at": "2025-01-15T10:30:00.000Z",
"last_synced_at": "2025-01-15T10:30:00.000Z"
}
}Update supplier (deprecated)
/e-invoicing/supplierDeprecated compatibility alias. Entity profile data is canonical for Peppol enrollment.
Header parameters
Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.
Body parameters
Returns
{
"id": "string",
"entity_id": "string",
"environment": "string",
"status": "string",
"reject_reason": "string",
"verification_url": "string",
"last_synced_at": "2025-01-15T10:30:00.000Z",
"peppol_registered": true,
"peppol_participant_id": "string",
"peppol_scheme_id": "string",
"company_name": "string",
"vat_number": "string",
"company_number": "string",
"iban": "string",
"address": "string",
"city": "string",
"post_code": "string",
"country_code": "string",
"contact_email": "string",
"contact_phone": "string",
"kyc_id_document_url": "string",
"kyc_business_register_url": "string",
"metadata": {},
"onboarded_at": "2025-01-15T10:30:00.000Z",
"created_at": "2025-01-15T10:30:00.000Z",
"updated_at": "2025-01-15T10:30:00.000Z"
}Send document
/e-invoicing/documents/{id}/sendSend an invoice or credit note over Peppol. The document type is derived from the ID prefix.
Header parameters
Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.
Path parameters
Invoice or credit note ID. The document type is derived from the ID prefix.
Body parameters
import SpaceInvoices from '@spaceinvoices/js-sdk';
const sdk = new SpaceInvoices('YOUR_API_KEY');
const response = await sdk.eInvoicing.sendEInvoicingDocument("inv_123", {
recipient_peppol_id: "string",
recipient_scheme_id: "string",
recipient_name: "string"
});
console.log(response);Returns
{
"id": "string",
"entity_id": "string",
"supplier_id": "string",
"environment": "string",
"document_id": "string",
"document_type": "string",
"transmission_id": "string",
"recipient_peppol_id": "string",
"recipient_scheme_id": "string",
"recipient_name": "string",
"status": "string",
"error_message": "string",
"metadata": {},
"submitted_at": "2025-01-15T10:30:00.000Z",
"delivered_at": "2025-01-15T10:30:00.000Z",
"created_at": "2025-01-15T10:30:00.000Z",
"updated_at": "2025-01-15T10:30:00.000Z"
}Retry failed submission
/e-invoicing/submissions/{id}/retryRetry a failed or rejected e-invoice submission.
Header parameters
Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.
Path parameters
Unique resource identifier
import SpaceInvoices from '@spaceinvoices/js-sdk';
const sdk = new SpaceInvoices('YOUR_API_KEY');
const response = await sdk.eInvoicing.retryEInvoicingSubmissionById("inv_6595a27b5d35015c3ef0c3fd");
console.log(response);Returns
{
"id": "string",
"entity_id": "string",
"supplier_id": "string",
"environment": "string",
"document_id": "string",
"document_type": "string",
"transmission_id": "string",
"recipient_peppol_id": "string",
"recipient_scheme_id": "string",
"recipient_name": "string",
"status": "string",
"error_message": "string",
"metadata": {},
"submitted_at": "2025-01-15T10:30:00.000Z",
"delivered_at": "2025-01-15T10:30:00.000Z",
"created_at": "2025-01-15T10:30:00.000Z",
"updated_at": "2025-01-15T10:30:00.000Z"
}