Supplier Integration Guide

This guide provides complete instructions for suppliers to integrate with the RightBytes EDI platform. It covers supplier onboarding, available transport methods (HTTP upload, SFTP polling, and email ingestion), and the EDI/JSON/CSV document formats that the platform validates today.

Table of Contents


Overview

The RightBytes EDI platform accepts data from suppliers via HTTP API, SFTP polling, or email ingestion. This guide focuses on EDI 810 (Invoice) validation plus the JSON/CSV order feeds that share the same ingestion pipeline. The integration process consists of two steps:

  1. Onboarding - Register your supplier account and provide the configuration details for each transport you intend to use.
  2. File Delivery - Send EDI/JSON/CSV files through one of the approved transport methods (HTTP API, SFTP, or Email).

All onboarding APIs use JSON for request/response bodies unless otherwise noted.

Quick Start

  1. Get onboarded via the web form at https://edi.rightbytes.com/onboarding or by POST https://edi.rightbytes.com/api/onboard.
  2. Choose a transport: HTTP API upload, SFTP polling, or Email ingestion.
  3. Send one of the supported payloads:
    • EDI 810 invoice using the RightBytes 004010 profile
    • JSON order file
    • CSV order file
  4. Review the upload response and resolve any reported errors.

Supplier Onboarding

Before you can submit files, you must be onboarded as a supplier in the system. This is typically done by a RightBytes administrator, but you may be asked to provide the information that populates the onboarding payload. RightBytes offers two entry points that both feed the same /api/onboard endpoint:

  1. A guided web form for operations teams who prefer a UI workflow.
  2. A JSON API for scripted or automated provisioning.

Web Form Onboarding

Visit https://edi.rightbytes.com/onboarding to walk through the onboarding wizard. The form builds the same payload described in the API section below and is useful when stakeholders want to copy/paste configuration details instead of composing JSON manually.

How it works

What you receive

Onboarding API

Use the API when you want to automate onboarding via scripts or CI/CD tooling.

Endpoint

POST /api/onboard
Content-Type: application/json

Request Format

{
  "supplier": {
    "supplier_code": "ACME001",
    "supplier_name": "ACME Foods Inc",
    "supplier_qualifier": "ZZ",
    "contact_name": "John Smith",
    "contact_email": "[email protected]",
    "contact_phone": "+1-555-123-4567",
    "is_active": true
  },
  "configurations": [
    {
      "customer_number": 145,
      "supplier_code": "ACME001",
      "integration_type": "EDI-810",
      "transport_method": "API",
      "is_active": true
    },
    {
      "customer_number": 145,
      "supplier_code": "ACME001",
      "integration_type": "CSV",
      "transport_method": "SFTP",
      "sftp_config": {
        "host": "sftp.acmefoods.com",
        "port": 22,
        "username": "rightbytes",
        "password": "<your-sftp-password>",
        "path": "/exports/invoices",
        "file_pattern": "invoice-*.csv"
      }
    },
    {
      "customer_number": 145,
      "supplier_code": "ACME001",
      "integration_type": "EDI-810",
      "transport_method": "Email",
      "email_config": {
        "email_sender_address": "[email protected]",
        "email_subject_pattern": "Invoice*",
        "email_attachment_pattern": "*.edi"
      }
    }
  ]
}

Request Fields

Supplier Object (Required)
Field Type Required Description
supplier_code string Yes Unique identifier for the supplier (e.g., "ACME001")
supplier_name string Yes Company name
supplier_qualifier string No EDI qualifier code (default: "ZZ"). Common values: "ZZ" (Mutually Defined), "01" (DUNS), "92" (Assigned by Buyer)
contact_name string No Primary contact name
contact_email string No Contact email address
contact_phone string No Contact phone number
is_active boolean No Whether supplier is active (default: true)
Configuration Object (Required - at least one)
Field Type Required Description
customer_number integer Yes The RightBytes customer number you are supplying to
supplier_code string Yes Must match the supplier code above
integration_type string Yes Type of data: "EDI-810" (Invoice), "CSV", or "JSON"
transport_method string Yes How data will be sent: "API", "SFTP", or "Email"
is_active boolean No Whether configuration is active (default: true)
SFTP Configuration Object

