The complete API for programming EDI

Code in the language you know to programmatically manipulate EDI files

EDI for developers

EDI API

Sitting atop our EDI platform are JSON & XML APIs to translate, generate, validate, acknowledge and split EDI files

EDI for developers

EDI Platform

At our core is a powerful EDI engine, based on our EDI Tools for .NET Core, that makes manipulating EDI files easy

EDI for developers

Infrastructure

Our cloud-based infrastructure is hosted in Microsoft Azure and provides reliability, scalability, and security

EDI for developers

EDI Transactions

Convert between EDI and JSON or XML natively by using a vast collection of ready-to-use EDI transaction models

EDI for developers

Build faster

Start building with all the information you need and get unstuck quickly with how-to guides, sample code, and API documentation

EDI for developers

No shenanigans

Rapidly integrate EDI with simple pricing plans, amazing support, and the freedom to scale up or down without contracts

var data = new FormData();
data.append("edi_file", "C:\\my_edi_file.txt");

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === 4) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.edifabric.com/v1/translate/x12?read_mode=read_small&validate=False");
xhr.setRequestHeader("Ocp-Apim-Subscription-Key", "1f8e7c5a3f1e4ea5bb965c3fdd388aff");
xhr.setRequestHeader("Accept", "application/json");

xhr.send(data);
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW");
RequestBody body = RequestBody.create(mediaType, "------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; " + 
    "name=\"edi_file\"; filename=\"C:\\my_edi_file.txt\"\r\nContent-Type: text/plain\r\n\r\n\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW--");
Request request = new Request.Builder()
  .url("https://api.edifabric.com/v1/translate/x12?read_mode=read_small&validate=False")
  .post(body)
  .addHeader("content-type", "multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW")
  .addHeader("Ocp-Apim-Subscription-Key", "1f8e7c5a3f1e4ea5bb965c3fdd388aff")
  .addHeader("Accept", "application/json")
  .build();

Response response = client.newCall(request).execute();
import http.client

conn = http.client.HTTPConnection("api,edifabric,com")

payload = """------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; 
    name=\"edi_file\"; filename=\"C:\\my_edi_file.txt\"\r\nContent-Type: text/plain\r\n\r\n\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW--"""

headers = {
    'content-type': "multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW",
    'Ocp-Apim-Subscription-Key': "1f8e7c5a3f1e4ea5bb965c3fdd388aff",
    'Accept': "application/json"
    }

conn.request("POST", "v1,translate,x12", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
var client = new HttpClient();
var queryString = HttpUtility.ParseQueryString(string.Empty);

// Request headers

client.DefaultRequestHeaders.Accept.Add(MediaTypeWithQualityHeaderValue.Parse("application/json"));
client.DefaultRequestHeaders.Add("Ocp-Apim-Subscription-Key", "{subscription key}");

// Request parameters
queryString["read_mode"] = "read_small";
queryString["validate"] = "False";
var uri = "https://api.edifabric.com/v1/translate/x12?" + queryString;

HttpResponseMessage response;

// Request body
MultipartFormDataContent multiPartContent = new MultipartFormDataContent();
multiPartContent.Add(edibytes, "edi_file", "my-edi-file.txt");

using (var content = new ByteArrayContent(multiPartContent))
{
   content.Headers.ContentType = new MediaTypeHeaderValue("< your content type, i.e. application/json >");
   response = await client.PostAsync(uri, content);
}
require 'uri'
require 'net/http'

url = URI("https://api.edifabric.com/v1/translate/x12?read_mode=read_small&validate=False")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["content-type"] = 'multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW'
request["Ocp-Apim-Subscription-Key"] = '1f8e7c5a3f1e4ea5bb965c3fdd388aff'
request["Accept"] = 'application/json'
request.body = "------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; "/
    "name=\"edi_file\"; filename=\"C:\\my-edi-file.txt\"\r\nContent-Type: text/plain\r\n\r\n\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW--"

response = http.request(request)
puts response.read_body
$request = new HttpRequest();
$request->setUrl('https://api.edifabric.com/v1/translate/x12');
$request->setMethod(HTTP_METH_POST);

$request->setQueryData(array(
  'read_mode' => 'read_small',
  'validate' => 'False'
));

$request->setHeaders(array(
  'Accept' => 'application/json',
  'Ocp-Apim-Subscription-Key' => '1f8e7c5a3f1e4ea5bb965c3fdd388aff',
  'content-type' => 'multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW'
));

$request->setBody('------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="edi_file"; filename="C:\\my_edi_file.txt"
Content-Type: text/plain


------WebKitFormBoundary7MA4YWxkTrZu0gW--');

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
curl -X POST \
  'https://api.edifabric.com/v1/translate/x12?read_mode=read_small&validate=False' \
  -H 'Accept: application/json' \
  -H 'Ocp-Apim-Subscription-Key: 1f8e7c5a3f1e4ea5bb965c3fdd388aff' \
  -H 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \
  -F 'edi_file=@C:\my_edi_file.txt'
#import </Foundation.h>

NSDictionary *headers = @{ @"content-type": @"multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW",
                           @"Ocp-Apim-Subscription-Key": @"1f8e7c5a3f1e4ea5bb965c3fdd388aff",
                           @"Accept": @"application/json";
NSArray *parameters = @[ @{ @"name": @"edi_file", @"fileName": @"C:\my_edi_file.txt" } ];
NSString *boundary = @"----WebKitFormBoundary7MA4YWxkTrZu0gW";

NSError *error;
NSMutableString *body = [NSMutableString string];
for (NSDictionary *param in parameters) {
    [body appendFormat:@"--%@\r\n", boundary];
    if (param[@"fileName"]) {
        [body appendFormat:@"Content-Disposition:form-data; name=\"%@\"; filename=\"%@\"\r\n", param[@"name"], param[@"fileName"]];
        [body appendFormat:@"Content-Type: %@\r\n\r\n", param[@"contentType"]];
        [body appendFormat:@"%@", [NSString stringWithContentsOfFile:param[@"fileName"] encoding:NSUTF8StringEncoding error:&error]];
        if (error) {
            NSLog(@"%@", error);
        }
    } else {
        [body appendFormat:@"Content-Disposition:form-data; name=\"%@\"\r\n\r\n", param[@"name"]];
        [body appendFormat:@"%@", param[@"value"]];
    }
}
[body appendFormat:@"\r\n--%@--\r\n", boundary];
NSData *postData = [body dataUsingEncoding:NSUTF8StringEncoding];

NSMutableURLRequest *request = 
    [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://api.edifabric.com/v1/translate/x12?read_mode=read_small&validate=False"]
                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                   timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];

NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
                                            completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                if (error) {
                                                    NSLog(@"%@", error);
                                                } else {
                                                    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                    NSLog(@"%@", httpResponse);
                                                }
                                            }];
[dataTask resume];

A better answer to Build vs. Buy

Companies of all sizes face the question of whether to build or buy an EDI solution. EdiFabric EDI API gives you a better option

The first EDI API, ever

Paving the way for businesses to integrate EDI using cloud based and modern technologies, and break away from legacy solutions or extensive bills

Industry expertise built-in

Rely on us to assist you with anything EDI-related: from file formats and partner specific customizations to the latest versions and the best practices

Developer-centric

Our APIs have been built from developers for developers. We always seek out elegant solutions that enable scalable, flexible and robust EDI integrations

Ready to get started?

Get in touch or try our products.