Learn how to manage and retrieve documents, define data structures, and configure searchable fields in Master Data.
Master Data API provides a structured way to store, retrieve, and manage data. It is organized into two categories:
- Data Plane: Manages records, enabling tasks such as searching and accessing documents.
- Control Plane: Defines the structure of records and access configurations.
Data Plane
The Data Plane stores and retrieves documents. Designed for high-volume operations, the Data Plane ensures quick and reliable data access for store operations.
Getting a Document by id
The /documents
endpoint is used to store and retrieve individual Documents. To retrieve a Document, you must provide the id
value of the desired document, which serves as the unique identifier of the Document.
Searching for Documents
When the id
of a document is unknown, you can use the following APIs to locate it using Searchable fields or Indexes:
/search
: Retrieves documents using Index fields. Learn more about Indices in Components./scroll
: Handles large datasets, enabling bulk document retrieval through Searchable fields.
Searchable fields are configured to work with the
/search
and/scroll
endpoints. In Master Data V1, they are defined using theIs Filter
property. In Master Data V2, they use thev-indexed
property.
Control Plane
The Control Plane manages the structure and behavior of the Data Plane. It enables developers to configure data validation, searchable fields and triggers within Data Entities. Control Plane operations are less frequent but crucial for defining data structures.
Master Data V1
Master Data V1 does not provide a Control Plane API. All configurations are handled via the VTEX Admin through the Dynamic Storage at Store Settings > Storefront > Master Data > ⚙ > Data structure (https://{{account}}.ds.vtexcrm.com.br
).
Master Data V2
Master Data V2 has the /schema
and /indices
endpoints, allowing for the creation and management of JSON Schemas for Data Entities. These schemas define the structure of stored data and directly influence how the Data Plane processes and validates documents.
JSON Schemas are exclusive to Master Data V2.
Master Data API endpoints
The table below summarizes the available endpoints, their categories, descriptions, and supported versions.
Endpoint | Category | Description | V1 Documentation | V2 Documentation |
---|---|---|---|---|
/schemas | Control Plane | Creates and manages schemas for a Data Entity. The use of schemas enables searches with custom fields and to add rules when managing documents. Learn more in Schema Lifecycle. | N/A | |
/indices | Control Plane | Manages indices for fast Document access via fields other than id . Learn more in Components. | N/A | |
/documents | Data Plane | Manages individual Documents using their id . | ||
/search | Data Plane | Retrieves documents based on parameters like schemas and indexed fields. | Search documents | Search documents |
/scroll | Data Plane | Retrieves large amount of Documents. | Scroll documents | Scroll documents |