Provide this block when transport_method is "SFTP".

Field Type Required Description
host string Yes Public hostname or IP address of your SFTP server
port integer No TCP port (default 22)
username string Yes Username RightBytes should use when connecting
password string Yes Password for the user (stored securely by RightBytes; never returned)
path string No Remote directory to poll (default /)
file_pattern string No Glob-style file filter (default *)
Email Configuration Object

Provide this block when transport_method is "Email".

Field Type Required Description
email_sender_address string Yes Exact sender email address we should trust
email_subject_pattern string No Pattern to match subject lines (default *)
email_attachment_pattern string No Pattern to match attachment names (default *)
email_recipient_address string No Leave blank during onboarding; RightBytes will populate this automatically with the generated plus-address

Notes:

Successful Response

{
  "success": true,
  "message": "Successfully onboarded supplier 'ACME001' with 3 configuration(s)",
  "supplier_id": 42,
  "config_ids": [156, 157, 158],
  "errors": [],
  "generated_api_keys": {
    "156": "rbedi_5ec9432e9b5304de3da2ba6acb9fd973"
  },
  "generated_email_addresses": {
    "158": "[email protected]"
  },
  "generated_sftp_configs": {
    "157": {
      "host": "sftp.acmefoods.com",
      "port": 22,
      "username": "rightbytes",
      "path": "/exports/invoices",
      "file_pattern": "invoice-*.csv"
    }
  }
}

Response field clarifications:

Important: API keys are only shown once at onboarding time. Store them securely; RightBytes support cannot retrieve the same key again.

Error Response

{
  "success": false,
  "message": "Failed to onboard supplier 'ACME001': 1 configuration error(s) occurred. No changes were made.",
  "supplier_id": null,
  "config_ids": [],
  "errors": [
    "Customer number 999 does not exist in the system. Please contact support to set up this customer first."
  ],
  "generated_api_keys": null,
  "generated_email_addresses": null,
  "generated_sftp_configs": null
}

File Transport Options

After onboarding you can enable one or more transport methods. All transports feed the same ingestion pipeline (file validation → blob storage → downstream processing) and support the same payload formats (EDI 810, CSV orders, JSON orders). The sections below describe how each method works today.

File Upload API (HTTP)

Use this endpoint to push files directly to RightBytes over HTTPS. It accepts EDI (.edi), CSV (.csv), and JSON (.json) payloads. File type detection happens automatically based on both the contents and the X-File-Name extension.

Endpoint

POST /api/upload

Headers

Header Required Description Example
X-API-Key Yes Your API key from onboarding (identifies your supplier account) rbedi_5ec9432e9b5304de3da2ba6acb9fd973
X-File-Name No Name of the file being uploaded (RightBytes infers file type from this extension if possible) invoice-2025-001.edi
Content-Type Yes application/octet-stream or text/csv for EDI/CSV uploads, application/json for JSON payloads application/json

Request Body

Send the raw file content. EDI/CSV uploads should be transmitted as binary streams (--data-binary), while JSON uploads should be UTF-8 encoded text. Maximum supported file size is 100 MB across all formats.

Example Request (cURL)

curl -X POST "https://edi.rightbytes.com/api/upload" \
  -H "X-API-Key: rbedi_5ec9432e9b5304de3da2ba6acb9fd973" \
  -H "X-File-Name: invoice-2025-001.edi" \
  -H "Content-Type: application/octet-stream" \
  --data-binary @invoice-2025-001.edi

Example Request (Python)

import json
import requests

url = "https://edi.rightbytes.com/api/upload"

order_payload = {
  "supplier_name": "ACME Foods",
  "orders": [{
    "order_id": "ORD-2025-001",
    "ship_to_location": "Store 145",
    "lines": [{
      "product_name": "Chocolate Chip Cookies",
      "supplier_product_code": "ACME-CC-001",
      "brand": "ACME",
      "category": "Bakery",
      "quantity": 24,
      "unit_of_measure": "CA",
      "cost": 12.99
    }]
  }]
}

