Back to tracks

End-Customer IT Integration

Connect your ERP directly to the Semansys Compliance Platform. Get started in minutes with our SDK and start sending compliant e-invoices.

1

Generate API key via self-serve portal

Create an API key and store it securely.

using Semansys.CompliancePlatform.Client;

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

var key = await client.ApiKeys.CreateAsync(new CreateApiKeyRequest
{
    Name = "ERP Production Key",
    Scopes = new[] { "documents:write", "documents:read", "webhooks:manage" },
    ExpiresAt = DateTimeOffset.UtcNow.AddYears(1)
});

Console.WriteLine($"API Key: {key.ApiKey}");
Console.WriteLine("Store this securely — it will not be shown again.");
2

Install SDK

Install the Semansys SDK for your language.

using Semansys.CompliancePlatform.Client;

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

var health = await client.HealthCheckAsync();
Console.WriteLine($"Connected: {health.Status}");
3

Submit first document with 5 lines of code

Create your first e-invoice from a JSON file.

var result = await client.Documents.CreateAsync(new CreateDocumentRequest
{
    SenderLegalEntityId = myLegalEntityId,
    Receiver = new ReceiverRef { Identifier = "0106:87654321" },
    Content = new SsmContent
    {
        Kind = "ssm",
        Ssm = SsmInvoice.FromJson(File.ReadAllText("invoice.json"))
    }
});

Console.WriteLine($"Submitted! Document ID: {result.DocumentId}");
4

Handle webhook delivery confirmation

Register a webhook for real-time delivery confirmations.

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

app.MapPost("/api/webhooks/invoices", async (HttpContext ctx) =>
{
    var body = await new StreamReader(ctx.Request.Body).ReadToEndAsync();
    var evt = JsonSerializer.Deserialize<WebhookEvent>(body);
    switch (evt.EventType)
    {
        case "document.sent.v1":
            Console.WriteLine($"Invoice {evt.DocumentId} delivered!");
            break;
        case "document.delivery.failed.v1":
            Console.WriteLine($"Invoice {evt.DocumentId} failed: {evt.Detail}");
            break;
    }
    return Results.Ok();
});