NeoEdi.Sdk 1.0.18

dotnet add package NeoEdi.Sdk --version 1.0.18
                    
NuGet\Install-Package NeoEdi.Sdk -Version 1.0.18
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="NeoEdi.Sdk" Version="1.0.18" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NeoEdi.Sdk" Version="1.0.18" />
                    
Directory.Packages.props
<PackageReference Include="NeoEdi.Sdk" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add NeoEdi.Sdk --version 1.0.18
                    
#r "nuget: NeoEdi.Sdk, 1.0.18"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package NeoEdi.Sdk@1.0.18
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=NeoEdi.Sdk&version=1.0.18
                    
Install as a Cake Addin
#tool nuget:?package=NeoEdi.Sdk&version=1.0.18
                    
Install as a Cake Tool

NeoEdi.Sdk

Official .NET SDK for the Neo-EDI platform.

Installation

dotnet add package NeoEdi.Sdk

Quick Start

using NeoEdi.Sdk;
using NeoEdi.Sdk.Models;

var client = new NeoEdiClient(new NeoEdiClientOptions
{
    BaseUrl = "https://api.neo-edi.com",
    ApiKey = "nedk_xxxxxxxxxxxx"
});

// List customers
var customers = await client.Customers.ListAsync(new ListCustomersParams { IsActive = true });

// Create a customer
var customer = await client.Customers.CreateAsync(new CreateCustomerRequest
{
    CustomerName = "Acme Corporation"
});

// Get a customer
var existing = await client.Customers.GetAsync("ACME-001");

// Get customer by identifier (e.g., EXTERNAL, GLN, DUNS)
var byExternal = await client.Customers.GetByIdentifierAsync(
    CustomerIdentifierType.EXTERNAL, "EXT-12345");

// Update a customer
var updated = await client.Customers.UpdateAsync("ACME-001", new UpdateCustomerRequest
{
    CustomerName = "Acme Corp"
});

// Delete a customer
await client.Customers.DeleteAsync("ACME-001");

Sub-Customers (Customer Hierarchy)

// Link existing customer as sub-customer
var result = await client.SubCustomers.AddAsync("PARENT-001", "CHILD-001");
// Returns: { HierarchyId, ParentCustomerId, ChildCustomerId, Created, Activated }

// Create a new sub-customer under a parent
var newSub = await client.SubCustomers.CreateAsync("PARENT-001", new CreateSubCustomerRequest
{
    CustomerName = "New Store Location",
    AccountNumber = "STORE-123",  // Optional: creates an EXTERNAL identifier
    IsActive = true               // Optional: defaults to true
});
// Returns: { HierarchyId, ParentCustomerId, ChildCustomerId, ChildCustomerName, Identifier?, Created }

// List sub-customers
var subs = await client.SubCustomers.ListAsync("PARENT-001");

// Include inactive relationships
var allSubs = await client.SubCustomers.ListAsync("PARENT-001", includeInactive: true);

// List sub-customers with their identifiers
var subsWithIds = await client.SubCustomers.ListWithIdentifiersAsync("PARENT-001");
// Returns List<SubCustomerWithIdentifiers> with Identifiers array for each sub-customer

// Remove sub-customer relationship
await client.SubCustomers.RemoveAsync("PARENT-001", "CHILD-001");

Partners (Trading Partners)

// List all partners
var partners = await client.Partners.ListAsync();

// List only active partners
var activePartners = await client.Partners.ListAsync(new ListPartnersParams { ActiveOnly = true });

// Get a partner
var partner = await client.Partners.GetAsync("PARTNER-001");

// Create a partner
var newPartner = await client.Partners.CreateAsync(new CreatePartnerRequest
{
    PartnerId = "WALMART",
    PartnerName = "Walmart",
    Email = "edi@walmart.com",
    Phone = "+15551234567",
    Address = new Address
    {
        Street = "702 SW 8th St",
        City = "Bentonville",
        State = "AR",
        Zip = "72712",
        Country = "USA"
    }
});

