Back to tracks

ERP / Accounting Vendor Integration

Embed e-invoicing capabilities directly into your ERP or accounting product. Follow these four steps to go from zero to sending your first invoice.

1

Provision sandbox tenant + API key

Create a sandbox environment with a test tenant and API key.

using Semansys.CompliancePlatform.Client;

var client = new CompliancePlatformClient("https://api.semansys.com");

// Provision a sandbox tenant and API key
var sandbox = await client.Sandbox.ProvisionAsync(new ProvisionRequest
{
    CompanyName = "Acme ERP Testing",
    ContactEmail = "dev@acme-erp.com"
});

Console.WriteLine($"Tenant ID: {sandbox.TenantId}");
Console.WriteLine($"API Key:   {sandbox.ApiKey}");
2

Submit a test invoice

Send your first invoice using SSM JSON format, or submit a pre-built UBL/XML payload.

var result = await client.Documents.CreateAsync(new CreateDocumentRequest
{
    SenderLegalEntityId = sandbox.DefaultLegalEntityId,
    Receiver = new ReceiverRef { Identifier = "0106:87654321" },
    Content = new SsmContent
    {
        Kind = "ssm",
        Ssm = new SsmInvoice
        {
            InvoiceNumber = "INV-2026-001",
            IssueDate = "2026-03-16",
            CurrencyCode = "EUR",
        }
    }
});

Console.WriteLine($"Document ID: {result.DocumentId}");
3

Register a webhook for delivery status

Subscribe to document lifecycle events for real-time tracking.

var webhook = await client.Webhooks.RegisterAsync(new RegisterWebhookRequest
{
    Url = "https://your-erp.com/webhooks/semansys",
    EventTypes = new[]
    {
        "document.validated.v1",
        "document.sent.v1",
        "document.delivery.failed.v1"
    }
});

Console.WriteLine($"Webhook ID: {webhook.WebhookId}");
Console.WriteLine($"Signing Secret: {webhook.SigningSecret}");
4

Retrieve an inbound document

List and download documents received on behalf of your legal entity.

var documents = await client.Documents.ListInboundAsync(new ListInboundRequest
{
    Status = "received",
    Limit = 10
});

foreach (var doc in documents.Items)
{
    Console.WriteLine($"Document: {doc.DocumentId} — {doc.SenderName}");
    var payload = await client.Documents.DownloadPayloadAsync(doc.DocumentId);
    Console.WriteLine($"Format: {payload.Format}, Size: {payload.SizeBytes} bytes");
}