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
| Feature | Python | Node.js | .NET | Java |
|---|---|---|---|---|
| Async Support | ✅ | ✅ | ✅ | ✅ |
| Type Safety | ✅ (hints) | ✅ (TS) | ✅ | ✅ |
| Retries | ✅ | ✅ | ✅ | ✅ |
| Webhook Verification | ✅ | ✅ | ✅ | ✅ |
| Framework Integration | FastAPI, Django | Express, Nest | ASP.NET Core | Spring Boot |
Getting Help
- 📧 Email: support@goroute.ai
- 💬 Community: Discord
- 🐛 Issues: Report on the respective GitHub repository