-
Notifications
You must be signed in to change notification settings - Fork 133
/
VTEX - Audience API.json
359 lines (359 loc) · 16 KB
/
VTEX - Audience API.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
{
"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## Index\r\n\r\n### Audience Manager\r\n- `POST` [Fetch audience](https:\/\/developers.vtex.com\/docs\/api-reference\/audience-api\/#post-\/api\/audience-manager\/pvt\/audience)\r\n\r\n### Price Table Mapper\r\n- `GET` [Get price table mapping](https:\/\/developers.vtex.com\/docs\/api-reference\/audience-api\/#get-\/api\/price-table-mapper\/pvt\/mapping\/-audienceId-)\r\n- `PUT` [Set price table mapping](https:\/\/developers.vtex.com\/docs\/api-reference\/audience-api\/#put-\/api\/price-table-mapper\/pvt\/mapping\/-audienceId-)\r\n- `DELETE`[Delete price table mapping](https:\/\/developers.vtex.com\/docs\/api-reference\/audience-api\/#delete-\/api\/price-table-mapper\/pvt\/mapping\/-audienceId-)\r\n\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 [application key](https:\/\/developers.vtex.com\/docs\/guides\/api-authentication-using-application-keys). |\r\n| `{{X-VTEX-API-AppToken}}` | Secret token of the [application key](https:\/\/developers.vtex.com\/docs\/guides\/api-authentication-using-application-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": "[email protected]"
}
}
}
}
}
},
"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 [application key](https://developers.vtex.com/docs/guides/api-authentication-using-application-keys)."
},
"appToken": {
"type": "apiKey",
"in": "header",
"name": "X-VTEX-API-AppToken",
"description": "Secret token of the [application key](https://developers.vtex.com/docs/guides/api-authentication-using-application-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"
}
]
}