Skip to content

EDU-18211: add B2B Addresses integration guide#2632

Merged
PedroAntunesCosta merged 3 commits into
mainfrom
docs/b2b-addresses-integration
May 6, 2026
Merged

EDU-18211: add B2B Addresses integration guide#2632
PedroAntunesCosta merged 3 commits into
mainfrom
docs/b2b-addresses-integration

Conversation

@PedroAntunesCosta
Copy link
Copy Markdown
Collaborator

@PedroAntunesCosta PedroAntunesCosta commented Apr 29, 2026

Adds a new integration guide for the B2B Addresses API under docs/guides/b2b/b2b-buyer-portal/.

The guide explains how the three entities exposed by the API (B2B addresses, recipients, and locations) relate to each other and provides the integration-level details developers need to wire them together.

Related Task

EDU-18211

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 29, 2026

👁️‍🗨️ Preview changes on Developer Portal

You can use the link below to load the Developer Portal in preview mode with the changes from this branch:

👉 Open preview environment

Below is the list of modified pages and their corresponding preview URLs:

File Preview URL Sidebar
docs/guides/b2b/b2b-buyer-portal/b2b-addresses-integration.md https://developers.vtex.com/docs/guides/b2b-addresses-integration ⚠️ Missing from navigation.json


A recipient is a person who can be selected as the order recipient at checkout — they may differ from the user placing the order. Stored in the `contact_information` Master Data v2 entity.

### Linking IDs
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[markdownlint] reported by reviewdog 🐶
MD024/no-duplicate-heading Multiple headings with the same content [Context: "### Linking IDs"]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revise as suggested so that won't be duplicated headings.

- Deleting a recipient does not affect the addresses referenced through `addressIds`.
- To find every recipient associated with a given address, query with `_where=addressIds={{addressId}}`.

### Operations
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[markdownlint] reported by reviewdog 🐶
MD024/no-duplicate-heading Multiple headings with the same content [Context: "### Operations"]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revise as suggested so that won't be duplicated headings.