response = requests.post(
  url,
  data=json.dumps(order_payload).encode("utf-8"),
  headers={
    "X-API-Key": "rbedi_5ec9432e9b5304de3da2ba6acb9fd973",
    "X-File-Name": "order-2025-001.json",
    "Content-Type": "application/json"
  }
)

print(response.json())

Successful Response

{
  "status": "success",
  "message": "File uploaded successfully",
  "file_id": "ACME001:invoice-2025-001.edi:ad2f1673f5b66a13",
  "file_type": "edi",
  "size": 1250
}

Error Responses

400 Bad Request - Invalid input

{
  "error": "No file content provided"
}

or

{
  "error": "Invalid filename: {details}"
}

or

{
  "error": "File exceeds maximum size of 100MB"
}

401 Unauthorized - Missing or invalid API key

{
  "error": "Missing X-API-Key header"
}

or

{
  "error": "Invalid API key"
}

403 Forbidden - Supplier or configuration is inactive

{
  "error": "Supplier is inactive"
}

or

{
  "error": "Supplier configuration is inactive"
}

500 Internal Server Error - Server-side error

{
  "error": "Database error"
}

or

{
  "error": "Internal server error"
}

SFTP Polling

Choose this transport when you already host files on your own SFTP server and prefer RightBytes to pick them up. During onboarding you provide the host, port, username, password, remote path, and file pattern. Credentials are stored securely; passwords are never written to the RightBytes response or logs.

The onboarding response returns a generated_sftp_configs entry for each SFTP configuration so you can confirm the non-secret values (host/port/path/pattern) that RightBytes is using.

Email Ingestion

This option lets you email attachments (EDI/CSV/JSON) to RightBytes. Supply the sending mailbox, subject filter, and attachment pattern during onboarding. RightBytes generates a unique plus-address—for example [email protected]—and returns it in generated_email_addresses.


Payload Formats

All transport methods feed the same validation pipeline and accept the formats below. Use these specifications to ensure your files pass validation regardless of how they were delivered.

EDI 810 Invoice Format

The RightBytes platform accepts ANSI X12 810 Invoice transactions. This section describes the RightBytes 810 implementation requirements based on ANSI X12 004010. Requirements marked "Required" refer to what the RightBytes platform validates, not the full ANSI X12 standard.

RightBytes Validation Scope: RightBytes intentionally enforces a stricter subset of the ANSI X12 810 standard. When you see "Required" below, read it as "Required for RightBytes to accept and process the file," even if the official X12 spec marks that segment optional.

Requirements Summary

Segment Requirements (RightBytes validation rules)

Segment Requirement Notes
ISA, GS, ST, SE, GE, IEA Required Envelope segments - file will be rejected without these
BIG Required Invoice header - file will be rejected without this
N1*ST Required Ship-To location is required
IT1 Required At least one line item required
PID Required Product description needed (see Line Item Data below)
REF*DP Required Category is required for each line item
N1SU, N1BY, N3, N4 Optional Additional trading partner information
TDS, CTT Optional Summary totals (recommended but not validated)
DTM, TXI, SAC, LIN Optional Additional information

Note: "Required" in this table means the segment is required by the RightBytes platform. Some of these segments are optional in the ANSI X12 810 standard but are mandatory for RightBytes processing.

Line Item Data Requirements (RightBytes validation rules)

Each IT1 line item must provide the following data (via IT1, PID, or REF segments):

Data Field Required Source Segment
Product Name Yes PID*F (element 5)
UPC or Supplier SKU Yes (at least one) IT1 positions 6-7+ (UP or VN/SK qualifier)
Brand Yes PIDS (element 5), or extracted from first word of PIDF if not provided
Category Yes REF*DP
Quantity Yes IT1 position 2
Unit Cost Yes IT1 position 4
Unit of Measure Yes IT1 position 3

