-
Notifications
You must be signed in to change notification settings - Fork 0
/
apiary.apib
669 lines (458 loc) · 21.1 KB
/
apiary.apib
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
FORMAT: 1A
HOST: http://api.evino.com.br/v1/
# Evino
# Evino API [/]
This resource does not have any attributes. Instead it offers the initial
API affordances in the form of the links in the JSON body.
It is recommend to follow the “url” link values,
[Link](https://tools.ietf.org/html/rfc5988) or Location headers where
applicable to retrieve resources. Instead of constructing your own URLs,
to keep your client decoupled from implementation details.
## Retrieve the Entry Point [GET]
+ Response 200 (application/json)
+ Attributes
+ register: /auth/register (string)
## Group Error handling [/error]
All responses with HTTP out of 200 range WILL response and JSON object with an human friendly message and a compreensive http status code
### Error example [GET]
+ Response 418 (application/json)
+ Attributes
+ message: I'm a error message for human beings (string) - Friendly error message
# Group Authentication
The authentication schema for Evino API is based on OAuth2. Each endpoint that needed or can show personnalized data for each user MUST be requested passing the access token in "Authorization" http header and MUST to use an HTTPS connection.
Example:
`Authorization: Bearer CAACEdEose0cBAAavhW6UJnS1AlVgZAqFZB1d5JeBqYvAiDAP7BugMuElSo6sYBxFhrfRFaJmOPKUTjQis8Uezsil7yCRUxKWZBMwkcZB0QbhVr106bkJmEHx8AhTa0o4FM5SVyCgVJO7rCvVnVwqKl3RmviBj4MFO9n7O5y4LckZATrW9o3MCc7U1uFbzZB2LYc2AZCgYLmcpdSz5tlkiTZBZB9cZAmFsxd8GZD`
## Register [/auth/register]
Used for create a new user and returns an access token in success case.
### Register of user [POST /auth/register]
+ Request Hard sign-up with e-mail and password (application/json)
+ Attributes
+ email: [email protected] (string) - E-mail from the user
+ password: S3cr3t (string) - Password from the user MUST be omitted for soft create soft login user
+ Request Hard sign-up with access token and password (application/json)
+ Attributes
+ password: S3cr3t (string) - Password from the user MUST be omitted for soft create soft login user
+ Headers
Authorization: Bearer CAACEdEose0cBAAavhW6UJnS1AlVgZAqFZB1d5JeBqYvAiDAP7BugMuElSo6sYBxFhrfRFaJmOPKUTjQis8Uezsil7yCRUxKWZBMwkcZB0QbhVr106bkJmEHx8AhTa0o4FM5SVyCgVJO7rCvVnVwqKl3RmviBj4MFO9n7O5y4LckZATrW9o3MCc7U1uFbzZB2LYc2AZCgYLmcpdSz5tlkiTZBZB9cZAmFsxd8GZD
+ Request Soft sign-up sending e-mail for create a soft user (application/json)
+ Attributes
+ email: [email protected] (string) - E-mail from the user
+ Response 200 (application/json)
+ Attributes
+ token: CAACEdEose0cBAAavhW6UJnS1AlVgZAqFZB1d5JeBqYvAiDAP7BugMuElSo6sYBxFhrfRFaJmOPKUTjQis8Uezsil7yCRUxKWZBMwkcZB0QbhVr106bkJmEHx8AhTa0o4FM5SVyCgVJO7rCvVnVwqKl3RmviBj4MFO9n7O5y4LckZATrW9o3MCc7U1uFbzZB2LYc2AZCgYLmcpdSz5tlkiTZBZB9cZAmFsxd8QZD (string) - Access token for request to Evino API
+ Request E-mail already taken sign-up (application/json)
+ Attributes
+ email: [email protected] (string) - E-mail from the user
+ Request Sign-up for existent user (application/json)
+ Attributes
+ email: [email protected] (string) - E-mail from the user
+ password: S3cr3t (string) - Password from the user MUST be omitted for soft create soft login user
+ Response 409 (application/json)
+ Attributes
+ message: E-mail already taken (string) - Friendly error message
+ Request Login case with e-mail and token from different users (application/json)
+ Attributes
+ email: [email protected] (string) - E-mail from the user
+ password: S3cr3t (string) - Password from the user MUST be omitted for soft create soft login user
+ Headers
Authorization: Bearer CAACEdEose0cBAAavhW6UJnS1AlVgZAqFZB1d5JeBqYvAiDAP7BugMuElSo6sYBxFhrfRFaJmOPKUTjQis8Uezsil7yCRUxKWZBMwkcZB0QbhVr106bkJmEHx8AhTa0o4FM5SVyCgVJO7rCvVnVwqKl3RmviBj4MFO9n7O5y4LckZATrW9o3MCc7U1uFbzZB2LYc2AZCgYLmcpdSz5tlkiTZBZB9cZAmFsxd8GZD
+ Response 409 (application/json)
+ Attributes
+ message: E-mail and access token are related to different users (string) - Friendly error message
+ Request Login case without any e-mail or token (application/json)
+ Attributes
+ password: S3cr3t (string) - Password from the user MUST be omitted for soft create soft login user
+ Response 403 (application/json)
+ Attributes
+ message: No user to perform this action (string) - Friendly error message
### Login [POST /auth/login]
+ Request Hard login with e-mail and password (application/json)
+ Attributes
+ email: [email protected] (string) - E-mail from the user
+ password: S3cr3t (string) - Password from the user MUST be omitted for soft create soft login user
+ Request Hard login with access token and password (application/json)
+ Attributes
+ password: S3cr3t (string) - Password from the user MUST be omitted for soft create soft login user
+ Headers
Authorization: Bearer CAACEdEose0cBAAavhW6UJnS1AlVgZAqFZB1d5JeBqYvAiDAP7BugMuElSo6sYBxFhrfRFaJmOPKUTjQis8Uezsil7yCRUxKWZBMwkcZB0QbhVr106bkJmEHx8AhTa0o4FM5SVyCgVJO7rCvVnVwqKl3RmviBj4MFO9n7O5y4LckZATrW9o3MCc7U1uFbzZB2LYc2AZCgYLmcpdSz5tlkiTZBZB9cZAmFsxd8GZD
+ Request Soft login sending e-mail for create a soft user (application/json)
+ Attributes
+ email: [email protected] (string) - E-mail from the user
+ Response 200 (application/json)
+ Attributes
+ token: CAACEdEose0cBAAavhW6UJnS1AlVgZAqFZB1d5JeBqYvAiDAP7BugMuElSo6sYBxFhrfRFaJmOPKUTjQis8Uezsil7yCRUxKWZBMwkcZB0QbhVr106bkJmEHx8AhTa0o4FM5SVyCgVJO7rCvVnVwqKl3RmviBj4MFO9n7O5y4LckZATrW9o3MCc7U1uFbzZB2LYc2AZCgYLmcpdSz5tlkiTZBZB9cZAmFsxd8QZD (string) - Access token for request to Evino API
+ Request E-mail don't exists at database (application/json)
+ Attributes
+ email: [email protected] (string) - E-mail from the user
+ Response 201 (application/json)
+ Attributes
+ token: CAACEdEose0cBAAavhW6UJnS1AlVgZAqFZB1d5JeBqYvAiDAP7BugMuElSo6sYBxFhrfRFaJmOPKUTjQis8Uezsil7yCRUxKWZBMwkcZB0QbhVr106bkJmEHx8AhTa0o4FM5SVyCgVJO7rCvVnVwqKl3RmviBj4MFO9n7O5y4LckZATrW9o3MCc7U1uFbzZB2LYc2AZCgYLmcpdSz5tlkiTZBZB9cZAmFsxd8QZD (string) - Access token for request to Evino API
+ Request Login with wrong password (application/json)
+ Attributes
+ email: [email protected] (string) - E-mail from the user
+ password: Wr0ngP455w0rd (string) - Password from the user MUST be omitted for soft create soft login user
+ Response 409 (application/json)
+ Attributes
+ message: Wrong e-mail and/or password (string) - Friendly error message
+ Request Login case with e-mail and token from different users (application/json)
+ Attributes
+ email: [email protected] (string) - E-mail from the user
+ password: S3cr3t (string) - Password from the user MUST be omitted for soft create soft login user
+ Headers
Authorization: Bearer CAACEdEose0cBAAavhW6UJnS1AlVgZAqFZB1d5JeBqYvAiDAP7BugMuElSo6sYBxFhrfRFaJmOPKUTjQis8Uezsil7yCRUxKWZBMwkcZB0QbhVr106bkJmEHx8AhTa0o4FM5SVyCgVJO7rCvVnVwqKl3RmviBj4MFO9n7O5y4LckZATrW9o3MCc7U1uFbzZB2LYc2AZCgYLmcpdSz5tlkiTZBZB9cZAmFsxd8GZD
+ Response 409 (application/json)
+ Attributes
+ message: E-mail and access token are related to different users (string) - Friendly error message
+ Request Login case without any e-mail or token (application/json)
+ Attributes
+ password: S3cr3t (string) - Password from the user MUST be omitted for soft create soft login user
+ Response 403 (application/json)
+ Attributes
+ message: No user to perform this action (string) - Friendly error message
### Logout [GET /auth/logout]
+ Request Logout with access token
+ Headers
Authorization: Bearer CAACEdEose0cBAAavhW6UJnS1AlVgZAqFZB1d5JeBqYvAiDAP7BugMuElSo6sYBxFhrfRFaJmOPKUTjQis8Uezsil7yCRUxKWZBMwkcZB0QbhVr106bkJmEHx8AhTa0o4FM5SVyCgVJO7rCvVnVwqKl3RmviBj4MFO9n7O5y4LckZATrW9o3MCc7U1uFbzZB2LYc2AZCgYLmcpdSz5tlkiTZBZB9cZAmFsxd8GZD
+ Response 205 (application/json)
+ Request Login case without any e-mail or token (application/json)
+ Response 403 (application/json)
+ Attributes
+ message: No user to perform this action (string) - Friendly error message
### Facebook login [GET /auth/facebook]
+ Request Login case with oauth code from facebook (application/json)
+ Attributes
+ code: BCKODOgaO7NHKDGCSsAhMmZA7p0GilZBSNlRD9ZBOCzJIZAB7YB0QRP9EYNdLh5tGOT2aFOZActW8LXdkl53ZBWbZBqHNhZC9xZBZALp7Bg52Bi3ZAmrbkuKbbFV8Svy8oRWDaZB5q8NfB4DDuTLQ5GnxCX2pH11ARrzHMMKdVkfUFHcI8rO7Tnzii9GbphRJtDpBXi8srmC4KRPAOfeK1sGqMu5rKgYnUKGElDkZD (string) - Access token from Facebook
+ Response 200 (application/json)
+ Attributes
+ token: CAACEdEose0cBAAavhW6UJnS1AlVgZAqFZB1d5JeBqYvAiDAP7BugMuElSo6sYBxFhrfRFaJmOPKUTjQis8Uezsil7yCRUxKWZBMwkcZB0QbhVr106bkJmEHx8AhTa0o4FM5SVyCgVJO7rCvVnVwqKl3RmviBj4MFO9n7O5y4LckZATrW9o3MCc7U1uFbzZB2LYc2AZCgYLmcpdSz5tlkiTZBZB9cZAmFsxd8QZD (string) - Access token for request to Evino API
# Group Customer
## Base Object [/resource/1]
+ Attributes (object)
+ createdAt: `2012-04-23T18:25:43.511Z` (string) - Creation date of this resource in ISO 8861
+ updatedAt: `2012-04-23T18:25:43.511Z` (string) - Last update of this resource in ISO 8861
+ meta (object)
+ href: http://api.evino.com.br/v1/resource/1 (string) - The resource location
## Customer [/me]
Retrieve and update customer data
+ Attributes (Base Object)
+ firstName: User (string) - First name of customer
+ lastName: of Test (string) - Last name of customer
+ email: [email protected] (string) - E-mail address of customer
+ taxId: 12345678900 (string) - Tax ID of customer
+ birthDate: `2012-04-23T18:25:43.511Z` (string) - Birthdate of customer in ISO 8861
### Retrieve [GET]
+ Response 200 (application/json)
+ Attributes (Customer)
### Create [POST]
+ Request (application/json)
+ Attributes (Customer)
+ Response 204
### Update [PUT]
+ Request (application/json)
+ Attributes (Customer)
+ Response 201
### Delete [DELETE]
+ Response 204
## Address [/me/address/{id}]
+ Attributes (Base Object)
+ type: shipping, billing (enum) - Type of address
+ firstName: User (string) - First name of the user
+ lastName: of Test (string) - Last name of the user
+ zipcode: 12345678 (string) - Zip code of the address
+ address: Test St (string) - Address name (Street, Avenue)
+ number: 123 (string) - Number of the address
+ description: The description of address (string) - Description of the address used for apartment
+ city: São Paulo (string) - City of the address
+ state: SP (string) - State of the address
+ referencePoint (string) - Point of reference of the address (used for delivery purposes)
### List [GET /me/address]
+ Response 200 (application/json)
+ Attributes (array[Address])
### Add [POST]
+ Request (application/json)
+ Attributes (Address)
+ Response 201 (application/json)
+ Attributes (Address)
### Retrieve [GET]
+ Response 200 (application/json)
+ Attributes (Address)
### Update [PUT]
+ Request (application/json)
+ Attributes (Address)
+ Response 204 (application/json)
+ Attributes (Address)
### Delete [DELETE]
+ Response 204
## Payment method [/me/payment-method/{id}]
+ Attributes (Base Object)
+ type: creditcard (enum) - Type of payment method, by now it's only credit cards
+ brand: Visa, Mastercard, Amex, Elo (enum) - Brand of the credit card
+ number: 1234 (string) - Number of credit card
+ expiration: 12/2015 (string) - Date of expiration of credit card in MM/YYYY
### List [GET /me/payment-method]
+ Response 200 (application/json)
+ Attributes (array[Payment method])
### Add [POST]
+ Request (application/json)
+ Attributes (Payment method)
+ Response 201 (application/json)
+ Attributes (Payment method)
### Retrieve [GET]
+ Response 200 (application/json)
+ Attributes (Payment method)
### Update [PUT]
+ Request (application/json)
+ Attributes (Payment method)
+ Response 204 (application/json)
+ Attributes (Payment method)
### Delete [DELETE]
+ Response 204
## Orders [/me/orders]
### List [GET]
+ Response 200
+ Attributes (array[Order])
# Group Cellar
This resource shows the wines the customer has already bought
## Cellar item [/cellar-item/{sku}]
+ Parameters
+ sku (string) - SKU of cellar item
+ Attributes (Base Object)
+ price (number, required) - Price of last bought of this wine
+ quantity (number, required) - Quantity of total units bought
### List [GET /cellar]
+ Response 200 (application/json)
+ Attributes (array[Cellar item])
### Add [POST]
+ Request (application/json)
+ Attributes (Cellar item)
+ Response 201 (application/json)
+ Attributes (Cellar item)
### Retrieve [GET]
+ Response 200 (application/json)
+ Attributes (Cellar item)
### Update [PUT]
+ Request (application/json)
+ Attributes (Cellar item)
+ Response 204 (application/json)
+ Attributes (Cellar item)
### Delete [DELETE]
+ Response 204
# Group Catalog
## Product [/product/{sku}]
A product is a representation of a Stock Keepping Unit (SKU)
+ Parameters
+ sku (string) - The SKU of the product
+ Attributes (Base Object)
+ sku: 123456789 (string) - SKU of the product
+ name: Bull's blood (string)
+ vendor: Aurora (string) - Vendor of the product
+ shortDescription: An very good wine produced in the best places of South America (string) - Short description of the product
+ longDescription: An long description about a very good wine produced in the best places of South America (string) - Long description of the product
+ startDate: `2012-04-23T18:25:43.511Z` (string) - Date when the product starts being disponible
+ endDate: `2012-04-23T18:25:43.511Z` (string) - Date when the product ends being disponible
+ images (object)
+ thumb: http://img.evino.com.br/image-thumb-1278.png - Image in 200x200px
+ price (object)
+ full: 60.99 (number) - Price without any discount
+ cart: 45.99 (number) - Price considering discount for subscription etc.
+ quantity: 10 (number) - Quantity for sale
+ attributes (object) - Attributes EAV editted by content team
+ attr1: value1 (string) - Value of example for an attr1 attribute
### List [GET /product]
+ Response 200 (application/json)
+ Attributes (array[Product])
### Add [POST]
+ Request (application/json)
+ Attributes (Product)
+ Response 201 (application/json)
+ Attributes (Product)
### Retrieve [GET]
+ Response 200 (application/json)
+ Attributes (Product)
### Update [PUT]
+ Request (application/json)
+ Attributes (Product)
+ Response 204 (application/json)
+ Attributes (Product)
### Delete [DELETE]
+ Response 204
#Group Order
## Order [/order/{id}]
Order resource representation
+ Parameters
+ id (string) - The id of the sales order
+ Attributes (Base Object)
+ sku: 123456789 (string) - SKU of the product
+ shipping (object)
+ partner: Total Express (string) - Logistics partner for delivery
+ trakcing (object)
+ number: BR1234567 (string) - Tracking number of shipping
+ href: http://intellipost.com.br/tracking/BR2367890 (string) - External URL for shipping tracking info
+ estimatedDate: `2012-04-23T18:25:43.511Z` (string) - Estimated date for order delivery for customer
### List [GET /order]
+ Response 200 (application/json)
+ Attributes (array[Order])
### Add [POST]
+ Request (application/json)
+ Attributes (Order)
+ Response 201 (application/json)
+ Attributes (Order)
### Retrieve [GET]
+ Response 200 (application/json)
+ Attributes (Order)
### Update [PUT]
+ Request (application/json)
+ Attributes (Order)
+ Response 204 (application/json)
+ Attributes (Order)
### Delete [DELETE]
+ Response 204
#Group Rule
## Sales rule [/sales-rule/{id}]
Sales rule resource representation
+ Parameters
+ id (string) - The id of the sales rule
+ Attributes (Base Object)
+ name: Free Shipping (string) - Name of the rule
+ description: Free Shipping for the first buy (string) - A description more detailed about the rule
+ active: True (boolean)
+ scope: global, local (enum) - Global if the rule MUST be runned after and local if it MUST be runned before
+ priority: 1 (number) - Priority of run starting at 0
+ conditions (array[Base Object])
+ name: ConditionName (string)
+ configuration: (object)
+ config1: test (string)
+ action: ActionName (string)
+ amount: 10 (number)
### List [GET /sales-rule]
+ Response 200 (application/json)
+ Attributes (array[Sales rule])
### Add [POST]
+ Request (application/json)
+ Attributes (Sales rule)
+ Response 201 (application/json)
+ Attributes (Sales rule)
### Retrieve [GET]
+ Response 200 (application/json)
+ Attributes (Sales rule)
### Update [PUT]
+ Request (application/json)
+ Attributes (Sales rule)
+ Response 204 (application/json)
+ Attributes (Sales rule)
### Delete [DELETE]
+ Response 204
#Group Subscription
## Period [/period/{id}]
Subscription period resource representation
+ Parameters
+ id (string) - The id of the subscription period
+ Attributes (Base Object)
+ chargeDate: `2012-04-23T18:25:43.511Z` (string) - Date for start the charge of subscription
+ endDate: `2012-04-23T18:25:43.511Z` (string) - End of buying period
### List [GET /period]
+ Response 200 (application/json)
+ Attributes (array[Period])
### Add [POST]
+ Request (application/json)
+ Attributes (Period)
+ Response 201 (application/json)
+ Attributes (Period)
### Retrieve [GET]
+ Response 200 (application/json)
+ Attributes (Period)
### Update [PUT]
+ Request (application/json)
+ Attributes (Period)
+ Response 204 (application/json)
+ Attributes (Period)
### Delete [DELETE]
+ Response 204
## Plan [/plan/{id}]
Subscription plan resource representation
+ Parameters
+ id (string) - The id of the subscription plan
+ Attributes (Base Object)
+ name: 2 bottles plan + voucher (string)
+ cyclePeriods: 2 (number) - Periods before automatic change the subscribers to the nextPlan, no migration if 0
+ nextPlan (Base Object) - The plan to be migrated
+ name: 2 bottles plan (string)
+ cyclePeriods: 0 (number) - Periods before automatic change the subscribers to the nextPlan, no migration if 0
+ nextPlan - The plan to be migrated
+ available: true (boolean) - Availability of the plan
+ available: true (boolean) - Availability of the plan
### List [GET /plan]
+ Response 200 (application/json)
+ Attributes (array[Plan])
### Add [POST]
+ Request (application/json)
+ Attributes (Plan)
+ Response 201 (application/json)
+ Attributes (Plan)
### Retrieve [GET]
+ Response 200 (application/json)
+ Attributes (Plan)
### Update [PUT]
+ Request (application/json)
+ Attributes (Plan)
+ Response 204 (application/json)
+ Attributes (Plan)
### Delete [DELETE]
+ Response 204
## Plan Period Product [/plan-period-product/{id}]
Subscription cross of plan, period and product entities
+ Parameters
+ id (string) - The id of the subscription
+ Attributes (Base Object)
+ plan (Plan)
+ period (Period)
+ product (Product)
### List [GET /plan-period-product]
+ Response 200 (application/json)
+ Attributes (array[Plan Period Product])
### Add [POST]
+ Request (application/json)
+ Attributes (Plan Period Product)
+ Response 201 (application/json)
+ Attributes (Plan Period Product)
### Retrieve [GET]
+ Response 200 (application/json)
+ Attributes (Plan Period Product)
### Update [PUT]
+ Request (application/json)
+ Attributes (Plan Period Product)
+ Response 204 (application/json)
+ Attributes (Plan Period Product)
### Delete [DELETE]
+ Response 204
## Subscription [/subscription/{id}]
Subscription resource representation
+ Parameters
+ id (string) - The id of the subscription
+ Attributes (Base Object)
+ number: BRS2345678902345678 (string) - The incremental id for this subscription
+ status: new, active, paused, canceled, invalid (enum) - The current status of this subscription
+ remainingCycles: 2 (number) - The number of remaining cycles on current subscription plan
+ customer (Customer) - The customer owner of the subscription
+ plan (Plan) - Plan for this subscription
+ periods (array[Plan Period Product]) - Periods charged for this subscription
+ paymentMethod (Payment method) - Payment method choosen for this subscription
+ shippingAddress (Address) - Shipping address choosen for this subscription
### List [GET /subscription]
+ Response 200 (application/json)
+ Attributes (array[Subscription])
### Add [POST]
+ Request (application/json)
+ Attributes (Subscription)
+ Response 201 (application/json)
+ Attributes (Subscription)
### Retrieve [GET]
+ Response 200 (application/json)
+ Attributes (Subscription)
### Update [PUT]
+ Request (application/json)
+ Attributes (Subscription)
+ Response 204 (application/json)
+ Attributes (Subscription)
### Delete [DELETE]
+ Response 204