-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathcodeSamples.yaml
827 lines (827 loc) · 163 KB
/
codeSamples.yaml
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
overlay: 1.0.0
info:
title: CodeSamples overlay for typescript target
version: 0.0.0
actions:
- target: $["paths"]["/v1/advertisements/"]["get"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.advertisements.list({\n benefitId: \"<value>\",\n });\n\n for await (const page of result) {\n // Handle the page\n console.log(page);\n }\n}\n\nrun();"
- target: $["paths"]["/v1/advertisements/{id}"]["get"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.advertisements.get({\n id: \"<value>\",\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/benefits/"]["get"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.benefits.list({});\n\n for await (const page of result) {\n // Handle the page\n console.log(page);\n }\n}\n\nrun();"
- target: $["paths"]["/v1/benefits/"]["post"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.benefits.create({\n description: \"delightfully fumigate convection though zowie up bulky electronics\",\n properties: {\n guildToken: \"<value>\",\n roleId: \"<id>\",\n },\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/benefits/{id}"]["delete"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n await polar.benefits.delete({\n id: \"<value>\",\n });\n\n\n}\n\nrun();"
- target: $["paths"]["/v1/benefits/{id}"]["get"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.benefits.get({\n id: \"<value>\",\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/benefits/{id}"]["patch"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.benefits.update({\n id: \"<value>\",\n requestBody: {},\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/benefits/{id}/grants"]["get"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.benefits.grants({\n id: \"<value>\",\n });\n\n for await (const page of result) {\n // Handle the page\n console.log(page);\n }\n}\n\nrun();"
- target: $["paths"]["/v1/checkout-links/"]["get"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.checkoutLinks.list({});\n\n for await (const page of result) {\n // Handle the page\n console.log(page);\n }\n}\n\nrun();"
- target: $["paths"]["/v1/checkout-links/"]["post"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.checkoutLinks.create({\n allowDiscountCodes: true,\n productId: \"<value>\",\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/checkout-links/{id}"]["delete"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n await polar.checkoutLinks.delete({\n id: \"<value>\",\n });\n\n\n}\n\nrun();"
- target: $["paths"]["/v1/checkout-links/{id}"]["get"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.checkoutLinks.get({\n id: \"<value>\",\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/checkout-links/{id}"]["patch"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.checkoutLinks.update({\n id: \"<value>\",\n checkoutLinkUpdate: {},\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/checkouts/"]["get"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.checkouts.list({});\n\n for await (const page of result) {\n // Handle the page\n console.log(page);\n }\n}\n\nrun();"
- target: $["paths"]["/v1/checkouts/"]["post"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.checkouts.create({\n allowDiscountCodes: true,\n productId: \"<value>\",\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/checkouts/client/{client_secret}"]["get"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.checkouts.clientGet({\n clientSecret: \"<value>\",\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/checkouts/client/{client_secret}"]["patch"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.checkouts.clientUpdate({\n clientSecret: \"<value>\",\n checkoutUpdatePublic: {},\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/checkouts/client/{client_secret}/confirm"]["post"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.checkouts.clientConfirm({\n clientSecret: \"<value>\",\n checkoutConfirmStripe: {},\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/checkouts/{id}"]["get"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.checkouts.get({\n id: \"<value>\",\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/checkouts/{id}"]["patch"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.checkouts.update({\n id: \"<value>\",\n checkoutUpdate: {},\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/custom-fields/"]["get"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.customFields.list({});\n\n for await (const page of result) {\n // Handle the page\n console.log(page);\n }\n}\n\nrun();"
- target: $["paths"]["/v1/custom-fields/"]["post"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.customFields.create({\n slug: \"<value>\",\n name: \"<value>\",\n properties: {},\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/custom-fields/{id}"]["delete"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n await polar.customFields.delete({\n id: \"<value>\",\n });\n\n\n}\n\nrun();"
- target: $["paths"]["/v1/custom-fields/{id}"]["get"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.customFields.get({\n id: \"<value>\",\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/custom-fields/{id}"]["patch"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.customFields.update({\n id: \"<value>\",\n customFieldUpdate: {},\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/customer-portal/benefit-grants/"]["get"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar();\n\nasync function run() {\n const result = await polar.customerPortal.benefitGrants.list({\n customerSession: process.env[\"POLAR_CUSTOMER_SESSION\"] ?? \"\",\n }, {});\n\n for await (const page of result) {\n // Handle the page\n console.log(page);\n }\n}\n\nrun();"
- target: $["paths"]["/v1/customer-portal/benefit-grants/{id}"]["get"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar();\n\nasync function run() {\n const result = await polar.customerPortal.benefitGrants.get({\n customerSession: process.env[\"POLAR_CUSTOMER_SESSION\"] ?? \"\",\n }, {\n id: \"<value>\",\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/customer-portal/benefit-grants/{id}"]["patch"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar();\n\nasync function run() {\n const result = await polar.customerPortal.benefitGrants.update({\n customerSession: process.env[\"POLAR_CUSTOMER_SESSION\"] ?? \"\",\n }, {\n id: \"<value>\",\n customerBenefitGrantUpdate: {},\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/customer-portal/customers/me"]["get"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar();\n\nasync function run() {\n const result = await polar.customerPortal.customers.get({\n customerSession: process.env[\"POLAR_CUSTOMER_SESSION\"] ?? \"\",\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/customer-portal/customers/me"]["patch"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar();\n\nasync function run() {\n const result = await polar.customerPortal.customers.update({\n customerSession: process.env[\"POLAR_CUSTOMER_SESSION\"] ?? \"\",\n }, {});\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/customer-portal/customers/me/payment-methods"]["get"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar();\n\nasync function run() {\n const result = await polar.customerPortal.customers.getPaymentMethods({\n customerSession: process.env[\"POLAR_CUSTOMER_SESSION\"] ?? \"\",\n }, {});\n\n for await (const page of result) {\n // Handle the page\n console.log(page);\n }\n}\n\nrun();"
- target: $["paths"]["/v1/customer-portal/customers/me/payment-methods"]["post"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar();\n\nasync function run() {\n const result = await polar.customerPortal.customers.addPaymentMethod({\n customerSession: process.env[\"POLAR_CUSTOMER_SESSION\"] ?? \"\",\n }, {\n confirmationTokenId: \"<id>\",\n setDefault: false,\n returnUrl: \"https://slight-digestive.info\",\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/customer-portal/customers/me/payment-methods/{id}"]["delete"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar();\n\nasync function run() {\n await polar.customerPortal.customers.deletePaymentMethod({\n customerSession: process.env[\"POLAR_CUSTOMER_SESSION\"] ?? \"\",\n }, {\n id: \"<id>\",\n });\n\n\n}\n\nrun();"
- target: $["paths"]["/v1/customer-portal/downloadables/"]["get"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar();\n\nasync function run() {\n const result = await polar.customerPortal.downloadables.list({\n customerSession: process.env[\"POLAR_CUSTOMER_SESSION\"] ?? \"\",\n }, {});\n\n for await (const page of result) {\n // Handle the page\n console.log(page);\n }\n}\n\nrun();"
- target: $["paths"]["/v1/customer-portal/downloadables/{token}"]["get"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.customerPortal.downloadables.get({\n token: \"<value>\",\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/customer-portal/license-keys/"]["get"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar();\n\nasync function run() {\n const result = await polar.customerPortal.licenseKeys.list({\n customerSession: process.env[\"POLAR_CUSTOMER_SESSION\"] ?? \"\",\n }, {});\n\n for await (const page of result) {\n // Handle the page\n console.log(page);\n }\n}\n\nrun();"
- target: $["paths"]["/v1/customer-portal/license-keys/activate"]["post"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.customerPortal.licenseKeys.activate({\n key: \"<key>\",\n organizationId: \"<value>\",\n label: \"<value>\",\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/customer-portal/license-keys/deactivate"]["post"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n await polar.customerPortal.licenseKeys.deactivate({\n key: \"<key>\",\n organizationId: \"<value>\",\n activationId: \"<value>\",\n });\n\n\n}\n\nrun();"
- target: $["paths"]["/v1/customer-portal/license-keys/validate"]["post"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.customerPortal.licenseKeys.validate({\n key: \"<key>\",\n organizationId: \"<value>\",\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/customer-portal/license-keys/{id}"]["get"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar();\n\nasync function run() {\n const result = await polar.customerPortal.licenseKeys.get({\n customerSession: process.env[\"POLAR_CUSTOMER_SESSION\"] ?? \"\",\n }, {\n id: \"<value>\",\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/customer-portal/orders/"]["get"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar();\n\nasync function run() {\n const result = await polar.customerPortal.orders.list({\n customerSession: process.env[\"POLAR_CUSTOMER_SESSION\"] ?? \"\",\n }, {});\n\n for await (const page of result) {\n // Handle the page\n console.log(page);\n }\n}\n\nrun();"
- target: $["paths"]["/v1/customer-portal/orders/{id}"]["get"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar();\n\nasync function run() {\n const result = await polar.customerPortal.orders.get({\n customerSession: process.env[\"POLAR_CUSTOMER_SESSION\"] ?? \"\",\n }, {\n id: \"<value>\",\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/customer-portal/orders/{id}/invoice"]["get"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar();\n\nasync function run() {\n const result = await polar.customerPortal.orders.invoice({\n customerSession: process.env[\"POLAR_CUSTOMER_SESSION\"] ?? \"\",\n }, {\n id: \"<value>\",\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/customer-portal/organizations/{slug}"]["get"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.customerPortal.organizations.get({\n slug: \"<value>\",\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/customer-portal/subscriptions/"]["get"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar();\n\nasync function run() {\n const result = await polar.customerPortal.subscriptions.list({\n customerSession: process.env[\"POLAR_CUSTOMER_SESSION\"] ?? \"\",\n }, {});\n\n for await (const page of result) {\n // Handle the page\n console.log(page);\n }\n}\n\nrun();"
- target: $["paths"]["/v1/customer-portal/subscriptions/{id}"]["delete"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar();\n\nasync function run() {\n const result = await polar.customerPortal.subscriptions.cancel({\n customerSession: process.env[\"POLAR_CUSTOMER_SESSION\"] ?? \"\",\n }, {\n id: \"<value>\",\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/customer-portal/subscriptions/{id}"]["get"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar();\n\nasync function run() {\n const result = await polar.customerPortal.subscriptions.get({\n customerSession: process.env[\"POLAR_CUSTOMER_SESSION\"] ?? \"\",\n }, {\n id: \"<value>\",\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/customer-portal/subscriptions/{id}"]["patch"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar();\n\nasync function run() {\n const result = await polar.customerPortal.subscriptions.update({\n customerSession: process.env[\"POLAR_CUSTOMER_SESSION\"] ?? \"\",\n }, {\n id: \"<value>\",\n customerSubscriptionUpdate: {},\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/customer-sessions/"]["post"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.customerSessions.create({\n customerId: \"<value>\",\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/customers/"]["get"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.customers.list({});\n\n for await (const page of result) {\n // Handle the page\n console.log(page);\n }\n}\n\nrun();"
- target: $["paths"]["/v1/customers/"]["post"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.customers.create({\n email: \"[email protected]\",\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/customers/external/{external_id}"]["delete"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n await polar.customers.deleteExternal({\n externalId: \"<id>\",\n });\n\n\n}\n\nrun();"
- target: $["paths"]["/v1/customers/external/{external_id}"]["get"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.customers.getExternal({\n externalId: \"<id>\",\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/customers/external/{external_id}"]["patch"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.customers.updateExternal({\n externalId: \"<id>\",\n customerUpdate: {},\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/customers/{id}"]["delete"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n await polar.customers.delete({\n id: \"<value>\",\n });\n\n\n}\n\nrun();"
- target: $["paths"]["/v1/customers/{id}"]["get"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.customers.get({\n id: \"<value>\",\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/customers/{id}"]["patch"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.customers.update({\n id: \"<value>\",\n customerUpdate: {},\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/discounts/"]["get"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.discounts.list({});\n\n for await (const page of result) {\n // Handle the page\n console.log(page);\n }\n}\n\nrun();"
- target: $["paths"]["/v1/discounts/"]["post"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.discounts.create({\n duration: \"forever\",\n durationInMonths: 417458,\n type: \"fixed\",\n amount: 69025,\n currency: \"usd\",\n name: \"<value>\",\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/discounts/{id}"]["delete"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n await polar.discounts.delete({\n id: \"<value>\",\n });\n\n\n}\n\nrun();"
- target: $["paths"]["/v1/discounts/{id}"]["get"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.discounts.get({\n id: \"<value>\",\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/discounts/{id}"]["patch"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.discounts.update({\n id: \"<value>\",\n discountUpdate: {},\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/events/"]["get"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.events.list({});\n\n for await (const page of result) {\n // Handle the page\n console.log(page);\n }\n}\n\nrun();"
- target: $["paths"]["/v1/events/ingest"]["post"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.events.ingest({\n events: [\n {\n name: \"<value>\",\n customerId: \"<value>\",\n },\n {\n name: \"<value>\",\n externalCustomerId: \"<id>\",\n },\n ],\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/events/{id}"]["get"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.events.get({\n id: \"<value>\",\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/external_organizations/"]["get"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.externalOrganizations.list({});\n\n for await (const page of result) {\n // Handle the page\n console.log(page);\n }\n}\n\nrun();"
- target: $["paths"]["/v1/files/"]["get"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.files.list({});\n\n for await (const page of result) {\n // Handle the page\n console.log(page);\n }\n}\n\nrun();"
- target: $["paths"]["/v1/files/"]["post"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.files.create({\n name: \"<value>\",\n mimeType: \"<value>\",\n size: 638424,\n upload: {\n parts: [\n {\n number: 417458,\n chunkStart: 134365,\n chunkEnd: 69025,\n },\n ],\n },\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/files/{id}"]["delete"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n await polar.files.delete({\n id: \"<value>\",\n });\n\n\n}\n\nrun();"
- target: $["paths"]["/v1/files/{id}"]["patch"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.files.update({\n id: \"<value>\",\n filePatch: {},\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/files/{id}/uploaded"]["post"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.files.uploaded({\n id: \"<value>\",\n fileUploadCompleted: {\n id: \"<id>\",\n path: \"/sys\",\n parts: [\n {\n number: 173116,\n checksumEtag: \"<value>\",\n checksumSha256Base64: \"<value>\",\n },\n {\n number: 894030,\n checksumEtag: \"<value>\",\n checksumSha256Base64: \"<value>\",\n },\n {\n number: 673715,\n checksumEtag: \"<value>\",\n checksumSha256Base64: \"<value>\",\n },\n ],\n },\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/license-keys"]["get"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.licenseKeys.list({});\n\n for await (const page of result) {\n // Handle the page\n console.log(page);\n }\n}\n\nrun();"
- target: $["paths"]["/v1/license-keys/{id}"]["get"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.licenseKeys.get({\n id: \"<value>\",\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/license-keys/{id}"]["patch"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.licenseKeys.update({\n id: \"<value>\",\n licenseKeyUpdate: {},\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/license-keys/{id}/activations/{activation_id}"]["get"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.licenseKeys.getActivation({\n id: \"<value>\",\n activationId: \"<value>\",\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/meters/"]["get"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.meters.list({});\n\n for await (const page of result) {\n // Handle the page\n console.log(page);\n }\n}\n\nrun();"
- target: $["paths"]["/v1/meters/"]["post"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.meters.create({\n name: \"<value>\",\n filter: {\n conjunction: \"and\",\n clauses: [\n\n ],\n },\n aggregation: {\n func: \"sum\",\n property: \"<value>\",\n },\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/meters/{id}"]["get"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.meters.get({\n id: \"<value>\",\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/meters/{id}"]["patch"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.meters.update({\n id: \"<value>\",\n meterUpdate: {},\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/meters/{id}/events"]["get"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.meters.events({\n id: \"<value>\",\n });\n\n for await (const page of result) {\n // Handle the page\n console.log(page);\n }\n}\n\nrun();"
- target: $["paths"]["/v1/meters/{id}/quantities"]["get"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.meters.quantities({\n id: \"<value>\",\n startTimestamp: new Date(\"2023-09-17T00:45:34.608Z\"),\n endTimestamp: new Date(\"2023-07-21T18:11:39.069Z\"),\n interval: \"hour\",\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/metrics/"]["get"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\nimport { RFCDate } from \"@polar-sh/sdk/types/rfcdate.js\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.metrics.get({\n startDate: new RFCDate(\"2025-02-06\"),\n endDate: new RFCDate(\"2024-09-04\"),\n interval: \"week\",\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/metrics/limits"]["get"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.metrics.limits();\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/oauth2/"]["get"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.oauth2.clients.list({});\n\n for await (const page of result) {\n // Handle the page\n console.log(page);\n }\n}\n\nrun();"
- target: $["paths"]["/v1/oauth2/authorize"]["get"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.oauth2.authorize();\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/oauth2/introspect"]["post"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.oauth2.introspect({\n token: \"<value>\",\n clientId: \"<id>\",\n clientSecret: \"<value>\",\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/oauth2/register"]["post"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.oauth2.clients.create({\n redirectUris: [\n \"https://inferior-chainstay.com\",\n ],\n clientName: \"<value>\",\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/oauth2/register/{client_id}"]["delete"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.oauth2.clients.delete({\n clientId: \"<id>\",\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/oauth2/register/{client_id}"]["get"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.oauth2.clients.get({\n clientId: \"<id>\",\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/oauth2/register/{client_id}"]["put"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.oauth2.clients.update({\n clientId: \"<id>\",\n oAuth2ClientConfigurationUpdate: {\n redirectUris: [\n \"https://grown-worth.name\",\n \"https://worthwhile-avalanche.org/\",\n \"https://general-digit.com/\",\n ],\n clientName: \"<value>\",\n clientId: \"<id>\",\n },\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/oauth2/revoke"]["post"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.oauth2.revoke({\n token: \"<value>\",\n clientId: \"<id>\",\n clientSecret: \"<value>\",\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/oauth2/token"]["post"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.oauth2.token({\n clientId: \"<id>\",\n clientSecret: \"<value>\",\n code: \"<value>\",\n redirectUri: \"https://old-fort.name\",\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/oauth2/userinfo"]["get"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.oauth2.userinfo();\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/orders/"]["get"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.orders.list({});\n\n for await (const page of result) {\n // Handle the page\n console.log(page);\n }\n}\n\nrun();"
- target: $["paths"]["/v1/orders/{id}"]["get"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.orders.get({\n id: \"<value>\",\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/orders/{id}/invoice"]["get"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.orders.invoice({\n id: \"<value>\",\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/organizations/"]["get"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.organizations.list({});\n\n for await (const page of result) {\n // Handle the page\n console.log(page);\n }\n}\n\nrun();"
- target: $["paths"]["/v1/organizations/"]["post"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.organizations.create({\n name: \"<value>\",\n slug: \"<value>\",\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/organizations/{id}"]["get"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.organizations.get({\n id: \"<value>\",\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/organizations/{id}"]["patch"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.organizations.update({\n id: \"<value>\",\n organizationUpdate: {},\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/products/"]["get"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.products.list({});\n\n for await (const page of result) {\n // Handle the page\n console.log(page);\n }\n}\n\nrun();"
- target: $["paths"]["/v1/products/"]["post"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.products.create({\n name: \"<value>\",\n recurringInterval: \"month\",\n prices: [\n {\n priceCurrency: \"usd\",\n },\n {\n priceCurrency: \"usd\",\n },\n ],\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/products/{id}"]["get"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.products.get({\n id: \"<value>\",\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/products/{id}"]["patch"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.products.update({\n id: \"<value>\",\n productUpdate: {},\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/products/{id}/benefits"]["post"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.products.updateBenefits({\n id: \"<value>\",\n productBenefitsUpdate: {\n benefits: [\n \"<value>\",\n ],\n },\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/refunds/"]["get"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.refunds.list({});\n\n for await (const page of result) {\n // Handle the page\n console.log(page);\n }\n}\n\nrun();"
- target: $["paths"]["/v1/refunds/"]["post"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.refunds.create({\n orderId: \"<value>\",\n reason: \"customer_request\",\n amount: 638424,\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/repositories/"]["get"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.repositories.list({});\n\n for await (const page of result) {\n // Handle the page\n console.log(page);\n }\n}\n\nrun();"
- target: $["paths"]["/v1/repositories/{id}"]["get"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.repositories.get({\n id: \"<value>\",\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/repositories/{id}"]["patch"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.repositories.update({\n id: \"<value>\",\n repositoryUpdate: {},\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/subscriptions/"]["get"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.subscriptions.list({});\n\n for await (const page of result) {\n // Handle the page\n console.log(page);\n }\n}\n\nrun();"
- target: $["paths"]["/v1/subscriptions/export"]["get"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.subscriptions.export({});\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/subscriptions/{id}"]["delete"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.subscriptions.revoke({\n id: \"<value>\",\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/subscriptions/{id}"]["get"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.subscriptions.get({\n id: \"<value>\",\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/subscriptions/{id}"]["patch"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.subscriptions.update({\n id: \"<value>\",\n subscriptionUpdate: {},\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["benefit.created"]["post"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar();\n\nasync function run() {\n const result = await polar.endpointbenefitCreatedPost({\n data: {\n createdAt: new Date(\"2023-04-15T11:45:18.891Z\"),\n modifiedAt: new Date(\"2025-06-17T12:04:55.002Z\"),\n id: \"<value>\",\n description: \"vastly lest but\",\n selectable: false,\n deletable: false,\n organizationId: \"<value>\",\n properties: {\n archived: {\n \"key\": false,\n },\n files: [\n \"<value>\",\n ],\n },\n },\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["benefit.updated"]["post"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar();\n\nasync function run() {\n const result = await polar.endpointbenefitUpdatedPost({\n data: {\n createdAt: new Date(\"2025-11-19T14:31:03.333Z\"),\n modifiedAt: new Date(\"2023-08-21T02:54:25.671Z\"),\n id: \"<value>\",\n description: \"merge when gratefully sparse hmph throughout honesty untried gripping um\",\n selectable: false,\n deletable: false,\n organizationId: \"<value>\",\n properties: {\n repositoryOwner: \"polarsource\",\n repositoryName: \"private_repo\",\n permission: \"push\",\n },\n },\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["benefit_grant.created"]["post"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar();\n\nasync function run() {\n const result = await polar.endpointbenefitGrantCreatedPost({\n data: {\n createdAt: new Date(\"2025-01-04T13:03:27.870Z\"),\n modifiedAt: new Date(\"2023-05-08T00:47:14.556Z\"),\n id: \"<value>\",\n isGranted: true,\n isRevoked: false,\n subscriptionId: \"<value>\",\n orderId: \"<value>\",\n customerId: \"<value>\",\n userId: \"<value>\",\n benefitId: \"<value>\",\n customer: {\n createdAt: new Date(\"2025-08-25T12:22:42.430Z\"),\n modifiedAt: new Date(\"2023-03-03T22:39:55.256Z\"),\n id: \"<value>\",\n metadata: {\n\n },\n externalId: \"<id>\",\n email: \"[email protected]\",\n emailVerified: false,\n name: \"<value>\",\n billingAddress: {\n country: \"El Salvador\",\n },\n taxId: [\n \"<id>\",\n \"ae_trn\",\n \"is_vat\",\n ],\n organizationId: \"<value>\",\n avatarUrl: \"https://frightened-secrecy.biz\",\n },\n properties: {},\n benefit: {\n createdAt: new Date(\"2023-05-08T00:47:14.556Z\"),\n modifiedAt: new Date(\"2023-02-20T12:28:33.166Z\"),\n id: \"<value>\",\n description: \"ick form ack lest plus worriedly gifted\",\n selectable: false,\n deletable: false,\n organizationId: \"<value>\",\n properties: {\n archived: {\n \"key\": false,\n },\n files: [\n \"<value>\",\n ],\n },\n },\n },\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["benefit_grant.revoked"]["post"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar();\n\nasync function run() {\n const result = await polar.endpointbenefitGrantRevokedPost({\n data: {\n createdAt: new Date(\"2025-03-12T10:35:36.881Z\"),\n modifiedAt: new Date(\"2025-04-12T13:10:16.426Z\"),\n id: \"<value>\",\n isGranted: true,\n isRevoked: false,\n subscriptionId: \"<value>\",\n orderId: \"<value>\",\n customerId: \"<value>\",\n userId: \"<value>\",\n benefitId: \"<value>\",\n customer: {\n createdAt: new Date(\"2025-03-29T21:56:48.008Z\"),\n modifiedAt: new Date(\"2025-07-18T16:16:40.562Z\"),\n id: \"<value>\",\n metadata: {\n\n },\n externalId: \"<id>\",\n email: \"[email protected]\",\n emailVerified: true,\n name: \"<value>\",\n billingAddress: {\n country: \"Poland\",\n },\n taxId: [\n \"<id>\",\n \"<id>\",\n \"au_arn\",\n ],\n organizationId: \"<value>\",\n avatarUrl: \"https://bouncy-granny.net\",\n },\n properties: {\n advertisementCampaignId: \"<id>\",\n },\n benefit: {\n createdAt: new Date(\"2025-04-12T13:10:16.426Z\"),\n modifiedAt: new Date(\"2024-03-08T05:20:11.943Z\"),\n id: \"<value>\",\n description: \"incidentally immense scotch meh quaff generously supposing however ugh kindly\",\n selectable: false,\n deletable: false,\n organizationId: \"<value>\",\n properties: {\n archived: {\n \"key\": false,\n },\n files: [\n \"<value>\",\n ],\n },\n },\n },\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["benefit_grant.updated"]["post"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar();\n\nasync function run() {\n const result = await polar.endpointbenefitGrantUpdatedPost({\n data: {\n createdAt: new Date(\"2025-01-02T13:54:42.243Z\"),\n modifiedAt: new Date(\"2024-02-25T11:58:59.486Z\"),\n id: \"<value>\",\n isGranted: false,\n isRevoked: false,\n subscriptionId: \"<value>\",\n orderId: \"<value>\",\n customerId: \"<value>\",\n userId: \"<value>\",\n benefitId: \"<value>\",\n customer: {\n createdAt: new Date(\"2025-08-08T07:44:28.757Z\"),\n modifiedAt: new Date(\"2024-08-31T04:19:19.970Z\"),\n id: \"<value>\",\n metadata: {\n \"key\": \"<value>\",\n \"key1\": 549371,\n \"key2\": 502350,\n },\n externalId: \"<id>\",\n email: \"[email protected]\",\n emailVerified: false,\n name: \"<value>\",\n billingAddress: {\n country: \"Israel\",\n },\n taxId: [\n \"<id>\",\n ],\n organizationId: \"<value>\",\n avatarUrl: \"https://teeming-formamide.com/\",\n },\n properties: {},\n benefit: {\n createdAt: new Date(\"2024-02-25T11:58:59.486Z\"),\n modifiedAt: new Date(\"2025-04-04T12:08:04.168Z\"),\n id: \"<value>\",\n description: \"oil painfully spring requirement import lest to tragic\",\n selectable: false,\n deletable: false,\n organizationId: \"<value>\",\n properties: {\n archived: {\n \"key\": false,\n },\n files: [\n \"<value>\",\n ],\n },\n },\n },\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["checkout.created"]["post"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar();\n\nasync function run() {\n const result = await polar.endpointcheckoutCreatedPost({\n data: {\n createdAt: new Date(\"2025-11-12T14:26:42.882Z\"),\n modifiedAt: new Date(\"2024-05-27T05:08:06.235Z\"),\n id: \"<value>\",\n paymentProcessor: \"stripe\",\n status: \"failed\",\n clientSecret: \"<value>\",\n url: \"https://heavy-beret.com/\",\n expiresAt: new Date(\"2023-02-25T02:26:48.460Z\"),\n successUrl: \"https://sardonic-final.info/\",\n embedOrigin: \"<value>\",\n amount: 962818,\n taxAmount: 6400,\n currency: \"Yen\",\n subtotalAmount: 648726,\n totalAmount: 210702,\n productId: \"<value>\",\n productPriceId: \"<value>\",\n discountId: \"<value>\",\n allowDiscountCodes: true,\n isDiscountApplicable: false,\n isFreeProductPrice: false,\n isPaymentRequired: false,\n isPaymentSetupRequired: false,\n isPaymentFormRequired: false,\n customerId: \"<value>\",\n customerName: \"<value>\",\n customerEmail: \"<value>\",\n customerIpAddress: \"<value>\",\n customerBillingAddress: {\n country: \"Solomon Islands\",\n },\n customerTaxId: \"<id>\",\n paymentProcessorMetadata: {\n \"key\": \"<value>\",\n \"key1\": \"<value>\",\n \"key2\": \"<value>\",\n },\n metadata: {\n \"key\": \"<value>\",\n },\n products: [\n {\n createdAt: new Date(\"2024-02-27T04:46:39.621Z\"),\n modifiedAt: new Date(\"2024-02-07T04:30:48.802Z\"),\n id: \"<value>\",\n name: \"<value>\",\n description: \"really capitalize um restructure prickly rationale certainly these restfully\",\n recurringInterval: \"year\",\n isRecurring: true,\n isArchived: false,\n organizationId: \"<value>\",\n prices: [\n {\n createdAt: new Date(\"2025-11-19T15:59:15.588Z\"),\n modifiedAt: new Date(\"2023-11-17T00:11:23.972Z\"),\n id: \"<value>\",\n isArchived: false,\n productId: \"<value>\",\n type: \"one_time\",\n recurringInterval: \"month\",\n priceCurrency: \"<value>\",\n minimumAmount: 82334,\n maximumAmount: 50275,\n presetAmount: 473871,\n },\n ],\n benefits: [\n {\n createdAt: new Date(\"2025-10-01T00:10:58.922Z\"),\n modifiedAt: new Date(\"2023-01-30T18:58:55.355Z\"),\n id: \"<value>\",\n type: \"github_repository\",\n description: \"via archaeology scientific forsaken who suspiciously mmm bleak\",\n selectable: true,\n deletable: false,\n organizationId: \"<value>\",\n },\n ],\n medias: [\n {\n id: \"<value>\",\n organizationId: \"<value>\",\n name: \"<value>\",\n path: \"/usr/include\",\n mimeType: \"<value>\",\n size: 169862,\n storageVersion: \"<value>\",\n checksumEtag: \"<value>\",\n checksumSha256Base64: \"<value>\",\n checksumSha256Hex: \"<value>\",\n lastModifiedAt: new Date(\"2023-06-26T19:30:29.818Z\"),\n version: \"<value>\",\n isUploaded: true,\n createdAt: new Date(\"2024-10-05T17:30:08.836Z\"),\n sizeReadable: \"<value>\",\n publicUrl: \"https://spanish-essence.name\",\n },\n {\n id: \"<value>\",\n organizationId: \"<value>\",\n name: \"<value>\",\n path: \"/etc/mail\",\n mimeType: \"<value>\",\n size: 852701,\n storageVersion: \"<value>\",\n checksumEtag: \"<value>\",\n checksumSha256Base64: \"<value>\",\n checksumSha256Hex: \"<value>\",\n lastModifiedAt: new Date(\"2025-01-15T00:45:10.927Z\"),\n version: \"<value>\",\n isUploaded: false,\n createdAt: new Date(\"2023-01-18T00:51:17.880Z\"),\n sizeReadable: \"<value>\",\n publicUrl: \"https://best-pharmacopoeia.org/\",\n },\n ],\n },\n {\n createdAt: new Date(\"2024-03-12T06:20:21.161Z\"),\n modifiedAt: new Date(\"2024-06-27T20:20:27.400Z\"),\n id: \"<value>\",\n name: \"<value>\",\n description: \"since hollow massive offensively painfully what questionably destock pish\",\n recurringInterval: \"year\",\n isRecurring: true,\n isArchived: false,\n organizationId: \"<value>\",\n prices: [\n {\n createdAt: new Date(\"2024-04-03T00:20:23.805Z\"),\n modifiedAt: new Date(\"2025-11-21T05:56:48.487Z\"),\n id: \"<value>\",\n isArchived: false,\n productId: \"<value>\",\n type: \"one_time\",\n recurringInterval: \"month\",\n priceCurrency: \"<value>\",\n priceAmount: 648726,\n },\n {\n createdAt: new Date(\"2025-04-20T22:18:45.464Z\"),\n modifiedAt: new Date(\"2024-10-18T10:45:47.767Z\"),\n id: \"<value>\",\n isArchived: false,\n productId: \"<value>\",\n recurringInterval: \"year\",\n priceCurrency: \"<value>\",\n priceAmount: 688646,\n },\n ],\n benefits: [\n\n ],\n medias: [\n {\n id: \"<value>\",\n organizationId: \"<value>\",\n name: \"<value>\",\n path: \"/etc/namedb\",\n mimeType: \"<value>\",\n size: 721019,\n storageVersion: \"<value>\",\n checksumEtag: \"<value>\",\n checksumSha256Base64: \"<value>\",\n checksumSha256Hex: \"<value>\",\n lastModifiedAt: new Date(\"2024-01-18T04:40:39.968Z\"),\n version: \"<value>\",\n isUploaded: false,\n createdAt: new Date(\"2023-09-29T18:20:07.088Z\"),\n sizeReadable: \"<value>\",\n publicUrl: \"https://similar-impostor.info/\",\n },\n {\n id: \"<value>\",\n organizationId: \"<value>\",\n name: \"<value>\",\n path: \"/root\",\n mimeType: \"<value>\",\n size: 907325,\n storageVersion: \"<value>\",\n checksumEtag: \"<value>\",\n checksumSha256Base64: \"<value>\",\n checksumSha256Hex: \"<value>\",\n lastModifiedAt: new Date(\"2023-02-26T14:50:51.751Z\"),\n version: \"<value>\",\n isUploaded: false,\n createdAt: new Date(\"2025-03-01T12:36:21.395Z\"),\n sizeReadable: \"<value>\",\n publicUrl: \"https://thin-illusion.org/\",\n },\n ],\n },\n ],\n product: {\n createdAt: new Date(\"2023-09-09T02:18:18.878Z\"),\n modifiedAt: new Date(\"2025-12-30T17:25:31.182Z\"),\n id: \"<value>\",\n name: \"<value>\",\n description: \"roundabout gah oh hm over\",\n recurringInterval: \"year\",\n isRecurring: false,\n isArchived: false,\n organizationId: \"<value>\",\n prices: [\n {\n createdAt: new Date(\"2025-07-31T13:25:31.669Z\"),\n modifiedAt: new Date(\"2023-11-12T09:40:10.044Z\"),\n id: \"<value>\",\n isArchived: false,\n productId: \"<value>\",\n type: \"one_time\",\n recurringInterval: \"year\",\n },\n {\n createdAt: new Date(\"2025-06-25T22:47:14.264Z\"),\n modifiedAt: new Date(\"2025-01-27T19:10:37.564Z\"),\n id: \"<value>\",\n isArchived: false,\n productId: \"<value>\",\n recurringInterval: \"month\",\n priceCurrency: \"<value>\",\n priceAmount: 18677,\n },\n ],\n benefits: [\n {\n createdAt: new Date(\"2024-05-22T12:15:14.230Z\"),\n modifiedAt: new Date(\"2025-05-10T15:49:09.927Z\"),\n id: \"<value>\",\n type: \"downloadables\",\n description: \"consequently pant ha\",\n selectable: true,\n deletable: true,\n organizationId: \"<value>\",\n },\n {\n createdAt: new Date(\"2024-09-05T11:03:30.226Z\"),\n modifiedAt: new Date(\"2024-10-27T06:30:15.454Z\"),\n id: \"<value>\",\n type: \"ads\",\n description: \"failing clonk kowtow kookily sunbathe ugh delirious now boohoo lean\",\n selectable: false,\n deletable: false,\n organizationId: \"<value>\",\n },\n {\n createdAt: new Date(\"2024-04-20T16:45:08.626Z\"),\n modifiedAt: new Date(\"2025-10-27T21:24:45.236Z\"),\n id: \"<value>\",\n type: \"discord\",\n description: \"until tenderly chapel quantify optimistically excluding aw because amongst emulsify\",\n selectable: false,\n deletable: false,\n organizationId: \"<value>\",\n },\n ],\n medias: [\n {\n id: \"<value>\",\n organizationId: \"<value>\",\n name: \"<value>\",\n path: \"/etc/ppp\",\n mimeType: \"<value>\",\n size: 933572,\n storageVersion: \"<value>\",\n checksumEtag: \"<value>\",\n checksumSha256Base64: \"<value>\",\n checksumSha256Hex: \"<value>\",\n lastModifiedAt: new Date(\"2025-12-28T08:49:03.364Z\"),\n version: \"<value>\",\n isUploaded: false,\n createdAt: new Date(\"2024-07-14T04:00:39.280Z\"),\n sizeReadable: \"<value>\",\n publicUrl: \"https://back-pear.name/\",\n },\n ],\n },\n productPrice: {\n createdAt: new Date(\"2023-04-02T00:05:42.586Z\"),\n modifiedAt: new Date(\"2024-12-15T03:02:38.803Z\"),\n id: \"<value>\",\n isArchived: false,\n productId: \"<value>\",\n type: \"recurring\",\n recurringInterval: \"year\",\n priceCurrency: \"<value>\",\n priceAmount: 825463,\n },\n discount: {\n duration: \"repeating\",\n durationInMonths: 41338,\n type: \"percentage\",\n basisPoints: 818655,\n id: \"<value>\",\n name: \"<value>\",\n code: \"<value>\",\n },\n subscriptionId: \"<value>\",\n attachedCustomFields: [\n {\n customFieldId: \"<value>\",\n customField: {\n createdAt: new Date(\"2023-01-09T04:38:53.436Z\"),\n modifiedAt: new Date(\"2024-12-24T07:52:43.518Z\"),\n id: \"<value>\",\n metadata: {\n \"key\": \"<value>\",\n },\n slug: \"<value>\",\n name: \"<value>\",\n organizationId: \"<value>\",\n properties: {\n options: [\n {\n value: \"<value>\",\n label: \"<value>\",\n },\n ],\n },\n },\n order: 552387,\n required: false,\n },\n {\n customFieldId: \"<value>\",\n customField: {\n createdAt: new Date(\"2024-04-28T02:33:08.095Z\"),\n modifiedAt: new Date(\"2025-07-27T09:28:36.892Z\"),\n id: \"<value>\",\n metadata: {\n \"key\": \"<value>\",\n },\n slug: \"<value>\",\n name: \"<value>\",\n organizationId: \"<value>\",\n properties: {},\n },\n order: 576333,\n required: false,\n },\n ],\n customerMetadata: {\n \"key\": 667273,\n },\n },\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["checkout.updated"]["post"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar();\n\nasync function run() {\n const result = await polar.endpointcheckoutUpdatedPost({\n data: {\n createdAt: new Date(\"2025-10-04T13:06:10.658Z\"),\n modifiedAt: new Date(\"2024-10-02T21:25:15.366Z\"),\n id: \"<value>\",\n paymentProcessor: \"stripe\",\n status: \"failed\",\n clientSecret: \"<value>\",\n url: \"https://square-cafe.biz/\",\n expiresAt: new Date(\"2025-03-25T08:55:11.873Z\"),\n successUrl: \"https://physical-import.name/\",\n embedOrigin: \"<value>\",\n amount: 245418,\n taxAmount: 624213,\n currency: \"Naira\",\n subtotalAmount: 24587,\n totalAmount: 447013,\n productId: \"<value>\",\n productPriceId: \"<value>\",\n discountId: \"<value>\",\n allowDiscountCodes: true,\n isDiscountApplicable: true,\n isFreeProductPrice: true,\n isPaymentRequired: false,\n isPaymentSetupRequired: false,\n isPaymentFormRequired: true,\n customerId: \"<value>\",\n customerName: \"<value>\",\n customerEmail: \"<value>\",\n customerIpAddress: \"<value>\",\n customerBillingAddress: {\n country: \"Zambia\",\n },\n customerTaxId: \"<id>\",\n paymentProcessorMetadata: {\n \"key\": \"<value>\",\n },\n metadata: {\n\n },\n products: [\n {\n createdAt: new Date(\"2024-03-12T12:25:44.387Z\"),\n modifiedAt: new Date(\"2024-03-10T17:45:08.857Z\"),\n id: \"<value>\",\n name: \"<value>\",\n description: \"on likewise growing capsize lest overcook vice independence strategy magnetize\",\n recurringInterval: \"year\",\n isRecurring: false,\n isArchived: false,\n organizationId: \"<value>\",\n prices: [\n\n ],\n benefits: [\n {\n createdAt: new Date(\"2023-02-02T21:51:07.680Z\"),\n modifiedAt: new Date(\"2025-02-22T05:03:37.259Z\"),\n id: \"<value>\",\n type: \"github_repository\",\n description: \"kiddingly likewise inveigle\",\n selectable: true,\n deletable: false,\n organizationId: \"<value>\",\n },\n {\n createdAt: new Date(\"2024-03-23T22:28:05.345Z\"),\n modifiedAt: new Date(\"2025-04-30T11:01:37.991Z\"),\n id: \"<value>\",\n type: \"license_keys\",\n description: \"repeatedly perky capsize shred loudly though whoever millet\",\n selectable: false,\n deletable: false,\n organizationId: \"<value>\",\n },\n ],\n medias: [\n {\n id: \"<value>\",\n organizationId: \"<value>\",\n name: \"<value>\",\n path: \"/home\",\n mimeType: \"<value>\",\n size: 339556,\n storageVersion: \"<value>\",\n checksumEtag: \"<value>\",\n checksumSha256Base64: \"<value>\",\n checksumSha256Hex: \"<value>\",\n lastModifiedAt: new Date(\"2024-09-01T01:36:50.867Z\"),\n version: \"<value>\",\n isUploaded: false,\n createdAt: new Date(\"2025-06-17T05:19:25.570Z\"),\n sizeReadable: \"<value>\",\n publicUrl: \"https://forceful-peninsula.name/\",\n },\n ],\n },\n {\n createdAt: new Date(\"2023-01-07T16:39:06.170Z\"),\n modifiedAt: new Date(\"2024-07-02T04:06:47.300Z\"),\n id: \"<value>\",\n name: \"<value>\",\n description: \"ruin wiggly abaft\",\n recurringInterval: \"month\",\n isRecurring: false,\n isArchived: false,\n organizationId: \"<value>\",\n prices: [\n\n ],\n benefits: [\n {\n createdAt: new Date(\"2023-01-13T15:01:23.486Z\"),\n modifiedAt: new Date(\"2025-01-22T18:51:34.092Z\"),\n id: \"<value>\",\n type: \"discord\",\n description: \"that resource whoa scarcely\",\n selectable: true,\n deletable: true,\n organizationId: \"<value>\",\n },\n {\n createdAt: new Date(\"2025-10-31T20:58:36.719Z\"),\n modifiedAt: new Date(\"2025-11-05T11:15:53.647Z\"),\n id: \"<value>\",\n type: \"custom\",\n description: \"recovery queasily despite concrete independence celsius ouch\",\n selectable: true,\n deletable: true,\n organizationId: \"<value>\",\n },\n ],\n medias: [\n {\n id: \"<value>\",\n organizationId: \"<value>\",\n name: \"<value>\",\n path: \"/boot\",\n mimeType: \"<value>\",\n size: 913510,\n storageVersion: \"<value>\",\n checksumEtag: \"<value>\",\n checksumSha256Base64: \"<value>\",\n checksumSha256Hex: \"<value>\",\n lastModifiedAt: new Date(\"2023-09-10T21:22:45.561Z\"),\n version: \"<value>\",\n isUploaded: false,\n createdAt: new Date(\"2023-05-08T03:57:28.293Z\"),\n sizeReadable: \"<value>\",\n publicUrl: \"https://stable-fort.org\",\n },\n {\n id: \"<value>\",\n organizationId: \"<value>\",\n name: \"<value>\",\n path: \"/System\",\n mimeType: \"<value>\",\n size: 604454,\n storageVersion: \"<value>\",\n checksumEtag: \"<value>\",\n checksumSha256Base64: \"<value>\",\n checksumSha256Hex: \"<value>\",\n lastModifiedAt: new Date(\"2024-05-15T10:29:39.214Z\"),\n version: \"<value>\",\n isUploaded: true,\n createdAt: new Date(\"2024-01-19T16:36:20.955Z\"),\n sizeReadable: \"<value>\",\n publicUrl: \"https://simplistic-simple.biz\",\n },\n ],\n },\n {\n createdAt: new Date(\"2024-04-10T05:20:18.358Z\"),\n modifiedAt: new Date(\"2023-06-22T09:12:37.578Z\"),\n id: \"<value>\",\n name: \"<value>\",\n description: \"yesterday bleakly sheathe yawningly tinted untrue\",\n recurringInterval: \"month\",\n isRecurring: true,\n isArchived: false,\n organizationId: \"<value>\",\n prices: [\n {\n createdAt: new Date(\"2025-10-20T04:48:05.954Z\"),\n modifiedAt: new Date(\"2024-03-12T21:45:21.173Z\"),\n id: \"<value>\",\n isArchived: false,\n productId: \"<value>\",\n type: \"recurring\",\n recurringInterval: \"month\",\n priceCurrency: \"<value>\",\n minimumAmount: 316079,\n maximumAmount: 743040,\n presetAmount: 306145,\n },\n {\n createdAt: new Date(\"2024-10-03T07:55:07.025Z\"),\n modifiedAt: new Date(\"2023-09-26T23:29:16.889Z\"),\n id: \"<value>\",\n isArchived: false,\n productId: \"<value>\",\n type: \"recurring\",\n recurringInterval: \"year\",\n priceCurrency: \"<value>\",\n minimumAmount: 24587,\n maximumAmount: 447013,\n presetAmount: 371362,\n },\n {\n createdAt: new Date(\"2025-08-02T14:33:19.677Z\"),\n modifiedAt: new Date(\"2024-11-17T10:36:50.593Z\"),\n id: \"<value>\",\n isArchived: false,\n productId: \"<value>\",\n recurringInterval: \"month\",\n priceCurrency: \"<value>\",\n minimumAmount: 995460,\n maximumAmount: 461061,\n presetAmount: 134244,\n },\n ],\n benefits: [\n {\n createdAt: new Date(\"2024-07-07T23:56:09.903Z\"),\n modifiedAt: new Date(\"2024-09-12T11:04:17.318Z\"),\n id: \"<value>\",\n type: \"ads\",\n description: \"knottily huzzah ick\",\n selectable: true,\n deletable: false,\n organizationId: \"<value>\",\n },\n {\n createdAt: new Date(\"2024-02-14T16:02:41.163Z\"),\n modifiedAt: new Date(\"2023-04-28T06:23:40.197Z\"),\n id: \"<value>\",\n type: \"discord\",\n description: \"before inasmuch appreciate\",\n selectable: true,\n deletable: false,\n organizationId: \"<value>\",\n },\n ],\n medias: [\n {\n id: \"<value>\",\n organizationId: \"<value>\",\n name: \"<value>\",\n path: \"/usr/sbin\",\n mimeType: \"<value>\",\n size: 165243,\n storageVersion: \"<value>\",\n checksumEtag: \"<value>\",\n checksumSha256Base64: \"<value>\",\n checksumSha256Hex: \"<value>\",\n lastModifiedAt: new Date(\"2024-06-20T00:42:56.885Z\"),\n version: \"<value>\",\n isUploaded: true,\n createdAt: new Date(\"2024-06-03T23:30:54.188Z\"),\n sizeReadable: \"<value>\",\n publicUrl: \"https://pleasing-provider.biz\",\n },\n ],\n },\n ],\n product: {\n createdAt: new Date(\"2025-03-02T07:44:00.713Z\"),\n modifiedAt: new Date(\"2024-11-07T21:48:42.673Z\"),\n id: \"<value>\",\n name: \"<value>\",\n description: \"recommendation soupy tuxedo emboss unlike inscribe frankly zowie um\",\n recurringInterval: \"month\",\n isRecurring: true,\n isArchived: false,\n organizationId: \"<value>\",\n prices: [\n {\n createdAt: new Date(\"2024-03-10T17:45:08.857Z\"),\n modifiedAt: new Date(\"2025-08-21T20:24:37.634Z\"),\n id: \"<value>\",\n isArchived: false,\n productId: \"<value>\",\n type: \"one_time\",\n recurringInterval: \"month\",\n priceCurrency: \"<value>\",\n minimumAmount: 688507,\n maximumAmount: 907403,\n presetAmount: 166544,\n },\n {\n createdAt: new Date(\"2025-05-08T16:44:17.277Z\"),\n modifiedAt: new Date(\"2023-12-03T09:52:08.965Z\"),\n id: \"<value>\",\n isArchived: false,\n productId: \"<value>\",\n recurringInterval: \"month\",\n priceCurrency: \"<value>\",\n priceAmount: 751656,\n },\n ],\n benefits: [\n {\n createdAt: new Date(\"2023-08-11T22:46:57.443Z\"),\n modifiedAt: new Date(\"2023-04-27T10:34:15.837Z\"),\n id: \"<value>\",\n type: \"github_repository\",\n description: \"of sit jut\",\n selectable: true,\n deletable: false,\n organizationId: \"<value>\",\n },\n {\n createdAt: new Date(\"2024-08-22T01:13:57.044Z\"),\n modifiedAt: new Date(\"2025-09-18T08:20:48.636Z\"),\n id: \"<value>\",\n type: \"downloadables\",\n description: \"relative curiously grim to\",\n selectable: false,\n deletable: false,\n organizationId: \"<value>\",\n },\n ],\n medias: [\n {\n id: \"<value>\",\n organizationId: \"<value>\",\n name: \"<value>\",\n path: \"/home/user\",\n mimeType: \"<value>\",\n size: 558866,\n storageVersion: \"<value>\",\n checksumEtag: \"<value>\",\n checksumSha256Base64: \"<value>\",\n checksumSha256Hex: \"<value>\",\n lastModifiedAt: new Date(\"2023-07-21T12:30:10.295Z\"),\n version: \"<value>\",\n isUploaded: false,\n createdAt: new Date(\"2023-11-12T16:29:20.536Z\"),\n sizeReadable: \"<value>\",\n publicUrl: \"https://silver-contractor.org\",\n },\n {\n id: \"<value>\",\n organizationId: \"<value>\",\n name: \"<value>\",\n path: \"/usr/ports\",\n mimeType: \"<value>\",\n size: 934999,\n storageVersion: \"<value>\",\n checksumEtag: \"<value>\",\n checksumSha256Base64: \"<value>\",\n checksumSha256Hex: \"<value>\",\n lastModifiedAt: new Date(\"2025-09-19T02:05:47.978Z\"),\n version: \"<value>\",\n isUploaded: true,\n createdAt: new Date(\"2023-04-19T21:25:09.653Z\"),\n sizeReadable: \"<value>\",\n publicUrl: \"https://ashamed-platter.com\",\n },\n ],\n },\n productPrice: {\n createdAt: new Date(\"2024-04-13T13:45:30.435Z\"),\n modifiedAt: new Date(\"2025-12-31T21:16:51.807Z\"),\n id: \"<value>\",\n isArchived: false,\n productId: \"<value>\",\n recurringInterval: \"month\",\n },\n discount: {\n duration: \"forever\",\n type: \"percentage\",\n basisPoints: 701511,\n id: \"<value>\",\n name: \"<value>\",\n code: \"<value>\",\n },\n subscriptionId: \"<value>\",\n attachedCustomFields: [\n {\n customFieldId: \"<value>\",\n customField: {\n createdAt: new Date(\"2025-06-06T19:17:28.589Z\"),\n modifiedAt: new Date(\"2025-02-23T18:15:44.994Z\"),\n id: \"<value>\",\n metadata: {\n \"key\": 343034,\n },\n slug: \"<value>\",\n name: \"<value>\",\n organizationId: \"<value>\",\n properties: {},\n },\n order: 177975,\n required: false,\n },\n {\n customFieldId: \"<value>\",\n customField: {\n createdAt: new Date(\"2023-01-18T13:42:58.942Z\"),\n modifiedAt: new Date(\"2025-09-27T11:53:33.602Z\"),\n id: \"<value>\",\n metadata: {\n \"key\": 388366,\n },\n slug: \"<value>\",\n name: \"<value>\",\n organizationId: \"<value>\",\n properties: {},\n },\n order: 492106,\n required: true,\n },\n ],\n customerMetadata: {\n \"key\": 354923,\n },\n },\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["order.created"]["post"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar();\n\nasync function run() {\n const result = await polar.endpointorderCreatedPost({\n data: {\n createdAt: new Date(\"2024-11-11T12:46:15.007Z\"),\n modifiedAt: new Date(\"2024-03-23T03:54:38.261Z\"),\n id: \"<value>\",\n metadata: {\n \"key\": \"<value>\",\n \"key1\": \"<value>\",\n },\n status: \"<value>\",\n amount: 485666,\n taxAmount: 81588,\n refundedAmount: 605593,\n refundedTaxAmount: 738083,\n currency: \"Jamaican Dollar\",\n billingReason: \"purchase\",\n billingAddress: {\n country: \"Maldives\",\n },\n customerId: \"<value>\",\n productId: \"<value>\",\n productPriceId: \"<value>\",\n discountId: \"<value>\",\n subscriptionId: \"<value>\",\n checkoutId: \"<value>\",\n customer: {\n createdAt: new Date(\"2025-09-23T11:59:51.286Z\"),\n modifiedAt: new Date(\"2025-12-14T00:30:10.871Z\"),\n id: \"<value>\",\n metadata: {\n \"key\": \"<value>\",\n \"key1\": \"<value>\",\n \"key2\": 386855,\n },\n externalId: \"<id>\",\n email: \"[email protected]\",\n emailVerified: false,\n name: \"<value>\",\n billingAddress: {\n country: \"Hong Kong\",\n },\n taxId: [\n \"no_vat\",\n \"<id>\",\n ],\n organizationId: \"<value>\",\n avatarUrl: \"https://darling-kit.org\",\n },\n userId: \"<value>\",\n user: {\n id: \"<value>\",\n email: \"[email protected]\",\n publicName: \"<value>\",\n },\n product: {\n createdAt: new Date(\"2025-12-27T14:05:37.748Z\"),\n modifiedAt: new Date(\"2025-01-01T22:00:53.940Z\"),\n id: \"<value>\",\n name: \"<value>\",\n description: \"circle colorize given\",\n recurringInterval: \"month\",\n isRecurring: true,\n isArchived: false,\n organizationId: \"<value>\",\n },\n productPrice: {\n createdAt: new Date(\"2025-03-27T08:15:55.821Z\"),\n modifiedAt: new Date(\"2023-11-08T15:41:27.758Z\"),\n id: \"<value>\",\n isArchived: false,\n productId: \"<value>\",\n type: \"one_time\",\n recurringInterval: \"month\",\n priceCurrency: \"<value>\",\n minimumAmount: 81588,\n maximumAmount: 605593,\n presetAmount: 738083,\n },\n discount: {\n duration: \"repeating\",\n type: \"fixed\",\n amount: 228282,\n currency: \"Baht\",\n createdAt: new Date(\"2023-04-06T06:29:00.267Z\"),\n modifiedAt: new Date(\"2023-03-01T18:48:46.167Z\"),\n id: \"<value>\",\n metadata: {\n \"key\": \"<value>\",\n \"key1\": \"<value>\",\n \"key2\": \"<value>\",\n },\n name: \"<value>\",\n code: \"<value>\",\n startsAt: new Date(\"2023-12-14T21:08:51.727Z\"),\n endsAt: new Date(\"2023-08-24T00:05:31.570Z\"),\n maxRedemptions: 133794,\n redemptionsCount: 558400,\n organizationId: \"<value>\",\n },\n subscription: {\n metadata: {\n \"key\": 838937,\n \"key1\": true,\n },\n createdAt: new Date(\"2025-05-09T06:10:47.548Z\"),\n modifiedAt: new Date(\"2025-02-13T18:51:37.875Z\"),\n id: \"<value>\",\n amount: 420337,\n currency: \"New Zealand Dollar\",\n recurringInterval: \"year\",\n status: \"incomplete\",\n currentPeriodStart: new Date(\"2025-12-01T13:27:57.927Z\"),\n currentPeriodEnd: new Date(\"2023-06-23T18:54:19.334Z\"),\n cancelAtPeriodEnd: false,\n canceledAt: new Date(\"2024-11-15T11:53:36.436Z\"),\n startedAt: new Date(\"2025-11-18T03:47:21.756Z\"),\n endsAt: new Date(\"2023-02-02T12:07:22.717Z\"),\n endedAt: new Date(\"2023-02-15T16:05:22.828Z\"),\n customerId: \"<value>\",\n productId: \"<value>\",\n priceId: \"<value>\",\n discountId: \"<value>\",\n checkoutId: \"<value>\",\n customerCancellationReason: \"switched_service\",\n customerCancellationComment: \"<value>\",\n userId: \"<value>\",\n },\n },\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["order.refunded"]["post"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar();\n\nasync function run() {\n const result = await polar.endpointorderRefundedPost({\n data: {\n createdAt: new Date(\"2023-01-02T23:38:59.363Z\"),\n modifiedAt: new Date(\"2025-02-28T12:31:35.473Z\"),\n id: \"<value>\",\n metadata: {\n \"key\": true,\n \"key1\": true,\n \"key2\": \"<value>\",\n },\n status: \"<value>\",\n amount: 528865,\n taxAmount: 824083,\n refundedAmount: 158895,\n refundedTaxAmount: 509231,\n currency: \"US Dollar\",\n billingReason: \"subscription_update\",\n billingAddress: {\n country: \"Mozambique\",\n },\n customerId: \"<value>\",\n productId: \"<value>\",\n productPriceId: \"<value>\",\n discountId: \"<value>\",\n subscriptionId: \"<value>\",\n checkoutId: \"<value>\",\n customer: {\n createdAt: new Date(\"2023-06-06T13:40:41.280Z\"),\n modifiedAt: new Date(\"2023-12-12T14:47:44.609Z\"),\n id: \"<value>\",\n metadata: {\n \"key\": \"<value>\",\n \"key1\": true,\n },\n externalId: \"<id>\",\n email: \"[email protected]\",\n emailVerified: true,\n name: \"<value>\",\n billingAddress: {\n country: \"Gabon\",\n },\n taxId: [\n \"tw_vat\",\n ],\n organizationId: \"<value>\",\n avatarUrl: \"https://authorized-planula.info/\",\n },\n userId: \"<value>\",\n user: {\n id: \"<value>\",\n email: \"[email protected]\",\n publicName: \"<value>\",\n },\n product: {\n createdAt: new Date(\"2025-08-20T03:33:42.720Z\"),\n modifiedAt: new Date(\"2023-01-12T20:44:44.199Z\"),\n id: \"<value>\",\n name: \"<value>\",\n description: \"wholly till ill-fated ignite shyly timely duh\",\n recurringInterval: \"year\",\n isRecurring: true,\n isArchived: true,\n organizationId: \"<value>\",\n },\n productPrice: {\n createdAt: new Date(\"2025-10-05T18:25:49.221Z\"),\n modifiedAt: new Date(\"2025-10-25T11:18:00.181Z\"),\n id: \"<value>\",\n isArchived: false,\n productId: \"<value>\",\n recurringInterval: \"month\",\n },\n discount: {\n duration: \"forever\",\n type: \"percentage\",\n amount: 798101,\n currency: \"UAE Dirham\",\n createdAt: new Date(\"2023-07-31T17:16:21.805Z\"),\n modifiedAt: new Date(\"2024-12-19T01:36:36.664Z\"),\n id: \"<value>\",\n metadata: {\n \"key\": 802290,\n \"key1\": 6677,\n \"key2\": 898371,\n },\n name: \"<value>\",\n code: \"<value>\",\n startsAt: new Date(\"2025-10-04T09:22:51.824Z\"),\n endsAt: new Date(\"2025-05-25T20:59:26.748Z\"),\n maxRedemptions: 625636,\n redemptionsCount: 302499,\n organizationId: \"<value>\",\n },\n subscription: {\n metadata: {\n \"key\": \"<value>\",\n \"key1\": 434679,\n },\n createdAt: new Date(\"2023-03-11T03:15:27.257Z\"),\n modifiedAt: new Date(\"2024-08-05T00:21:50.603Z\"),\n id: \"<value>\",\n amount: 690659,\n currency: \"Lari\",\n recurringInterval: \"year\",\n status: \"canceled\",\n currentPeriodStart: new Date(\"2025-08-31T07:32:06.622Z\"),\n currentPeriodEnd: new Date(\"2023-12-09T23:03:57.242Z\"),\n cancelAtPeriodEnd: false,\n canceledAt: new Date(\"2024-09-03T00:25:25.397Z\"),\n startedAt: new Date(\"2023-07-04T15:25:35.943Z\"),\n endsAt: new Date(\"2024-09-24T05:43:42.179Z\"),\n endedAt: new Date(\"2024-11-02T16:14:59.150Z\"),\n customerId: \"<value>\",\n productId: \"<value>\",\n priceId: \"<value>\",\n discountId: \"<value>\",\n checkoutId: \"<value>\",\n customerCancellationReason: \"missing_features\",\n customerCancellationComment: \"<value>\",\n userId: \"<value>\",\n },\n },\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["organization.updated"]["post"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar();\n\nasync function run() {\n const result = await polar.endpointorganizationUpdatedPost({\n data: {\n createdAt: new Date(\"2023-08-12T18:45:04.236Z\"),\n modifiedAt: new Date(\"2025-12-29T16:35:25.119Z\"),\n id: \"<value>\",\n name: \"<value>\",\n slug: \"<value>\",\n avatarUrl: \"https://devoted-bump.net\",\n bio: \"<value>\",\n company: \"Torp, Kuhlman and Howell\",\n blog: \"<value>\",\n location: \"<value>\",\n email: \"[email protected]\",\n twitterUsername: \"<value>\",\n pledgeMinimumAmount: 105265,\n pledgeBadgeShowAmount: true,\n defaultUpfrontSplitToContributors: 907160,\n profileSettings: {},\n featureSettings: {},\n subscriptionSettings: {\n allowMultipleSubscriptions: false,\n allowCustomerUpdates: true,\n prorationBehavior: \"prorate\",\n },\n },\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["pledge.created"]["post"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar();\n\nasync function run() {\n const result = await polar.endpointpledgeCreatedPost({\n data: {\n createdAt: new Date(\"2025-03-12T00:19:41.487Z\"),\n modifiedAt: new Date(\"2023-04-19T01:42:59.169Z\"),\n id: \"<value>\",\n amount: 330877,\n currency: \"Jamaican Dollar\",\n state: \"disputed\",\n type: \"pay_directly\",\n issue: {\n id: \"66524b69-aa0b-47ac-bb9a-0cee5d3a9110\",\n platform: \"github\",\n number: 280857,\n title: \"<value>\",\n state: \"open\",\n issueCreatedAt: new Date(\"2024-02-26T00:33:35.289Z\"),\n needsConfirmationSolved: false,\n funding: {},\n repository: {\n id: \"356e14cb-87a4-484c-bcfa-ebfe50487706\",\n platform: \"github\",\n isPrivate: true,\n name: \"MyOrg\",\n description: \"different premium tinderbox peter under often buzzing hastily\",\n stars: 1337,\n license: \"<value>\",\n homepage: \"<value>\",\n profileSettings: {},\n organization: {\n id: \"29159f56-74c0-464d-b598-8d5bc3b9cdda\",\n platform: \"github\",\n name: \"<value>\",\n avatarUrl: \"https://frightened-poppy.com/\",\n isPersonal: false,\n bio: \"<value>\",\n prettyName: \"<value>\",\n company: \"Bailey - Towne\",\n blog: \"<value>\",\n location: \"<value>\",\n email: \"[email protected]\",\n twitterUsername: \"<value>\",\n organizationId: \"<value>\",\n },\n internalOrganization: {\n createdAt: new Date(\"2025-01-03T15:27:13.109Z\"),\n modifiedAt: new Date(\"2024-02-15T22:10:17.041Z\"),\n id: \"<value>\",\n name: \"<value>\",\n slug: \"<value>\",\n avatarUrl: \"https://hard-to-find-thyme.org\",\n bio: \"<value>\",\n company: \"Schinner - Wiegand\",\n blog: \"<value>\",\n location: \"<value>\",\n email: \"[email protected]\",\n twitterUsername: \"<value>\",\n pledgeMinimumAmount: 273260,\n pledgeBadgeShowAmount: false,\n defaultUpfrontSplitToContributors: 976949,\n profileSettings: {},\n featureSettings: {},\n subscriptionSettings: {\n allowMultipleSubscriptions: true,\n allowCustomerUpdates: true,\n prorationBehavior: \"invoice\",\n },\n },\n },\n pledgeBadgeCurrentlyEmbedded: false,\n },\n },\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["pledge.updated"]["post"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar();\n\nasync function run() {\n const result = await polar.endpointpledgeUpdatedPost({\n data: {\n createdAt: new Date(\"2024-11-29T00:10:39.674Z\"),\n modifiedAt: new Date(\"2025-10-02T21:42:49.754Z\"),\n id: \"<value>\",\n amount: 634567,\n currency: \"Singapore Dollar\",\n state: \"refunded\",\n type: \"pay_on_completion\",\n issue: {\n id: \"d2e1349d-085a-441c-abf4-379a1f21d0da\",\n platform: \"github\",\n number: 218372,\n title: \"<value>\",\n state: \"closed\",\n issueCreatedAt: new Date(\"2024-08-12T14:08:31.083Z\"),\n needsConfirmationSolved: true,\n funding: {},\n repository: {\n id: \"814bd7c6-3412-4f11-b523-7b38c659f44a\",\n platform: \"github\",\n isPrivate: false,\n name: \"MyOrg\",\n description: \"hm however microchip\",\n stars: 1337,\n license: \"<value>\",\n homepage: \"<value>\",\n profileSettings: {},\n organization: {\n id: \"3ddd5cc2-de10-41ef-baa1-7551cf671cc3\",\n platform: \"github\",\n name: \"<value>\",\n avatarUrl: \"https://gummy-interviewer.biz\",\n isPersonal: false,\n bio: \"<value>\",\n prettyName: \"<value>\",\n company: \"Ferry - Tremblay\",\n blog: \"<value>\",\n location: \"<value>\",\n email: \"[email protected]\",\n twitterUsername: \"<value>\",\n organizationId: \"<value>\",\n },\n internalOrganization: {\n createdAt: new Date(\"2025-12-13T11:00:39.217Z\"),\n modifiedAt: new Date(\"2025-12-02T09:51:26.214Z\"),\n id: \"<value>\",\n name: \"<value>\",\n slug: \"<value>\",\n avatarUrl: \"https://memorable-numeracy.com/\",\n bio: \"<value>\",\n company: \"Schuster - Crooks\",\n blog: \"<value>\",\n location: \"<value>\",\n email: \"[email protected]\",\n twitterUsername: \"<value>\",\n pledgeMinimumAmount: 653584,\n pledgeBadgeShowAmount: false,\n defaultUpfrontSplitToContributors: 175899,\n profileSettings: {},\n featureSettings: {},\n subscriptionSettings: {\n allowMultipleSubscriptions: false,\n allowCustomerUpdates: true,\n prorationBehavior: \"invoice\",\n },\n },\n },\n pledgeBadgeCurrentlyEmbedded: true,\n },\n },\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["product.created"]["post"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar();\n\nasync function run() {\n const result = await polar.endpointproductCreatedPost({\n data: {\n createdAt: new Date(\"2023-03-27T06:36:20.130Z\"),\n modifiedAt: new Date(\"2025-04-21T12:05:16.637Z\"),\n id: \"<value>\",\n name: \"<value>\",\n description: \"into horst metal grimy clinch big grounded industrialize\",\n recurringInterval: \"month\",\n isRecurring: true,\n isArchived: true,\n organizationId: \"<value>\",\n metadata: {\n \"key\": \"<value>\",\n \"key1\": \"<value>\",\n },\n prices: [\n {\n createdAt: new Date(\"2024-12-07T23:31:39.577Z\"),\n modifiedAt: new Date(\"2024-04-25T10:21:28.587Z\"),\n id: \"<value>\",\n isArchived: false,\n productId: \"<value>\",\n recurringInterval: \"month\",\n },\n {\n createdAt: new Date(\"2024-09-06T02:23:36.299Z\"),\n modifiedAt: new Date(\"2024-10-09T12:20:00.039Z\"),\n id: \"<value>\",\n isArchived: false,\n productId: \"<value>\",\n type: \"recurring\",\n recurringInterval: \"month\",\n priceCurrency: \"<value>\",\n minimumAmount: 66164,\n maximumAmount: 215783,\n presetAmount: 203043,\n },\n ],\n benefits: [\n {\n createdAt: new Date(\"2023-12-13T12:26:05.455Z\"),\n modifiedAt: new Date(\"2024-04-17T08:36:36.851Z\"),\n id: \"<value>\",\n description: \"before requite than throughout\",\n selectable: false,\n deletable: false,\n organizationId: \"<value>\",\n properties: {\n imageHeight: 400,\n imageWidth: 400,\n },\n },\n {\n createdAt: new Date(\"2024-04-16T11:54:19.983Z\"),\n modifiedAt: new Date(\"2024-09-03T21:44:52.825Z\"),\n id: \"<value>\",\n description: \"unaccountably beneath opposite bah hose fellow surge frankly\",\n selectable: false,\n deletable: false,\n organizationId: \"<value>\",\n properties: {\n guildId: \"<id>\",\n roleId: \"<id>\",\n guildToken: \"<value>\",\n },\n },\n {\n createdAt: new Date(\"2023-07-03T13:23:53.646Z\"),\n modifiedAt: new Date(\"2025-10-22T11:14:29.082Z\"),\n id: \"<value>\",\n description: \"though pace shakily stack carefully wherever\",\n selectable: false,\n deletable: false,\n organizationId: \"<value>\",\n properties: {\n archived: {\n \"key\": false,\n },\n files: [\n \"<value>\",\n ],\n },\n },\n ],\n medias: [\n {\n id: \"<value>\",\n organizationId: \"<value>\",\n name: \"<value>\",\n path: \"/usr/obj\",\n mimeType: \"<value>\",\n size: 260470,\n storageVersion: \"<value>\",\n checksumEtag: \"<value>\",\n checksumSha256Base64: \"<value>\",\n checksumSha256Hex: \"<value>\",\n lastModifiedAt: new Date(\"2025-08-18T19:34:49.881Z\"),\n version: \"<value>\",\n isUploaded: true,\n createdAt: new Date(\"2025-05-10T10:45:18.149Z\"),\n sizeReadable: \"<value>\",\n publicUrl: \"https://yellow-reasoning.biz/\",\n },\n ],\n attachedCustomFields: [\n {\n customFieldId: \"<value>\",\n customField: {\n createdAt: new Date(\"2025-10-19T10:03:16.084Z\"),\n modifiedAt: new Date(\"2024-05-28T07:55:26.633Z\"),\n id: \"<value>\",\n metadata: {\n \"key\": false,\n },\n slug: \"<value>\",\n name: \"<value>\",\n organizationId: \"<value>\",\n properties: {},\n },\n order: 752699,\n required: false,\n },\n {\n customFieldId: \"<value>\",\n customField: {\n createdAt: new Date(\"2023-05-17T05:27:36.888Z\"),\n modifiedAt: new Date(\"2023-03-28T23:52:23.232Z\"),\n id: \"<value>\",\n metadata: {\n \"key\": \"<value>\",\n },\n slug: \"<value>\",\n name: \"<value>\",\n organizationId: \"<value>\",\n properties: {},\n },\n order: 425950,\n required: true,\n },\n ],\n },\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["product.updated"]["post"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar();\n\nasync function run() {\n const result = await polar.endpointproductUpdatedPost({\n data: {\n createdAt: new Date(\"2024-06-25T03:46:32.479Z\"),\n modifiedAt: new Date(\"2023-06-04T01:47:33.158Z\"),\n id: \"<value>\",\n name: \"<value>\",\n description: \"er ick birdcage\",\n recurringInterval: \"month\",\n isRecurring: false,\n isArchived: true,\n organizationId: \"<value>\",\n metadata: {\n \"key\": 498845,\n },\n prices: [\n {\n createdAt: new Date(\"2023-04-14T23:22:06.974Z\"),\n modifiedAt: new Date(\"2023-11-27T16:49:54.775Z\"),\n id: \"<value>\",\n isArchived: false,\n productId: \"<value>\",\n recurringInterval: \"month\",\n priceCurrency: \"<value>\",\n minimumAmount: 147529,\n maximumAmount: 389871,\n presetAmount: 137830,\n },\n ],\n benefits: [\n {\n createdAt: new Date(\"2025-10-01T01:25:21.739Z\"),\n modifiedAt: new Date(\"2023-04-13T14:11:42.240Z\"),\n id: \"<value>\",\n description: \"ick nauseate louse over snoop consequently glossy probe\",\n selectable: false,\n deletable: false,\n organizationId: \"<value>\",\n properties: {\n guildId: \"<id>\",\n roleId: \"<id>\",\n guildToken: \"<value>\",\n },\n },\n ],\n medias: [\n {\n id: \"<value>\",\n organizationId: \"<value>\",\n name: \"<value>\",\n path: \"/etc/defaults\",\n mimeType: \"<value>\",\n size: 132814,\n storageVersion: \"<value>\",\n checksumEtag: \"<value>\",\n checksumSha256Base64: \"<value>\",\n checksumSha256Hex: \"<value>\",\n lastModifiedAt: new Date(\"2024-04-24T09:18:36.586Z\"),\n version: \"<value>\",\n isUploaded: false,\n createdAt: new Date(\"2024-02-12T19:04:33.442Z\"),\n sizeReadable: \"<value>\",\n publicUrl: \"https://kaleidoscopic-quart.name/\",\n },\n {\n id: \"<value>\",\n organizationId: \"<value>\",\n name: \"<value>\",\n path: \"/mnt\",\n mimeType: \"<value>\",\n size: 173885,\n storageVersion: \"<value>\",\n checksumEtag: \"<value>\",\n checksumSha256Base64: \"<value>\",\n checksumSha256Hex: \"<value>\",\n lastModifiedAt: new Date(\"2023-01-02T06:55:06.076Z\"),\n version: \"<value>\",\n isUploaded: true,\n createdAt: new Date(\"2024-08-06T03:21:47.848Z\"),\n sizeReadable: \"<value>\",\n publicUrl: \"https://total-pigpen.com/\",\n },\n ],\n attachedCustomFields: [\n {\n customFieldId: \"<value>\",\n customField: {\n createdAt: new Date(\"2024-05-09T01:31:02.965Z\"),\n modifiedAt: new Date(\"2025-12-17T05:54:42.907Z\"),\n id: \"<value>\",\n metadata: {\n \"key\": 513990,\n },\n slug: \"<value>\",\n name: \"<value>\",\n organizationId: \"<value>\",\n properties: {},\n },\n order: 326849,\n required: true,\n },\n ],\n },\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["refund.created"]["post"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar();\n\nasync function run() {\n const result = await polar.endpointrefundCreatedPost({\n data: {\n createdAt: new Date(\"2025-12-29T06:17:19.062Z\"),\n modifiedAt: new Date(\"2023-06-28T13:27:59.588Z\"),\n id: \"<value>\",\n metadata: {\n \"key\": false,\n \"key1\": true,\n },\n status: \"canceled\",\n reason: \"fraudulent\",\n amount: 872325,\n taxAmount: 273821,\n currency: \"New Israeli Sheqel\",\n organizationId: \"<value>\",\n orderId: \"<value>\",\n subscriptionId: \"<value>\",\n customerId: \"<value>\",\n revokeBenefits: true,\n },\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["refund.updated"]["post"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar();\n\nasync function run() {\n const result = await polar.endpointrefundUpdatedPost({\n data: {\n createdAt: new Date(\"2024-01-23T03:57:31.216Z\"),\n modifiedAt: new Date(\"2024-04-24T01:16:45.429Z\"),\n id: \"<value>\",\n metadata: {\n\n },\n status: \"succeeded\",\n reason: \"other\",\n amount: 397442,\n taxAmount: 509120,\n currency: \"Rufiyaa\",\n organizationId: \"<value>\",\n orderId: \"<value>\",\n subscriptionId: \"<value>\",\n customerId: \"<value>\",\n revokeBenefits: false,\n },\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["subscription.active"]["post"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar();\n\nasync function run() {\n const result = await polar.endpointsubscriptionActivePost({\n data: {\n createdAt: new Date(\"2023-09-17T11:03:44.679Z\"),\n modifiedAt: new Date(\"2025-07-24T20:02:17.426Z\"),\n id: \"<value>\",\n amount: 116760,\n currency: \"Quetzal\",\n recurringInterval: \"month\",\n status: \"incomplete\",\n currentPeriodStart: new Date(\"2023-08-25T00:14:50.252Z\"),\n currentPeriodEnd: new Date(\"2023-12-10T18:25:01.577Z\"),\n cancelAtPeriodEnd: false,\n canceledAt: new Date(\"2024-07-05T14:07:23.099Z\"),\n startedAt: new Date(\"2024-06-30T08:12:48.355Z\"),\n endsAt: new Date(\"2023-06-29T07:42:54.895Z\"),\n endedAt: new Date(\"2025-10-30T02:51:06.576Z\"),\n customerId: \"<value>\",\n productId: \"<value>\",\n priceId: \"<value>\",\n discountId: \"<value>\",\n checkoutId: \"<value>\",\n customerCancellationReason: \"switched_service\",\n customerCancellationComment: \"<value>\",\n metadata: {\n \"key\": true,\n \"key1\": \"<value>\",\n \"key2\": 615212,\n },\n customer: {\n createdAt: new Date(\"2023-04-25T08:49:41.567Z\"),\n modifiedAt: new Date(\"2025-09-05T08:50:11.879Z\"),\n id: \"<value>\",\n metadata: {\n\n },\n externalId: \"<id>\",\n email: \"[email protected]\",\n emailVerified: true,\n name: \"<value>\",\n billingAddress: {\n country: \"Cuba\",\n },\n taxId: [\n \"pe_ruc\",\n \"tr_tin\",\n ],\n organizationId: \"<value>\",\n avatarUrl: \"https://steel-zebra.biz/\",\n },\n userId: \"<value>\",\n user: {\n id: \"<value>\",\n email: \"[email protected]\",\n publicName: \"<value>\",\n },\n product: {\n createdAt: new Date(\"2024-08-26T12:17:17.429Z\"),\n modifiedAt: new Date(\"2025-06-15T18:12:34.300Z\"),\n id: \"<value>\",\n name: \"<value>\",\n description: \"during boo place enchanting\",\n recurringInterval: \"year\",\n isRecurring: false,\n isArchived: true,\n organizationId: \"<value>\",\n metadata: {\n \"key\": 390560,\n },\n prices: [\n\n ],\n benefits: [\n\n ],\n medias: [\n {\n id: \"<value>\",\n organizationId: \"<value>\",\n name: \"<value>\",\n path: \"/etc/periodic\",\n mimeType: \"<value>\",\n size: 368833,\n storageVersion: \"<value>\",\n checksumEtag: \"<value>\",\n checksumSha256Base64: \"<value>\",\n checksumSha256Hex: \"<value>\",\n lastModifiedAt: new Date(\"2023-09-18T05:20:53.809Z\"),\n version: \"<value>\",\n isUploaded: false,\n createdAt: new Date(\"2025-02-15T09:26:15.001Z\"),\n sizeReadable: \"<value>\",\n publicUrl: \"https://scornful-flood.org\",\n },\n {\n id: \"<value>\",\n organizationId: \"<value>\",\n name: \"<value>\",\n path: \"/private/var\",\n mimeType: \"<value>\",\n size: 135533,\n storageVersion: \"<value>\",\n checksumEtag: \"<value>\",\n checksumSha256Base64: \"<value>\",\n checksumSha256Hex: \"<value>\",\n lastModifiedAt: new Date(\"2025-06-08T01:38:58.555Z\"),\n version: \"<value>\",\n isUploaded: true,\n createdAt: new Date(\"2023-02-13T01:11:01.495Z\"),\n sizeReadable: \"<value>\",\n publicUrl: \"https://small-monocle.org\",\n },\n ],\n attachedCustomFields: [\n {\n customFieldId: \"<value>\",\n customField: {\n createdAt: new Date(\"2025-07-24T20:02:17.426Z\"),\n modifiedAt: new Date(\"2023-05-08T23:16:06.519Z\"),\n id: \"<value>\",\n metadata: {\n \"key\": \"<value>\",\n },\n slug: \"<value>\",\n name: \"<value>\",\n organizationId: \"<value>\",\n properties: {},\n },\n order: 18363,\n required: false,\n },\n ],\n },\n price: {\n createdAt: new Date(\"2023-08-25T00:14:50.252Z\"),\n modifiedAt: new Date(\"2023-12-10T18:25:01.577Z\"),\n id: \"<value>\",\n isArchived: false,\n productId: \"<value>\",\n recurringInterval: \"year\",\n priceCurrency: \"<value>\",\n minimumAmount: 503274,\n maximumAmount: 498487,\n presetAmount: 163614,\n },\n discount: {\n duration: \"forever\",\n durationInMonths: 764641,\n type: \"percentage\",\n basisPoints: 267197,\n createdAt: new Date(\"2024-10-19T13:44:20.141Z\"),\n modifiedAt: new Date(\"2024-08-30T17:40:05.617Z\"),\n id: \"<value>\",\n metadata: {\n \"key\": 275346,\n \"key1\": \"<value>\",\n },\n name: \"<value>\",\n code: \"<value>\",\n startsAt: new Date(\"2024-07-06T18:40:04.116Z\"),\n endsAt: new Date(\"2023-05-12T20:57:57.609Z\"),\n maxRedemptions: 365189,\n redemptionsCount: 573023,\n organizationId: \"<value>\",\n },\n },\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["subscription.canceled"]["post"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar();\n\nasync function run() {\n const result = await polar.endpointsubscriptionCanceledPost({\n data: {\n createdAt: new Date(\"2024-02-08T10:04:43.200Z\"),\n modifiedAt: new Date(\"2023-02-20T09:16:44.963Z\"),\n id: \"<value>\",\n amount: 384017,\n currency: \"Nakfa\",\n recurringInterval: \"month\",\n status: \"canceled\",\n currentPeriodStart: new Date(\"2025-08-29T23:51:26.505Z\"),\n currentPeriodEnd: new Date(\"2024-01-30T14:57:29.126Z\"),\n cancelAtPeriodEnd: false,\n canceledAt: new Date(\"2023-05-31T10:57:35.559Z\"),\n startedAt: new Date(\"2024-10-31T08:13:37.012Z\"),\n endsAt: new Date(\"2023-08-22T21:50:14.399Z\"),\n endedAt: new Date(\"2023-07-13T20:08:34.251Z\"),\n customerId: \"<value>\",\n productId: \"<value>\",\n priceId: \"<value>\",\n discountId: \"<value>\",\n checkoutId: \"<value>\",\n customerCancellationReason: \"too_expensive\",\n customerCancellationComment: \"<value>\",\n metadata: {\n \"key\": \"<value>\",\n \"key1\": \"<value>\",\n \"key2\": 199269,\n },\n customer: {\n createdAt: new Date(\"2023-12-04T19:57:16.999Z\"),\n modifiedAt: new Date(\"2025-01-03T00:48:16.846Z\"),\n id: \"<value>\",\n metadata: {\n \"key\": \"<value>\",\n },\n externalId: \"<id>\",\n email: \"[email protected]\",\n emailVerified: false,\n name: \"<value>\",\n billingAddress: {\n country: \"Costa Rica\",\n },\n taxId: [\n \"eu_oss_vat\",\n \"in_gst\",\n ],\n organizationId: \"<value>\",\n avatarUrl: \"https://pretty-t-shirt.info/\",\n },\n userId: \"<value>\",\n user: {\n id: \"<value>\",\n email: \"[email protected]\",\n publicName: \"<value>\",\n },\n product: {\n createdAt: new Date(\"2024-12-23T22:35:56.583Z\"),\n modifiedAt: new Date(\"2023-10-09T20:16:33.963Z\"),\n id: \"<value>\",\n name: \"<value>\",\n description: \"where yogurt atop\",\n recurringInterval: \"year\",\n isRecurring: false,\n isArchived: false,\n organizationId: \"<value>\",\n metadata: {\n\n },\n prices: [\n {\n createdAt: new Date(\"2024-02-25T21:11:48.890Z\"),\n modifiedAt: new Date(\"2023-10-06T06:04:45.294Z\"),\n id: \"<value>\",\n isArchived: false,\n productId: \"<value>\",\n recurringInterval: \"month\",\n priceCurrency: \"<value>\",\n minimumAmount: 803599,\n maximumAmount: 886856,\n presetAmount: 360058,\n },\n ],\n benefits: [\n {\n createdAt: new Date(\"2023-05-31T10:57:35.559Z\"),\n modifiedAt: new Date(\"2024-10-31T08:13:37.012Z\"),\n id: \"<value>\",\n description: \"around meh patiently t-shirt\",\n selectable: false,\n deletable: false,\n organizationId: \"<value>\",\n properties: {\n repositoryOwner: \"polarsource\",\n repositoryName: \"private_repo\",\n permission: \"triage\",\n },\n },\n {\n createdAt: new Date(\"2024-04-22T15:20:36.336Z\"),\n modifiedAt: new Date(\"2023-02-02T14:55:14.427Z\"),\n id: \"<value>\",\n description: \"yawningly yum considering\",\n selectable: false,\n deletable: false,\n organizationId: \"<value>\",\n properties: {\n repositoryOwner: \"polarsource\",\n repositoryName: \"private_repo\",\n permission: \"pull\",\n },\n },\n {\n createdAt: new Date(\"2025-04-12T18:57:51.082Z\"),\n modifiedAt: new Date(\"2025-02-01T11:25:35.223Z\"),\n id: \"<value>\",\n description: \"bestride circa aw gum judgementally till upwardly pro urgently\",\n selectable: false,\n deletable: false,\n organizationId: \"<value>\",\n properties: {\n archived: {\n \"key\": false,\n },\n files: [\n \"<value>\",\n ],\n },\n },\n ],\n medias: [\n\n ],\n attachedCustomFields: [\n {\n customFieldId: \"<value>\",\n customField: {\n createdAt: new Date(\"2023-06-03T19:12:20.362Z\"),\n modifiedAt: new Date(\"2025-05-23T18:16:04.701Z\"),\n id: \"<value>\",\n metadata: {\n \"key\": \"<value>\",\n },\n slug: \"<value>\",\n name: \"<value>\",\n organizationId: \"<value>\",\n properties: {},\n },\n order: 722899,\n required: true,\n },\n ],\n },\n price: {\n createdAt: new Date(\"2023-10-27T13:26:08.325Z\"),\n modifiedAt: new Date(\"2025-08-04T08:26:05.471Z\"),\n id: \"<value>\",\n isArchived: false,\n productId: \"<value>\",\n recurringInterval: \"month\",\n },\n discount: {\n duration: \"forever\",\n durationInMonths: 430541,\n type: \"fixed\",\n basisPoints: 609664,\n createdAt: new Date(\"2025-06-05T02:50:38.815Z\"),\n modifiedAt: new Date(\"2025-02-01T19:29:19.952Z\"),\n id: \"<value>\",\n metadata: {\n \"key\": 817419,\n \"key1\": 247251,\n },\n name: \"<value>\",\n code: \"<value>\",\n startsAt: new Date(\"2024-05-29T08:36:46.000Z\"),\n endsAt: new Date(\"2025-10-18T20:11:55.955Z\"),\n maxRedemptions: 132079,\n redemptionsCount: 69009,\n organizationId: \"<value>\",\n },\n },\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["subscription.created"]["post"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar();\n\nasync function run() {\n const result = await polar.endpointsubscriptionCreatedPost({\n data: {\n createdAt: new Date(\"2024-07-03T01:29:40.920Z\"),\n modifiedAt: new Date(\"2023-02-20T03:35:25.500Z\"),\n id: \"<value>\",\n amount: 78980,\n currency: \"Dong\",\n recurringInterval: \"month\",\n status: \"incomplete_expired\",\n currentPeriodStart: new Date(\"2025-01-25T02:46:12.208Z\"),\n currentPeriodEnd: new Date(\"2023-10-08T16:07:22.449Z\"),\n cancelAtPeriodEnd: false,\n canceledAt: new Date(\"2025-10-17T20:21:29.819Z\"),\n startedAt: new Date(\"2023-02-26T17:52:17.099Z\"),\n endsAt: new Date(\"2023-07-04T19:46:53.033Z\"),\n endedAt: new Date(\"2023-09-06T09:33:34.348Z\"),\n customerId: \"<value>\",\n productId: \"<value>\",\n priceId: \"<value>\",\n discountId: \"<value>\",\n checkoutId: \"<value>\",\n customerCancellationReason: \"unused\",\n customerCancellationComment: \"<value>\",\n metadata: {\n \"key\": \"<value>\",\n \"key1\": 229409,\n },\n customer: {\n createdAt: new Date(\"2023-04-01T11:22:10.531Z\"),\n modifiedAt: new Date(\"2024-06-26T00:08:47.301Z\"),\n id: \"<value>\",\n metadata: {\n \"key\": true,\n },\n externalId: \"<id>\",\n email: \"[email protected]\",\n emailVerified: false,\n name: \"<value>\",\n billingAddress: {\n country: \"Bhutan\",\n },\n taxId: [\n \"il_vat\",\n ],\n organizationId: \"<value>\",\n avatarUrl: \"https://tense-convection.net/\",\n },\n userId: \"<value>\",\n user: {\n id: \"<value>\",\n email: \"[email protected]\",\n publicName: \"<value>\",\n },\n product: {\n createdAt: new Date(\"2023-03-19T22:51:30.621Z\"),\n modifiedAt: new Date(\"2025-04-17T16:08:26.249Z\"),\n id: \"<value>\",\n name: \"<value>\",\n description: \"twine deed um on sudden\",\n recurringInterval: \"month\",\n isRecurring: false,\n isArchived: true,\n organizationId: \"<value>\",\n metadata: {\n \"key\": \"<value>\",\n },\n prices: [\n {\n createdAt: new Date(\"2023-03-28T13:29:27.613Z\"),\n modifiedAt: new Date(\"2025-10-05T17:53:50.261Z\"),\n id: \"<value>\",\n isArchived: false,\n productId: \"<value>\",\n type: \"one_time\",\n recurringInterval: \"month\",\n priceCurrency: \"<value>\",\n priceAmount: 688974,\n },\n {\n createdAt: new Date(\"2025-10-17T20:21:29.819Z\"),\n modifiedAt: new Date(\"2023-02-26T17:52:17.099Z\"),\n id: \"<value>\",\n isArchived: false,\n productId: \"<value>\",\n recurringInterval: \"month\",\n },\n ],\n benefits: [\n {\n createdAt: new Date(\"2025-05-17T19:46:56.602Z\"),\n modifiedAt: new Date(\"2025-03-19T21:12:06.131Z\"),\n id: \"<value>\",\n description: \"huff wherever gosh bah\",\n selectable: false,\n deletable: false,\n organizationId: \"<value>\",\n properties: {\n note: \"<value>\",\n },\n isTaxApplicable: false,\n },\n {\n createdAt: new Date(\"2024-09-19T06:46:41.784Z\"),\n modifiedAt: new Date(\"2023-03-19T22:51:30.621Z\"),\n id: \"<value>\",\n description: \"empty although fax phooey perfumed parody gah requite unfreeze\",\n selectable: false,\n deletable: false,\n organizationId: \"<value>\",\n properties: {\n imageHeight: 400,\n imageWidth: 400,\n },\n },\n ],\n medias: [\n {\n id: \"<value>\",\n organizationId: \"<value>\",\n name: \"<value>\",\n path: \"/usr/share\",\n mimeType: \"<value>\",\n size: 586409,\n storageVersion: \"<value>\",\n checksumEtag: \"<value>\",\n checksumSha256Base64: \"<value>\",\n checksumSha256Hex: \"<value>\",\n lastModifiedAt: new Date(\"2023-08-31T15:18:05.996Z\"),\n version: \"<value>\",\n isUploaded: false,\n createdAt: new Date(\"2024-01-15T17:54:00.133Z\"),\n sizeReadable: \"<value>\",\n publicUrl: \"https://moist-hydrocarbon.info/\",\n },\n {\n id: \"<value>\",\n organizationId: \"<value>\",\n name: \"<value>\",\n path: \"/etc/defaults\",\n mimeType: \"<value>\",\n size: 914697,\n storageVersion: \"<value>\",\n checksumEtag: \"<value>\",\n checksumSha256Base64: \"<value>\",\n checksumSha256Hex: \"<value>\",\n lastModifiedAt: new Date(\"2023-07-03T04:55:47.377Z\"),\n version: \"<value>\",\n isUploaded: true,\n createdAt: new Date(\"2023-03-13T02:22:01.631Z\"),\n sizeReadable: \"<value>\",\n publicUrl: \"https://stormy-sock.net\",\n },\n {\n id: \"<value>\",\n organizationId: \"<value>\",\n name: \"<value>\",\n path: \"/lib\",\n mimeType: \"<value>\",\n size: 179605,\n storageVersion: \"<value>\",\n checksumEtag: \"<value>\",\n checksumSha256Base64: \"<value>\",\n checksumSha256Hex: \"<value>\",\n lastModifiedAt: new Date(\"2024-05-17T17:16:41.803Z\"),\n version: \"<value>\",\n isUploaded: true,\n createdAt: new Date(\"2025-06-21T23:06:39.354Z\"),\n sizeReadable: \"<value>\",\n publicUrl: \"https://animated-vicinity.info/\",\n },\n ],\n attachedCustomFields: [\n {\n customFieldId: \"<value>\",\n customField: {\n createdAt: new Date(\"2023-01-05T10:41:20.531Z\"),\n modifiedAt: new Date(\"2023-08-11T17:49:31.404Z\"),\n id: \"<value>\",\n metadata: {\n \"key\": \"<value>\",\n },\n slug: \"<value>\",\n name: \"<value>\",\n organizationId: \"<value>\",\n properties: {},\n },\n order: 388741,\n required: true,\n },\n {\n customFieldId: \"<value>\",\n customField: {\n createdAt: new Date(\"2023-03-30T15:12:32.248Z\"),\n modifiedAt: new Date(\"2025-11-18T22:23:40.707Z\"),\n id: \"<value>\",\n metadata: {\n \"key\": false,\n },\n slug: \"<value>\",\n name: \"<value>\",\n organizationId: \"<value>\",\n properties: {},\n },\n order: 287379,\n required: false,\n },\n ],\n },\n price: {\n createdAt: new Date(\"2023-11-27T13:44:20.258Z\"),\n modifiedAt: new Date(\"2025-03-12T04:23:07.414Z\"),\n id: \"<value>\",\n isArchived: false,\n productId: \"<value>\",\n type: \"recurring\",\n recurringInterval: \"year\",\n },\n discount: {\n duration: \"forever\",\n durationInMonths: 181099,\n type: \"percentage\",\n basisPoints: 476081,\n createdAt: new Date(\"2024-08-19T11:00:20.002Z\"),\n modifiedAt: new Date(\"2025-01-01T07:02:24.223Z\"),\n id: \"<value>\",\n metadata: {\n\n },\n name: \"<value>\",\n code: \"<value>\",\n startsAt: new Date(\"2025-07-01T06:15:52.967Z\"),\n endsAt: new Date(\"2025-03-29T17:45:51.057Z\"),\n maxRedemptions: 700007,\n redemptionsCount: 24340,\n organizationId: \"<value>\",\n },\n },\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["subscription.revoked"]["post"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar();\n\nasync function run() {\n const result = await polar.endpointsubscriptionRevokedPost({\n data: {\n createdAt: new Date(\"2025-11-29T12:00:55.925Z\"),\n modifiedAt: new Date(\"2023-03-13T04:36:55.320Z\"),\n id: \"<value>\",\n amount: 780683,\n currency: \"CFP Franc\",\n recurringInterval: \"year\",\n status: \"trialing\",\n currentPeriodStart: new Date(\"2023-06-20T05:55:42.170Z\"),\n currentPeriodEnd: new Date(\"2024-05-16T17:55:53.899Z\"),\n cancelAtPeriodEnd: true,\n canceledAt: new Date(\"2025-10-25T10:04:20.460Z\"),\n startedAt: new Date(\"2024-09-29T18:36:35.285Z\"),\n endsAt: new Date(\"2024-02-23T17:26:12.806Z\"),\n endedAt: new Date(\"2024-01-24T11:12:57.680Z\"),\n customerId: \"<value>\",\n productId: \"<value>\",\n priceId: \"<value>\",\n discountId: \"<value>\",\n checkoutId: \"<value>\",\n customerCancellationReason: \"too_expensive\",\n customerCancellationComment: \"<value>\",\n metadata: {\n\n },\n customer: {\n createdAt: new Date(\"2025-09-02T15:09:07.489Z\"),\n modifiedAt: new Date(\"2025-06-23T22:13:15.423Z\"),\n id: \"<value>\",\n metadata: {\n \"key\": \"<value>\",\n \"key1\": 182663,\n },\n externalId: \"<id>\",\n email: \"[email protected]\",\n emailVerified: false,\n name: \"<value>\",\n billingAddress: {\n country: \"Portugal\",\n },\n taxId: [\n\n ],\n organizationId: \"<value>\",\n avatarUrl: \"https://exotic-traffic.com/\",\n },\n userId: \"<value>\",\n user: {\n id: \"<value>\",\n email: \"[email protected]\",\n publicName: \"<value>\",\n },\n product: {\n createdAt: new Date(\"2024-10-17T20:35:01.045Z\"),\n modifiedAt: new Date(\"2025-05-01T17:14:35.906Z\"),\n id: \"<value>\",\n name: \"<value>\",\n description: \"scout second management whose underachieve weakly yippee\",\n recurringInterval: \"month\",\n isRecurring: false,\n isArchived: true,\n organizationId: \"<value>\",\n metadata: {\n \"key\": true,\n \"key1\": false,\n },\n prices: [\n {\n createdAt: new Date(\"2025-11-17T16:25:39.728Z\"),\n modifiedAt: new Date(\"2024-08-16T13:41:14.572Z\"),\n id: \"<value>\",\n isArchived: false,\n productId: \"<value>\",\n recurringInterval: \"month\",\n },\n ],\n benefits: [\n {\n createdAt: new Date(\"2024-05-16T17:55:53.899Z\"),\n modifiedAt: new Date(\"2024-06-24T17:28:30.971Z\"),\n id: \"<value>\",\n description: \"uh-huh that drab psst gee scout second management whose underachieve\",\n selectable: false,\n deletable: false,\n organizationId: \"<value>\",\n properties: {\n imageHeight: 400,\n imageWidth: 400,\n },\n },\n {\n createdAt: new Date(\"2025-04-09T17:12:00.943Z\"),\n modifiedAt: new Date(\"2024-07-26T22:37:48.771Z\"),\n id: \"<value>\",\n description: \"ridge reconsideration spirit tromp\",\n selectable: false,\n deletable: false,\n organizationId: \"<value>\",\n properties: {\n repositoryOwner: \"polarsource\",\n repositoryName: \"private_repo\",\n permission: \"pull\",\n },\n },\n ],\n medias: [\n\n ],\n attachedCustomFields: [\n {\n customFieldId: \"<value>\",\n customField: {\n createdAt: new Date(\"2023-12-15T15:35:52.203Z\"),\n modifiedAt: new Date(\"2023-07-22T04:02:13.353Z\"),\n id: \"<value>\",\n metadata: {\n \"key\": \"<value>\",\n },\n slug: \"<value>\",\n name: \"<value>\",\n organizationId: \"<value>\",\n properties: {},\n },\n order: 679852,\n required: true,\n },\n {\n customFieldId: \"<value>\",\n customField: {\n createdAt: new Date(\"2025-06-06T16:36:59.904Z\"),\n modifiedAt: new Date(\"2024-12-14T07:14:12.681Z\"),\n id: \"<value>\",\n metadata: {\n \"key\": \"<value>\",\n },\n slug: \"<value>\",\n name: \"<value>\",\n organizationId: \"<value>\",\n properties: {},\n },\n order: 63475,\n required: true,\n },\n {\n customFieldId: \"<value>\",\n customField: {\n createdAt: new Date(\"2024-10-25T16:43:54.572Z\"),\n modifiedAt: new Date(\"2023-06-30T10:25:57.370Z\"),\n id: \"<value>\",\n metadata: {\n \"key\": \"<value>\",\n },\n slug: \"<value>\",\n name: \"<value>\",\n organizationId: \"<value>\",\n properties: {},\n },\n order: 436843,\n required: true,\n },\n ],\n },\n price: {\n createdAt: new Date(\"2025-04-10T09:20:53.588Z\"),\n modifiedAt: new Date(\"2025-07-20T00:25:29.865Z\"),\n id: \"<value>\",\n isArchived: false,\n productId: \"<value>\",\n type: \"one_time\",\n recurringInterval: \"month\",\n priceCurrency: \"<value>\",\n minimumAmount: 374556,\n maximumAmount: 385209,\n presetAmount: 613688,\n },\n discount: {\n duration: \"forever\",\n type: \"fixed\",\n amount: 80847,\n currency: \"Leone\",\n createdAt: new Date(\"2024-10-04T15:58:28.010Z\"),\n modifiedAt: new Date(\"2023-10-23T10:13:26.881Z\"),\n id: \"<value>\",\n metadata: {\n \"key\": 156123,\n \"key1\": false,\n },\n name: \"<value>\",\n code: \"<value>\",\n startsAt: new Date(\"2024-01-03T19:38:21.378Z\"),\n endsAt: new Date(\"2023-06-25T15:31:04.595Z\"),\n maxRedemptions: 915224,\n redemptionsCount: 505961,\n organizationId: \"<value>\",\n },\n },\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["subscription.uncanceled"]["post"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar();\n\nasync function run() {\n const result = await polar.endpointsubscriptionUncanceledPost({\n data: {\n createdAt: new Date(\"2024-06-17T13:11:57.598Z\"),\n modifiedAt: new Date(\"2025-03-19T00:33:29.972Z\"),\n id: \"<value>\",\n amount: 243909,\n currency: \"Swiss Franc\",\n recurringInterval: \"month\",\n status: \"past_due\",\n currentPeriodStart: new Date(\"2025-04-10T22:53:35.005Z\"),\n currentPeriodEnd: new Date(\"2025-11-06T14:37:36.152Z\"),\n cancelAtPeriodEnd: false,\n canceledAt: new Date(\"2025-11-20T17:26:51.612Z\"),\n startedAt: new Date(\"2023-03-17T23:30:29.508Z\"),\n endsAt: new Date(\"2024-09-26T10:53:58.966Z\"),\n endedAt: new Date(\"2023-07-03T15:11:27.108Z\"),\n customerId: \"<value>\",\n productId: \"<value>\",\n priceId: \"<value>\",\n discountId: \"<value>\",\n checkoutId: \"<value>\",\n customerCancellationReason: \"low_quality\",\n customerCancellationComment: \"<value>\",\n metadata: {\n \"key\": 21399,\n \"key1\": \"<value>\",\n },\n customer: {\n createdAt: new Date(\"2023-12-13T17:38:34.053Z\"),\n modifiedAt: new Date(\"2025-01-30T22:08:30.455Z\"),\n id: \"<value>\",\n metadata: {\n\n },\n externalId: \"<id>\",\n email: \"[email protected]\",\n emailVerified: false,\n name: \"<value>\",\n billingAddress: {\n country: \"Bangladesh\",\n },\n taxId: [\n \"us_ein\",\n \"jp_trn\",\n \"ca_gst_hst\",\n ],\n organizationId: \"<value>\",\n avatarUrl: \"https://direct-ferret.org/\",\n },\n userId: \"<value>\",\n user: {\n id: \"<value>\",\n email: \"[email protected]\",\n publicName: \"<value>\",\n },\n product: {\n createdAt: new Date(\"2023-03-30T10:41:05.586Z\"),\n modifiedAt: new Date(\"2025-10-18T00:21:05.189Z\"),\n id: \"<value>\",\n name: \"<value>\",\n description: \"fully pepper hm jovially outside coal bah fax midst\",\n recurringInterval: \"year\",\n isRecurring: false,\n isArchived: true,\n organizationId: \"<value>\",\n metadata: {\n \"key\": true,\n \"key1\": 737248,\n \"key2\": \"<value>\",\n },\n prices: [\n\n ],\n benefits: [\n {\n createdAt: new Date(\"2023-07-07T10:48:19.585Z\"),\n modifiedAt: new Date(\"2024-03-27T14:57:46.256Z\"),\n id: \"<value>\",\n description: \"even record ick misappropriate toe grouchy tough why\",\n selectable: false,\n deletable: false,\n organizationId: \"<value>\",\n properties: {\n note: \"<value>\",\n },\n isTaxApplicable: false,\n },\n ],\n medias: [\n {\n id: \"<value>\",\n organizationId: \"<value>\",\n name: \"<value>\",\n path: \"/usr/src\",\n mimeType: \"<value>\",\n size: 297045,\n storageVersion: \"<value>\",\n checksumEtag: \"<value>\",\n checksumSha256Base64: \"<value>\",\n checksumSha256Hex: \"<value>\",\n lastModifiedAt: new Date(\"2023-10-31T23:41:23.146Z\"),\n version: \"<value>\",\n isUploaded: true,\n createdAt: new Date(\"2025-09-28T06:56:53.284Z\"),\n sizeReadable: \"<value>\",\n publicUrl: \"https://quarrelsome-cauliflower.com/\",\n },\n {\n id: \"<value>\",\n organizationId: \"<value>\",\n name: \"<value>\",\n path: \"/var/spool\",\n mimeType: \"<value>\",\n size: 364012,\n storageVersion: \"<value>\",\n checksumEtag: \"<value>\",\n checksumSha256Base64: \"<value>\",\n checksumSha256Hex: \"<value>\",\n lastModifiedAt: new Date(\"2023-12-04T23:56:43.538Z\"),\n version: \"<value>\",\n isUploaded: true,\n createdAt: new Date(\"2023-05-30T06:21:31.559Z\"),\n sizeReadable: \"<value>\",\n publicUrl: \"https://illiterate-airline.org/\",\n },\n {\n id: \"<value>\",\n organizationId: \"<value>\",\n name: \"<value>\",\n path: \"/usr/include\",\n mimeType: \"<value>\",\n size: 597598,\n storageVersion: \"<value>\",\n checksumEtag: \"<value>\",\n checksumSha256Base64: \"<value>\",\n checksumSha256Hex: \"<value>\",\n lastModifiedAt: new Date(\"2023-06-18T04:43:20.642Z\"),\n version: \"<value>\",\n isUploaded: true,\n createdAt: new Date(\"2023-04-29T23:28:30.708Z\"),\n sizeReadable: \"<value>\",\n publicUrl: \"https://ugly-unique.name\",\n },\n ],\n attachedCustomFields: [\n {\n customFieldId: \"<value>\",\n customField: {\n createdAt: new Date(\"2025-10-15T00:12:13.325Z\"),\n modifiedAt: new Date(\"2024-12-21T23:06:09.697Z\"),\n id: \"<value>\",\n metadata: {\n \"key\": \"<value>\",\n },\n slug: \"<value>\",\n name: \"<value>\",\n organizationId: \"<value>\",\n properties: {},\n },\n order: 756036,\n required: true,\n },\n {\n customFieldId: \"<value>\",\n customField: {\n createdAt: new Date(\"2025-10-24T08:25:56.079Z\"),\n modifiedAt: new Date(\"2023-09-30T20:08:09.304Z\"),\n id: \"<value>\",\n metadata: {\n \"key\": false,\n },\n slug: \"<value>\",\n name: \"<value>\",\n organizationId: \"<value>\",\n properties: {\n options: [\n {\n value: \"<value>\",\n label: \"<value>\",\n },\n ],\n },\n },\n order: 123447,\n required: true,\n },\n ],\n },\n price: {\n createdAt: new Date(\"2024-02-14T18:38:24.900Z\"),\n modifiedAt: new Date(\"2024-02-21T00:12:57.498Z\"),\n id: \"<value>\",\n isArchived: false,\n productId: \"<value>\",\n type: \"recurring\",\n recurringInterval: \"year\",\n priceCurrency: \"<value>\",\n minimumAmount: 258418,\n maximumAmount: 31232,\n presetAmount: 383685,\n },\n discount: {\n duration: \"once\",\n durationInMonths: 124703,\n type: \"fixed\",\n amount: 999504,\n currency: \"Kina\",\n createdAt: new Date(\"2025-06-23T01:13:00.462Z\"),\n modifiedAt: new Date(\"2023-12-24T01:11:49.705Z\"),\n id: \"<value>\",\n metadata: {\n \"key\": \"<value>\",\n \"key1\": \"<value>\",\n },\n name: \"<value>\",\n code: \"<value>\",\n startsAt: new Date(\"2025-11-14T22:48:21.529Z\"),\n endsAt: new Date(\"2023-01-05T01:25:46.479Z\"),\n maxRedemptions: 140123,\n redemptionsCount: 513004,\n organizationId: \"<value>\",\n },\n },\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["subscription.updated"]["post"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "Typescript (SDK)"
"source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar();\n\nasync function run() {\n const result = await polar.endpointsubscriptionUpdatedPost({\n data: {\n createdAt: new Date(\"2023-08-16T06:35:49.390Z\"),\n modifiedAt: new Date(\"2025-11-13T10:48:05.575Z\"),\n id: \"<value>\",\n amount: 299644,\n currency: \"Baht\",\n recurringInterval: \"year\",\n status: \"trialing\",\n currentPeriodStart: new Date(\"2025-10-06T07:01:55.000Z\"),\n currentPeriodEnd: new Date(\"2025-01-20T06:59:31.349Z\"),\n cancelAtPeriodEnd: false,\n canceledAt: new Date(\"2023-10-04T04:56:04.382Z\"),\n startedAt: new Date(\"2023-01-22T12:57:07.430Z\"),\n endsAt: new Date(\"2025-08-08T17:53:12.513Z\"),\n endedAt: new Date(\"2023-10-08T02:40:52.099Z\"),\n customerId: \"<value>\",\n productId: \"<value>\",\n priceId: \"<value>\",\n discountId: \"<value>\",\n checkoutId: \"<value>\",\n customerCancellationReason: \"too_expensive\",\n customerCancellationComment: \"<value>\",\n metadata: {\n \"key\": 394013,\n },\n customer: {\n createdAt: new Date(\"2025-09-14T04:37:19.722Z\"),\n modifiedAt: new Date(\"2025-03-24T00:03:13.207Z\"),\n id: \"<value>\",\n metadata: {\n \"key\": \"<value>\",\n \"key1\": true,\n \"key2\": 392900,\n },\n externalId: \"<id>\",\n email: \"[email protected]\",\n emailVerified: false,\n name: \"<value>\",\n billingAddress: {\n country: \"Sweden\",\n },\n taxId: [\n \"mx_rfc\",\n \"gb_vat\",\n \"<id>\",\n ],\n organizationId: \"<value>\",\n avatarUrl: \"https://worthy-place.biz\",\n },\n userId: \"<value>\",\n user: {\n id: \"<value>\",\n email: \"[email protected]\",\n publicName: \"<value>\",\n },\n product: {\n createdAt: new Date(\"2024-06-11T14:55:33.574Z\"),\n modifiedAt: new Date(\"2023-06-02T07:14:13.619Z\"),\n id: \"<value>\",\n name: \"<value>\",\n description: \"intent that yowza\",\n recurringInterval: \"month\",\n isRecurring: false,\n isArchived: false,\n organizationId: \"<value>\",\n metadata: {\n\n },\n prices: [\n {\n createdAt: new Date(\"2023-11-25T09:50:52.301Z\"),\n modifiedAt: new Date(\"2025-06-16T22:58:18.488Z\"),\n id: \"<value>\",\n isArchived: false,\n productId: \"<value>\",\n recurringInterval: \"year\",\n },\n {\n createdAt: new Date(\"2025-01-20T06:59:31.349Z\"),\n modifiedAt: new Date(\"2025-10-02T11:51:36.131Z\"),\n id: \"<value>\",\n isArchived: false,\n productId: \"<value>\",\n recurringInterval: \"month\",\n },\n {\n createdAt: new Date(\"2023-10-08T02:40:52.099Z\"),\n modifiedAt: new Date(\"2024-11-17T00:23:52.590Z\"),\n id: \"<value>\",\n isArchived: false,\n productId: \"<value>\",\n recurringInterval: \"month\",\n },\n ],\n benefits: [\n {\n createdAt: new Date(\"2024-03-07T20:06:27.705Z\"),\n modifiedAt: new Date(\"2025-09-14T04:37:19.722Z\"),\n id: \"<value>\",\n description: \"though ski freely really caption intent that yowza\",\n selectable: false,\n deletable: false,\n organizationId: \"<value>\",\n properties: {\n guildId: \"<id>\",\n roleId: \"<id>\",\n guildToken: \"<value>\",\n },\n },\n {\n createdAt: new Date(\"2025-02-15T13:33:22.624Z\"),\n modifiedAt: new Date(\"2024-10-23T16:11:02.880Z\"),\n id: \"<value>\",\n description: \"meanwhile unique shoddy whether\",\n selectable: false,\n deletable: false,\n organizationId: \"<value>\",\n properties: {\n imageHeight: 400,\n imageWidth: 400,\n },\n },\n ],\n medias: [\n {\n id: \"<value>\",\n organizationId: \"<value>\",\n name: \"<value>\",\n path: \"/etc/periodic\",\n mimeType: \"<value>\",\n size: 982857,\n storageVersion: \"<value>\",\n checksumEtag: \"<value>\",\n checksumSha256Base64: \"<value>\",\n checksumSha256Hex: \"<value>\",\n lastModifiedAt: new Date(\"2024-01-10T04:34:23.991Z\"),\n version: \"<value>\",\n isUploaded: true,\n createdAt: new Date(\"2023-09-24T05:10:51.411Z\"),\n sizeReadable: \"<value>\",\n publicUrl: \"https://gaseous-scorpion.net\",\n },\n {\n id: \"<value>\",\n organizationId: \"<value>\",\n name: \"<value>\",\n path: \"/bin\",\n mimeType: \"<value>\",\n size: 900741,\n storageVersion: \"<value>\",\n checksumEtag: \"<value>\",\n checksumSha256Base64: \"<value>\",\n checksumSha256Hex: \"<value>\",\n lastModifiedAt: new Date(\"2025-06-03T14:50:28.387Z\"),\n version: \"<value>\",\n isUploaded: true,\n createdAt: new Date(\"2025-03-17T21:34:29.382Z\"),\n sizeReadable: \"<value>\",\n publicUrl: \"https://fatal-adrenalin.org\",\n },\n {\n id: \"<value>\",\n organizationId: \"<value>\",\n name: \"<value>\",\n path: \"/private/tmp\",\n mimeType: \"<value>\",\n size: 964994,\n storageVersion: \"<value>\",\n checksumEtag: \"<value>\",\n checksumSha256Base64: \"<value>\",\n checksumSha256Hex: \"<value>\",\n lastModifiedAt: new Date(\"2024-08-02T02:45:10.380Z\"),\n version: \"<value>\",\n isUploaded: false,\n createdAt: new Date(\"2025-04-01T15:44:20.788Z\"),\n sizeReadable: \"<value>\",\n publicUrl: \"https://bruised-bid.net/\",\n },\n ],\n attachedCustomFields: [\n {\n customFieldId: \"<value>\",\n customField: {\n createdAt: new Date(\"2025-01-08T14:04:12.750Z\"),\n modifiedAt: new Date(\"2023-06-03T02:13:26.324Z\"),\n id: \"<value>\",\n metadata: {\n \"key\": false,\n },\n slug: \"<value>\",\n name: \"<value>\",\n organizationId: \"<value>\",\n properties: {},\n },\n order: 456613,\n required: true,\n },\n ],\n },\n price: {\n createdAt: new Date(\"2025-07-17T05:00:37.853Z\"),\n modifiedAt: new Date(\"2025-04-13T10:51:42.560Z\"),\n id: \"<value>\",\n isArchived: false,\n productId: \"<value>\",\n recurringInterval: \"year\",\n priceCurrency: \"<value>\",\n minimumAmount: 610711,\n maximumAmount: 874041,\n presetAmount: 276608,\n },\n discount: {\n duration: \"forever\",\n type: \"percentage\",\n basisPoints: 348833,\n createdAt: new Date(\"2025-01-17T18:55:09.118Z\"),\n modifiedAt: new Date(\"2023-08-24T20:25:51.621Z\"),\n id: \"<value>\",\n metadata: {\n \"key\": true,\n \"key1\": 865091,\n },\n name: \"<value>\",\n code: \"<value>\",\n startsAt: new Date(\"2023-06-05T09:14:00.691Z\"),\n endsAt: new Date(\"2025-02-12T07:29:32.508Z\"),\n maxRedemptions: 29535,\n redemptionsCount: 59919,\n organizationId: \"<value>\",\n },\n },\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"