Note: These fields are required by the RightBytes platform for inventory tracking and reporting. Some are optional in the ANSI X12 810 standard.

Document Structure

An EDI 810 document consists of:

  1. Envelope segments (ISA/IEA, GS/GE) - Transport metadata
  2. Header segments (ST, BIG, REF, N1) - Invoice header information
  3. Detail segments (IT1, PID, REF) - Line item details
  4. Summary segments (TDS, CTT, SE) - Totals

Format notes:

Minimal Example

ISA*00*          *00*          *ZZ*ACME001        *ZZ*RIGHTBYTES     *250127*1030*U*00401*000000001*0*P*>~
GS*IN*ACME001*RIGHTBYTES*20250127*1030*1*X*004010~
ST*810*0001~
BIG*20250127*INV-001*20250120*PO-100001~
N1*ST*Store Name*92*0000000145~
IT1*1*10*EA*5.99**VN*SKU-001~
PID*F****ACME Chips 12oz~
PID*S****ACME~
REF*DP*Snacks~
TDS*5990~
CTT*1~
SE*9*0001~
GE*1*1~
IEA*1*000000001~

Segment Reference

ISA - Interchange Control Header (Required)

Identifies the interchange sender and receiver.

Position Element Description
ISA01 Authorization Qualifier Use "00"
ISA02 Authorization Info 10 spaces
ISA03 Security Qualifier Use "00"
ISA04 Security Info 10 spaces
ISA05 Sender ID Qualifier "ZZ" or your assigned qualifier
ISA06 Sender ID Your supplier code (15 chars, padded)
ISA07 Receiver ID Qualifier "ZZ"
ISA08 Receiver ID "RIGHTBYTES" (15 chars, padded)
ISA09 Date YYMMDD format
ISA10 Time HHMM format
ISA11 Standards ID "U"
ISA12 Version "00401"
ISA13 Control Number Unique number (9 digits)
ISA14 Ack Requested "0"
ISA15 Usage Indicator "P" (Production) or "T" (Test)
ISA16 Component Separator ">"

GS - Functional Group Header (Required)

Position Element Description
GS01 Functional ID "IN" for Invoice
GS02 Sender Code Your supplier code
GS03 Receiver Code "RIGHTBYTES"
GS04 Date CCYYMMDD format
GS05 Time HHMM format
GS06 Control Number Group control number
GS07 Agency Code "X"
GS08 Version "004010"

ST - Transaction Set Header (Required)

Position Element Description
ST01 Transaction Set ID "810"
ST02 Control Number Transaction control number

BIG - Beginning Segment for Invoice (Required)

Position Element Required Description
BIG01 Invoice Date Yes CCYYMMDD format
BIG02 Invoice Number Yes Your invoice number
BIG03 PO Date Required Purchase order date
BIG04 PO Number No Purchase order number

REF - Reference Information (Optional)

Position Element Description
REF01 Qualifier See qualifiers below
REF02 Value Reference value

Reference Qualifiers:

Examples:

REF*CN*TRACK-12345~
REF*CO*CUST-ORD-789~
REF*DP*Grocery~
REF*SO*SO-2025-001~

DTM - Date/Time Reference at Header Level (Optional)

Date/time information for the invoice.

Position Element Description
DTM01 Qualifier Date type code
DTM02 Date CCYYMMDD format
DTM03 Time HHMM or HHMMSS format (optional)

Date Qualifiers:

Examples:

DTM*011*20250125~
DTM*002*20250127*1430~

N1 - Name (Required for Ship-To)

Identifies trading partners. N1*ST (Ship-To) is required for all EDI 810 invoices submitted to RightBytes.

Position Element Description
N101 Entity Code "ST" (Ship To - Required), "BY" (Buyer), "SU" (Supplier)
N102 Name Entity name
N103 ID Qualifier "92" for Assigned by Buyer
N104 ID Store/location ID (used as ship_to_location)

For Ship-To, the N104 should be the store number padded to 10 digits (e.g., "0000000145").

Example:

N1*ST*Main Street Store*92*0000000145~