A location is a specific delivery point within a B2B address (for example, `Dock 3456`, a department, or an internal area). Locations are values of a [custom checkout field](https://developers.vtex.com/docs/guides/custom-fields-integration), stored in the `customFieldValues` Master Data v2 entity.

### Linking IDs
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[markdownlint] reported by reviewdog 🐶
MD024/no-duplicate-heading Multiple headings with the same content [Context: "### Linking IDs"]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revise as suggested so that won't be duplicated headings.

| `customFieldId` | ID of the location setting (custom field configuration). It must already exist, this API does not create the setting itself. To discover the `customFieldId` for your account, list the existing settings with `GET` [Search custom field settings](https://developers.vtex.com/docs/api-reference/custom-fields-api#get-/api/dataentities/customFieldSettings/search) and pick the one matching the location feature. |
| `auxId` | ID of the B2B address the location belongs to (the `id` returned by the addresses endpoint). |

### Integration notes
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[markdownlint] reported by reviewdog 🐶
MD024/no-duplicate-heading Multiple headings with the same content [Context: "### Integration notes"]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revise as suggested so that won't be duplicated headings.

- To move a location to another address, update its `auxId`. To rename it, update its `value`.
- Deleting a location does not affect its address (`auxId`) or contract (`contractId`).

### Operations
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[markdownlint] reported by reviewdog 🐶
MD024/no-duplicate-heading Multiple headings with the same content [Context: "### Operations"]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revise as suggested so that won't be duplicated headings.

Comment on lines +24 to +26
## Before you begin

### Required features
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An H2 level with no introduction text and a single H3 level could be simplified into a unique heading.

Comment on lines +36 to +38
- **Address** — created first, its `id` becomes the anchor for the other entities.
- **Recipient** (optional) — references one or more addresses through `addressIds`. At checkout, recipients linked to the chosen address are offered as order recipients.
- **Location** (optional) — references a single address through `auxId`, plus a contract and a custom field setting.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- **Address**created first, its `id` becomes the anchor for the other entities.
- **Recipient** (optional) — references one or more addresses through `addressIds`. At checkout, recipients linked to the chosen address are offered as order recipients.
- **Location** (optional) — references a single address through `auxId`, plus a contract and a custom field setting.
- **Address**Created first, its `id` becomes the anchor for the other entities.
- **Recipient** (optional) — References one or more addresses through `addressIds`. At checkout, recipients linked to the chosen address are offered as order recipients.
- **Location** (optional) — References a single address through `auxId`, plus a contract and a custom field setting.

Addresses-->>APP: 200 OK (addressId)

APP->>Addresses: POST Create recipient (contact_information)
Note over APP,Addresses: addressIds: [addressId]
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addressIds: [addressId] wouldn't be better visualized as in addressIds: [Id], following the endpoint's field name?

Image

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the careful look! Quick context on the choice — the mermaid notes here are tracing the flow of values between requests, not the schema of the recipient document. Reading top to bottom:

  1. Addresses-->>APP: 200 OK (addressId) — the address creation response hands back an addressId.
  2. Note over APP,Addresses: addressIds: [addressId] — that same addressId is then placed inside the addressIds array of the recipient request.

The next note (auxId: addressId) follows the same pattern: the value from step 1 is reused as auxId when creating a location. So the labels in those notes are deliberately the variable name from step 1, not field names from the destination payload.

I'd also be cautious about switching to addressIds: [Id] because the guide reserves capital-Id for a different concept in the Address linking IDs table — the prefixed form (AD-<uuid>) returned by the POST response. Recipients must store the unprefixed id / DocumentId value, so labeling the array element Id here would risk nudging integrators toward sending the prefixed value.

If the current notation still reads ambiguously, happy to make the value flow more explicit — for example addressIds: [<addressId from step 1>], or adding a one-line note above the diagram. Let me know what reads better!

Comment thread docs/guides/b2b/b2b-buyer-portal/b2b-addresses-integration.md Outdated
Comment on lines +78 to +82
- `country`: three-letter [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) code (for example, `BRA`, `USA`).
- `state`: two-letter code (for example, `FL`, `SP`); full names are not accepted.
- `postalCode`: string in the country's exact format (for example, `02999`, not `2999`); nine-digit formats are not accepted.
- `receiverName`: required, but slated to be deprecated in favor of [Recipients](#recipients). Fill it with any value (for example, `.`).
- `geoCoordinates` (optional): array of two doubles (`[lat, lon]`) or `[]`.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- `country`: three-letter [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) code (for example, `BRA`, `USA`).
- `state`: two-letter code (for example, `FL`, `SP`); full names are not accepted.
- `postalCode`: string in the country's exact format (for example, `02999`, not `2999`); nine-digit formats are not accepted.
- `receiverName`: required, but slated to be deprecated in favor of [Recipients](#recipients). Fill it with any value (for example, `.`).
- `geoCoordinates` (optional): array of two doubles (`[lat, lon]`) or `[]`.
- `country`: Three-letter [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) code (for example, `BRA`, `USA`).
- `state`: Two-letter code (for example, `FL`, `SP`); full names are not accepted.
- `postalCode`: String in the country's exact format (for example, `02999`, not `2999`); nine-digit formats are not accepted.
- `receiverName`: Required, but slated to be deprecated in favor of [Recipients](#recipients). Fill it with any value (for example, `.`).
- `geoCoordinates` (optional): Array of two doubles (`[lat, lon]`) or `[]`.


- `value` has a maximum length of 22 characters.
- Search requires `_schema=v1`, `_where`, and `_fields`.
- Build the `_where` filter by combining the linking IDs with `AND`: start from `contractId` and `customFieldId` (the contract and location setting), then optionally add `auxId` to narrow down to a specific address.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Build the `_where` filter by combining the linking IDs with `AND`: start from `contractId` and `customFieldId` (the contract and location setting), then optionally add `auxId` to narrow down to a specific address.
- Build the `_where` filter by combining the linking IDs with `AND`: Start from `contractId` and `customFieldId` (the contract and location setting), then optionally add `auxId` to narrow down to a specific address.

Copy link
Copy Markdown
Collaborator

@Isabella-Veloso Isabella-Veloso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Request changes

PedroAntunesCosta and others added 2 commits April 30, 2026 16:06
Co-authored-by: Isabella Veloso Sá <77300325+Isabella-Veloso@users.noreply.github.com>
Copy link
Copy Markdown
Collaborator

@Isabella-Veloso Isabella-Veloso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@PedroAntunesCosta PedroAntunesCosta merged commit 971242e into main May 6, 2026
4 checks passed
@PedroAntunesCosta PedroAntunesCosta deleted the docs/b2b-addresses-integration branch May 6, 2026 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants