Notes
Address mapping between a store and an ERP: one line, two lines or three fields
A store keeps an address as two free-text lines, a state, a ZIP code and a country. The ERP and the carrier want the same address in their own fields, codes and lengths, so the integration normalizes each part. What does not fit is shortened along the way, usually without an error: UPS accepts 35 characters for a name or an address line, and the company name in the example on this page has 47.
Updated
The problem in one address
A customer of a B2B store fills in the checkout. Shopify delivers the shipping address of the order like this:
{
"shipping_address": {
"company": "Harlow Industrial Supply and Fastener Co., Inc.",
"name": "Dana Whitfield",
"address1": "1250 North Commerce Parkway Building C Suite 400",
"address2": "Attn: Receiving, dock 4",
"city": "Worcester",
"province": "Massachusetts",
"province_code": "MA",
"zip": "01608-1127",
"country_code": "US"
}
}
Every value is valid in the store. On the way to the ERP and the carrier, five of them need work: a company name of 47 characters, an address line of 48, an instruction in the second line, a state that exists as a name and as a code, and a ZIP code with a leading zero and a hyphen.
The two lines are free text, so customers fill them in every possible order:
| Line 1 | Line 2 | What goes wrong |
|---|---|---|
1250 N Commerce Pkwy |
Ste 400 |
Nothing |
1250 N Commerce Pkwy Ste 400 |
empty | A target with a separate unit field gets no unit |
Ste 400 |
1250 N Commerce Pkwy |
The carrier reads the suite as the street |
1250 N Commerce Pkwy |
Harlow Industrial Supply |
The company is printed as an address line and the name field stays empty |
1250 N Commerce Pkwy |
Attn: Receiving, dock 4 |
An instruction lands in the street field of the ERP |
PO Box 1182 |
empty | A PO box: the UPS API has its own POBoxIndicator flag for it |
PSC 802 Box 74 |
empty | Military mail: the city is APO and the state is AE, which is not one of the 50 states |
One Harlow Plaza |
14th Floor |
A rule that looks for a house number finds no digit |
One line or two is only part of it. USPS Publication 28 breaks a delivery address line into seven components: primary address number, predirectional, street name, suffix, postdirectional, secondary address identifier and secondary address. 1250 N COMMERCE PKWY STE 400 uses six of them. A system that wants number, street and unit as three fields needs that parsing. A rule written for US addresses, number first, fails on a Dutch or German address, where the number follows the street.
What each system stores
The field names below were read from each vendor's documentation on October 3, 2026.
| System | Street lines | State | ZIP and country |
|---|---|---|---|
| Shopify | address1, address2 |
province as a name, province_code as a code |
zip, country_code with two letters |
| WooCommerce | address_1, address_2 |
state, documented as "ISO code or name" |
postcode, country as an ISO code |
| BigCommerce | street_1, street_2 |
state as a name: Texas |
zip, country as a name, country_iso2 |
| Adobe Commerce | street, a list of lines |
region and region_code |
postcode, country_id |
| NetSuite | addr1, addr2, addr3 |
state, text |
zip as text, country required |
| Business Central | Address, Address 2 |
County, 30 characters |
Post Code, Country/Region Code |
| UPS Shipping API | AddressLine, up to 3 |
StateProvinceCode, a valid code |
PostalCode, CountryCode with two letters |
Between two systems of the same shape little happens: the two lines of Shopify go into addr1 and addr2 of NetSuite unchanged. The work starts where the shapes differ. A BigCommerce order gives the state as Texas, and UPS accepts only TX. The customer table of Business Central has no field called state: the state goes into County.
Names differ in the same way. NetSuite has an addressee and an attention field on every address, and its field help marks attention as required for the UPS integration. UPS has Name for the company and AttentionName for the person. A consumer order has no company, so the person's name goes into addressee and Name, and the attention line stays empty.
State, ZIP code and country
State. USPS lists 62 two-letter codes: the 50 states, the District of Columbia, 8 territories and associated states such as PR and GU, and 3 codes for military mail, AA, AE and AP. A lookup table with 50 rows rejects 12 of them. The table also has to accept what people type: Massachusetts, Mass., ma. cXML, the format of PunchOut orders, carries the state a third way, as isoStateCode="US-MA".
ZIP code. A ZIP code is 5 digits, or 9 as ZIP+4. USPS writes ZIP+4 with a hyphen, 01608-1127; it is the one punctuation mark Publication 28 does not allow to be omitted. The UPS API wants 5 or 9 digits and allows 9 characters at most, so the same value goes to UPS as 016081127. ZIP codes in Massachusetts start with a zero. In a numeric column, or in a CSV file saved from Excel, 01608 becomes 1608. That is 4 digits and matches nothing. More on files in supplier CSV and Excel files.
Country. US, USA, United States and United States of America are four spellings of one country. Shopify and WooCommerce send the two-letter ISO code. BigCommerce sends the name and the code. NetSuite's SOAP web services use their own list, where the value is _unitedStates. Puerto Rico is a state code at USPS, PR, and a separate country or territory in NetSuite's list and in the UPS API. The same address in San Juan is state PR in country US in one system and country PR in the next, and the lookup has to know which form each target expects.
Field lengths that truncate silently
A value that is too long for its target is refused by the API or shortened by the software in front of it. Shortening is the common case, and it raises no error. The limits of the targets in this example:
| Field | Limit |
|---|---|
NetSuite addr1, addr2 |
50 characters, per NetSuite's field help |
Business Central Address, Address 2, City |
100, 50 and 30 characters |
UPS Name, AttentionName |
35 characters each |
UPS AddressLine |
35 characters per line, 3 lines |
UPS City |
30 accepted, 15 printed on the label |
Run the example through them. The company name has 47 characters. UPS takes 35, so 47 minus 35 is 12 characters that have to go. Cut at the end, the label reads Harlow Industrial Supply and Fasten. The address line has 48 characters. It fits NetSuite's 50 with 2 to spare and exceeds the UPS line by 13. With USPS abbreviations, N for North, PKWY for Parkway, BLDG for Building and STE for Suite, it becomes 1250 N Commerce Pkwy Bldg C Ste 400: exactly 35.
The order of events hides the problem. The address is accepted by the store and by the ERP, and it is shortened two steps later, when the warehouse requests the label. UPS documents one such cut itself: a city of up to 30 characters is accepted and only 15 are printed. Rancho Santa Margarita, 22 characters, comes out as Rancho Santa Ma. The integration therefore measures each value against the shortest field downstream at the moment the order comes in.
One ship-to per order, or one per customer
An ERP stores addresses as records of the customer. On a NetSuite sales order the ship-to is one of three things: an existing address of the customer, a new address that is saved with the customer, or a custom address for this transaction only.
An integration that always creates a new address adds one to the customer with every order. A customer who orders 3 times a week has 156 addresses after a year, all for the same dock. Comparing the raw text does not prevent it: 1250 North Commerce Parkway, Suite 400 and 1250 N Commerce Pkwy Ste 400 are different strings and the same place. The comparison runs after normalization. The same mechanism on the customer record itself is described in duplicate customers and duplicate orders.
The ship-to in a PunchOut session
In a PunchOut integration an address appears twice. The PunchOutSetupRequest that opens the session may carry a ShipTo. The cXML Reference Guide describes it as optional and meant for estimating delivery time or price. The delivery address of the order is the ShipTo in the OrderRequest, at header level or per line.
A cXML address has its own shape: Name holds the company, DeliverTo can occur twice, first the person and then the location in the building, and the Address element can carry an addressID such as 2000431. That ID is the buyer's code for the location. Mapping the ID to a ship-to record in the ERP is more reliable than parsing the street lines again on every order.
How an integration handles it
Per field, three things are written down: which form the source delivers, which form each target needs, and what happens to a value that fits nowhere. That is field mapping, applied to the address.
| Field | Normalization | When the value does not fit |
|---|---|---|
| Address lines | Unit recognized by its designator, USPS abbreviations, split over the lines the target has | Review list, no label |
| Second line | Recognized as unit, company, attention or instruction | Instructions go to the order note |
| State | Lookup table to the code or name of the target, 62 codes | Review list for an unknown value |
| ZIP code | Text, 5 or 9 digits, hyphen per target | Review list when a US ZIP has fewer than 5 digits |
| Country | Lookup table per target, territories included | Review list for an unknown value |
| Company and name | Length measured against the shortest field downstream | Abbreviate, second line, or review list |
What this means for your integration
We write down per address field how it moves from your store to your ERP and your carrier: the form the source delivers, the form each target needs and the length each target allows. In the dry run before go-live your existing orders pass through those rules, so you see which addresses do not fit before a single label is printed. After go-live every address the integration cannot place is on a review list in the dashboard, with the original lines next to it.
The order flow as a whole is on orders, customers and shipping, and the NetSuite side on the NetSuite integration page. Tell us which store, ERP and carriers you use, and we map the address fields between them.
Frequently asked questions
Should the suite number go in address line 1 or line 2?
USPS prefers the unit at the end of the delivery address line, as in 1250 N Commerce Pkwy Ste 400, and allows it on the line above when it does not fit. Customers do both, and some put it first. An integration reads both lines, recognizes the unit by its designator (STE, APT, UNIT, #) and places it where the target system expects it.
Why is the leading zero missing from our ZIP codes?
Because somewhere on the way the ZIP code was stored as a number. 01608 becomes 1608 in a numeric database column or in a CSV file that was opened and saved in Excel. A ZIP code is text. The integration reads and writes it as text and sends a 4-digit value for a US address to the review list.
Why is a long company name cut off on the shipping label?
The carrier field is shorter than the store field. The UPS Shipping API accepts 35 characters for the consignee name and 35 for each address line. A name of 47 characters has to lose 12, and software that shortens it to fit does not report it. The integration measures the length when the order comes in and abbreviates, moves the rest to a second line or puts the order on the review list.
Do we need ZIP+4?
No. Five digits are enough for an ERP and for a carrier label; the UPS API accepts 5 or 9 digits for a US address. What matters is that a ZIP+4 a customer did enter survives: with its hyphen where the target wants 01608-1127, and without it where the target allows 9 characters at most.
What happens to an address the integration cannot place?
The order goes to a review list with the original address lines, and no label is requested for it. Someone corrects the address and the order continues. The order does not hang without a notice, and no parcel leaves with an empty street line or a state the carrier rejects.
How do international addresses fit in?
With a rule per country, chosen by the country code of the order. A US address has the number before the street and needs a state code. A Dutch or German address has the number after the street and no state. UPS requires a state or province code for the United States and Canada, and a Canadian postal code in the form A1A1A1.
Tell us what you need
Tell us which systems you use and what needs to work better. We reply personally within one working day. We help you define the work, then agree the price and timing before you commit.
- You know the price and the timeline before you commit to anything
- We work out the connection that takes the work off your hands
- We handle the build, hosting, monitoring and maintenance
- Your team has less information to retype and fewer discrepancies to chase