N3 - Address Information (Optional)

Position Element Description
N301 Street Address Street address line

N4 - Geographic Location (Optional)

Position Element Description
N401 City City name
N402 State State code (2 chars)
N403 ZIP Postal code

IT1 - Baseline Item Data (Required - one per line item)

Position Element Required Description
IT101 Line Number Yes Sequential line number (1, 2, 3...)
IT102 Quantity Yes Quantity invoiced
IT103 Unit of Measure Yes EA, CA, CS, LB, OZ, PK, BX, DZ, KG, GM
IT104 Unit Cost Yes Price per unit
IT105 Basis Code No Usually blank
IT106 ID Qualifier Yes* Product identifier type
IT107 Product ID Yes* Product identifier value

*At least one IT106/IT107 pair is required (UPC or Supplier SKU). Additional pairs can follow. Common qualifiers:

Example with UPC and SKU:

IT1*1*24*CA*12.99**UP*003680004122*VN*SKU-001~

LIN - Item Identification (Optional)

Additional product identifiers for the line item. Qualifier/value pairs can repeat.

Position Element Description
LIN01 ID Qualifier Identifier type
LIN02 Product ID Identifier value
LIN03+ Additional pairs Qualifier/value pairs can continue

Qualifiers:

Example:

LIN*MG*ACME-FOODS*MF*AF-CHIPS-001~

PID - Product/Item Description (Required)

Provides product description and brand information for the line item.

Position Element Description
PID01 Type "F" (Free-form) or "S" (Structured/Brand)
PID05 Description Product name or brand name

PID*F - Product Description (Required):

PID*F****ACME Potato Chips 12oz~

PID*S - Brand Name (Optional):

PID*S****ACME~

The RightBytes parser processes all PID segments for each line item:

Example with both:

PID*F****Potato Chips 12oz~
PID*S****ACME~

This sets Product Name = "Potato Chips 12oz" and Brand = "ACME"

REF at Line Item Level (Category Required)

Reference information specific to a line item. REF*DP (Category) is required for each line item.

Category (Required):

REF*DP*Beverages~

Lot Number (Optional):

REF*LS*LOT-20250127~

DTM - Date/Time Reference at Line Item Level (Optional)

Expiration Date:

DTM*361*20260127~
Position Element Description
DTM01 Qualifier "361" for Expiration Date
DTM02 Date CCYYMMDD format

TDS - Total Monetary Value Summary (Optional but Recommended)

Position Element Description
TDS01 Amount Total in cents (no decimal point)

Example: For $59.90, use TDS*5990~

While not strictly required, including TDS helps verify invoice totals match line item calculations.

TXI - Tax Information (Optional)

Position Element Description
TXI01 Tax Type "ST" for Sales Tax
TXI02 Tax Amount Tax amount in dollars
TXI03 Percent Tax percentage (optional)

Example:

TXI*ST*5.50*5.00~

SAC - Service, Allowance, or Charge (Optional)

Position Element Description
SAC01 Indicator "C" (Charge) or "A" (Allowance)
SAC02 Code Charge type code
SAC05 Amount Charge amount in dollars

Common Charge Codes:

Example:

SAC*C*D240***125.00~

CTT - Transaction Totals (Optional but Recommended)

Position Element Description
CTT01 Line Count Number of IT1 segments

While not strictly required, including CTT helps verify the expected number of line items were received.

SE - Transaction Set Trailer (Required)

Position Element Description
SE01 Segment Count Number of segments in transaction (ST to SE inclusive)
SE02 Control Number Must match ST02

GE - Functional Group Trailer (Required)

Position Element Description
GE01 Transaction Count Number of transactions in group
GE02 Control Number Must match GS06

IEA - Interchange Control Trailer (Required)

Position Element Description
IEA01 Group Count Number of functional groups
IEA02 Control Number Must match ISA13

Complete Example

