Documentation
Feedback
Guides
API Reference

Guides
Guides
B2B
B2B Buyer Portal

B2B Buyer Portal Master Data architecture

Map the Master Data entities and logical relationships that underpin B2B Buyer Portal integrations, and find the right integration guides and API references for each domain.

This feature is only available for stores using B2B Buyer Portal, which is currently available to selected accounts.

B2B Buyer Portal persists buyer organization data across several Master Data entities. Understanding how those entities relate to each other is essential for building reliable integrations, particularly when orchestrating multi-step operations such as contract creation, address provisioning, or user onboarding.

This guide maps all seven Master Data entities used by B2B Buyer Portal, their fields, logical relationships, and common integration patterns. For the full operation set, parameters, and payload schemas, see the API reference linked in each section.

Before you begin

  • The store must have B2B Buyer Portal enabled.
  • Familiarize yourself with Master Data v1 and Master Data v2 query syntax. Different entities use different versions, so query parameters, pagination conventions, and schema requirements vary.

Entity overview

B2B Buyer Portal uses seven Master Data entities, each covering a distinct domain:

EntityMaster Data nameMaster Data versionDomain
ContractCLv1Root entity for a buyer organization's commercial conditions.
AddressADv1Shipping and billing destinations linked to a contract.
Buyer datashopperv1Enriched profile data for storefront users with purchase permission.
Custom field settingscustomFieldSettingsv2Field definitions (type, level, requirements) per contract.
Custom field valuescustomFieldValuesv2Values filled in for custom fields, optionally tied to an address.
Recipientscontact_informationv2People authorized to receive shipments at a given address.
Default valuesdefaultValuesv1Pre-configured checkout defaults per organizational unit.

Entity relationships

The diagram shows logical references between entities. Edge labels are the field names used as foreign keys in the child record.

OrgUnit and storefront User records are not Master Data entities. They appear here because several Master Data entities reference organizational unit IDs or VTEX user IDs.

All relationships are logical references managed at the application layer. Master Data does not enforce referential integrity, so deleting a parent document does not cascade to its children.

Key linking fields

Use this table when orchestrating multi-step flows. It lists only the fields that connect entities. For every other attribute, see the API reference for that entity.

Child entityLinking fieldPoints toParent / target
AD (address)userIdCL.idContract that owns the address
customFieldSettingscontractIdCL.idContract the field belongs to
customFieldValuescontractIdCL.idContract the value belongs to
customFieldValuesauxIdAD.idAddress, when the value is a location
customFieldValuescustomFieldIdcustomFieldSettings.idField definition, required for locations
contact_information (recipient)profileIdCL.idContract that owns the recipient
contact_information (recipient)addressIdsAD.id (array)Addresses the recipient can receive at
defaultValuesidOrg unit IDOrganizational unit (set explicitly, not auto-generated)
defaultValuesentityValueIdAD.id or customFieldValues.idDefault shipping/billing address or custom field value
shopper (buyer data)userIdVTEX user IDStorefront user from VTEX ID, not the contract

Common integration patterns

  • Contract-first provisioning: Involves creating or resolving a contract (CL) before addresses, custom fields, or recipients. Child records reference CL.id through userId, contractId, or profileId.
  • Address and destination setup: Consists of creating addresses (AD), then optionally attaching recipients (contact_information) and locations (customFieldValues through auxId and a location-type custom field setting).
  • User onboarding: Requires creating the storefront user in VTEX ID, assigning organizational units and roles, then persisting buyer data in shopper linked by userId.

Entities by domain

The subsections below describe each entity's role in the model and where to find implementation details. Field-level attributes are documented in the API reference for each entity.

Contract (CL)

The contract is the root of every buyer organization. Its id anchors addresses, custom fields, and recipients. Commercial conditions such as assortment, pricing, and payment restrictions live on this record.

Addresses, recipients, and locations

Three entities work together for checkout destinations:

ConceptData entityRole in the model
AddressADShipping (commercial) or billing (invoice) destination. AD.id is reused when linking recipients and locations.
Recipientcontact_informationPerson selectable as order recipient. Scoped to a contract via profileId, optionally narrowed to specific addresses via addressIds.
LocationcustomFieldValuesDelivery point within an address (dock, department, area). Linked through auxId and a location-type custom field setting.

Custom field settings and values

Custom fields (accounting fields) are split across two entities:

ConceptData entityRole in the model
SettingscustomFieldSettingsDefines field name, type, level (order, item, address), and requirements per contract.
ValuescustomFieldValuesStores predefined options or location records. Location values reference both a contract and an address (auxId).

Search and get operations on v2 entities (customFieldSettings, customFieldValues, contact_information) require _schema=v1 in the query string. See the integration guides above for filter patterns.

Buyer data (shopper)

The shopper entity stores enriched profile attributes for a storefront user. It links to VTEX ID through userId, not to a contract. User provisioning creates the VTEX user first, then persists buyer data.

Default values (defaultValues)

Default values pre-fill checkout for an organizational unit. The document id equals the org unit ID. Each entry in the defaultValues array maps an entity path (for example, address/shipping, customFieldValues/{fieldName}) to an entityValueId pointing at an address or custom field value record.

Next steps

Contributors
1
Photo of the contributor
Was this helpful?
Yes
No
Suggest Edits (GitHub)
Contributors
1
Photo of the contributor
Was this helpful?
Suggest edits (GitHub)
On this page