-
Notifications
You must be signed in to change notification settings - Fork 132
/
VTEX - Marketplace Protocol - External Seller Marketplace.json
525 lines (525 loc) · 30.6 KB
/
VTEX - Marketplace Protocol - External Seller Marketplace.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
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
{
"openapi": "3.0.0",
"info": {
"title": "Marketplace Protocol",
"description": "The _Marketplace Protocol_ is a set of API requests and definitions to help you integrate external sellers into a VTEX marketplace as well as external marketplaces into VTEX sellers.\r\n\r\n## External Seller\r\n\r\nHere you will find the endpoints involved in the integration between a VTEX marketplace and an external seller. Note that some of these requests are typically sent by the seller while others are received.\r\n\r\n| **Request** | **From** | **To** |\r\n|-|-|-|\r\n| [Fulfillment simulation](https://developers.vtex.com/docs/api-reference/marketplace-protocol-external-seller-fulfillment#post-/pvt/orderForms/simulation) | Marketplace | Seller |\r\n| [Order placement](https://developers.vtex.com/docs/api-reference/marketplace-protocol-external-seller-fulfillment#post-/pvt/orders) | Marketplace | Seller |\r\n| [Authorize fulfillment](https://developers.vtex.com/docs/api-reference/marketplace-protocol-external-seller-fulfillment#post-/pvt/orders/-sellerOrderId-/fulfill) | Marketplace | Seller |\r\n| [Marketplace order cancellation](https://developers.vtex.com/docs/api-reference/marketplace-protocol-external-seller-fulfillment#post-/pvt/orders/-orderId-/cancel) | Marketplace | Seller |\r\n| [Send invoice](https://developers.vtex.com/docs/api-reference/marketplace-protocol#post-/pvt/orders/-marketplaceOrderId-/invoice) | Seller | Marketplace |\r\n| [Send tracking information](https://developers.vtex.com/docs/api-reference/marketplace-protocol#post-/pvt/orders/-marketplaceOrderId-/invoice/-invoiceNumber-) | Seller | Marketplace |\r\n| [Update tracking status](https://developers.vtex.com/docs/api-reference/marketplace-protocol#post-/pvt/orders/-marketplaceOrderId-/invoice/-invoiceNumber-/tracking) | Seller | Marketplace |\r\n| [Cancel order in marketplace](https://developers.vtex.com/docs/api-reference/marketplace-protocol#post-/pvt/orders/-marketplaceOrderId-/cancel) | Seller | Marketplace |\r\n\r\nFor a detailed explanation of the steps required to develop a custom connector to sell products from an external seller in your storefront, check out our complete [External Seller Integration Guide](https://developers.vtex.com/docs/guides/external-seller-integration-guide).\r\n\r\n\r\n## External Marketplace\r\n\r\nIn this section, you will find the endpoints involved in the VTEX integration between an external marketplace and a VTEX seller.\r\n\r\n\r\n| **Request** | **From** | **To** |\r\n|-|-|-|\r\n| [VTEX Mapper Registration](https://developers.vtex.com/docs/api-reference/marketplace-protocol-external-marketplace-mapper#post-/api/mkp-category-mapper/connector/register) | External marketplace | VTEX system |\r\n| [Send Category Mapping to VTEX Mapper](https://developers.vtex.com/docs/api-reference/marketplace-protocol-external-marketplace-mapper#post-/api/mkp-category-mapper/categories/marketplace/-id-) | External marketplace | VTEX system |\r\n| [New Order Integration](https://developers.vtex.com/docs/api-reference/marketplace-protocol-external-marketplace-orders#post-/api/order-integration/orders) | External marketplace | VTEX system |\r\n| [Update Order Status](https://developers.vtex.com/docs/api-reference/marketplace-protocol-external-marketplace-orders#put-/api/order-integration/orders/status) | External marketplace | VTEX system |\r\n| [Fulfillment simulation - External Marketplace](https://developers.vtex.com/docs/api-reference/marketplace-protocol-external-marketplace-orders#post-/api/checkout/pub/orderForms/simulation) | External marketplace | VTEX system |\r\n| [Place fulfillment order](https://developers.vtex.com/docs/api-reference/marketplace-protocol-external-marketplace-orders#post-/api/fulfillment/pvt/orders) | External marketplace | VTEX Seller |\r\n| [Authorize dispatch for fulfillment order](https://developers.vtex.com/docs/api-reference/marketplace-protocol-external-marketplace-orders#post-/api/fulfillment/pvt/orders/-orderId-/fulfill) | External marketplace | VTEX Seller |\r\n\r\n\r\nFor a detailed explanation of the steps required to develop a custom connector to become an external marketplace for VTEX sellers, check out our complete [External Marketplace Integration Guide](https://developers.vtex.com/docs/guides/external-marketplace-integration-guide).",
"version": "1.0"
},
"servers": [
{
"url": "https://{marketplaceServicesEndpoint}",
"description": "Marketplace Service Endpoint",
"variables": {
"marketplaceServicesEndpoint": {
"description": "This is an endpoint sent from VTEX to the external seller in the [Order placement request](https://developers.vtex.com/vtex-rest-api/reference/external-seller#order-placement).",
"default": "{marketplaceServicesEndpoint}"
}
}
}
],
"paths": {
"/pvt/orders/{marketplaceOrderId}/invoice": {
"post": {
"tags": [
"External Seller"
],
"summary": "Send invoice",
"description": "This request is sent by the external seller to the VTEX marketplace to send invoice information.\n\nThis can be necessary in a regular order or in the case of a return. The `type` field is used to indicate which of these is the case.\r\n\r\n## Permissions\r\n\r\nCheck with your service provider to know what permissions are needed.",
"operationId": "send-invoice",
"parameters": [
{
"$ref": "#/components/parameters/Accept"
},
{
"$ref": "#/components/parameters/Content-Type"
},
{
"$ref": "#/components/parameters/marketplaceOrderId"
},
{
"$ref": "#/components/parameters/marketplaceServicesEndpoint"
},
{
"$ref":"#/components/parameters/invoiceNumber"
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/requestSendInvoice"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/responseFulfill"
},
"example": {
"date": "2021-06-09T15:22:56.7612218-02:00",
"orderId": "1138342255777-01",
"receipt": "527b1ae251264ef1b7a9b597cd8f16b9"
}
}
}
}
},
"deprecated": false
}
},
"/pvt/orders/{marketplaceOrderId}/invoice/{invoiceNumber}": {
"post": {
"tags": [
"External Seller"
],
"summary": "Send tracking information",
"description": "This request is sent by the external seller to the VTEX marketplace to add tracking information to a given order's invoice, in case it is necessary to do so after the invoice has been sent.\r\n\r\n## Permissions\r\n\r\nAny user or [application key](https://developers.vtex.com/docs/guides/api-authentication-using-application-keys) must have at least one of the appropriate [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3) to be able to successfully run this request. Otherwise, they will receive a status code `403` error. These are the applicable resources for this endpoint:\r\n\r\n| **Product** | **Category** | **Resource** |\r\n| --------------- | ----------------- | ----------------- |\r\n| OMS | OMS access | **Notify invoice** |\r\n\r\nYou can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy):\r\n\r\n| **Role** | **Resource** | \r\n| --------------- | ----------------- | \r\n| Allows you to report invoices (NF) and tracking data | Notify invoice |\r\n\r\n>❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-application-keys--7b6nD1VMHa49aI5brlOvJm).\r\n\r\nTo learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication).",
"operationId": "send-tracking-information",
"parameters": [
{
"$ref": "#/components/parameters/marketplaceServicesEndpoint"
},
{
"$ref": "#/components/parameters/marketplaceOrderId"
},
{
"$ref": "#/components/parameters/invoiceNumber"
},
{
"$ref": "#/components/parameters/Accept"
},
{
"$ref": "#/components/parameters/Content-Type"
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/requestSendTracking"
},
"example": {
"courier": "courier-example",
"trackingNumber": "12345678abc",
"trackingUrl": "https://courier-example.com/tracking",
"dispatchedDate": "2021-06-09"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/responseFulfill"
},
"example": {
"date": "2021-06-09T15:22:56.7612218-02:00",
"orderId": "1138342255777-01",
"receipt": "527b1ae251264ef1b7a9b597cd8f16b9"
}
}
}
}
},
"deprecated": false
}
},
"/pvt/orders/{marketplaceOrderId}/invoice/{invoiceNumber}/tracking": {
"post": {
"tags": [
"External Seller"
],
"summary": "Update tracking status",
"description": "This request is sent by the external seller to the VTEX marketplace to update a given order's tracking status.\r\n\r\n## Permissions\r\n\r\nAny user or [application key](https://developers.vtex.com/docs/guides/api-authentication-using-application-keys) must have at least one of the appropriate [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3) to be able to successfully run this request. Otherwise they will receive a status code `403` error. These are the applicable resources for this endpoint:\r\n\r\n| **Product** | **Category** | **Resource** |\r\n| --------------- | ----------------- | ----------------- |\r\n| OMS | OMS access | **Notify invoice** |\r\n\r\nYou can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy):\r\n\r\n| **Role** | **Resource** | \r\n| --------------- | ----------------- | \r\n| Allows you to report invoices (NF) and tracking data | Notify invoice |\r\n\r\n>❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-application-keys--7b6nD1VMHa49aI5brlOvJm).\r\n\r\nTo learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication).",
"operationId": "update-tracking-status",
"parameters": [
{
"$ref": "#/components/parameters/marketplaceServicesEndpoint"
},
{
"$ref": "#/components/parameters/marketplaceOrderId"
},
{
"$ref": "#/components/parameters/invoiceNumber"
},
{
"$ref": "#/components/parameters/Accept"
},
{
"$ref": "#/components/parameters/Content-Type"
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/requestUpdateTrackingStatus"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/responseFulfill"
},
"example": {
"date": "2021-06-09T15:22:56.7612218-02:00",
"orderId": "1138342255777-01",
"receipt": "527b1ae251264ef1b7a9b597cd8f16b9"
}
}
}
}
},
"deprecated": false
}
},
"/pvt/orders/{marketplaceOrderId}/cancel": {
"post": {
"tags": [
"External Seller"
],
"summary": "Cancel order in marketplace",
"description": "This request is sent by the external seller to the VTEX marketplace to cancel an order.\r\n\r\n## Permissions\r\n\r\nAny user or [application key](https://developers.vtex.com/docs/guides/api-authentication-using-application-keys) must have at least one of the appropriate [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3) to be able to successfully run this request. Otherwise, they will receive a status code `403` error. These are the applicable resources for this endpoint:\r\n\r\n| **Product** | **Category** | **Resource** |\r\n| --------------- | ----------------- | ----------------- |\r\n| Checkout | CheckoutResources | **Order Cancellation** |\r\n\r\nYou can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy):\r\n\r\n| **Role** | **Resource** | \r\n| --------------- | ----------------- | \r\n| Cancel Orders | Order Cancellation |\r\n\r\n>❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-application-keys--7b6nD1VMHa49aI5brlOvJm).\r\n\r\nTo learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication).",
"operationId": "cancel-order-in-marketplace",
"parameters": [
{
"$ref": "#/components/parameters/marketplaceServicesEndpoint"
},
{
"$ref": "#/components/parameters/marketplaceOrderId"
},
{
"$ref": "#/components/parameters/Accept"
},
{
"$ref": "#/components/parameters/Content-Type"
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/requestCancelOrderMarketplace"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/responseFulfill"
},
"example": {
"date": "2021-06-09T15:22:56.7612218-02:00",
"orderId": "1138342255777-01",
"receipt": "527b1ae251264ef1b7a9b597cd8f16b9"
}
}
}
}
},
"deprecated": false
}
}
},
"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",
"default": "application/json"
}
},
"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",
"default": "application/json"
}
},
"marketplaceServicesEndpoint": {
"name": "marketplaceServicesEndpoint",
"in": "path",
"description": "This is an endpoint sent from VTEX to the external seller in the [Order placement request](https://developers.vtex.com/docs/api-reference/marketplace-protocol-external-seller-fulfillment#post-/pvt/orders).",
"required": true,
"style": "simple",
"schema": {
"type": "string",
"example": "marketplaceservicesendpoint.myvtex.com"
}
},
"marketplaceOrderId": {
"name": "marketplaceOrderId",
"in": "path",
"description": "Identifies the order in the marketplace.",
"required": true,
"style": "simple",
"schema": {
"type": "string",
"example": "1138342255777-01"
}
},
"invoiceNumber": {
"name": "invoiceNumber",
"in": "path",
"description": "Invoice number.",
"required": true,
"style": "simple",
"schema": {
"type": "string",
"example": "NFe-00002"
}
}
},
"schemas": {
"requestSendInvoice": {
"type": "object",
"description": "Object used to send invoice information related to an order.",
"required": [
"type",
"invoiceNumber",
"items"
],
"properties": {
"type": {
"type": "string",
"description": "Indicates the type of the invoice. Use `\"Output\"` for regular orders and `\"Input\"` for returns.",
"example":"Output"
},
"invoiceNumber": {
"type": "string",
"description": "Invoice number.",
"example":"NFe-00002"
},
"courier": {
"type": "string",
"description": "Courier, if available on invoice.",
"example":"courier-example"
},
"trackingNumber": {
"type": "string",
"description": "Tracking number.",
"example":"12345678abc"
},
"trackingUrl": {
"type": "string",
"description": "Tracking URL.",
"example": "https://courier-example.com/tracking"
},
"items": {
"type": "array",
"description": "Array containing the order items.",
"items": {
"type": "object",
"description": "Specification data for each order item.",
"required": [
"id",
"quantity",
"price"
],
"properties": {
"id": {
"type": "string",
"description": "SKU ID.",
"example": "6"
},
"quantity": {
"type": "integer",
"description": "Quantity of items of the SKU in the cart.",
"example": 1
},
"price": {
"type": "integer",
"description": "Price of the item.",
"example": 5500
}
}
}
},
"issuanceDate": {
"type": "string",
"description": "Issuance date.",
"example": "2021-05-21T10:00:00"
},
"invoiceValue": {
"type": "integer",
"description": "Invoice value.",
"example": 6000
}
}
},
"responseFulfill": {
"properties": {
"date": {
"type": "string",
"description": "Request processing date and time."
},
"orderId": {
"type": "string",
"description": "Order ID referring to the Invoice number sent."
},
"receipt": {
"type": "string",
"description": "Requisition receipt code."
}
},
"example":{
"date":"2021-06-09T15:22:56.7612218-02:00",
"orderId":"1138342255777-01",
"receipt":"527b1ae251264ef1b7a9b597cd8f16b9"
}
},
"requestSendTracking": {
"required": [
"courier",
"trackingNumber",
"trackingUrl",
"dispatchedDate"
],
"properties": {
"courier": {
"type": "string",
"description": "Courier.",
"example":"courier-example"
},
"trackingNumber": {
"type": "string",
"description": "Tracking number.",
"example": "12345678abc"
},
"trackingUrl": {
"type": "string",
"description": "Tracking URL.",
"example": "https://courier-example.com/tracking"
},
"dispatchedDate": {
"type": "string",
"description": "Date of order dispatch.",
"example":"2021-06-09"
}
}
},
"requestUpdateTrackingStatus": {
"type": "object",
"description": "Request body object used to update the tracking status of an order.",
"required": [
"isDelivered"
],
"properties": {
"isDelivered": {
"type": "boolean",
"description": "Indicates if order has been delivered. `false` if it is in transit.",
"example": true
},
"events": {
"type": "array",
"description": "Array containing information on each tracking event received.",
"items": {
"type": "object",
"description": "Description of tracking event fields.",
"properties": {
"city": {
"type": "string",
"description": "City where the event ocurred.",
"example": "Rio de Janeiro"
},
"state": {
"type": "string",
"description": "State where the event ocurred.",
"example": "Rio de Janeiro"
},
"description": {
"type": "string",
"description": "Description of the event.",
"example": "Order delivered."
},
"date": {
"type": "string",
"description": "Date when event ocurred.",
"example": "2021-03-16"
}
}
}
}
}
},
"requestCancelOrderMarketplace": {
"type": "object",
"description": "Object used to request the cancellation of an order on the marketplace.",
"required": [
"reason"
],
"properties": {
"reason": {
"type": "string",
"description": "Insert here the reason for the order's cancellation.",
"example": "Product is unavailable."
}
}
}
}
},
"tags": [
{
"name": "External Seller"
}
]
}