ISA*00*          *00*          *ZZ*ACME001        *ZZ*RIGHTBYTES     *250127*1030*U*00401*000000001*0*P*>~
GS*IN*ACME001*RIGHTBYTES*20250127*1030*1*X*004010~
ST*810*0001~
BIG*20250127*INV-2025-001*20250120*PO-500123~
REF*CN*TRACK-12345~
DTM*011*20250125~
N1*ST*Main Street Store*92*0000000145~
N3*123 Main Street~
N4*Springfield*IL*62701~
IT1*1*24*CA*12.99**UP*003680004122*VN*ACME-SKU-001~
LIN*MG*ACME-FOODS*MF*AF-CHIPS-001~
PID*F****Potato Chips 12oz~
PID*S****ACME~
REF*DP*Snacks~
REF*LS*LOT-20250127~
DTM*361*20260127~
IT1*2*48*EA*2.49**UP*012345678905*VN*ACME-SKU-002~
PID*F****Cola 12oz Can~
PID*S****ACME~
REF*DP*Beverages~
TDS*45784~
TXI*ST*21.56*5.00~
SAC*C*D240***5.00~
CTT*2~
SE*23*0001~
GE*1*1~
IEA*1*000000001~

Totals breakdown:

JSON Order Format

The RightBytes platform also accepts order data in JSON format. This section describes the RightBytes JSON order schema requirements. Requirements marked "Required" refer to what the RightBytes platform validates.

Document Structure

A JSON order file contains:

  1. Root object - Supplier name and orders array
  2. Orders array - One or more order objects
  3. Lines array - Line items within each order

Requirements Summary

Root Level Requirements (RightBytes validation rules)

Field Required Type Description
supplier_name Yes string Supplier company name (min 1 character)
orders Yes array Array of order objects

Order Level Requirements (RightBytes validation rules)

Field Required Type Description
order_placed_at Yes string Order date/time in ISO 8601 format
lines Yes array Array of line item objects
order_id No string Your order identifier
order_shipped_at No string Ship date/time in ISO 8601 format
order_delivered_at No string Delivery date/time in ISO 8601 format
tracking_number No string Shipment tracking number
invoice_number No string Associated invoice number
ship_to_location Yes string Destination store/location for the entire order

Processing behavior: Every order in the orders array is validated independently. Orders that pass validation continue through processing immediately, while orders with errors are reported without blocking the rest of the file.

Line Item Requirements (RightBytes validation rules)

Field Required Type Description
product_name Yes string Product description
quantity Yes number Quantity ordered (must be positive)
cost Yes number Unit cost (must be non-negative)
brand Yes string Product brand name
category Yes string Product category
unit_of_measure Yes string UOM code (EA, CA, LB, etc.)
upc or supplier_product_code Yes (at least one) string Product identifier
upc No string 12-digit UPC code
supplier_product_code No string Your SKU/product code
manufacturer_name No string Manufacturer company name
manufacturer_product_code No string Manufacturer part number
product_expiration_date No string Expiration date (YYYY-MM-DD format)
product_expiration_timeframe No object Shelf life information

Minimal Example

This example shows only the required fields:

{
  "supplier_name": "ACME Foods",
  "orders": [
    {
      "order_placed_at": "2025-01-27T08:00:00Z",
      "ship_to_location": "Store 145",
      "lines": [
        {
          "product_name": "Chocolate Chip Cookies",
          "supplier_product_code": "ACME-CC-001",
          "brand": "ACME",
          "category": "Bakery",
          "quantity": 24,
          "unit_of_measure": "CA",
          "cost": 12.99
        }
      ]
    }
  ]
}

Complete Example

This example shows all available fields:

