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: admin@goroute.ai
- ๐ฌ Community: Discord
- ๐ Issues: Report on the respective GitHub repository