Documentation
Feedback
Guides
API Reference

API Reference
Filter By
Post
Get
Put
Delete
Patch

Master Data API - v2

Master Data v2 is not compatible with data entities from previous versions, such as CL and AD.

Master Data is a secure, fast, scalable, and extensible solution that allows users to create their own entities, store data, and retrieve information directly from the storefront or external integrations.

Several internal VTEX modules use Master Data as a data repository, including Orders and Sales App.

There are two main ways to use Master Data:

Directly from the storefront

When using Master Data within the storefront, consider the following:

  • Use the storefront host to query or store information to avoid issues related to Cross-origin resource sharing (CORS).
  • Use the relative path to avoid CORS issues.
  • Configure the JSON Schema of the Data Entity to specify which information should be public and which should not be.
  • Avoid creating query loops to prevent potential throttling issues or APIs being disabled due to security protection measures.
  • Never add authentication keys, such as X-VTEX-API-AppKey or X-VTEX-API-AppToken, via JavaScript as this could pose security risks.

External integrations

When using Master Data to store data from an external integration, such as client data from another service, consider the following:

  • Use the host {{accountName}}.vtexcommercestable.com.br.
  • Use the authentication keys (X-VTEX-API-AppKey ou X-VTEX-API-AppToken).

Common parameters

Name Description
accountName Account name in VTEX License Manager.
name Data Entity name.
schema JSON Schema of a Data Entity.
id Identifier of a document.
X-VTEX-API-AppKey appKey.
X-VTEX-API-AppToken appToken.

Endpoints

Documents

SummaryMethodPath
Create new documentPOST/api/dataentities/{dataEntityName}/documents
Create partial documentPATCH/api/dataentities/{dataEntityName}/documents
Get documentGET/api/dataentities/{dataEntityName}/documents/{id}
Create document with custom ID or update entire documentPUT/api/dataentities/{dataEntityName}/documents/{id}
Update partial documentPATCH/api/dataentities/{dataEntityName}/documents/{id}
Delete documentDELETE/api/dataentities/{dataEntityName}/documents/{id}

Search

SummaryMethodPath
Search documentsGET/api/dataentities/{dataEntityName}/search

Scroll

SummaryMethodPath
Scroll documentsGET/api/dataentities/{dataEntityName}/scroll

Schemas

SummaryMethodPath
Get schemasGET/api/dataentities/{dataEntityName}/schemas
Get schema by nameGET/api/dataentities/{dataEntityName}/schemas/{schemaName}
Save schema by namePUT/api/dataentities/{dataEntityName}/schemas/{schemaName}
Delete schema by nameDELETE/api/dataentities/{dataEntityName}/schemas/{schemaName}

Indices

SummaryMethodPath
Get indicesGET/api/dataentities/{dataEntityName}/indices
Create indexPUT/api/dataentities/{dataEntityName}/indices
Get index by nameGET/api/dataentities/{dataEntityName}/indices/{index_name}
Delete index by nameDELETE/api/dataentities/{dataEntityName}/indices/{index_name}

Clusters

SummaryMethodPath
Validate document by clustersPOST/api/dataentities/{dataEntityName}/documents/{id}/clusters

Versions

SummaryMethodPath
List versionsGET/api/dataentities/{dataEntityName}/documents/{id}/versions
Get versionGET/api/dataentities/{dataEntityName}/documents/{id}/versions/{versionId}
Update versionPUT/api/dataentities/{dataEntityName}/documents/{id}/versions/{versionId}

Loading API specification...