{
  "supplier_name": "ACME Foods Inc",
  "orders": [
    {
      "order_id": "ORD-2025-001",
      "order_placed_at": "2025-01-27T08:00:00Z",
      "order_shipped_at": "2025-01-28T10:00:00Z",
      "order_delivered_at": "2025-01-29T14:30:00Z",
      "tracking_number": "TRACK-12345",
      "invoice_number": "INV-2025-001",
      "ship_to_location": "Main Distribution Center",
      "lines": [
        {
          "product_name": "Premium Chocolate Chip Cookies",
          "supplier_product_code": "ACME-CC-001",
          "upc": "012345678901",
          "manufacturer_name": "Cookie Co",
          "manufacturer_product_code": "CC-CHOC-001",
          "brand": "ACME Premium",
          "category": "Bakery",
          "quantity": 48,
          "unit_of_measure": "CA",
          "cost": 15.99,
          "product_expiration_date": "2025-06-15",
          "product_expiration_timeframe": {
            "frozen_days": 180,
            "thawed_days": 7
          }
        },
        {
          "product_name": "Organic Apple Juice",
          "supplier_product_code": "ACME-AJ-002",
          "upc": "012345678902",
          "brand": "ACME Organic",
          "category": "Beverages",
          "quantity": 100,
          "unit_of_measure": "EA",
          "cost": 3.49,
          "product_expiration_date": "2025-12-31"
        }
      ]
    }
  ]
}

Date/Time Formats

All date/time fields use ISO 8601 format:

Format Example Used For
Date-time 2025-01-27T08:00:00Z order_placed_at, order_shipped_at, order_delivered_at
Date only 2025-01-27 product_expiration_date

Expiration Timeframe Object

The product_expiration_timeframe field provides shelf life information:

{
  "product_expiration_timeframe": {
    "frozen_days": 180,
    "thawed_days": 7
  }
}
Field Type Description
frozen_days integer Shelf life when frozen (days)
thawed_days integer Shelf life after thawing (days)

Common Validation Errors

Error Code Field Description Resolution
E004 supplier_name Missing required field Add supplier_name to root object
E004 ship_to_location Missing required field Add ship_to_location to each order object
E004 product_name Missing required field Add product_name to line item
E004 brand Missing required field Add brand to line item
E004 category Missing required field Add category to line item
E004 quantity Quantity must be positive Ensure quantity > 0
E004 upc Either UPC or Supplier Product Code required Add upc or supplier_product_code
E001 upc Invalid UPC (not 12 digits) Ensure UPC is exactly 12 digits

CSV Order Format

The RightBytes platform also accepts supplier orders as UTF-8 CSV files. Each row represents a line item, and the parser uses the first data row to populate order-level fields such as supplier name, ship-to, and timestamps. Column names are case-sensitive and must match the headers listed below.

Document Structure

  1. Header Row – Defines the column names. Required columns must be present.
  2. Line Rows – Each subsequent row is a line item. CSV format supports exactly one order per file. Multiple orders require multiple CSV files.

Requirements Summary

File-Level Columns (RightBytes validation rules)

Column Required Type Description
supplier_name Yes string Supplier company name (used for reporting/display)
ship_to_location Yes string Destination store/location; value from the first row becomes the order-level ship-to
order_placed_at Yes datetime ISO 8601 timestamp (e.g., 2025-01-27T08:00:00Z)
order_id No string Your internal order identifier
order_shipped_at No datetime ISO 8601 timestamp
order_delivered_at No datetime ISO 8601 timestamp
tracking_number No string Shipment tracking number
invoice_number No string Associated invoice number

Note: Populate these columns on every row when possible. The parser reads the first row for order-level values, so the first line must contain accurate data.

Line Item Columns (RightBytes validation rules)

Column Required Type Description
product_name Yes string Product description
supplier_product_code Yes* string Supplier SKU (required if UPC is blank)
upc Yes* string 12-digit UPC (required if supplier SKU is blank)
brand Yes string Product brand name
category Yes string Product category/department
quantity Yes number Quantity ordered; must be positive
unit_of_measure Yes string UOM code (EA, CA, LB, OZ, PK, BX, DZ, KG, GM)
cost Yes number Unit cost; must be non-negative
manufacturer_name No string Manufacturer company name
manufacturer_product_code No string Manufacturer part number
lot_number No string Lot/batch identifier
product_expiration_date No date Shelf-life date (ISO 8601 recommended)
product_expiration_timeframe No string Shelf-life window (e.g., frozen_days:180,thawed_days:7)

