Hi @jgoliveira, good morning. All good. No problem.
1. How to Get the Customer Entity Name
The customer entity name in Master Data is generally called Clients or Customer. CL is the acronym. The CL entity stores information related to customers.
Your client can check the available entities directly in Master Data using the following call, though it is more commonly used for V1. Test it to see if it works in V2:
Endpoint:
GET https://{{accountName}}.vtexcommercestable.com.br/api/dataentities
This call will list all available data entities, including the customer one (usually CL). If they want to directly check customer data, they can make a call to the CL entity (if it hasn’t been changed).
Documentation: Master Data API - v1 › Data Entities
2. Ensuring Access Permissions for Master Data V2
The 403 Forbidden error indicates that the token or API Key being used does not have permission to access Master Data. To resolve this, you need to ensure that the correct permissions are configured for the API Key in the VTEX Admin.
Steps to Configure Access Permissions:
- Access the VTEX Admin:
- The client (or the person responsible for permissions) must access the VTEX admin panel (
{{accountName}}.myvtex.com/admin).
- Check the API Key Permissions:
- In the Admin, go to the Account Settings > Application Keys menu.
- Locate the API Key that was generated and click Edit to adjust the permissions.
- Add Access Permissions to Master Data:
- In the API Key permissions, verify that there is access permission to Master Data. The permissions need to include the following scope:
- Data Entity: Allow access to the
CLentity for reading and writing data (depending on what is needed). - Document: Allow access to perform CRUD (Create, Read, Update, Delete) operations on documents within the entity.
- Permission Group: Check that the permission group to which the API Key is linked has access to
Master Data.
- Data Entity: Allow access to the
Documentation: Permissions
Any user or application key must have at least one of the appropriate License Manager resources to be able to successfully run this request. Otherwise they will receive a status code 403 error.
If this helped you, please mark it as a “Solution”.
I’m here if you need anything else.
Best,
EstevĂŁo.