API & SDK

You found the good stuff.

You have reached the API & SDK documentation. This is where things get a little more interesting. Build translators, package them, deploy them and let SwedenEDI handle the runtime.


Download CLI

Build your own translator with the SwedenEDI SDK, package it as a .swedi plugin and upload it to your account.


01

Create a project

Install the SwedenEDI CLI and create a new translator project using the SDK.

swedenedi.exe new project MyTranslator

This will create a folder SwediProject with your solution in and a project called MyTranslator


02

Build your translator in Visual Studio 2026

Implement your translation logic using the SwedenEDI SDK. Your translator can support any source and target format you need.
You can include nuget packages of your desired, just make sure you understand the license part, read more here


03

Package it

When your translator is ready, package the project into a portable .swedi plugin. Call Pack command with the folder path to your Project folder

SwedenEDI.exe pack Path-To-MyTranslator-project 
SwedenEDI.exe pack SwediProject/MyTranslator
                

This creates a package in SwediProject folder:

MyTranslator.swedi

04

Upload your plugin

Upload the .swedi package to your SwedenEDI account using your API key.


POST /v1/plugins HTTP/1.1
Content-Type: application/octet-stream
Host: api.swedenedi.com
X-Api-Key: YOUR_API_KEY
Body: mulitpart/form
file: your-swedi-package.swedi

C-sharp example

var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Post,
    RequestUri = new Uri("https://api.swedenedi.com/v1/plugins"),
    Headers =
    {
        { "X-API-Key", "YOUR_API_KEY" },
    },
    Content = new MultipartFormDataContent
    {
        new StringContent("")
        {
            Headers =
            {
                ContentDisposition = new ContentDispositionHeaderValue("form-data")
                {
                    Name = "file",
                    FileName = "Example2.swedi",
                }
            }
        },
    },
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}

05

Translate


Translate documents directly through the SwedenEDI API. Send your API key, translator and document in a single request.

POST /v1/translate HTTP/1.1
Content-Type: application/octet-stream
Host: api.swedenedi.com
X-Api-Key: YOUR_API_KEY
Body: mulitpart/form
file: your-edi.txt
translator: your-swedi-package (without.swedi)



C-sharp example


var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Post,
    RequestUri = new Uri("https://api.swedenedi.com/v1/translate"),
    Headers =
    {
        { "X-API-Key", "YOUR_API_KEY" },
    },
    Content = new MultipartFormDataContent
    {
        new StringContent("D96A")
        {
            Headers =
            {
                ContentDisposition = new ContentDispositionHeaderValue("form-data")
                {
                    Name = "translator",
                }
            }
        },
        new StringContent("")
        {
            Headers =
            {
                ContentDisposition = new ContentDispositionHeaderValue("form-data")
                {
                    Name = "file",
                    FileName = "test.edi",
                }
            }
        },
    },
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}

The translated document is returned directly in the response.


    { 
        "Number": "ORD13246", 
        "Date": "2026-08-08T16:43:22", 
        "Supplier": { 
            "Name": "SwedenEDI", 
            "Identifier": "Swedi", 
            "Country": "SE" 
        }, 
        "Customer": { 
            "Name": "Thats you", 
            "Identifier": "NumberOne", 
            "Country": "US" 
        }, 
        "Currency": "USD", 
        "Lines": [{
            "lineNo": 1,
            "product": "SwedenEDI-API Demo",
            "price": 0
        },
        {
            "lineNo": 12
            "product": "SwedenEDI-CLI always free",
            "price": 0
        }], 
        "Total": "Free demo" 
    }
← Let´s get back to SwedenEDI.com