*At least one of supplier_product_code or upc must be provided on every row.

Minimal Example

supplier_name,ship_to_location,order_placed_at,product_name,supplier_product_code,brand,category,quantity,unit_of_measure,cost
ACME Foods,Store 145,2025-01-27T08:00:00Z,Chocolate Chip Cookies,ACME-CC-001,ACME,Bakery,24,CA,12.99

Complete Example

supplier_name,ship_to_location,order_id,order_placed_at,order_shipped_at,order_delivered_at,tracking_number,invoice_number,product_name,supplier_product_code,upc,brand,category,quantity,unit_of_measure,cost,manufacturer_name,manufacturer_product_code,lot_number,product_expiration_date,product_expiration_timeframe
ACME Foods,Main Distribution Center,ORD-2025-001,2025-01-27T08:00:00Z,2025-01-28T10:00:00Z,2025-01-29T14:30:00Z,TRACK-12345,INV-2025-001,Premium Chocolate Chip Cookies,ACME-CC-001,012345678901,ACME Premium,Bakery,48,CA,15.99,Cookie Co,CC-CHOC-001,LOT-20250127,2025-06-15,"frozen_days:180,thawed_days:7"
ACME Foods,Main Distribution Center,ORD-2025-001,2025-01-27T08:00:00Z,2025-01-28T10:00:00Z,2025-01-29T14:30:00Z,TRACK-12345,INV-2025-001,Organic Apple Juice,ACME-AJ-002,012345678902,ACME Organic,Beverages,100,EA,3.49,,,,2025-12-31,

Additional Notes


Error Handling

Parsing Errors

These errors occur when the EDI file structure is invalid:

Error Description Resolution
Missing ISA/GS segment EDI envelope is incomplete Ensure all envelope segments (ISA, GS, GE, IEA) are present
Missing ST/SE segment Transaction set envelope is incomplete Ensure ST and SE segments are present and control numbers match
Missing BIG segment Invoice header is required Add BIG segment with invoice date and number
Not an 810 transaction Wrong transaction type in ST01 Verify ST01 contains "810"
Invalid EDI structure General structure issues Check segment terminators and element separators

Data Validation Errors

These errors occur when required data is missing or invalid:

Code Error Resolution
E001 Invalid UPC (not 12 digits) Ensure UPC is exactly 12 digits, zero-padded if needed
E004 Missing required field: Invoice number Add invoice number in BIG02
E004 Missing required field: Invoice date Add invoice date in BIG01
E004 Missing required field: N1*ST (Ship-To) segment is required Add N1*ST segment with store/location ID
E004 Missing required field: Invoice line items Add at least one IT1 segment
E004 Missing required field: Product name Add PID*F segment with product description
E004 Missing required field: Either UPC or Supplier SKU Add UP or VN/SK qualifier in IT1
E004 Missing required field: Brand Add PID*S segment or ensure description has extractable brand
E004 Missing required field: Category Add REF*DP segment for each line item
E004 Missing required field: Quantity must be positive Ensure IT102 has a positive value
E004 Missing required field: Unit cost cannot be negative Ensure IT104 is non-negative
E004 Missing required field: Unit of measure Ensure IT103 has valid UOM code
E005 Invalid date format Use CCYYMMDD format (e.g., 20250127)

Warnings

These are non-fatal issues that will be logged but won't reject the file:

Code Warning Description
W001 Supplier ID not provided N1*SU segment missing
W002 PO date is after invoice date BIG03 date is later than BIG01
W003 Total amount cannot be negative TDS value is negative
W004 Line count mismatch CTT01 doesn't match number of IT1 segments
W011 Unusual unit of measure UOM not in standard list

Best Practices

  1. Validate Locally - Check your EDI file structure before uploading
  2. Unique Invoice Numbers - Each invoice number should be unique
  3. Consistent Supplier Code - Use your supplier code in ISA06 (matches your API key configuration)
  4. Control Numbers - Increment control numbers (ISA13, GS06) with each transmission

Support

For technical support or questions about integration:

For issues with specific file rejections, please provide: