# Ship-to Addresses _(Realtime-enabled)_

`GET` `POST` `PATCH` `DELETE` _(Table: Ship-to Address)_

```
eOne/core/v1.0/shipToAddresses
```

> **Note:** This is the **customer's reusable address book**. To set the delivery/billing address on one specific order instead, use the ship-to / bill-to fields on that document, e.g. [Sales Orders](https://eonesolutions.github.io/eone-bc-integration/core-salesOrders.md) exposes `shipToCode`, `shipToOptions`, and `billToOptions` alongside the individual address fields.

Read and write a customer's alternate shipping addresses, the address book eOne integration orders pick a delivery address from. An address belongs to a customer, and `customerNumber` + `code` together form the key. Set an `integrationId` to anchor the address to its external-system record; when you do, `code` becomes optional on create and is generated for you. Also reachable nested under a [customer](https://eonesolutions.github.io/eone-bc-integration/resolvers.md).

## Create a ship-to address

`POST` `/shipToAddresses`

```
{
  "customerNumber": "10000",
  "integrationId": "CRM-778101",
  "name": "West Coast DC",
  "addressLine1": "123 Dockside Rd",
  "city": "Seattle",
  "postalCode": "98101",
  "countryRegionCode": "US"
}
```

> **Note:** `customerNumber` is required. Provide either a `code` or an `integrationId`: if `code` is omitted while an `integrationId` is present, a code is generated automatically (see below). A duplicate `code` for the same customer is rejected rather than silently overwriting the existing address.

## Auto-generated codes

POST with an `integrationId` but no `code` and the code is built as the first 8 characters of `customerNumber` followed by a two-digit sequence, `1000001`, then `1000002`, taking the first free slot for that customer. A customer can hold up to 99 auto-generated addresses; beyond that, supply your own `code`. Passing an explicit `code` always overrides the formula.

## Updating the code

Anchor updates on `integrationId`: locate the address by `integrationId`, then PATCH. Sending a new `code` **renames** the address in place, the record keeps its `id` and `integrationId`, and the rename cascades to any open, unposted sales documents that reference the old code. Posted documents keep their original snapshot and are unaffected.

## customerId is read-only

`customerId` is a convenience lookup resolved from `customerNumber`. It returns the parent customer's GUID but is **not** writable. Always identify the parent with `customerNumber`.

## Ship-to Addresses fields

_API column → BC field._

**Legend**

- _(req)_ required on create
- _(res)_ resolver
- _(cur)_ currency-translated
- _(ro)_ read-only
- _(ext)_ added to this endpoint by another extension (BC field name shown; its API column name is not known here)

| API | BC field | Notes |
| --- | --- | --- |
| `id` | SystemId | BC record GUID. _(ro)_ |
| `bcCompanyId` | bcCompanyId | The company this row belongs to - the same GUID that appears in the request URL. Present on every endpoint so a store pooling several companies can keep them apart without relying on which URL it called. _(ro)_ |
| `bcCompanyName` | bcCompanyName | The name of the company this row belongs to. _(ro)_ |
| `customerNumber` | Customer No. | Parent customer; part of the key. Required. _(req)_ |
| `customerId` | customerId | Parent customer GUID, resolved from customerNumber. _(ro)_ |
| `code` | Code | Address code; part of the key. Leave blank on create to auto-generate it from customerNumber. Send a new value on update (matched by integrationId) to rename the address code. |
| `integrationId` | EONE Integration Id | eOne integration external identifier. Set this to anchor the address so later updates can locate it by integrationId. |
| `name` | Name |  |
| `name2` | Name 2 |  |
| `addressLine1` | Address |  |
| `addressLine2` | Address 2 |  |
| `city` | City |  |
| `county` | County |  |
| `postalCode` | Post Code |  |
| `countryRegionCode` | Country/Region Code |  |
| `contactName` | Contact |  |
| `phoneNumber` | Phone No. |  |
| `email` | E-Mail |  |
| `website` | Home Page |  |
| `locationCode` | Location Code |  |
| `salespersonCode` | Salesperson Code |  |
| `shipmentMethodCode` | Shipment Method Code |  |
| `shippingAgentCode` | Shipping Agent Code |  |
| `shippingAgentServiceCode` | Shipping Agent Service Code |  |
| `taxAreaCode` | Tax Area Code |  |
| `taxLiable` | Tax Liable |  |
| `gln` | GLN |  |
| `createdDateTime` | SystemCreatedAt | _(ro)_ |
| `lastModifiedDateTime` | SystemModifiedAt | _(ro)_ |

## Related pages

Nested under [Customers](https://eonesolutions.github.io/eone-bc-integration/core-customers.md).
