-
Notifications
You must be signed in to change notification settings - Fork 131
/
VTEX - Subscriptions API v3.json
4552 lines (4551 loc) · 290 KB
/
VTEX - Subscriptions API v3.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
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{
"openapi": "3.0.0",
"info": {
"title": "Subscriptions API (v3)",
"description": "[Subscriptions](https://help.vtex.com/en/tutorial/how-subscriptions-work--frequentlyAskedQuestions_4453) is the VTEX solution for customers to make recurrent purchases at your store on a regular schedule. When customers subscribe, they define what products they want to acquire regularly and at what frequency they want these automatic orders to be created. For more information, see [Subscriptions onboarding guide](https://developers.vtex.com/docs/guides/subscriptions).\r\n\r\n## Index\r\n\r\n### Cycles\r\n\r\n- `GET` [Get cycle details](https:\/\/developers.vtex.com\/docs\/api-reference\/subscriptions-api-v3#get-\/api\/rns\/pub\/cycles\/-cycleId-)\r\n- `GET` [List cycles](https:\/\/developers.vtex.com\/docs\/api-reference\/subscriptions-api-v3#get-\/api\/rns\/pub\/cycles)\r\n- `POST` [Retry cycle](https:\/\/developers.vtex.com\/docs\/api-reference\/subscriptions-api-v3#post-\/api\/rns\/pub\/cycles\/-cycleId-\/retry)\r\n\r\n### Plans\r\n\r\n- `GET` [List plans](https:\/\/developers.vtex.com\/docs\/api-reference\/subscriptions-api-v3#get-\/api\/rns\/pvt\/plans)\r\n- `GET` [Get plan details](https:\/\/developers.vtex.com\/docs\/api-reference\/subscriptions-api-v3#get-\/api\/rns\/pvt\/plans\/-id-)\r\n\r\n### Reports\r\n\r\n- `GET` [List report templates](https:\/\/developers.vtex.com\/docs\/api-reference\/subscriptions-api-v3#get-\/api\/rns\/pvt\/reports)\r\n- `GET` [Get report document details](https:\/\/developers.vtex.com\/docs\/api-reference\/subscriptions-api-v3#get-\/api\/rns\/pvt\/reports\/-reportName-\/documents\/-documentId-)\r\n- `POST` [Generate report](https:\/\/developers.vtex.com\/docs\/api-reference\/subscriptions-api-v3#post-\/api\/rns\/pvt\/reports\/-reportName-\/documents)\r\n\r\n### Subscriptions\r\n\r\n- `GET` [Get subscription details by ID](https:\/\/developers.vtex.com\/docs\/api-reference\/subscriptions-api-v3#get-\/api\/rns\/pub\/subscriptions\/-id-)\r\n- `PATCH` [Update subscription by ID](https:\/\/developers.vtex.com\/docs\/api-reference\/subscriptions-api-v3#patch-\/api\/rns\/pub\/subscriptions\/-id-)\r\n- `GET` [List subscriptions](https:\/\/developers.vtex.com\/docs\/api-reference\/subscriptions-api-v3#get-\/api\/rns\/pub\/subscriptions)\r\n- `POST` [Create subscription](https:\/\/developers.vtex.com\/docs\/api-reference\/subscriptions-api-v3#post-\/api\/rns\/pub\/subscriptions)\r\n- `DELETE` [Remove item from subscription](https:\/\/developers.vtex.com\/docs\/api-reference\/subscriptions-api-v3#delete-\/api\/rns\/pub\/subscriptions\/-id-\/items\/-itemId-)\r\n- `PATCH` [Edit item on subscription](https:\/\/developers.vtex.com\/docs\/api-reference\/subscriptions-api-v3#patch-\/api\/rns\/pub\/subscriptions\/-id-\/items\/-itemId-)\r\n- `POST` [Add item to subscription](https:\/\/developers.vtex.com\/docs\/api-reference\/subscriptions-api-v3#post-\/api\/rns\/pub\/subscriptions\/-id-\/items)\r\n- `POST` [Calculate the current prices for a subscription](https:\/\/developers.vtex.com\/docs\/api-reference\/subscriptions-api-v3#post-\/api\/rns\/pub\/subscriptions\/-id-\/simulate)\r\n- `POST` [Calculate the current prices for the provided subscription template](https:\/\/developers.vtex.com\/docs\/api-reference\/subscriptions-api-v3#post-\/api\/rns\/pub\/subscriptions\/simulate)\r\n- `GET` [Get conversation messages](https:\/\/developers.vtex.com\/docs\/api-reference\/subscriptions-api-v3#get-\/api\/rns\/pub\/subscriptions\/-subscriptionId-\/conversation-message)\r\n\r\n### Settings\r\n\r\n- `GET` [Get subscription settings](https:\/\/developers.vtex.com\/docs\/api-reference\/subscriptions-api-v3#get-\/api\/rns\/settings)\r\n- `POST` [Edit subscriptions settings](https:\/\/developers.vtex.com\/docs\/api-reference\/subscriptions-api-v3#post-\/api\/rns\/settings) \r\n\r\n## Common parameters\r\n\r\n| **Parameter name** | **Description** | **Type** |\r\n| :---: | :--- | :--- |\r\n| `{{accountName}}` | Name of the VTEX account. Used as part of the URL. | Server variable. |\r\n| `{{environment}}` | Environment to use. Used as part of the URL. The default value is `vtexcommercestable`. | Server variable. |\r\n| `X-VTEX-API-AppKey` | Unique identifier of the [application key](https://developers.vtex.com/docs/guides/api-authentication-using-application-keys). | Authentication header. Must be used together with `X-VTEX-API-AppToken`. Not necessary when using `VtexIdclientAutCookie`. |\r\n| `X-VTEX-API-AppToken` | Secret token of the [application key](https://developers.vtex.com/docs/guides/api-authentication-using-application-keys). | Authentication header. Must be used together with X-VTEX-API-AppKey. Not necessary when using `VtexIdclientAutCookie`. |\r\n| `VtexIdclientAutCookie` | [User token](https://developers.vtex.com/docs/guides/api-authentication-using-user-tokens), valid for 24 hours. | Authentication header. Not necessary when using `X-VTEX-API-AppKey` and `X-VTEX-API-AppToken`. |",
"contact": {},
"version": "1.0"
},
"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/rns/pub/cycles/{cycleId}": {
"get": {
"tags": [
"Cycles"
],
"summary": "Get cycle details",
"description": "Retrieves a specific cycle by its ID.\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| Subscriptions | ApplicationAccess | **Subscription view only** |\r\n| Subscriptions | ApplicationAccess | **Subscription view and edit** |\r\n\r\nThere are no applicable [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) for this resource list. You must [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) and add at least one of the resources above in order to use this endpoint. To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication).\r\n\r\n>\u2757 To prevent integrations from having excessive permissions, consider the [best practices for managing app keys](https://help.vtex.com/en/tutorial/best-practices-application-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations.",
"parameters": [
{
"name": "cycleId",
"in": "path",
"description": "ID from the desired cycle.",
"required": true,
"schema": {
"type": "string",
"example": "2b9de8a5-b29b-4e18-8400-400dc0a2330d"
}
},
{
"name": "Content-Type",
"in": "header",
"description": "Type of the content being sent.",
"required": true,
"style": "simple",
"schema": {
"type": "string",
"example": "application/json"
}
},
{
"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"
}
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SubscriptionCycleResponse"
},
"example": {
"id": "2b9de8a5-b29b-4e18-8400-400dc0a2330d-20240730",
"subscriptionId": "2b9de8a5-b29b-4e18-8400-400dc0a2330d",
"workflowId": "73a385ff-b3dc-48c0-ab25-0f1cecc4be8a",
"status": "SUCCESS",
"customerEmail": "customer@email.com",
"customerId": "94b0a774-09c7-43ee-91e2-e8fa6guad0ju",
"date": "2024-07-30T09:04:59.7325176Z",
"lastUpdate": "2024-07-31T09:06:05.6879323Z",
"cycleCount": 3,
"isInRetry": false,
"message": null,
"friendlyMessage": null,
"plan": {
"id": "store.subscription.tshirt-collection",
"frequency": {
"periodicity": "WEEKLY",
"interval": 3
},
"validity": {
"begin": "2024-04-11T11:04:24.0454821Z",
"end": null
},
"purchaseDay": "Sunday"
},
"orderInfo": {
"orderId": "V-8753228-01",
"orderGroup": "V-8753228",
"paymentUrl": null,
"value": 21600
},
"context": {
"items": [
{
"subscriptionItem": "69C872657263439D899265717E733A84",
"skuId": "1154",
"quantity": 1,
"status": "ACTIVE",
"isSkipped": false,
"cycleCount": 1
}
],
"paymentSystem": "47",
"paymentSystemName": "Cash",
"paymentSystemGroup": "cash",
"paymentAccountId": null,
"addressId": "Address",
"addressType": "residential",
"catalogAttachment": "vtex.subscription.tshirt-collection"
},
"simulationItems": [
{
"id": "1145",
"quantity": 1,
"unitPrice": 21600,
"status": "OK",
"price": null,
"sellingPrice": 21600,
"manualPrice": null
}
]
}
}
}
}
}
}
},
"/api/rns/pub/cycles": {
"get": {
"tags": [
"Cycles"
],
"summary": "List cycles",
"description": "Lists subscription cycles, based on filters defined in the query parameters.\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| Subscriptions | ApplicationAccess | **Subscription view only** |\r\n| Subscriptions | ApplicationAccess | **Subscription view and edit** |\r\n\r\nThere are no applicable [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) for this resource list. You must [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) and add at least one of the resources above in order to use this endpoint. To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication).\r\n\r\n>\u2757 To prevent integrations from having excessive permissions, consider the [best practices for managing app keys](https://help.vtex.com/en/tutorial/best-practices-application-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations.",
"parameters": [
{
"name": "beginDate",
"in": "query",
"description": "Lower limit for the date of creation of the cycle",
"schema": {
"type": "string",
"nullable": true
}
},
{
"name": "endDate",
"description": "Upper limit for the date of creation of the cycle",
"in": "query",
"schema": {
"type": "string",
"nullable": true
}
},
{
"name": "subscriptionId",
"description": "Id from the subscription that generated the cycle",
"in": "query",
"schema": {
"type": "string",
"nullable": true
}
},
{
"name": "customerEmail",
"in": "query",
"description": "Customer that owns the subscription. Defaults to the current logged user",
"schema": {
"type": "string",
"nullable": true
}
},
{
"name": "status",
"in": "query",
"description": "Current cycle status",
"schema": {
"type": "string",
"nullable": true
}
},
{
"name": "page",
"in": "query",
"description": "Page used for pagination",
"schema": {
"type": "integer",
"format": "int32",
"default": 1
}
},
{
"name": "size",
"in": "query",
"description": "Page size used for pagination",
"schema": {
"type": "integer",
"format": "int32",
"default": 15
}
},
{
"name": "Content-Type",
"in": "header",
"description": "Type of the content being sent.",
"required": true,
"style": "simple",
"schema": {
"type": "string",
"example": "application/json"
}
},
{
"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"
}
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "array",
"description": "List of subscriptions of the VTEX account, limited to 15 results.",
"items": {
"$ref": "#/components/schemas/SubscriptionCycleResponse"
}
},
"example": [
{
"id": "2b9de8a5-b29b-4e18-8400-400dc0a2330d-20240730",
"subscriptionId": "2b9de8a5-b29b-4e18-8400-400dc0a2330d",
"workflowId": "73a385ff-b3dc-48c0-ab25-0f1cecc4be8a",
"status": "SUCCESS",
"customerEmail": "customer@email.com",
"customerId": "94b0a774-09c7-43ee-91e2-e8fa6guad0ju",
"date": "2024-07-30T09:04:59.7325176Z",
"lastUpdate": "2024-07-31T09:06:05.6879323Z",
"cycleCount": 3,
"isInRetry": false,
"message": null,
"friendlyMessage": null,
"plan": {
"id": "store.subscription.tshirt-collection",
"frequency": {
"periodicity": "WEEKLY",
"interval": 3
},
"validity": {
"begin": "2024-04-11T11:04:24.0454821Z",
"end": null
},
"purchaseDay": "Sunday"
},
"orderInfo": {
"orderId": "V-8753228-01",
"orderGroup": "V-8753228",
"paymentUrl": null,
"value": 21600
},
"context": {
"items": [
{
"subscriptionItem": "69C872657263439D899265717E733A84",
"skuId": "1154",
"quantity": 1,
"status": "ACTIVE",
"isSkipped": false,
"cycleCount": 1
}
],
"paymentSystem": "47",
"paymentSystemName": "Cash",
"paymentSystemGroup": "cash",
"paymentAccountId": null,
"addressId": "Address",
"addressType": "residential",
"catalogAttachment": "vtex.subscription.tshirt-collection"
},
"simulationItems": [
{
"id": "1145",
"quantity": 1,
"unitPrice": 21600,
"status": "OK",
"price": null,
"sellingPrice": 21600,
"manualPrice": null
}
]
}
]
}
}
}
}
}
},
"/api/rns/pub/cycles/{cycleId}/retry": {
"post": {
"tags": [
"Cycles"
],
"summary": "Retry cycle",
"description": "Every subscription order has an execution count called cycle, which determines the position of an order counting from when the shopper subscribed. This endpoint reruns a cycle that is currently in error state.\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| Subscriptions | ApplicationAccess | **Subscription view only** |\r\n| Subscriptions | ApplicationAccess | **Subscription view and edit** |\r\n\r\nThere are no applicable [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) for this resource list. You must [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) and add at least one of the resources above in order to use this endpoint. To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication).\r\n\r\n>\u2757 To prevent integrations from having excessive permissions, consider the [best practices for managing app keys](https://help.vtex.com/en/tutorial/best-practices-application-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations.",
"parameters": [
{
"name": "cycleId",
"in": "path",
"description": "ID from the subscription cycle that will be retried.",
"required": true,
"schema": {
"type": "string",
"nullable": true
}
},
{
"name": "Content-Type",
"in": "header",
"description": "Type of the content being sent.",
"required": true,
"style": "simple",
"schema": {
"type": "string",
"example": "application/json"
}
},
{
"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"
}
}
],
"responses": {
"200": {
"description": "OK"
}
}
}
},
"/api/rns/pvt/plans": {
"get": {
"tags": [
"Plans"
],
"summary": "List plans",
"description": "Lists subscription plans, based on filters defined in the query parameters.\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| Subscriptions | ApplicationAccess | **Subscription admin** |\r\n\r\nThere are no applicable [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) for this resource list. You must [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) and add at least one of the resources above in order to use this endpoint. To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication).\r\n\r\n>\u2757 To prevent integrations from having excessive permissions, consider the [best practices for managing app keys](https://help.vtex.com/en/tutorial/best-practices-application-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations.",
"parameters": [
{
"name": "periodicity",
"in": "query",
"description": "Filter [subscription plans](https://help.vtex.com/en/tutorial/subscription-plans-beta--5kczKRqHEsrs1tYtRcY8wR) by available periodicity.",
"schema": {
"type": "string",
"nullable": true
}
},
{
"name": "interval",
"in": "query",
"description": "Filter [subscription plans](https://help.vtex.com/en/tutorial/subscription-plans-beta--5kczKRqHEsrs1tYtRcY8wR) by available interval.",
"schema": {
"type": "string",
"nullable": true
}
},
{
"name": "page",
"in": "query",
"description": "Page used for pagination.",
"schema": {
"type": "integer",
"example": 1
}
},
{
"name": "size",
"in": "query",
"description": "Desired number of [subscription plans](https://help.vtex.com/en/tutorial/subscription-plans-beta--5kczKRqHEsrs1tYtRcY8wR) in the response.",
"schema": {
"type": "integer",
"example": 15
}
},
{
"name": "Content-Type",
"in": "header",
"description": "Type of the content being sent.",
"required": true,
"style": "simple",
"schema": {
"type": "string",
"example": "application/json"
}
},
{
"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"
}
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/StorePlan"
}
},
"example": [
{
"id": "catfood.subscription",
"frequencies": [
{
"periodicity": "DAILY",
"interval": 1
}
],
"isActive": true,
"importInProgress": false,
"attachmentId": 40,
"isValid": true,
"validationMessages": [],
"validity": null,
"purchaseDays": [
"7"
]
},
{
"id": "subscription.tshirt",
"frequencies": [
{
"periodicity": "MONTHLY",
"interval": 1
}
],
"isActive": true,
"importInProgress": false,
"attachmentId": 39,
"isValid": true,
"validationMessages": [],
"validity": null,
"purchaseDays": [
"3"
]
}
]
}
}
}
}
}
},
"/api/rns/pvt/plans/{id}": {
"get": {
"tags": [
"Plans"
],
"summary": "Get plan details",
"description": "Retrieves a specific subscription plan by its ID.\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| Subscriptions | ApplicationAccess | **Subscription admin** |\r\n\r\nThere are no applicable [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) for this resource list. You must [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) and add at least one of the resources above in order to use this endpoint. To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication).\r\n\r\n>\u2757 To prevent integrations from having excessive permissions, consider the [best practices for managing app keys](https://help.vtex.com/en/tutorial/best-practices-application-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations.",
"parameters": [
{
"name": "id",
"in": "path",
"description": "ID from the [subscription plan](https://help.vtex.com/en/tutorial/subscription-plans-beta--5kczKRqHEsrs1tYtRcY8wR).",
"required": true,
"schema": {
"type": "string",
"example": "catfood.subscription"
}
},
{
"name": "Content-Type",
"in": "header",
"description": "Type of the content being sent.",
"required": true,
"style": "simple",
"schema": {
"type": "string",
"example": "application/json"
}
},
{
"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"
}
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/StorePlan"
},
"example": {
"id": "catfood.subscription",
"frequencies": [
{
"periodicity": "DAILY",
"interval": 1
}
],
"isActive": true,
"importInProgress": false,
"attachmentId": 40,
"isValid": true,
"validationMessages": [],
"validity": null,
"purchaseDays": [
"1",
"2",
"3",
"4",
"5",
"6",
"0"
]
}
}
}
}
}
}
},
"/api/rns/pvt/reports": {
"get": {
"tags": [
"Reports"
],
"summary": "List report templates",
"description": "Lists all subscription report templates available.\r\n\r\n>ℹ️ After choosing the desired template, use the [Generate report](https://developers.vtex.com/docs/api-reference/subscriptions-api-v3#post-/api/rns/pvt/reports/-reportName-/documents) endpoint to create the report for your store.\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| Subscriptions | ApplicationAccess | **Subscription view only** |\r\n| Subscriptions | ApplicationAccess | **Subscription admin** |\r\n| Subscriptions | ApplicationAccess | **Subscription view and edit** |\r\n| Subscriptions | ApplicationAccess | **Subscription metrics and reports** |\r\n\r\nThere are no applicable [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) for this resource list. You must [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) and add at least one of the resources above in order to use this endpoint. To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication).\r\n\r\n>\u2757 To prevent integrations from having excessive permissions, consider the [best practices for managing app keys](https://help.vtex.com/en/tutorial/best-practices-application-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations.",
"parameters": [
{
"name": "Content-Type",
"in": "header",
"description": "Type of the content being sent.",
"required": true,
"style": "simple",
"schema": {
"type": "string",
"example": "application/json"
}
},
{
"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"
}
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"type": "object",
"description": "Report template details.",
"properties": {
"account": {
"type": "string",
"description": "VTEX store account name."
},
"name": {
"type": "string",
"description": "Template type, more information in the `description` field.",
"enum": [
"subscriptionsWithStatus",
"subscriptionsScheduledBetweenDate",
"subscriptionsUpdatedBetweenDate",
"subscriptionsCreatedBetweenDate",
"executionsBetweenDate"
]
},
"description": {
"type": "string",
"description": "Template description, which varies according to the template type:\r\n- `subscriptionsWithStatus`: Get subscriptions based on status.\r\n- `subscriptionsScheduledBetweenDate`: Get active subscriptions scheduled between dates.\r\n- `subscriptionsUpdatedBetweenDate`: Get subscriptions updated between dates.\r\n- `subscriptionsCreatedBetweenDates`: Get subscriptions created between date.\r\n- `executionsBetweenDate`: Get executions between dates."
},
"reason": {
"type": "string",
"description": "Reason why the template was created.",
"nullable": true
},
"behalfOf": {
"type": "string",
"description": "On behalf of which user the template was created.",
"nullable": true
},
"params": {
"type": "array",
"description": "Information about the template params.",
"items": {
"type": "object",
"description": "Param details.",
"properties": {
"type": {
"type": "string",
"description": "Template param type, which can be `string` for the `subscriptionsWithStatus` template type, or `date` for the other cases.",
"enum": [
"string",
"date"
]
},
"format": {
"type": "string",
"description": "Template param format, such as `yyyy-MM-dd` for `beginDate` or `endDate`. Not applicable to the `subscriptionsWithStatus` type."
},
"name": {
"type": "string",
"description": "Template param name, which can relate to the template status (`status`) or dates (`beginDate`, `endDate`).",
"enum": [
"status",
"beginDate",
"endDate"
]
}
}
}
}
}
}
},
"example": [
{
"account": "fashionstore",
"name": "subscriptionsWithStatus",
"description": "Get subscriptions based on status",
"reason": null,
"behalfOf": null,
"params": [
{
"type": "string",
"name": "status"
}
]
},
{
"account": "fashionstore",
"name": "subscriptionsScheduledBetweenDate",
"description": "Get active subscriptions scheduled between date",
"reason": null,
"behalfOf": null,
"params": [
{
"type": "date",
"format": "yyyy-MM-dd",
"name": "beginDate"
},
{
"type": "date",
"format": "yyyy-MM-dd",
"name": "endDate"
}
]
},
{
"account": "fashionstore",
"name": "subscriptionsUpdatedBetweenDate",
"description": "Get subscriptions updated between date",
"reason": null,
"behalfOf": null,
"params": [
{
"type": "date",
"format": "yyyy-MM-dd",
"name": "beginDate"
},
{
"type": "date",
"format": "yyyy-MM-dd",
"name": "endDate"
}
]
},
{
"account": "fashionstore",
"name": "subscriptionsCreatedBetweenDate",
"description": "Get subscriptions created between date",
"reason": null,
"behalfOf": null,
"params": [
{
"type": "date",
"format": "yyyy-MM-dd",
"name": "beginDate"
},
{
"type": "date",
"format": "yyyy-MM-dd",
"name": "endDate"
}
]
},
{
"account": "fashionstore",
"name": "executionsBetweenDate",
"description": "Get executions between date",
"reason": null,
"behalfOf": null,
"params": [
{
"type": "date",
"format": "yyyy-MM-dd",
"name": "beginDate"
},
{
"type": "date",
"format": "yyyy-MM-dd",
"name": "endDate"
}
]
}
]
}
}
}
}
}
},
"/api/rns/pvt/reports/{reportName}/documents/{documentId}": {
"get": {
"tags": [
"Reports"
],
"summary": "Get report document details",
"description": "Retrieves information about a subscription report document, searching by document ID. In the status code `200 OK` response, you get a link to download the report.\r\n\r\n>❗ Before using this endpoint, you must create a report with the [Generate report](https://developers.vtex.com/docs/api-reference/subscriptions-api-v3#post-/api/rns/pvt/reports/-reportName-/documents) endpoint and get the document ID.\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| Subscriptions | ApplicationAccess | **Subscription metrics and reports** |\r\n\r\nThere are no applicable [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) for this resource list. You must [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) and add at least one of the resources above in order to use this endpoint. To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication).\r\n\r\n>\u2757 To prevent integrations from having excessive permissions, consider the [best practices for managing app keys](https://help.vtex.com/en/tutorial/best-practices-application-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations.",
"parameters": [
{
"name": "reportName",
"in": "path",
"required": true,
"description": "Name of the report type, which must be previously created for your store using the [Generate report](https://developers.vtex.com/docs/api-reference/subscriptions-api-v3#post-/api/rns/pvt/reports/-reportName-/documents) endpoint. The possible values are:\r\n- `subscriptionsWithStatus`\r\n- `subscriptionsScheduledBetweenDate`\r\n- `subscriptionsUpdatedBetweenDate`\r\n- `subscriptionsCreatedBetweenDate`\r\n- `executionsBetweenDate`",
"schema": {
"type": "string",
"example": "subscriptionsWithStatus"
}
},
{
"name": "documentId",
"in": "path",
"required": true,
"description": "Report document ID. You get this value after you create a report template for your store using the [Generate report](https://developers.vtex.com/docs/api-reference/subscriptions-api-v3#post-/api/rns/pvt/reports/-reportName-/documents) endpoint.",
"schema": {
"type": "string",
"example": "2804f3ab-5a51-11ef-b37f-f89ffae09a60"
}
},
{
"name": "Content-Type",
"in": "header",
"description": "Type of the content being sent.",
"required": true,
"style": "simple",
"schema": {
"type": "string",
"example": "application/json"
}
},
{
"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"
}
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ReportResponse"
},
"example": {
"id": "7849df9f-00d4-11ef-8452-1254acca1d85",
"finished": true,
"recordsProcessed": 63,
"recordsSum": 63,
"startDate": "2024-03-22T18:16:50.7487312Z",
"lastUpdateTime": "2024-04-22T18:16:50.7487312Z",
"completedDate": "2024-04-22T18:16:50.7487312Z",
"errorCount": null,
"percentageProcessed": 100,
"enqueueDate": "2024-04-22T18:16:50.7487312Z",
"email": "receiver@email.com",
"canceled": false,
"outputType": "CSV",
"zipped": false,
"linkToDownload": "https://s3.amazonaws.com/OMSReport/v3/_finished/accountname/7849df9f-00d4-11ef-8452-1254acca1d85//files/47363271-b655-11ed-83ab-12dbed7de2a7.csv?AWSAccessKeyId=ASIAQYXXCHIYPSJDRNHB&Expires=1724945014&x-amz-security-token=IQoJb3JpZ2luX2VjEMj%2Feq6V1w8z3NGlnfhvSp70Q80qvQUIwP%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FARAAGgwwNTMxMzE0OTE4ODgiDCM0JATV%2FwXQvXyovCqRBW%2F14aC5J3plQR%2BzKbpddyDnoAstfgJo1MfR0yel3uRzixrSRFE033V4%2B8cN7ez5Lr0ymGifnB14ONZ35RtM4PgQvuV0fs8If6cw8%3D%3D&Signature=7yZbA%2BGaYdPUkdxFXqy9W8GGHuo%3D",
"lastErrorMessage": null,
"statusMessage": "Report 7849df9f-00d4-11ef-8452-1254acca1d85 was completed at 15:23 and sent to receiver@email.com."
}
}
}
}
}
}
},
"/api/rns/pvt/reports/{reportName}/documents": {
"post": {
"tags": [
"Reports"
],
"summary": "Generate report",
"description": "Creates a subscriptions report in the format of a `csv` file and sends it via email to a given user.\r\n\r\n>ℹ️ In the response body of the current endpoint, you get the document ID required for the [Get report document details](https://developers.vtex.com/docs/api-reference/subscriptions-api-v3#get-/api/rns/pvt/reports/-reportName-/documents/-documentId-) endpoint.\r\n\r\nYou can generate the following types of report:\r\n\r\n- `subscriptionsWithStatus`: Get subscriptions based on subscription cycle execution status.\r\n - **Required query param:** `status`.\r\n\r\n- `subscriptionsScheduledBetweenDate`: Get active subscriptions scheduled between dates.\r\n - **Required query params:** `beginDate` and `endDate`.\r\n\r\n- `subscriptionsUpdatedBetweenDate`: Get subscriptions updated between dates.\r\n - **Required query params:** `beginDate` and `endDate`.\r\n\r\n- `subscriptionsCreatedBetweenDate`: Get subscriptions created between dates.\r\n - **Required query params:** `beginDate` and `endDate`.\r\n\r\n- `executionsBetweenDate`: Get executions between dates.\r\n - **Required query params:** `beginDate` and `endDate`.\r\n\r\n>ℹ️ You can also use the [List report templates](https://developers.vtex.com/docs/api-reference/subscriptions-api-v3#get-/api/rns/pvt/reports) endpoint to discover the types of reports you can generate.\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| Subscriptions | ApplicationAccess | **Subscription metrics and reports** |\r\n\r\nThere are no applicable [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) for this resource list. You must [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) and add at least one of the resources above in order to use this endpoint. To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication).\r\n\r\n>\u2757 To prevent integrations from having excessive permissions, consider the [best practices for managing app keys](https://help.vtex.com/en/tutorial/best-practices-application-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations.",
"parameters": [
{
"name": "reportName",
"in": "path",
"required": true,
"description": "Name of the type of report you wish to generate. The following values are accepted:\r\n- `subscriptionsWithStatus`\r\n- `subscriptionsScheduledBetweenDate`\r\n- `subscriptionsUpdatedBetweenDate`\r\n- `subscriptionsCreatedBetweenDate`\r\n- `executionsBetweenDate`",
"schema": {
"type": "string",
"example": "subscriptionsWithStatus"
}
},
{
"name": "email",
"in": "query",
"required": false,
"description": "The report will be sent to the email in this field. When no email is provided, the report is sent to the email of the user making the request.",
"schema": {
"type": "string",
"example": "receiver@email.com"
}
},
{
"name": "status",
"in": "query",
"required": false,
"description": "Subscription cycle execution status. This field is required only for the `subscriptionsWithStatus` report type, and the possible values are:\r\n- `TRIGGERED`: Execution has been triggered.\r\n- `IN_PROCESS`: Execution is being processed by the system.\r\n- `FAILURE`: An internal error occurred during the subscription execution.\r\n- `SUCCESS`: Successful cycle processing.\r\n- `EXPIRED`: The subscription was not renewed, and the period for which it was valid has ended.\r\n- `ORDER_ERROR`: Cycle was not executed due to an error in order placement.\r\n- `PAYMENT_ERROR`: Cycle was not executed due to an error in the payment.\r\n- `SKIPED`: A subscription cycle execution was skipped, and the subscription will be executed in the next cycle.\r\n- `SUCCESS_WITH_NO_ORDER`: Cycle was executed successfully, and the linked order has no items.\r\n- `SUCCESS_WITH_PARTIAL_ORDER`: Cycle was executed successfully, and has a linked partial order.\r\n- `RE_TRIGGERED`: Execution retry was triggered manually.\r\n- `SCHEDULE_UPDATED`: The next subscription cycle execution date has been updated.",
"schema": {
"type": "string",
"example": "SUCCESS"
}
},
{
"name": "beginDate",
"in": "query",
"required": false,
"description": "Beginning date in the format `YYYY-MM-DD`. This field is required for all report types, except for the `subscriptionsWithStatus` type.",
"schema": {
"type": "string",
"example": "2024-07-01"
}
},
{
"name": "endDate",
"in": "query",
"required": false,
"description": "Ending date in the format `YYYY-MM-DD`. This field is required for all report types, except for the `subscriptionsWithStatus` type.",
"schema": {
"type": "string",
"example": "2024-08-01"
}
},
{
"name": "Content-Type",
"in": "header",
"description": "Type of the content being sent.",
"required": true,
"style": "simple",
"schema": {
"type": "string",
"example": "application/json"
}
},
{
"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"
}
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ReportResponse"
},
"example": {
"id": "7849df9f-00d4-11ef-8452-1254acca1d85",
"finished": false,
"recordsProcessed": 0,
"recordsSum": null,
"startDate": null,
"lastUpdateTime": null,
"completedDate": null,
"errorCount": null,
"percentageProcessed": 0,
"enqueueDate": "2024-04-22T18:16:50.7487312Z",
"email": "receiver@email.com",
"canceled": false,
"outputType": "CSV",
"zipped": false,
"linkToDownload": null,
"lastErrorMessage": null,
"statusMessage": "Report 7849df9f-00d4-11ef-8452-1254acca1d85 is being processed (0.00% completed). The file will be sent to receiver@email.com."
}
}
}
}
}
}
},
"/api/rns/pub/subscriptions/{id}": {
"get": {
"tags": [
"Subscriptions"
],
"summary": "Get subscription details by ID",
"description": "Retrieves information about a subscription, searching by subscription ID.\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| Subscriptions | ApplicationAccess | **Subscription view only** |\r\n| Subscriptions | ApplicationAccess | **Subscription view and edit** |\r\n\r\nThere are no applicable [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) for this resource list. You must [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) and add at least one of the resources above in order to use this endpoint. To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication).\r\n\r\n>\u2757 To prevent integrations from having excessive permissions, consider the [best practices for managing app keys](https://help.vtex.com/en/tutorial/best-practices-application-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations.",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"description": "[Subscription](https://help.vtex.com/en/tutorial/how-subscriptions-work--frequentlyAskedQuestions_4453) ID.",
"schema": {
"type": "string",
"example": "F35A8B497EA9E5A6D8F3778CBBA4C9E3"
}
},
{
"name": "Content-Type",
"in": "header",
"description": "Type of the content being sent.",
"required": true,
"style": "simple",
"schema": {
"type": "string",
"example": "application/json"
}