// Update a partner
var updated = await client.Partners.UpdateAsync("WALMART", new UpdatePartnerRequest
{
    PartnerName = "Walmart Inc."
});

// Delete (soft delete) a partner
await client.Partners.DeleteAsync("WALMART");

Mapping Templates

// List all mapping templates
var templates = await client.MappingTemplates.ListAsync();

// Filter templates
var filtered = await client.MappingTemplates.ListAsync(new ListMappingTemplatesParams
{
    TargetTable = "edi_852_items",
    IsPublic = true
});

// Get a template by ID
var template = await client.MappingTemplates.GetAsync("template-001");

// Create a mapping template
var newTemplate = await client.MappingTemplates.CreateAsync(new CreateMappingTemplateRequest
{
    Name = "852 Item Import",
    TargetTable = "edi_852_items",
    MappingConfig = new Dictionary<string, object>
    {
        ["upc"] = "UPC_CODE",
        ["quantity"] = "QTY_ON_HAND"
    },
    Tags = ["852", "inventory"]
});

// Update a template
var updated = await client.MappingTemplates.UpdateAsync("template-001", new UpdateMappingTemplateRequest
{
    Name = "Updated Template Name"
});

// Delete a template
await client.MappingTemplates.DeleteAsync("template-001");

CSV Ingestion

// Upload and ingest a CSV file
using var fileStream = File.OpenRead("data.csv");
var result = await client.Ingest.UploadCsvAsync(fileStream, "data.csv", new IngestCsvOptions
{
    PartnerId = "PARTNER-001",
    MappingConfig = new CsvHeaderMappingCollection
    {
        Id = "mapping-001",
        Version = 1,
        Tables = new Dictionary<string, CsvHeaderTableEntry>
        {
            ["edi_852_items"] = new CsvHeaderTableEntry
            {
                BatchSize = 1000,
                Mapping = new Dictionary<string, object>
                {
                    ["upc"] = "UPC_CODE",
                    ["quantity_on_hand"] = "QTY"
                },
                Defaults = new Dictionary<string, string>()
            }
        }
    }
});

Console.WriteLine($"Processed {result.Stats.ProcessedRows} rows");

// Perform a dry run (validation only, no data changes)
using var testStream = File.OpenRead("test.csv");
var dryResult = await client.Ingest.DryRunAsync(testStream, "test.csv", options);
if (!dryResult.Valid)
{
    foreach (var error in dryResult.Errors)
    {
        Console.WriteLine($"Row {error.Row}: {error.Message}");
    }
}

Identifier Mappings

// Get all identifier patterns for a partner
var patterns = await client.IdentifierMappings.GetAsync("PARTNER-001");

// Get patterns for a specific customer
var customerPatterns = await client.IdentifierMappings.GetForCustomerAsync("PARTNER-001", "CUST-001");

// Add a pattern
await client.IdentifierMappings.AddAsync("PARTNER-001", new IdentifierPattern
{
    Pattern = @"^ACME-\d+$",
    CustomerId = "CUST-001",
    Priority = 10
});

// Remove a pattern
await client.IdentifierMappings.RemoveAsync("PARTNER-001", @"^ACME-\d+$");

GraphQL

The SDK provides LINQ-style queries for all GraphQL operations.

EDI 852 Headers

// Query with filtering and projection
var headers = await client.GraphQL.Edi852Headers()
    .Where(h => h.Status == "pending" && h.VendorPartnerId == "PARTNER-001")
    .Select(h => new { h.Id, h.DocumentId, h.ReportDate, h.TotalItems })
    .ToListAsync();

// Include nested locations
var headersWithLocations = await client.GraphQL.Edi852Headers()
    .Where(h => h.VendorPartnerId == "PARTNER-001")
    .Include(h => h.Locations)
    .Take(10)
    .ToListAsync();

// Nested includes with items
var full = await client.GraphQL.Edi852Headers()
    .Include(h => h.Locations, loc => loc.Include(l => l.Items))
    .FirstOrDefaultAsync();

// Get single header by ID (includes locations and items)
var header = await client.GraphQL.GetEdi852HeaderByIdAsync("header-id");

// Get header by document details
var header = await client.GraphQL.GetEdi852HeaderByDocumentDetailsAsync(
    documentId: "DOC123",
    customerId: "CUST-001",
    partnerId: "PARTNER-001");

EDI 852 Locations

// Query locations for a header
var locations = await client.GraphQL.Edi852Locations()
    .ForHeader("header-id")
    .IncludeItems()
    .Take(100)
    .ToListAsync();

// Get single location by ID (includes items)
var location = await client.GraphQL.GetEdi852LocationByIdAsync("location-id");

EDI 852 Items

// Query items for a location
var items = await client.GraphQL.Edi852Items()
    .ForLocation("location-id")
    .Select(i => new { i.Id, i.Upc, i.QuantityOnHand })
    .Take(50)
    .ToListAsync();

// Get single item by ID
var item = await client.GraphQL.GetEdi852ItemByIdAsync("item-id");

EDI 852 Delivery Summaries

// Query delivery summaries by date range
var summaries = await client.GraphQL.Edi852DeliverySummaries()
    .ForPartners("PARTNER-001", "PARTNER-002")
    .ForCustomer("CUST-001")  // optional
    .InDateRange("2024-01-01", "2024-12-31")
    .Take(100)
    .ToListAsync();

Trading Partner Executions

// Query execution details
var executions = await client.GraphQL.TradingPartnerExecutions()
    .Where(e => e.TradingPartnerId == "PARTNER-001")
    .Take(50)
    .ToListAsync();

// Query execution summaries
var summaries = await client.GraphQL.TradingPartnerExecutionSummaries()
    .ToListAsync();

Customer Partner IDs

// Get partner IDs for a customer
var partnerIds = await client.GraphQL.CustomerPartnerIds()
    .ForCustomer("CUST-001")
    .IncludeInactive()  // optional
    .ToListAsync();

Query Methods Reference

Method Description
.Where(predicate) Filter using expressions (==, !=, &&)
.Select(selector) Project to anonymous/named types
.Include(nav) Include nested navigation properties
.Take(n) Limit results
.ToListAsync() Execute and return list
.FirstOrDefaultAsync() Execute and return first or null

Dependency Injection

Register the client in Program.cs:

using NeoEdi.Sdk.DependencyInjection;

// Option 1: Configure inline
builder.Services.AddNeoEdiClient(options =>
{
    options.BaseUrl = "https://api.neo-edi.com";
    options.ApiKey = "nedk_xxxxxxxxxxxx";
});

// Option 2: From configuration
builder.Services.AddNeoEdiClient(builder.Configuration.GetSection("NeoEdi"));

With appsettings.json:

{
  "NeoEdi": {
    "BaseUrl": "https://api.neo-edi.com",
    "ApiKey": "nedk_xxxxxxxxxxxx"
  }
}

Then inject INeoEdiClient in your services:

public class CustomerService
{
    private readonly INeoEdiClient _client;

    public CustomerService(INeoEdiClient client)
    {
        _client = client;
    }

    public async Task<EdiCustomer?> GetCustomerAsync(string id)
    {
        return await _client.Customers.GetAsync(id);
    }
}

Error Handling

try
{
    var customer = await client.Customers.GetAsync("non-existent");
}
catch (NeoEdiException ex)
{
    Console.WriteLine($"Error: {ex.Message}");
    Console.WriteLine($"Status Code: {ex.StatusCode}");
}
Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.18 95 1/16/2026
1.0.11 94 1/15/2026
1.0.10 91 1/13/2026
1.0.8 93 1/13/2026
1.0.7 94 1/10/2026
1.0.6 97 1/10/2026
1.0.5 96 1/10/2026
1.0.4 92 1/10/2026
1.0.3 98 1/10/2026
1.0.2 93 1/10/2026
1.0.1 91 1/10/2026
1.0.0 103 1/10/2026
0.1.0 101 1/10/2026