{ "openapi": "3.0.0", "info": { "version": "1.0.0", "title": "Audience API", "description": "API for managing audiences and mapping [price tables](https:\/\/help.vtex.com\/en\/tutorial\/setting-up-price-tables-for-specific-users--5S9oDOMHNmY4K0kAewAiWY) to these audiences for contextual seller pricing.\r\n\r\n## Common parameters in the documentation\r\n\r\n| Parameter name | Description |\r\n| - | - |\r\n| `{{accountName}}`| Name of the VTEX account. Used as part of the URL. |\r\n| `{{environment}}`| Name of the VTEX account. Used as part of the URL. |\r\n| `{{X-VTEX-API-AppKey}}` | Unique identifier of the [API key](https:\/\/developers.vtex.com\/docs\/guides\/api-authentication-using-api-keys). |\r\n| `{{X-VTEX-API-AppToken}}` | Secret token of the [API key](https:\/\/developers.vtex.com\/docs\/guides\/api-authentication-using-api-keys). |" }, "servers": [ { "url": "https://{accountName}.{environment}.com.br", "description": "VTEX server URL.", "variables": { "accountName": { "description": "Name of the VTEX account. Used as part of the URL", "default": "apiexamples" }, "environment": { "description": "Environment to use. Used as part of the URL.", "enum": [ "vtexcommercestable" ], "default": "vtexcommercestable" } } } ], "paths": { "/api/audience-manager/pvt/audience": { "post": { "tags": [ "Audience Manager" ], "summary": "Fetch audience", "description": "Fetch the audience ID based on the provided shopper email.\r\n\r\n## Permissions\r\n\r\nThis endpoint does not require [permissions](https:\/\/help.vtex.com\/en\/tutorial\/license-manager-resources--3q6ztrC8YynQf6rdc6euk3).", "parameters": [ { "$ref": "#/components/parameters/Content-Type" }, { "$ref": "#/components/parameters/Accept" }, { "$ref": "#/components/parameters/an" } ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "description": "Object containing information about the shopper's email.", "required": [ "email" ], "properties": { "email": { "type": "string", "description": "Shopper's email.", "example": "shopper-email@email.com" } } } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "array", "description": "Array of price table IDs.", "items": { "type": "string", "description": "Audience ID." } }, "example": [ "f8cb4d62-b43a-599c-89cc-027fadaa4b18" ] } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "type": "object", "description": "Object containing the error message. This error occurs when the request body is empty, there are missing properties, or if the account is not identified from the context or query parameters.", "properties": { "error": { "type": "string", "description": "Error message." } } }, "example": { "error": "Invalid input or account not detected." } } } } } } }, "/api/price-table-mapper/pvt/mapping/{audienceId}": { "get": { "tags": [ "Price Table Mapper" ], "summary": "Get price table mapping", "description": "Fetches the price table mapping for a specific audience.\r\n\r\n## Permissions\r\n\r\nThis endpoint does not require [permissions](https:\/\/help.vtex.com\/en\/tutorial\/license-manager-resources--3q6ztrC8YynQf6rdc6euk3).", "parameters": [ { "$ref": "#/components/parameters/Content-Type" }, { "$ref": "#/components/parameters/Accept" }, { "$ref": "#/components/parameters/AudienceId" } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "array", "description": "Array of price table IDs.", "items": { "type": "string", "description": "Price table ID." } }, "example": [ "priceTable01" ] } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/responseError" }, "example": { "error": "Mapping not found for the provided audienceId." } } } } } }, "put": { "tags": [ "Price Table Mapper" ], "summary": "Set price table mapping", "description": "Sets one or more price table mappings for the specified audience. Each price table ID in the array defines a distinct price table that applies to the audience.\r\n\r\n## Permissions\r\n\r\nThis endpoint does not require [permissions](https:\/\/help.vtex.com\/en\/tutorial\/license-manager-resources--3q6ztrC8YynQf6rdc6euk3).", "parameters": [ { "$ref": "#/components/parameters/Content-Type" }, { "$ref": "#/components/parameters/Accept" }, { "$ref": "#/components/parameters/AudienceId" } ], "requestBody": { "content": { "application/json": { "schema": { "type": "array", "description": "Array of price table Ids.", "items": { "type": "string", "description": "Price table ID.", "example": "myPriceTable" } } } } }, "responses": { "204": { "description": "No Content" }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "type": "object", "description": "Object containing the error message. This error occurs when the request body is empty or if the account cannot be retrieved from the request context.", "properties": { "error": { "type": "string", "description": "Error message." } } }, "example": { "error": "Invalid input or account not detected." } } } } } }, "delete": { "tags": [ "Price Table Mapper" ], "summary": "Delete price table mapping", "description": "Removes the price table mapping for the provided audience.\r\n\r\n## Permissions\r\n\r\nThis endpoint does not require [permissions](https:\/\/help.vtex.com\/en\/tutorial\/license-manager-resources--3q6ztrC8YynQf6rdc6euk3).", "parameters": [ { "$ref": "#/components/parameters/Content-Type" }, { "$ref": "#/components/parameters/Accept" }, { "$ref": "#/components/parameters/AudienceId" } ], "responses": { "204": { "description": "No Content" }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "type": "object", "description": "Object containing the error message. This error occurs when the `audienceId` is not valid.", "properties": { "error": { "type": "string", "description": "Error message." } } }, "example": { "error": "Invalid audienceId." } } } } } } } }, "security": [ { "appKey": [], "appToken": [] }, { "VtexIdclientAutCookie": [] } ], "components": { "securitySchemes": { "appKey": { "type": "apiKey", "in": "header", "name": "X-VTEX-API-AppKey", "description": "Unique identifier of the [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-keys)." }, "appToken": { "type": "apiKey", "in": "header", "name": "X-VTEX-API-AppToken", "description": "Secret token of the [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-keys)." }, "VtexIdclientAutCookie": { "type": "apiKey", "in": "header", "name": "VtexIdclientAutCookie", "description": "[User token](https://developers.vtex.com/docs/guides/api-authentication-using-user-tokens), valid for 24 hours." } }, "parameters": { "Content-Type": { "name": "Content-Type", "in": "header", "description": "Type of the content being sent.", "required": true, "style": "simple", "schema": { "type": "string", "example": "application/json" } }, "an": { "name": "an", "in": "query", "description": "Name of your VTEX account.", "required": false, "style": "form", "schema": { "type": "string", "example": "exampleAccount" } }, "Accept": { "name": "Accept", "in": "header", "description": "HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand.", "required": true, "style": "simple", "schema": { "type": "string", "example": "application/json" } }, "AudienceId": { "name": "audienceId", "in": "path", "description": "ID that represents an audience.", "required": true, "schema": { "type": "string", "example": "f8cb4d62-b43a-599c-89cc-027fadaa4b18" } } }, "schemas": { "responseError": { "type": "object", "description": "Object containing the error message.", "properties": { "error": { "type": "string", "description": "Error message." } } } } }, "tags": [ { "name": "Audience Manager" }, { "name": "Price Table Mapper" } ] }