-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenapi.yaml
More file actions
4167 lines (4114 loc) · 144 KB
/
openapi.yaml
File metadata and controls
4167 lines (4114 loc) · 144 KB
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.2.0
info:
title: Vatly API
version: '1.0'
description: |
Vatly is a Merchant of Record billing platform for European SaaS companies.
This API enables you to manage checkouts, customers, orders, subscriptions, refunds, and more.
## Authentication
The Vatly API uses Bearer token authentication. All API requests must include an `Authorization` header:
```
Authorization: Bearer {your_api_token}
```
### Live vs Test Mode
API tokens determine the environment mode:
- Tokens prefixed with `live_` access **production** data
- Tokens prefixed with `test_` access **sandbox** data
Resources created in one mode cannot be accessed or referenced from the other mode.
For example, a checkout created with a test token cannot reference a customer created with a live token.
## Pagination
List endpoints use cursor-based pagination with the following query parameters:
| Parameter | Type | Description |
|-----------|------|-------------|
| `limit` | integer | Number of results per page (default: 10, max: 100) |
| `startingAfter` | string | Cursor ID to fetch results after |
| `endingBefore` | string | Cursor ID to fetch results before |
`startingAfter` and `endingBefore` are mutually exclusive.
All list responses are wrapped in a pagination envelope:
```json
{
"data": [ ... ],
"count": 2,
"links": {
"self": { "href": "https://api.vatly.com/v1/orders", "type": "application/json" },
"next": { "href": "https://api.vatly.com/v1/orders?startingAfter=order_abc", "type": "application/json" },
"prev": null
}
}
```
## Money Format
All monetary values are represented as objects with `value` (string) and `currency` (ISO 4217 code):
```json
{
"value": "99.99",
"currency": "EUR"
}
```
Values are strings to preserve decimal precision.
## Errors
The API returns standard HTTP status codes and JSON error responses:
| Status | Description |
|--------|-------------|
| 400 | Bad Request - Invalid request format |
| 401 | Unauthorized - Missing or invalid token |
| 403 | Forbidden - Token invalid or insufficient permissions |
| 404 | Not Found - Resource doesn't exist |
| 422 | Unprocessable Entity - Validation failed |
| 429 | Too Many Requests - Rate limit exceeded |
| 500 | Internal Server Error |
contact:
name: Vatly Support
url: https://vatly.com
email: support@vatly.com
license:
name: Proprietary
url: https://vatly.com/terms
servers:
- url: https://api.vatly.com/v1
description: Production API
- url: https://api.staging.vatly.com/v1
description: Staging API
security:
- BearerAuth: []
tags:
- name: Checkouts
description: |
Create and manage hosted checkout sessions.
Checkouts allow customers to purchase one-off products and subscription plans through a hosted payment page.
- name: Customers
description: |
Manage customer records.
Customers are identified by email and can have multiple subscriptions and orders.
- name: One-Off Products
description: |
View available one-off products.
Products are configured in the Vatly dashboard and can be added to checkouts.
- name: Subscription Plans
description: |
View available subscription plans.
Plans define recurring billing intervals and pricing.
- name: Orders
description: |
View orders and request invoice address updates.
Orders are created when checkouts complete or subscriptions renew.
- name: Refunds
description: |
Create and manage refunds for paid orders.
Supports both partial (per-item) and full refunds.
- name: Chargebacks
description: |
View chargebacks initiated by payment providers.
Chargebacks are created automatically when a customer disputes a payment.
- name: Subscriptions
description: |
Manage customer subscriptions.
Update plans, quantities, billing details, or cancel subscriptions.
- name: Test Helpers
description: |
Sandbox-only endpoints for simulating billing events.
These endpoints require a `test_` prefixed API token.
paths:
/checkouts:
get:
operationId: listCheckouts
summary: List all checkouts
description: |
Returns a paginated list of checkouts for the authenticated merchant.
Results are filtered by the testmode determined from the API token.
tags:
- Checkouts
parameters:
- $ref: '#/components/parameters/limit'
- $ref: '#/components/parameters/startingAfter'
- $ref: '#/components/parameters/endingBefore'
responses:
'200':
description: List of checkouts
content:
application/json:
schema:
type: object
required:
- data
- count
- links
properties:
data:
type: array
items:
$ref: '#/components/schemas/Checkout'
count:
type: integer
description: Number of items in the current page
example: 1
links:
$ref: '#/components/schemas/PaginationLinks'
example:
data:
- id: checkout_QdEpFhdSrG4Y3DnfsdqsH
resource: checkout
merchantId: merchant_Tk7mNvBxKw2RjTgYcZaE
orderId: null
testmode: false
redirectUrlSuccess: https://example.com/success
redirectUrlCanceled: https://example.com/canceled
metadata: {}
status: created
expiresAt: '2024-01-16T10:30:00Z'
createdAt: '2024-01-15T10:30:00Z'
links:
checkoutUrl:
href: https://checkout.vatly.com/checkout_QdEpFhdSrG4Y3DnfsdqsH
type: text/html
self:
href: https://api.vatly.com/v1/checkouts/checkout_QdEpFhdSrG4Y3DnfsdqsH
type: application/json
order: null
count: 1
links:
self:
href: https://api.vatly.com/v1/checkouts
type: application/json
next: null
prev: null
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'422':
$ref: '#/components/responses/ValidationFailed'
post:
operationId: createCheckout
summary: Create a checkout
description: |
Creates a new hosted checkout session.
The checkout URL in the response can be used to redirect customers to complete their purchase.
Checkouts expire after a configurable period (default: 24 hours).
**Products:**
- Include one or more products using their `prod_` or `plan_` IDs
- Mix one-off products and subscription plans in the same checkout
- Override prices for specific products using the `price` field
- Add trial periods to subscription plans using `trialDays`
**Customer association:**
- Optionally link to an existing customer using `customerId`
- If not provided, a new customer is created based on checkout form input
tags:
- Checkouts
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateCheckoutRequest'
examples:
oneOffProduct:
summary: Checkout with one-off product
value:
redirectUrlSuccess: https://example.com/success
redirectUrlCanceled: https://example.com/canceled
products:
- id: one_off_product_Vr8kQdFhSrG4Y3DnfsdqH
quantity: 1
subscriptionWithTrial:
summary: Subscription plan with trial
value:
redirectUrlSuccess: https://example.com/success
redirectUrlCanceled: https://example.com/canceled
customerId: customer_Fp2kQrSvWm8NjLhYbUcP
products:
- id: subscription_plan_Bm7xNvPwKr3YjTgHcZaE
trialDays: 14
customPrice:
summary: Product with custom price
value:
redirectUrlSuccess: https://example.com/success
redirectUrlCanceled: https://example.com/canceled
products:
- id: one_off_product_Vr8kQdFhSrG4Y3DnfsdqH
quantity: 2
price:
value: '49.99'
currency: EUR
metadata:
campaign: summer-sale
responses:
'201':
description: Checkout created successfully
content:
application/json:
schema:
$ref: '#/components/schemas/Checkout'
example:
id: checkout_Bm7xNvPwKr3YjTgHcZaE
resource: checkout
merchantId: merchant_Tk7mNvBxKw2RjTgYcZaE
orderId: null
testmode: false
redirectUrlSuccess: https://example.com/success
redirectUrlCanceled: https://example.com/canceled
metadata:
campaign: summer-sale
status: created
expiresAt: '2024-01-16T10:30:00Z'
createdAt: '2024-01-15T10:30:00Z'
links:
checkoutUrl:
href: https://checkout.vatly.com/checkout_Bm7xNvPwKr3YjTgHcZaE
type: text/html
self:
href: https://api.vatly.com/v1/checkouts/checkout_Bm7xNvPwKr3YjTgHcZaE
type: application/json
order: null
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'422':
$ref: '#/components/responses/ValidationFailed'
/checkouts/{checkoutId}:
get:
operationId: getCheckout
summary: Get a checkout
description: |
Retrieves a specific checkout by its ID.
Use this to check the status of a checkout or get the order ID after completion.
tags:
- Checkouts
parameters:
- $ref: '#/components/parameters/checkoutId'
responses:
'200':
description: Checkout details
content:
application/json:
schema:
$ref: '#/components/schemas/Checkout'
example:
id: checkout_QdEpFhdSrG4Y3DnfsdqsH
resource: checkout
merchantId: merchant_Tk7mNvBxKw2RjTgYcZaE
orderId: order_Jk4pQrSvWm8NjLhYbUcP
testmode: false
redirectUrlSuccess: https://example.com/success
redirectUrlCanceled: https://example.com/canceled
metadata:
campaign: summer-sale
status: paid
expiresAt: '2024-01-16T10:30:00Z'
createdAt: '2024-01-15T10:30:00Z'
links:
checkoutUrl:
href: https://checkout.vatly.com/checkout_QdEpFhdSrG4Y3DnfsdqsH
type: text/html
self:
href: https://api.vatly.com/v1/checkouts/checkout_QdEpFhdSrG4Y3DnfsdqsH
type: application/json
order:
href: https://api.vatly.com/v1/orders/order_Jk4pQrSvWm8NjLhYbUcP
type: application/json
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
/customers:
get:
operationId: listCustomers
summary: List all customers
description: |
Returns a paginated list of customers for the authenticated merchant.
Results are filtered by the testmode determined from the API token.
tags:
- Customers
parameters:
- $ref: '#/components/parameters/limit'
- $ref: '#/components/parameters/startingAfter'
- $ref: '#/components/parameters/endingBefore'
responses:
'200':
description: List of customers
content:
application/json:
schema:
type: object
required:
- data
- count
- links
properties:
data:
type: array
items:
$ref: '#/components/schemas/Customer'
count:
type: integer
description: Number of items in the current page
example: 2
links:
$ref: '#/components/schemas/PaginationLinks'
example:
data:
- id: customer_7kBmRtPvXw2NjLhYcZaE
resource: customer
testmode: false
email: john.doe@example.com
createdAt: '2024-01-15T10:30:00Z'
metadata:
userId: user_Qp8kNvBxKw7RjTgYcZaE
links:
self:
href: https://api.vatly.com/v1/customers/customer_7kBmRtPvXw2NjLhYcZaE
type: application/json
- id: customer_Lp3mNvBxKw7RjTgYcZaE
resource: customer
testmode: false
email: jane.smith@acme.com
createdAt: '2024-01-10T08:15:00Z'
metadata: {}
links:
self:
href: https://api.vatly.com/v1/customers/customer_Lp3mNvBxKw7RjTgYcZaE
type: application/json
count: 2
links:
self:
href: https://api.vatly.com/v1/customers
type: application/json
next: null
prev: null
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'422':
$ref: '#/components/responses/ValidationFailed'
post:
operationId: createCustomer
summary: Create a customer
description: |
Creates a new customer record.
Customers are uniquely identified by email within each testmode.
Creating a customer with an email that already exists will return a validation error.
**Use cases:**
- Pre-create customers before checkout
- Link existing users from your system to Vatly
tags:
- Customers
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateCustomerRequest'
example:
email: customer@example.com
metadata:
userId: user_Qp8kNvBxKw7RjTgYcZaE
responses:
'201':
description: Customer created successfully
content:
application/json:
schema:
$ref: '#/components/schemas/Customer'
example:
id: customer_7kBmRtPvXw2NjLhYcZaE
resource: customer
testmode: false
email: customer@example.com
createdAt: '2024-01-15T10:30:00Z'
metadata:
userId: user_Qp8kNvBxKw7RjTgYcZaE
links:
self:
href: https://api.vatly.com/v1/customers/customer_7kBmRtPvXw2NjLhYcZaE
type: application/json
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'422':
$ref: '#/components/responses/ValidationFailed'
/customers/{customerId}:
get:
operationId: getCustomer
summary: Get a customer
description: Retrieves a specific customer by their ID.
tags:
- Customers
parameters:
- $ref: '#/components/parameters/customerId'
responses:
'200':
description: Customer details
content:
application/json:
schema:
$ref: '#/components/schemas/Customer'
example:
id: customer_7kBmRtPvXw2NjLhYcZaE
resource: customer
testmode: false
email: john.doe@example.com
createdAt: '2024-01-15T10:30:00Z'
metadata:
userId: user_Qp8kNvBxKw7RjTgYcZaE
links:
self:
href: https://api.vatly.com/v1/customers/customer_7kBmRtPvXw2NjLhYcZaE
type: application/json
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
/customers/{customerId}/subscriptions:
get:
operationId: listCustomerSubscriptions
summary: List customer subscriptions
description: |
Returns a paginated list of subscriptions for a specific customer.
Includes subscriptions in all states (active, canceled, etc.).
tags:
- Customers
- Subscriptions
parameters:
- $ref: '#/components/parameters/customerId'
- $ref: '#/components/parameters/limit'
- $ref: '#/components/parameters/startingAfter'
- $ref: '#/components/parameters/endingBefore'
responses:
'200':
description: List of customer's subscriptions
content:
application/json:
schema:
type: object
required:
- data
- count
- links
properties:
data:
type: array
items:
$ref: '#/components/schemas/Subscription'
count:
type: integer
description: Number of items in the current page
example: 1
links:
$ref: '#/components/schemas/PaginationLinks'
example:
data:
- id: subscription_Lp3mNvBxKw7RjTgYcZaE
resource: subscription
customerId: customer_Lp3mNvBxKw7RjTgYcZaE
testmode: false
name: Pro Monthly
description: Full access to all Pro features
billingAddress:
fullName: John Doe
companyName: Acme Corp
streetAndNumber: 123 Main Street
city: Berlin
postalCode: '10115'
country: DE
basePrice:
value: '29.00'
currency: EUR
quantity: 1
interval: month
intervalCount: 1
status: active
startedAt: '2024-01-15T10:30:00Z'
endedAt: null
cancelledAt: null
renewedAt: '2024-02-15T10:30:00Z'
renewedUntil: '2024-03-15T10:30:00Z'
nextRenewalAt: '2024-03-15T10:30:00Z'
trialUntil: null
links:
self:
href: https://api.vatly.com/v1/subscriptions/subscription_Lp3mNvBxKw7RjTgYcZaE
type: application/json
customer:
href: https://api.vatly.com/v1/customers/customer_Lp3mNvBxKw7RjTgYcZaE
type: application/json
count: 1
links:
self:
href: https://api.vatly.com/v1/customers/customer_Lp3mNvBxKw7RjTgYcZaE/subscriptions
type: application/json
next: null
prev: null
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'422':
$ref: '#/components/responses/ValidationFailed'
/customers/{customerId}/subscriptions/{subscriptionId}:
get:
operationId: getCustomerSubscription
summary: Get a customer subscription
description: |
Retrieves a specific subscription for a customer.
The subscription must belong to the specified customer.
tags:
- Customers
- Subscriptions
parameters:
- $ref: '#/components/parameters/customerId'
- $ref: '#/components/parameters/subscriptionId'
responses:
'200':
description: Subscription details
content:
application/json:
schema:
$ref: '#/components/schemas/Subscription'
example:
id: subscription_Lp3mNvBxKw7RjTgYcZaE
resource: subscription
customerId: customer_Lp3mNvBxKw7RjTgYcZaE
testmode: false
name: Pro Monthly
description: Full access to all Pro features
billingAddress:
fullName: John Doe
companyName: Acme Corp
streetAndNumber: 123 Main Street
city: Berlin
postalCode: '10115'
country: DE
basePrice:
value: '29.00'
currency: EUR
quantity: 1
interval: month
intervalCount: 1
status: active
startedAt: '2024-01-15T10:30:00Z'
endedAt: null
cancelledAt: null
renewedAt: '2024-02-15T10:30:00Z'
renewedUntil: '2024-03-15T10:30:00Z'
nextRenewalAt: '2024-03-15T10:30:00Z'
trialUntil: null
links:
self:
href: https://api.vatly.com/v1/subscriptions/subscription_Lp3mNvBxKw7RjTgYcZaE
type: application/json
customer:
href: https://api.vatly.com/v1/customers/customer_Lp3mNvBxKw7RjTgYcZaE
type: application/json
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
/one-off-products:
get:
operationId: listOneOffProducts
summary: List all one-off products
description: |
Returns a paginated list of one-off products for the authenticated merchant.
Results are filtered by the testmode determined from the API token.
Only products with `active` status can be used in checkouts.
tags:
- One-Off Products
parameters:
- $ref: '#/components/parameters/limit'
- $ref: '#/components/parameters/startingAfter'
- $ref: '#/components/parameters/endingBefore'
responses:
'200':
description: List of one-off products
content:
application/json:
schema:
type: object
required:
- data
- count
- links
properties:
data:
type: array
items:
$ref: '#/components/schemas/OneOffProduct'
count:
type: integer
description: Number of items in the current page
example: 1
links:
$ref: '#/components/schemas/PaginationLinks'
example:
data:
- id: one_off_product_Vr8kQdFhSrG4Y3DnfsdqH
resource: one_off_product
testmode: false
name: Premium License
description: Lifetime access to all premium features
basePrice:
value: '299.00'
currency: EUR
status: active
createdAt: '2024-01-15T10:30:00Z'
links:
self:
href: https://api.vatly.com/v1/one-off-products/one_off_product_Vr8kQdFhSrG4Y3DnfsdqH
type: application/json
count: 1
links:
self:
href: https://api.vatly.com/v1/one-off-products
type: application/json
next: null
prev: null
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'422':
$ref: '#/components/responses/ValidationFailed'
/one-off-products/{oneOffProductId}:
get:
operationId: getOneOffProduct
summary: Get a one-off product
description: Retrieves a specific one-off product by its ID.
tags:
- One-Off Products
parameters:
- $ref: '#/components/parameters/oneOffProductId'
responses:
'200':
description: One-off product details
content:
application/json:
schema:
$ref: '#/components/schemas/OneOffProduct'
example:
id: one_off_product_Vr8kQdFhSrG4Y3DnfsdqH
resource: one_off_product
testmode: false
name: Premium License
description: Lifetime access to all premium features
basePrice:
value: '299.00'
currency: EUR
status: active
createdAt: '2024-01-15T10:30:00Z'
links:
self:
href: https://api.vatly.com/v1/one-off-products/one_off_product_Vr8kQdFhSrG4Y3DnfsdqH
type: application/json
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
/subscription-plans:
get:
operationId: listSubscriptionPlans
summary: List all subscription plans
description: |
Returns a paginated list of subscription plans for the authenticated merchant.
Results are filtered by the testmode determined from the API token.
Only plans with `active` status can be used in checkouts.
tags:
- Subscription Plans
parameters:
- $ref: '#/components/parameters/limit'
- $ref: '#/components/parameters/startingAfter'
- $ref: '#/components/parameters/endingBefore'
responses:
'200':
description: List of subscription plans
content:
application/json:
schema:
type: object
required:
- data
- count
- links
properties:
data:
type: array
items:
$ref: '#/components/schemas/SubscriptionPlan'
count:
type: integer
description: Number of items in the current page
example: 2
links:
$ref: '#/components/schemas/PaginationLinks'
example:
data:
- id: subscription_plan_Bm7xNvPwKr3YjTgHcZaE
resource: subscription_plan
testmode: false
name: Pro Monthly
description: Full access to all Pro features, billed monthly
basePrice:
value: '29.00'
currency: EUR
interval: month
intervalCount: 1
status: active
createdAt: '2024-01-15T10:30:00Z'
links:
self:
href: https://api.vatly.com/v1/subscription-plans/subscription_plan_Bm7xNvPwKr3YjTgHcZaE
type: application/json
- id: subscription_plan_Wt5mNvBxKw7YcZaEjLhR
resource: subscription_plan
testmode: false
name: Pro Yearly
description: Full access to all Pro features, billed yearly
basePrice:
value: '290.00'
currency: EUR
interval: year
intervalCount: 1
status: active
createdAt: '2024-01-15T10:30:00Z'
links:
self:
href: https://api.vatly.com/v1/subscription-plans/subscription_plan_Wt5mNvBxKw7YcZaEjLhR
type: application/json
count: 2
links:
self:
href: https://api.vatly.com/v1/subscription-plans
type: application/json
next: null
prev: null
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'422':
$ref: '#/components/responses/ValidationFailed'
/subscription-plans/{subscriptionPlanId}:
get:
operationId: getSubscriptionPlan
summary: Get a subscription plan
description: Retrieves a specific subscription plan by its ID.
tags:
- Subscription Plans
parameters:
- $ref: '#/components/parameters/subscriptionPlanId'
responses:
'200':
description: Subscription plan details
content:
application/json:
schema:
$ref: '#/components/schemas/SubscriptionPlan'
example:
id: subscription_plan_Bm7xNvPwKr3YjTgHcZaE
resource: subscription_plan
testmode: false
name: Pro Monthly
description: Full access to all Pro features, billed monthly
basePrice:
value: '29.00'
currency: EUR
interval: month
intervalCount: 1
status: active
createdAt: '2024-01-15T10:30:00Z'
links:
self:
href: https://api.vatly.com/v1/subscription-plans/subscription_plan_Bm7xNvPwKr3YjTgHcZaE
type: application/json
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
/orders:
get:
operationId: listOrders
summary: List all orders
description: |
Returns a paginated list of orders for the authenticated merchant.
Results are filtered by the testmode determined from the API token.
tags:
- Orders
parameters:
- $ref: '#/components/parameters/limit'
- $ref: '#/components/parameters/startingAfter'
- $ref: '#/components/parameters/endingBefore'
responses:
'200':
description: List of orders
content:
application/json:
schema:
type: object
required:
- data
- count
- links
properties:
data:
type: array
items:
$ref: '#/components/schemas/Order'
count:
type: integer
description: Number of items in the current page
example: 1
links:
$ref: '#/components/schemas/PaginationLinks'
example:
data:
- id: order_Hn5xWqVfKm8RjTgYbUcP
resource: order
merchantId: merchant_Tk7mNvBxKw2RjTgYcZaE
customerId: customer_Xk9pQrSvWm4NjLhYbUcP
testmode: false
metadata: {}
paymentMethod: ideal
createdAt: '2024-01-15T10:30:00Z'
status: paid
invoiceNumber: INV-2024-0001
total:
value: '35.09'
currency: EUR
subtotal:
value: '29.00'
currency: EUR
taxSummary:
- taxRate:
name: VAT
percentage: 21
taxablePercentage: 100
amount:
value: '6.09'
currency: EUR
lines:
- id: order_item_Mn6xBtPvKw2RjTgYcZaE
resource: orderline
description: Pro Monthly Subscription
quantity: 1
basePrice:
value: '29.00'
currency: EUR
total:
value: '35.09'
currency: EUR
subtotal:
value: '29.00'
currency: EUR
taxes:
- taxRate:
name: VAT
percentage: 21
taxablePercentage: 100
amount:
value: '6.09'
currency: EUR
merchantDetails:
fullName: Vatly B.V.
companyName: Vatly
vatNumber: NL123456789B01
streetAndNumber: Keizersgracht 123
city: Amsterdam
postalCode: 1015 CJ
country: NL
email: billing@vatly.com
customerDetails:
fullName: John Doe
companyName: Acme Corp
streetAndNumber: 123 Main Street
city: Berlin
postalCode: '10115'
country: DE
email: john@acme.com
links:
self:
href: https://api.vatly.com/v1/orders/order_Hn5xWqVfKm8RjTgYbUcP
type: application/json
customer:
href: https://api.vatly.com/v1/customers/customer_Xk9pQrSvWm4NjLhYbUcP
type: application/json
count: 1
links:
self:
href: https://api.vatly.com/v1/orders
type: application/json
next: null
prev: null
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'422':
$ref: '#/components/responses/ValidationFailed'
/orders/{orderId}:
get:
operationId: getOrder
summary: Get an order
description: |
Retrieves a specific order by its ID.
Includes full order details with line items, totals, and billing information.
tags:
- Orders
parameters:
- $ref: '#/components/parameters/orderId'
responses:
'200':
description: Order details
content: