Monitor and troubleshoot
When building dynamic storefronts with the Merchandising GraphQL API, it's essential to ensure that your implementation runs smoothly and efficiently. This section provides guidance on how to monitor and troubleshoot common issues you may encounter while using the Merchandising API.
Common Issues
- Authentication errors: Verify that the tenant ID used in the endpoint URL matches the instance ID for your Adobe Commerce Optimizer instance.
- Missing data: Ensure products are properly ingested via the Data Ingestion API. You can check the synchronization status for product data from the Data Sync page in Adobe Commerce Optimizer.
- Performance issues: Optimize queries and implement caching.
- Rate limiting: Monitor API usage and implement proper throttling.
Private catalog view access errors
If a request to a private catalog view returns an access-key-invalid GraphQL error instead of data, check the message field for the specific cause:
- Missing token: Add the
AC-Catalog-View-Access-Tokenheader with a valid signed JSON Web Token (JWT) for the catalog view specified byAC-View-ID. See Authentication. - Access token signature invalid: Confirm the JWT was signed with the private key that matches a restricted access key assigned to that catalog view, and that the token wasn't truncated or altered.
- Restricted access is enabled but no valid access keys are available: Assign at least one Restricted Access Key to the catalog view, or verify that an existing key hasn't passed its expiration date.
- Token expired: A JWT past its own
expclaim is denied even if its signature is otherwise valid. Tokens aren't refreshable, so generate a new one. - Recently rotated or deleted key still appears to grant access: A short caching window (observed up to approximately 5 minutes) can delay revocation after a Restricted Access Key is unassigned or deleted.
Debugging
- Query validation: In your staging environment, use GraphQL introspection to validate queries.
- Response analysis: Check response structure and error messages.
- Header verification: Ensure all required headers are included.