Skip to main content

Client Libraries

GoRoute provides official client libraries (SDKs) to make integration easier. Each SDK handles authentication, request formatting, error handling, and provides type-safe interfaces.

Python SDKโ€‹

The Python SDK supports both synchronous and asynchronous operations, making it ideal for data pipelines, batch processing, and modern async applications.

Installationโ€‹

pip install goroute-peppol

Quick Startโ€‹

from goroute import GoRouteClient

# Initialize the client
client = GoRouteClient(api_key="your-api-key")

# Send an invoice
result = client.documents.send(
sender_id="0088:1234567890123",
receiver_id="0088:9876543210987",
document_type="invoice",
document_content=invoice_xml
)

print(f"Document sent: {result.transaction_id}")

Async Supportโ€‹

import asyncio
from goroute import AsyncGoRouteClient

async def send_invoices():
async with AsyncGoRouteClient(api_key="your-api-key") as client:
# Send multiple invoices concurrently
tasks = [
client.documents.send(doc)
for doc in invoice_batch
]
results = await asyncio.gather(*tasks)
return results

asyncio.run(send_invoices())

Featuresโ€‹

  • โœ… Full API coverage
  • โœ… Async/await support
  • โœ… Automatic retries with exponential backoff
  • โœ… Type hints for IDE autocompletion
  • โœ… Webhook signature verification
  • โœ… XML/JSON document builders

๐Ÿ“ฆ PyPI Package | ๐Ÿ“– Python SDK Docs


Node.js / TypeScript SDKโ€‹

The Node.js SDK provides full TypeScript support with type definitions for all API objects.

Installationโ€‹

npm install @goroute/peppol-sdk
# or
yarn add @goroute/peppol-sdk

Quick Startโ€‹

import { GoRouteClient } from '@goroute/peppol-sdk';

const client = new GoRouteClient({
apiKey: process.env.GOROUTE_API_KEY,
});

// Send an invoice
const result = await client.documents.send({
senderId: '0088:1234567890123',
receiverId: '0088:9876543210987',
documentType: 'invoice',
documentContent: invoiceXml,
});

console.log(`Transaction ID: ${result.transactionId}`);

Webhook Handling (Express)โ€‹

import express from 'express';
import { GoRouteClient, verifyWebhookSignature } from '@goroute/peppol-sdk';

const app = express();

app.post('/webhooks/goroute', express.raw({ type: 'application/json' }), (req, res) => {
const signature = req.headers['x-goroute-signature'] as string;

if (!verifyWebhookSignature(req.body, signature, webhookSecret)) {
return res.status(401).send('Invalid signature');
}

const event = JSON.parse(req.body.toString());

switch (event.type) {
case 'document.received':
handleIncomingDocument(event.data);
break;
case 'document.delivered':
handleDeliveryConfirmation(event.data);
break;
}

res.status(200).send('OK');
});

Featuresโ€‹

  • โœ… Full TypeScript support
  • โœ… Promise-based async API
  • โœ… Automatic request retries
  • โœ… Webhook signature verification
  • โœ… ESM and CommonJS support

๐Ÿ“ฆ npm Package | ๐Ÿ“– TypeScript SDK Docs


C# / .NET SDKโ€‹

The .NET SDK targets .NET 6+ and provides a strongly-typed interface for enterprise applications.

Installationโ€‹

dotnet add package GoRoute.Peppol

Or via NuGet Package Manager:

Install-Package GoRoute.Peppol

Quick Startโ€‹

using GoRoute.Peppol;

var client = new GoRouteClient("your-api-key");

// Send an invoice
var result = await client.Documents.SendAsync(new SendDocumentRequest
{
SenderId = "0088:1234567890123",
ReceiverId = "0088:9876543210987",
DocumentType = DocumentType.Invoice,
DocumentContent = invoiceXml
});

Console.WriteLine($"Transaction ID: {result.TransactionId}");

Dependency Injection (ASP.NET Core)โ€‹

// In Program.cs or Startup.cs
builder.Services.AddGoRouteClient(options =>
{
options.ApiKey = builder.Configuration["GoRoute:ApiKey"];
options.Environment = GoRouteEnvironment.Production;
});

// In your service
public class InvoiceService
{
private readonly IGoRouteClient _client;

public InvoiceService(IGoRouteClient client)
{
_client = client;
}

public async Task SendInvoiceAsync(Invoice invoice)
{
var result = await _client.Documents.SendAsync(invoice.ToGoRouteRequest());
// Handle result
}
}

Featuresโ€‹

  • โœ… .NET 6, 7, 8 support
  • โœ… Dependency injection ready
  • โœ… IHttpClientFactory integration
  • โœ… Strongly-typed models
  • โœ… Polly retry policies

๐Ÿ“ฆ NuGet Package | ๐Ÿ“– .NET SDK Docs


Java SDKโ€‹

The Java SDK supports Java 11+ and integrates with common frameworks like Spring Boot.

Installation (Maven)โ€‹

<dependency>
<groupId>ai.goroute</groupId>
<artifactId>peppol-sdk</artifactId>
<version>1.0.0</version>
</dependency>

Installation (Gradle)โ€‹

implementation 'ai.goroute:peppol-sdk:1.0.0'

Quick Startโ€‹

import ai.goroute.peppol.GoRouteClient;
import ai.goroute.peppol.model.SendDocumentRequest;

GoRouteClient client = GoRouteClient.builder()
.apiKey("your-api-key")
.build();

SendDocumentRequest request = SendDocumentRequest.builder()
.senderId("0088:1234567890123")
.receiverId("0088:9876543210987")
.documentType(DocumentType.INVOICE)
.documentContent(invoiceXml)
.build();

SendDocumentResult result = client.documents().send(request);
System.out.println("Transaction ID: " + result.getTransactionId());

Spring Boot Integrationโ€‹

@Configuration
public class GoRouteConfig {

@Bean
public GoRouteClient goRouteClient(
@Value("${goroute.api-key}") String apiKey) {
return GoRouteClient.builder()
.apiKey(apiKey)
.build();
}
}

Featuresโ€‹

  • โœ… Java 11, 17, 21 support
  • โœ… Builder pattern for all objects
  • โœ… Spring Boot starter available
  • โœ… Reactive support (Project Reactor)
  • โœ… Comprehensive logging

๐Ÿ“ฆ Maven Central | ๐Ÿ“– Java SDK Docs


SDK Comparisonโ€‹

FeaturePythonNode.js.NETJava
Async Supportโœ…โœ…โœ…โœ…
Type Safetyโœ… (hints)โœ… (TS)โœ…โœ…
Retriesโœ…โœ…โœ…โœ…
Webhook Verificationโœ…โœ…โœ…โœ…
Framework IntegrationFastAPI, DjangoExpress, NestASP.NET CoreSpring Boot

Getting Helpโ€‹

  • ๐Ÿ“ง Email: admin@goroute.ai
  • ๐Ÿ’ฌ Community: Discord
  • ๐Ÿ› Issues: Report on the respective GitHub repository