Outbound
Version 1
Schema
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"title": "Barrett Distribution Centers, Inc. Outbound Order Schema",
"description": "Version 1",
"additionalProperties": false,
"properties": {
"customerId": {
"type": "string"
},
"orderId": {
"type": "string",
"maxLength": 20,
"pattern": "^[A-Za-z0-9\\-_. ]+$",
"description": "At most 20 characters; send it in upper case. Barrett stores the id upper-cased and cut to 20 characters, and every later lookup by order id is an exact, case-sensitive match on that stored value."
},
"orderType": {
"type": "string",
"enum": [
"outgoing"
]
},
"orderStatus": {
"type": "string"
},
"orderDirective": {
"enum": [
"hot",
"shipShort",
"specialHand",
"normal",
"backOrder",
"scheduled",
"dropShip",
"exception",
"repickSuggest",
"hold",
"noNotify",
"discount",
"routed",
"sameDayShip",
"edi",
null
]
},
"fromFacility": {
"type": "string",
"enum": [
"MA6",
"CA3",
"FF1",
"MS2",
"MA5",
"FRA",
"TMS",
"NJ2",
"TN5",
"TN4",
"TN2",
"TN3",
"MS1",
"MEM",
"TX1",
"TX2",
"NY1",
"GTZ",
"MSP",
"NJ3",
"PRC",
"GBM",
"BIT",
"MBC",
"JER",
"IDR",
"FRS",
"CTP",
"BRI",
"BDC",
"MAN",
"FRT",
"NBO",
"MS3",
"MS4",
"MS5",
"MST",
"SG1",
"SG2"
]
},
"tradingPartnerId": {
"type": "string"
},
"purchaseOrder": {
"type": "string",
"maxLength": 20
},
"dates": {
"$ref": "#/definitions/dates"
},
"transport": {
"$ref": "#/definitions/transport"
},
"billTo": {
"oneOf": [
{
"$ref": "#/definitions/address"
},
{
"$ref": "#/definitions/addressId"
}
]
},
"shipTo": {
"oneOf": [
{
"$ref": "#/definitions/address"
},
{
"$ref": "#/definitions/addressId"
}
]
},
"custom": {
"$ref": "#/definitions/custom"
},
"items": {
"type": "array",
"minItems": 1,
"items": {
"$ref": "#/definitions/item"
}
},
"orderInstructions": {
"type": "string"
},
"tags": {
"type": "array",
"items": {
"type": "string"
},
"description": "Order tag ids; each must exist for the customer"
},
"bolComment": {
"type": "string",
"maxLength": 4000,
"description": "Applied by PUT /v1/orders only; accepted but ignored on create."
},
"proNumber": {
"type": "string",
"maxLength": 20,
"description": "Applied by PUT /v1/orders only; accepted but ignored on create."
},
"routingStatus": {
"type": "string",
"enum": [
"0",
"1",
"2",
"3",
"4"
],
"description": "Applied by PUT /v1/orders only; accepted but ignored on create."
}
},
"required": [
"orderId",
"orderType",
"customerId",
"dates",
"transport",
"shipTo",
"items",
"fromFacility"
],
"definitions": {
"address": {
"type": "object",
"additionalProperties": false,
"properties": {
"contactName": {
"type": "string"
},
"companyName": {
"type": "string"
},
"email": {
"type": "string",
"format": "email"
},
"streetOne": {
"type": "string"
},
"streetTwo": {
"type": "string"
},
"city": {
"type": "string"
},
"state": {
"type": "string"
},
"postalCode": {
"type": "string"
},
"country": {
"type": "string",
"description": "ISO 3166-1 alpha-2 or alpha-3 code"
},
"phone": {
"type": "string"
}
},
"required": [
"streetOne",
"city"
],
"anyOf": [
{
"properties": {
"contactName": true
},
"required": [
"contactName"
]
},
{
"properties": {
"companyName": true
},
"required": [
"companyName"
]
}
],
"if": {
"properties": {
"country": {
"enum": [
"US",
"USA",
"us",
"usa"
]
}
},
"required": [
"country"
]
},
"then": {
"properties": {
"state": true,
"postalCode": true
},
"required": [
"state",
"postalCode"
]
}
},
"addressId": {
"type": "object",
"additionalProperties": false,
"properties": {
"addressId": {
"type": "string"
}
},
"required": [
"addressId"
]
},
"custom": {
"type": "object",
"additionalProperties": false,
"properties": {
"customStrings": {
"type": "array",
"minItems": 1,
"items": {
"$ref": "#/definitions/customString"
}
},
"customNumbers": {
"type": "array",
"minItems": 1,
"items": {
"$ref": "#/definitions/customNumber"
}
},
"customDates": {
"type": "array",
"minItems": 1,
"items": {
"$ref": "#/definitions/customDate"
}
}
},
"anyOf": [
{
"properties": {
"customStrings": true
},
"required": [
"customStrings"
]
},
{
"properties": {
"customNumbers": true
},
"required": [
"customNumbers"
]
},
{
"properties": {
"customDates": true
},
"required": [
"customDates"
]
}
]
},
"customString": {
"type": "object",
"additionalProperties": false,
"properties": {
"name": {
"type": "string"
},
"value": {
"type": "string",
"maxLength": 255
}
},
"required": [
"name",
"value"
]
},
"customNumber": {
"type": "object",
"additionalProperties": false,
"properties": {
"name": {
"type": "string"
},
"value": {
"type": "number"
}
},
"required": [
"name",
"value"
]
},
"customDate": {
"type": "object",
"additionalProperties": false,
"properties": {
"name": {
"type": "string"
},
"value": {
"type": "string",
"format": "date"
}
},
"required": [
"name",
"value"
]
},
"dates": {
"type": "object",
"additionalProperties": false,
"properties": {
"shipDateStart": {
"type": "string",
"format": "date",
"pattern": "^\\d{4}-\\d{2}-\\d{2}$"
},
"shipDateStop": {
"type": "string",
"format": "date",
"pattern": "^\\d{4}-\\d{2}-\\d{2}$"
},
"shipDateCancelBy": {
"type": "string",
"format": "date",
"pattern": "^\\d{4}-\\d{2}-\\d{2}$"
},
"poDate": {
"type": "string",
"format": "date",
"pattern": "^\\d{4}-\\d{2}-\\d{2}$"
},
"deliveryDate": {
"type": "string",
"format": "date",
"pattern": "^\\d{4}-\\d{2}-\\d{2}$"
},
"appointmentDate": {
"type": "string",
"format": "date",
"pattern": "^\\d{4}-\\d{2}-\\d{2}$"
}
},
"required": [
"shipDateStart"
]
},
"item": {
"type": "object",
"additionalProperties": false,
"properties": {
"itemId": {
"type": "string"
},
"itemDescription": {
"type": "string"
},
"tradingPartnerItemId": {
"type": "string",
"maxLength": 20
},
"upc": {
"type": "string",
"maxLength": 20
},
"orderedQuantity": {
"type": "integer",
"minimum": 0
},
"orderedQuantityUom": {
"type": "string",
"enum": [
"EA",
"PR",
"INNR",
"BAGS",
"CS",
"CTN",
"CRAT",
"PLT"
]
},
"lotNumber": {
"type": "string",
"maxLength": 30
},
"inventoryClass": {
"type": "string",
"minLength": 2,
"maxLength": 2
},
"custom": {
"$ref": "#/definitions/custom"
},
"comment": {
"type": "string"
},
"itemStatus": {
"type": "string"
}
},
"required": [
"orderedQuantity",
"orderedQuantityUom"
],
"anyOf": [
{
"properties": {
"itemId": true
},
"required": [
"itemId"
]
},
{
"properties": {
"upc": true
},
"required": [
"upc"
]
}
]
},
"transport": {
"type": "object",
"additionalProperties": false,
"properties": {
"carrier": {
"type": "string",
"enum": [
"BW01",
"BWTQ",
"CHR",
"CPU",
"DHL",
"DPGM",
"FCI",
"FDEG",
"FEDX",
"FXFE",
"GBLE",
"HGDS",
"HJBI",
"JBHU",
"P2PG",
"RLUS",
"ROUT",
"TRK",
"UPS",
"USP2",
"USPS",
"WWXS",
"ABF",
"AVGW",
"CENT",
"CEVA",
"DHXI",
"ECHS",
"EXLA",
"FECC",
"LVLP",
"MOLY",
"NFBR",
"ODFL",
"ROCO",
"SAIA",
"SFNC",
"SPAJ",
"TALO",
"TQYL"
]
},
"service": {
"type": "string",
"maxLength": 4
},
"terms": {
"type": "string",
"enum": [
"PPD",
"COL",
"3RD",
"PCK",
"UCB",
"DDP",
"CSL",
"DT3",
"DAP",
"FCA"
]
},
"type": {
"type": "string",
"enum": [
"A",
"B",
"C",
"L",
"P",
"R",
"S",
"T"
]
},
"shipperAccount": {
"type": "string"
},
"specialService1": {
"type": "string",
"maxLength": 4
},
"specialService2": {
"type": "string",
"maxLength": 4
},
"specialService3": {
"type": "string",
"maxLength": 4
},
"specialService4": {
"type": "string",
"maxLength": 4
},
"retailerRoutingNumber": {
"type": "string"
}
},
"allOf": [
{
"if": {
"properties": {
"carrier": {
"const": "BW01"
}
},
"required": [
"carrier"
]
},
"then": {
"properties": {
"service": {
"type": "string",
"enum": [
"C001",
"C002",
"C003",
"C004",
"C005",
"C008"
]
}
},
"required": [
"service"
]
}
},
{
"if": {
"properties": {
"carrier": {
"const": "CHR"
}
},
"required": [
"carrier"
]
},
"then": {
"properties": {
"service": {
"type": "string",
"enum": [
"AIRF",
"CHRB",
""
]
}
}
}
},
{
"if": {
"properties": {
"carrier": {
"const": "DHL"
}
},
"required": [
"carrier"
]
},
"then": {
"properties": {
"service": {
"type": "string",
"enum": [
"INTL",
"NXDY",
"AIR",
"GND",
"2ND"
]
}
},
"required": [
"service"
]
}
},
{
"if": {
"properties": {
"carrier": {
"const": "FDEG"
}
},
"required": [
"carrier"
]
},
"then": {
"properties": {
"service": {
"type": "string",
"enum": [
"1STO",
"1STR",
"PROV",
"PROR",
"STOV",
"STOR",
"2DAY",
"2DAR",
"2AM",
"2AMR",
"EXSA",
"EXSR",
"GRND",
"HOME",
"SPST",
"1FTF",
"2FTF",
"3FTF",
"INT1",
"INT2",
"INCP",
"INF1",
"INF2"
]
}
},
"required": [
"service"
]
}
},
{
"if": {
"properties": {
"carrier": {
"const": "FEDX"
}
},
"required": [
"carrier"
]
},
"then": {
"properties": {
"service": {
"type": "string",
"enum": [
"1STO",
"2DAY",
"GRND",
"HOME",
"INT1",
"INT2",
"INT0",
"PROV",
"STOV",
"SPST",
"EXSA"
]
}
},
"required": [
"service"
]
}
},
{
"if": {
"properties": {
"carrier": {
"const": "ROUT"
}
},
"required": [
"carrier"
]
},
"then": {
"properties": {
"service": {
"type": "string",
"enum": [
"ROUT"
]
}
},
"required": [
"service"
]
}
},
{
"if": {
"properties": {
"carrier": {
"const": "UPS"
}
},
"required": [
"carrier"
]
},
"then": {
"properties": {
"service": {
"type": "string",
"enum": [
"RED",
"REDE",
"GRES",
"CNST",
"2DAM",
"WWXP",
"WWX",
"WWE",
"SRPT",
"REDS",
"ORNG",
"GRND",
"WWXS",
"BLUE",
"GFP",
"CNSR",
"WXPR",
"WWXR",
"REDR",
"RDER",
"RDSR",
"BLUR",
"2AMR",
"ORNR",
"WWER",
"MIPS"
]
}
},
"required": [
"service"
]
}
},
{
"if": {
"properties": {
"carrier": {
"const": "USP2"
}
},
"required": [
"carrier"
]
},
"then": {
"properties": {
"service": {
"type": "string",
"enum": [
"FCP",
"PRI",
"ITPR",
"ITEX",
"PP",
"EX",
"GRAV"
]
}
},
"required": [
"service"
]
}
},
{
"if": {
"properties": {
"carrier": {
"const": "USPS"
}
},
"required": [
"carrier"
]
},
"then": {
"properties": {
"service": {
"type": "string",
"enum": [
"ITFC",
"ITGX",
"ITPR",
"ITEX",
"PRI",
"AIR",
"REG",
"GRAV"
]
}
},
"required": [
"service"
]
}
},
{
"if": {
"properties": {
"carrier": {
"const": "GBLE"
}
},
"required": [
"carrier"
]
},
"then": {
"properties": {
"service": {
"type": "string",
"enum": [
"GEEC"
]
}
},
"required": [
"service"
]
}
},
{
"if": {
"properties": {
"carrier": {
"const": "FCI"
}
},
"required": [
"carrier"
]
},
"then": {
"properties": {
"service": {
"type": "string",
"enum": [
"ECON"
]
}
},
"required": [
"service"
]
}
},
{
"if": {
"properties": {
"carrier": {
"const": "DPGM"
}
},
"required": [
"carrier"
]
},
"then": {
"properties": {
"service": {
"type": "string",
"enum": [
"GRND",
"EXPD"
]
}
},
"required": [
"service"
]
}
},
{
"if": {
"properties": {
"carrier": {
"const": "P2PG"
}
},
"required": [
"carrier"
]
},
"then": {
"properties": {
"service": {
"type": "string",
"enum": [
"PIEX",
"PIST",
"PDFP",
"PDSD",
"P2AU",
"P2CA",
"P2EU",
"P2IE",
"P2UK",
"PROW"
]
}
},
"required": [
"service"
]
}
},
{
"if": {
"properties": {
"carrier": {
"enum": [
"BWTQ",
"CPU",
"FXFE",
"HGDS",
"HJBI",
"JBHU",
"RLUS",
"TRK",
"WWXS",
"ABF",
"AVGW",
"CENT",
"CEVA",
"DHXI",
"ECHS",
"EXLA",
"FECC",
"LVLP",
"MOLY",
"NFBR",
"ODFL",
"ROCO",
"SAIA",
"SFNC",
"SPAJ",
"TALO",
"TQYL"
]
}
},
"required": [
"carrier"
]
},
"then": {
"properties": {
"service": {
"type": "string",
"maxLength": 0
}
}
}
}
],
"required": [
"carrier",
"terms",
"type"
]
}
}
}
Sample
{
"orderId": "OST23577532",
"orderType": "outgoing",
"customerId": "7782",
"purchaseOrder": "PO-123456",
"fromFacility": "MA6",
"tradingPartnerId": "DX1276",
"dates": {
"shipDateStart": "2015-06-17",
"shipDateCancelBy": "2018-04-20",
"poDate": "1946-06-14",
"shipDateStop": "1990-03-27",
"deliveryDate": "2020-01-12",
"appointmentDate": "2020-01-06"
},
"transport": {
"carrier": "FDEG",
"service": "HOME",
"terms": "PPD",
"type": "S",
"shipperAccount": "155555555"
},
"shipTo": {
"contactName": "Jane Doe",
"companyName": "Home Enterprises LLC",
"email": "email@email.com",
"streetOne": "123 West Way",
"streetTwo": "APT 21",
"city": "Maple Grove",
"state": "VA",
"postalCode": "88476",
"country": "US",
"phone": "800-555-1234"
},
"billTo": {
"addressId": "TY721"
},
"items": [
{
"itemId": "WX5786",
"orderedQuantity": 1,
"orderedQuantityUom": "EA",
"upc": "03600029145334",
"itemDescription": "SHOE AXL BLCK",
"lotNumber": "20210801",
"inventoryClass": "RG",
"tradingPartnerItemId": "DX12783384002"
},
{
"itemId": "WX9536",
"orderedQuantity": 10,
"orderedQuantityUom": "EA",
"itemDescription": "SHOE AXL WT",
"tradingPartnerItemId": "DX12783384001",
"upc": "036000291459972",
"lotNumber": "20210801",
"inventoryClass": "RG"
}
]
}
The sample billTo.addressId is a placeholder; replace it with the id of one of your consignees (GET /v1/consignees).
Transport Codes
The following captures the allowed values for the transport properties found in Barrett's REST APIs.
Note
transport.service is required for every carrier that has service codes, except CHR (see below), and must be one
of that carrier's codes. For carriers listed as having no service codes, transport.service must be omitted or
empty; any value is rejected.
transport.specialService1 to specialService4 are validated per carrier and service; retrieve the accepted
codes with GET /v1/special-services?carrier={carrier}&service={service}. Special services require a service
code. For carriers without service codes, and CHR sent without a service, leave specialService1-4 empty.
Terms
| Code | Description |
|---|---|
| PPD | Prepaid |
| COL | Collect |
| 3RD | 3rd Party to Collect |
| PCK | Consignee to Pick up |
| UCB | Contract Consignee Billing |
| DDP | Free Domicile |
| CSL | Customer Supplied Labels |
| DT3 | Bill Freight & Duties/Taxes 3rd |
| DAP | Delivered at Place |
| FCA | Free Carrier |
Type
| Code | Description |
|---|---|
| R | Rail |
| P | Customer Pick up |
| T | Truckload |
| L | Less Than Truckload |
| S | Small Package |
| A | Airborne |
| C | Sea |
| B | Barrett |
Carriers and Carrier Services
Carrier Code BW01 (Best Way)
| Service | Description |
|---|---|
| C001 | Customer Specific Routing |
| C002 | 1-Day Customer Specific Routing |
| C003 | 2-Day Customer Specific Routing |
| C004 | 3-Day Customer Specific Routing |
| C005 | Amazon Small Package Customer Specific Routing |
| C008 | International Customer Specific Routing |
Carrier Code BWTQ (Warehouse and Transport)
The transport.service property is not supported when using the BWTQ transport.carrier. BWTQ has no service codes.
Carrier Code CHR (C.H. Robinson)
CHR also accepts no service code, for general freight: omit transport.service or send an empty string.
| Service | Description |
|---|---|
| AIRF | Air Freight |
| CHRB | Sea Transport |
Carrier Code CPU (Customer Pickup)
The transport.service property is not supported when using the CPU transport.carrier. CPU has no service codes.
Carrier Code DHL
| Service | Description |
|---|---|
| INTL | DHL International Express |
NXDY, AIR, GND and 2ND are still accepted but unsupported; use INTL.
Carrier Code DPGM (DHL eCommerce)
| Service | Description |
|---|---|
| GRND | Ground |
| EXPD | Domestic Parcel Expedited |
Carrier Code FCI (FlavorCloud International)
| Service | Description |
|---|---|
| ECON | Economy |
Carrier Code FDEG (FedEx)
| Service | Description |
|---|---|
| 1STO | First Overnight |
| 1STR | First Overnight Residential |
| PROV | Priority Overnight |
| PROR | Priority Overnight Residential |
| STOV | Standard Overnight |
| STOR | Standard Overnight Residential |
| 2DAY | 2-Day |
| 2DAR | 2-Day Residential |
| 2AM | 2-Day AM |
| 2AMR | 2-Day AM Residential |
| EXSA | Express Saver |
| EXSR | Express Saver Residential |
| GRND | Ground |
| HOME | Home Delivery |
| SPST | SmartPost |
| 1FTF | 1-Day Freight |
| 2FTF | 2-Day Freight |
| 3FTF | 3-Day Freight |
| INT1 | International Priority |
| INT2 | International Economy |
| INCP | International Connect Plus |
| INF1 | International Priority Freight |
| INF2 | International Economy Freight |
Carrier Code FXFE (FedEx Priority Freight)
The transport.service property is not supported when using the FXFE transport.carrier. FXFE has no service codes.
Carrier Code GBLE (Global-E)
| Service | Description |
|---|---|
| GEEC | Global-E Carrier |
Carrier Code HGDS (Hegarty Delivery Service)
The transport.service property is not supported when using the HGDS transport.carrier. HGDS has no service codes.
Carrier Code HJBI (J.B. Hunt Intermodal)
The transport.service property is not supported when using the HJBI transport.carrier. HJBI has no service codes.
Carrier Code JBHU (J.B. Hunt Transportation)
The transport.service property is not supported when using the JBHU transport.carrier. JBHU has no service codes.
Carrier Code P2PG (Point2Point Global)
Accepted service codes: PIEX, PIST, PDFP, PDSD, P2AU, P2CA, P2EU, P2IE, P2UK, PROW.
Contact your Barrett team for the service each code maps to.
Carrier Code RLUS (Rohling)
The transport.service property is not supported when using the RLUS transport.carrier. RLUS has no service codes.
Carrier Code ROUT
| Service | Description |
|---|---|
| ROUT | LTL Carrier |
Carrier Code TRK (Truck)
The transport.service property is not supported when using the TRK transport.carrier. TRK has no service codes.
Carrier Code UPS
| Service | Description |
|---|---|
| RED | Next-Day Air |
| REDE | Next-Day Air Early AM |
| GRES | Ground Residential |
| CNST | Canada Standard Ground |
| 2DAM | 2nd-Day Air AM |
| WWXP | Worldwide Express Plus |
| WWX | Worldwide Express |
| WWE | Worldwide Expedited |
| SRPT | SurePost |
| REDS | Next-Day Air Saver |
| ORNG | 3-Day Select |
| GRND | Ground |
| WWXS | Worldwide Express Saver |
| BLUE | 2nd-Day Air |
| GFP | Ground Freight Pricing |
| CNSR | Canada Standard Ground Residential |
| WXPR | Worldwide Express Plus Residential |
| WWXR | Worldwide Express Residential |
| REDR | Next-Day Air Residential |
| RDER | Next-Day Air Early AM Residential |
| RDSR | Next-Day Air Saver Residential |
| BLUR | 2nd-Day Air Residential |
| 2AMR | 2nd-Day Air AM Residential |
| ORNR | 3-Day Select Residential |
| WWER | Worldwide Expedited Residential |
| MIPS | Mail Innovations Parcel Select |
Carrier Code USP2 (USPS)
| Service | Description |
|---|---|
| FCP | First-Class Package |
| PRI | Priority Mail |
| ITPR | Priority Mail International |
| ITEX | International Express |
| PP | Parcel Post |
| EX | Express Mail |
| GRAV | USPS Ground Advantage |
Carrier Code WWXS (World Wide Express)
The transport.service property is not supported when using the WWXS transport.carrier. WWXS has no service codes.
LTL carriers with no service codes
The transport.service property is not supported for any of the carriers below.
| Carrier | Description |
|---|---|
| ABF | ABF Freight |
| AVGW | Avenue Logistics |
| CENT | Central Transport |
| CEVA | CEVA |
| DHXI | Dependable Hawaiian |
| ECHS | Echo Global |
| EXLA | Estes |
| FECC | FedEx Custom Critical |
| LVLP | Omni Logistics |
| MOLY | MOLO |
| NFBR | NFI Brokerage |
| ODFL | Old Dominion |
| ROCO | RXO |
| SAIA | SAIA |
| SFNC | Select Transport Partners |
| SPAJ | Span Alaska |
| TALO | Titanium |
| TQYL | Total Quality Logistics |
Legacy carrier codes FEDX and USPS
FEDX and USPS are still accepted but are no longer supported; use FDEG and USP2 for new integrations.
FEDX accepts 1STO, 2DAY, EXSA, GRND, HOME, INT0, INT1, INT2, PROV, SPST, STOV.
USPS accepts AIR, GRAV, ITEX, ITFC, ITGX, ITPR, PRI, REG.
Railroad Diagrams
Note
Items in green represent the properties that Barrett requires. Items in blue represent optional properties that may be additionally sent by the customer.