-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathcodeSamples.yaml
731 lines (731 loc) · 141 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
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 page: 1,\n limit: 10,\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 page: 1,\n limit: 10,\n });\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 page: 1,\n limit: 10,\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 page: 1,\n limit: 10,\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/"]["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 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/custom/"]["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.custom.list({\n page: 1,\n limit: 10,\n });\n\n for await (const page of result) {\n // Handle the page\n console.log(page);\n }\n}\n\nrun();"
- target: $["paths"]["/v1/checkouts/custom/"]["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.custom.create({\n allowDiscountCodes: true,\n productId: \"<value>\",\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/checkouts/custom/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.custom.clientGet({\n clientSecret: \"<value>\",\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/checkouts/custom/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.custom.clientUpdate({\n clientSecret: \"<value>\",\n checkoutUpdatePublic: {},\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/checkouts/custom/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.custom.clientConfirm({\n clientSecret: \"<value>\",\n checkoutConfirmStripe: {},\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/checkouts/custom/{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.custom.get({\n id: \"<value>\",\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/checkouts/custom/{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.custom.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 page: 1,\n limit: 10,\n });\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 accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.customerPortal.benefitGrants.list({\n page: 1,\n limit: 10,\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 accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.customerPortal.benefitGrants.get({\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 accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.customerPortal.benefitGrants.update({\n id: \"<value>\",\n customerBenefitGrantUpdate: {},\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/v1/customer-portal/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.customerPortal.customers.get({\n id: \"<value>\",\n });\n\n // Handle the result\n console.log(result);\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 accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.customerPortal.downloadables.list({\n page: 1,\n limit: 10,\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 accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.customerPortal.licenseKeys.list({\n page: 1,\n limit: 10,\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 accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.customerPortal.licenseKeys.get({\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 accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.customerPortal.orders.list({\n page: 1,\n limit: 10,\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 accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.customerPortal.orders.get({\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 accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.customerPortal.orders.invoice({\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 accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.customerPortal.subscriptions.list({\n page: 1,\n limit: 10,\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 accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.customerPortal.subscriptions.cancel({\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 accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.customerPortal.subscriptions.get({\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 accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.customerPortal.subscriptions.update({\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 page: 1,\n limit: 10,\n });\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/{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 page: 1,\n limit: 10,\n });\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 currency: \"usd\",\n },\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 page: 1,\n limit: 10,\n });\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 page: 1,\n limit: 10,\n });\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 page: 1,\n limit: 10,\n });\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 usage: 0,\n },\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/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 page: 1,\n limit: 10,\n });\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 tokenEndpointAuthMethod: \"client_secret_post\",\n scope: \"openid profile email user:read organizations:read organizations:write custom_fields:read custom_fields:write discounts:read discounts:write checkout_links:read checkout_links:write checkouts:read checkouts:write products:read products:write benefits:read benefits:write events:read events:write files:read files:write subscriptions:read subscriptions:write customers:read customers:write customer_sessions:write orders:read refunds:read refunds:write metrics:read webhooks:read webhooks:write external_organizations:read license_keys:read license_keys:write repositories:read repositories:write issues:read issues:write customer_portal:read customer_portal:write\",\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 tokenEndpointAuthMethod: \"client_secret_post\",\n scope: \"openid profile email user:read organizations:read organizations:write custom_fields:read custom_fields:write discounts:read discounts:write checkout_links:read checkout_links:write checkouts:read checkouts:write products:read products:write benefits:read benefits:write events:read events:write files:read files:write subscriptions:read subscriptions:write customers:read customers:write customer_sessions:write orders:read refunds:read refunds:write metrics:read webhooks:read webhooks:write external_organizations:read license_keys:read license_keys:write repositories:read repositories:write issues:read issues:write customer_portal:read customer_portal:write\",\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 page: 1,\n limit: 10,\n });\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 page: 1,\n limit: 10,\n });\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 pledgeBadgeShowAmount: false,\n pledgeMinimumAmount: 2000,\n },\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 page: 1,\n limit: 10,\n });\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 prices: [\n {\n recurringInterval: \"month\",\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 page: 1,\n limit: 10,\n });\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 revokeBenefits: false,\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 page: 1,\n limit: 10,\n });\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 page: 1,\n limit: 10,\n });\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 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 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 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 product: {\n createdAt: new Date(\"2024-11-17T19:11:13.132Z\"),\n modifiedAt: new Date(\"2024-02-27T04:46:39.621Z\"),\n id: \"<value>\",\n name: \"<value>\",\n description: \"border opposite overload interior shady\",\n isRecurring: false,\n isArchived: true,\n organizationId: \"<value>\",\n prices: [\n\n ],\n benefits: [\n {\n createdAt: new Date(\"2025-08-24T18:28:03.144Z\"),\n modifiedAt: new Date(\"2023-10-21T11:52:11.842Z\"),\n id: \"<value>\",\n type: \"ads\",\n description: \"certainly these restfully geez who countess happily gym\",\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: \"/private/tmp\",\n mimeType: \"<value>\",\n size: 486328,\n storageVersion: \"<value>\",\n checksumEtag: \"<value>\",\n checksumSha256Base64: \"<value>\",\n checksumSha256Hex: \"<value>\",\n lastModifiedAt: new Date(\"2023-09-26T17:28:00.673Z\"),\n version: \"<value>\",\n isUploaded: true,\n createdAt: new Date(\"2025-05-06T18:54:29.001Z\"),\n sizeReadable: \"<value>\",\n publicUrl: \"https://forsaken-underpants.biz\",\n },\n {\n id: \"<value>\",\n organizationId: \"<value>\",\n name: \"<value>\",\n path: \"/Users\",\n mimeType: \"<value>\",\n size: 796127,\n storageVersion: \"<value>\",\n checksumEtag: \"<value>\",\n checksumSha256Base64: \"<value>\",\n checksumSha256Hex: \"<value>\",\n lastModifiedAt: new Date(\"2023-09-05T18:42:07.313Z\"),\n version: \"<value>\",\n isUploaded: false,\n createdAt: new Date(\"2025-10-05T11:55:07.194Z\"),\n sizeReadable: \"<value>\",\n publicUrl: \"https://quick-witted-markup.org/\",\n },\n ],\n },\n productPrice: {\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 priceCurrency: \"<value>\",\n minimumAmount: 363560,\n maximumAmount: 75876,\n presetAmount: 82334,\n },\n discount: {\n duration: \"repeating\",\n type: \"percentage\",\n basisPoints: 416143,\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(\"2024-06-03T08:42:54.736Z\"),\n modifiedAt: new Date(\"2025-02-14T09:22:19.644Z\"),\n id: \"<value>\",\n metadata: {\n \"key\": \"<value>\",\n },\n slug: \"<value>\",\n name: \"<value>\",\n organizationId: \"<value>\",\n properties: {},\n },\n order: 169862,\n required: true,\n },\n {\n customFieldId: \"<value>\",\n customField: {\n createdAt: new Date(\"2025-11-21T05:56:48.487Z\"),\n modifiedAt: new Date(\"2023-01-08T00:22:16.025Z\"),\n id: \"<value>\",\n metadata: {\n \"key\": 648726,\n },\n slug: \"<value>\",\n name: \"<value>\",\n organizationId: \"<value>\",\n properties: {},\n },\n order: 918364,\n required: true,\n },\n {\n customFieldId: \"<value>\",\n customField: {\n createdAt: new Date(\"2024-04-28T23:39:10.699Z\"),\n modifiedAt: new Date(\"2025-04-20T22:18:45.464Z\"),\n id: \"<value>\",\n metadata: {\n \"key\": 500372,\n },\n slug: \"<value>\",\n name: \"<value>\",\n organizationId: \"<value>\",\n properties: {},\n },\n order: 187532,\n required: true,\n },\n ],\n customerMetadata: {\n \"key\": \"<value>\",\n \"key1\": 790078,\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 product: {\n createdAt: new Date(\"2025-04-04T09:36:58.685Z\"),\n modifiedAt: new Date(\"2024-03-12T12:25:44.387Z\"),\n id: \"<value>\",\n name: \"<value>\",\n description: \"immediately times palatable controvert upon vicinity\",\n isRecurring: false,\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 priceCurrency: \"<value>\",\n minimumAmount: 789773,\n maximumAmount: 108579,\n presetAmount: 316079,\n },\n {\n createdAt: new Date(\"2024-10-28T13:46:29.597Z\"),\n modifiedAt: new Date(\"2024-05-15T07:46:47.748Z\"),\n id: \"<value>\",\n isArchived: false,\n productId: \"<value>\",\n priceCurrency: \"<value>\",\n priceAmount: 585155,\n },\n {\n createdAt: new Date(\"2024-11-05T16:13:01.569Z\"),\n modifiedAt: new Date(\"2023-01-27T22:45:20.202Z\"),\n id: \"<value>\",\n isArchived: false,\n productId: \"<value>\",\n priceCurrency: \"<value>\",\n minimumAmount: 447013,\n maximumAmount: 371362,\n presetAmount: 431603,\n recurringInterval: \"month\",\n },\n ],\n benefits: [\n\n ],\n medias: [\n {\n id: \"<value>\",\n organizationId: \"<value>\",\n name: \"<value>\",\n path: \"/root\",\n mimeType: \"<value>\",\n size: 819163,\n storageVersion: \"<value>\",\n checksumEtag: \"<value>\",\n checksumSha256Base64: \"<value>\",\n checksumSha256Hex: \"<value>\",\n lastModifiedAt: new Date(\"2025-07-07T07:29:52.938Z\"),\n version: \"<value>\",\n isUploaded: true,\n createdAt: new Date(\"2024-10-03T20:56:21.950Z\"),\n sizeReadable: \"<value>\",\n publicUrl: \"https://scratchy-making.com/\",\n },\n ],\n },\n productPrice: {\n createdAt: new Date(\"2023-09-05T19:01:42.068Z\"),\n modifiedAt: new Date(\"2025-12-27T00:33:20.973Z\"),\n id: \"<value>\",\n isArchived: false,\n productId: \"<value>\",\n priceCurrency: \"<value>\",\n minimumAmount: 461061,\n maximumAmount: 134244,\n presetAmount: 752191,\n },\n discount: {\n duration: \"repeating\",\n durationInMonths: 583437,\n type: \"fixed\",\n amount: 176064,\n currency: \"Iranian Rial\",\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(\"2024-03-10T17:45:08.857Z\"),\n modifiedAt: new Date(\"2025-08-21T20:24:37.634Z\"),\n id: \"<value>\",\n metadata: {\n \"key\": 174874,\n },\n slug: \"<value>\",\n name: \"<value>\",\n organizationId: \"<value>\",\n properties: {},\n },\n order: 679898,\n required: true,\n },\n ],\n customerMetadata: {\n \"key\": false,\n \"key1\": 385454,\n \"key2\": false,\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 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 isRecurring: true,\n isArchived: true,\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 priceCurrency: \"<value>\",\n minimumAmount: 196366,\n maximumAmount: 485666,\n presetAmount: 81588,\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 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 isRecurring: false,\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: \"once\",\n durationInMonths: 394868,\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 issueFundingEnabled: false,\n },\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 issueFundingEnabled: false,\n },\n subscriptionSettings: {\n allowMultipleSubscriptions: true,\n allowCustomerUpdates: true,\n prorationBehavior: \"invoice\",\n },\n },\n },\n pledgeBadgeCurrentlyEmbedded: false,\n },\n authedCanAdminSender: false,\n authedCanAdminReceived: false,\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 issueFundingEnabled: false,\n },\n subscriptionSettings: {\n allowMultipleSubscriptions: false,\n allowCustomerUpdates: true,\n prorationBehavior: \"invoice\",\n },\n },\n },\n pledgeBadgeCurrentlyEmbedded: true,\n },\n authedCanAdminSender: false,\n authedCanAdminReceived: false,\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 isRecurring: true,\n isArchived: true,\n organizationId: \"<value>\",\n metadata: {\n\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 priceCurrency: \"<value>\",\n minimumAmount: 527608,\n maximumAmount: 32202,\n presetAmount: 66164,\n },\n ],\n benefits: [\n {\n createdAt: new Date(\"2023-08-11T12:50:57.278Z\"),\n modifiedAt: new Date(\"2023-03-26T05:55:13.113Z\"),\n id: \"<value>\",\n description: \"tromp these near throughout shear\",\n selectable: false,\n deletable: false,\n organizationId: \"<value>\",\n properties: {\n note: \"<value>\",\n },\n isTaxApplicable: false,\n },\n {\n createdAt: new Date(\"2025-05-03T09:49:30.012Z\"),\n modifiedAt: new Date(\"2025-02-19T10:03:27.777Z\"),\n id: \"<value>\",\n description: \"creature think tuber best\",\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(\"2024-04-17T11:46:21.794Z\"),\n modifiedAt: new Date(\"2023-04-09T12:26:58.282Z\"),\n id: \"<value>\",\n description: \"massage super even\",\n selectable: false,\n deletable: false,\n organizationId: \"<value>\",\n properties: {\n prefix: \"<value>\",\n expires: {\n ttl: 935647,\n timeframe: \"month\",\n },\n activations: {\n limit: 136136,\n enableCustomerAdmin: false,\n },\n limitUsage: 923812,\n },\n },\n ],\n medias: [\n {\n id: \"<value>\",\n organizationId: \"<value>\",\n name: \"<value>\",\n path: \"/Users\",\n mimeType: \"<value>\",\n size: 692895,\n storageVersion: \"<value>\",\n checksumEtag: \"<value>\",\n checksumSha256Base64: \"<value>\",\n checksumSha256Hex: \"<value>\",\n lastModifiedAt: new Date(\"2023-02-28T01:03:14.537Z\"),\n version: \"<value>\",\n isUploaded: true,\n createdAt: new Date(\"2023-06-03T00:39:20.038Z\"),\n sizeReadable: \"<value>\",\n publicUrl: \"https://monstrous-cop-out.net\",\n },\n {\n id: \"<value>\",\n organizationId: \"<value>\",\n name: \"<value>\",\n path: \"/var/mail\",\n mimeType: \"<value>\",\n size: 843323,\n storageVersion: \"<value>\",\n checksumEtag: \"<value>\",\n checksumSha256Base64: \"<value>\",\n checksumSha256Hex: \"<value>\",\n lastModifiedAt: new Date(\"2023-04-23T21:31:25.476Z\"),\n version: \"<value>\",\n isUploaded: true,\n createdAt: new Date(\"2023-07-19T01:29:35.587Z\"),\n sizeReadable: \"<value>\",\n publicUrl: \"https://well-made-farm.com\",\n },\n {\n id: \"<value>\",\n organizationId: \"<value>\",\n name: \"<value>\",\n path: \"/root\",\n mimeType: \"<value>\",\n size: 849549,\n storageVersion: \"<value>\",\n checksumEtag: \"<value>\",\n checksumSha256Base64: \"<value>\",\n checksumSha256Hex: \"<value>\",\n lastModifiedAt: new Date(\"2023-07-30T13:09:33.963Z\"),\n version: \"<value>\",\n isUploaded: false,\n createdAt: new Date(\"2024-10-02T20:39:40.444Z\"),\n sizeReadable: \"<value>\",\n publicUrl: \"https://simplistic-devastation.com\",\n },\n ],\n attachedCustomFields: [\n {\n customFieldId: \"<value>\",\n customField: {\n createdAt: new Date(\"2023-03-24T09:30:48.572Z\"),\n modifiedAt: new Date(\"2023-02-09T00:26:32.257Z\"),\n id: \"<value>\",\n metadata: {\n \"key\": 657365,\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: 317196,\n required: false,\n },\n {\n customFieldId: \"<value>\",\n customField: {\n createdAt: new Date(\"2023-11-16T07:29:59.811Z\"),\n modifiedAt: new Date(\"2023-04-09T18:35:32.219Z\"),\n id: \"<value>\",\n metadata: {\n \"key\": \"<value>\",\n },\n slug: \"<value>\",\n name: \"<value>\",\n organizationId: \"<value>\",\n properties: {},\n },\n order: 492053,\n required: true,\n },\n {\n customFieldId: \"<value>\",\n customField: {\n createdAt: new Date(\"2023-03-07T07:24:39.165Z\"),\n modifiedAt: new Date(\"2025-01-25T07:31:37.106Z\"),\n id: \"<value>\",\n metadata: {\n \"key\": false,\n },\n slug: \"<value>\",\n name: \"<value>\",\n organizationId: \"<value>\",\n properties: {},\n },\n order: 17631,\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 isRecurring: true,\n isArchived: false,\n organizationId: \"<value>\",\n metadata: {\n\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 priceCurrency: \"<value>\",\n priceAmount: 320395,\n recurringInterval: \"month\",\n },\n ],\n benefits: [\n {\n createdAt: new Date(\"2023-06-01T01:28:53.091Z\"),\n modifiedAt: new Date(\"2024-02-29T01:53:23.154Z\"),\n id: \"<value>\",\n description: \"ick birdcage manage shark along always modulo fidget inside lightly\",\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(\"2024-02-12T19:04:33.442Z\"),\n modifiedAt: new Date(\"2024-03-30T22:30:29.668Z\"),\n id: \"<value>\",\n description: \"lotion role till by yuck terribly\",\n selectable: false,\n deletable: false,\n organizationId: \"<value>\",\n properties: {\n repositoryOwner: \"polarsource\",\n repositoryName: \"private_repo\",\n permission: \"maintain\",\n },\n },\n {\n createdAt: new Date(\"2023-05-05T14:08:08.545Z\"),\n modifiedAt: new Date(\"2023-10-20T01:25:33.770Z\"),\n id: \"<value>\",\n description: \"minor aha boohoo team\",\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-06-15T22:09:06.445Z\"),\n modifiedAt: new Date(\"2023-12-22T05:20:03.719Z\"),\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: 19557,\n required: true,\n },\n {\n customFieldId: \"<value>\",\n customField: {\n createdAt: new Date(\"2024-07-04T15:56:03.523Z\"),\n modifiedAt: new Date(\"2023-10-16T15:48:47.192Z\"),\n id: \"<value>\",\n metadata: {\n \"key\": \"<value>\",\n },\n slug: \"<value>\",\n name: \"<value>\",\n organizationId: \"<value>\",\n properties: {},\n },\n order: 753420,\n required: true,\n },\n {\n customFieldId: \"<value>\",\n customField: {\n createdAt: new Date(\"2023-10-31T20:54:51.973Z\"),\n modifiedAt: new Date(\"2025-06-25T07:43:21.903Z\"),\n id: \"<value>\",\n metadata: {\n \"key\": false,\n },\n slug: \"<value>\",\n name: \"<value>\",\n organizationId: \"<value>\",\n properties: {},\n },\n order: 454407,\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 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 isRecurring: false,\n isArchived: false,\n organizationId: \"<value>\",\n metadata: {\n\n },\n prices: [\n {\n createdAt: new Date(\"2023-05-08T23:16:06.519Z\"),\n modifiedAt: new Date(\"2023-12-23T21:06:29.057Z\"),\n id: \"<value>\",\n isArchived: false,\n productId: \"<value>\",\n recurringInterval: \"month\",\n },\n ],\n benefits: [\n {\n createdAt: new Date(\"2023-08-25T00:14:50.252Z\"),\n modifiedAt: new Date(\"2023-12-10T18:25:01.577Z\"),\n id: \"<value>\",\n description: \"repeat catalyst wiggly table while amidst during\",\n selectable: false,\n deletable: false,\n organizationId: \"<value>\",\n properties: {},\n },\n {\n createdAt: new Date(\"2023-06-02T05:19:01.352Z\"),\n modifiedAt: new Date(\"2023-07-07T22:15:53.860Z\"),\n id: \"<value>\",\n description: \"until below barring\",\n selectable: false,\n deletable: false,\n organizationId: \"<value>\",\n properties: {},\n },\n ],\n medias: [\n {\n id: \"<value>\",\n organizationId: \"<value>\",\n name: \"<value>\",\n path: \"/media\",\n mimeType: \"<value>\",\n size: 931655,\n storageVersion: \"<value>\",\n checksumEtag: \"<value>\",\n checksumSha256Base64: \"<value>\",\n checksumSha256Hex: \"<value>\",\n lastModifiedAt: new Date(\"2023-06-07T17:40:48.757Z\"),\n version: \"<value>\",\n isUploaded: false,\n createdAt: new Date(\"2024-07-27T18:04:02.928Z\"),\n sizeReadable: \"<value>\",\n publicUrl: \"https://remorseful-hamburger.name\",\n },\n ],\n attachedCustomFields: [\n {\n customFieldId: \"<value>\",\n customField: {\n createdAt: new Date(\"2024-03-04T01:17:37.967Z\"),\n modifiedAt: new Date(\"2023-06-12T20:00:04.431Z\"),\n id: \"<value>\",\n metadata: {\n \"key\": \"<value>\",\n },\n slug: \"<value>\",\n name: \"<value>\",\n organizationId: \"<value>\",\n properties: {},\n },\n order: 769742,\n required: false,\n },\n {\n customFieldId: \"<value>\",\n customField: {\n createdAt: new Date(\"2023-06-14T23:00:03.799Z\"),\n modifiedAt: new Date(\"2024-02-09T05:47:51.810Z\"),\n id: \"<value>\",\n metadata: {\n \"key\": \"<value>\",\n },\n slug: \"<value>\",\n name: \"<value>\",\n organizationId: \"<value>\",\n properties: {},\n },\n order: 61975,\n required: false,\n },\n {\n customFieldId: \"<value>\",\n customField: {\n createdAt: new Date(\"2025-02-15T09:26:15.001Z\"),\n modifiedAt: new Date(\"2025-12-17T07:08:38.057Z\"),\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: 531803,\n required: true,\n },\n ],\n },\n price: {\n createdAt: new Date(\"2025-09-06T01:15:07.788Z\"),\n modifiedAt: new Date(\"2024-06-24T14:24:29.896Z\"),\n id: \"<value>\",\n isArchived: false,\n productId: \"<value>\",\n priceCurrency: \"<value>\",\n minimumAmount: 135533,\n maximumAmount: 811194,\n presetAmount: 58418,\n recurringInterval: \"month\",\n },\n discount: {\n duration: \"repeating\",\n type: \"percentage\",\n basisPoints: 722311,\n createdAt: new Date(\"2025-09-04T07:15:12.730Z\"),\n modifiedAt: new Date(\"2025-10-06T11:12:50.335Z\"),\n id: \"<value>\",\n metadata: {\n \"key\": \"<value>\",\n },\n name: \"<value>\",\n code: \"<value>\",\n startsAt: new Date(\"2025-11-16T18:30:55.860Z\"),\n endsAt: new Date(\"2025-02-08T03:34:15.957Z\"),\n maxRedemptions: 692583,\n redemptionsCount: 78638,\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 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 isRecurring: false,\n isArchived: false,\n organizationId: \"<value>\",\n metadata: {\n \"key\": \"<value>\",\n \"key1\": 62716,\n \"key2\": 45973,\n },\n prices: [\n {\n createdAt: new Date(\"2024-04-19T18:43:33.089Z\"),\n modifiedAt: new Date(\"2025-05-30T17:50:59.070Z\"),\n id: \"<value>\",\n isArchived: false,\n productId: \"<value>\",\n priceCurrency: \"<value>\",\n priceAmount: 886856,\n recurringInterval: \"month\",\n },\n {\n createdAt: new Date(\"2024-10-31T08:13:37.012Z\"),\n modifiedAt: new Date(\"2023-08-22T21:50:14.399Z\"),\n id: \"<value>\",\n isArchived: false,\n productId: \"<value>\",\n priceCurrency: \"<value>\",\n priceAmount: 176860,\n },\n {\n createdAt: new Date(\"2023-10-29T03:39:59.256Z\"),\n modifiedAt: new Date(\"2023-02-12T13:18:53.912Z\"),\n id: \"<value>\",\n isArchived: false,\n productId: \"<value>\",\n },\n ],\n benefits: [\n\n ],\n medias: [\n {\n id: \"<value>\",\n organizationId: \"<value>\",\n name: \"<value>\",\n path: \"/root\",\n mimeType: \"<value>\",\n size: 856792,\n storageVersion: \"<value>\",\n checksumEtag: \"<value>\",\n checksumSha256Base64: \"<value>\",\n checksumSha256Hex: \"<value>\",\n lastModifiedAt: new Date(\"2023-05-15T05:51:11.123Z\"),\n version: \"<value>\",\n isUploaded: true,\n createdAt: new Date(\"2023-10-19T06:08:48.337Z\"),\n sizeReadable: \"<value>\",\n publicUrl: \"https://delirious-stir-fry.name\",\n },\n {\n id: \"<value>\",\n organizationId: \"<value>\",\n name: \"<value>\",\n path: \"/mnt\",\n mimeType: \"<value>\",\n size: 683673,\n storageVersion: \"<value>\",\n checksumEtag: \"<value>\",\n checksumSha256Base64: \"<value>\",\n checksumSha256Hex: \"<value>\",\n lastModifiedAt: new Date(\"2025-12-28T00:16:36.233Z\"),\n version: \"<value>\",\n isUploaded: true,\n createdAt: new Date(\"2024-07-03T23:27:48.693Z\"),\n sizeReadable: \"<value>\",\n publicUrl: \"https://self-reliant-comestible.org\",\n },\n ],\n attachedCustomFields: [\n {\n customFieldId: \"<value>\",\n customField: {\n createdAt: new Date(\"2023-08-07T09:34:29.827Z\"),\n modifiedAt: new Date(\"2023-12-04T19:57:16.999Z\"),\n id: \"<value>\",\n metadata: {\n \"key\": false,\n },\n slug: \"<value>\",\n name: \"<value>\",\n organizationId: \"<value>\",\n properties: {},\n },\n order: 765648,\n required: false,\n },\n ],\n },\n price: {\n createdAt: new Date(\"2023-10-15T15:32:03.593Z\"),\n modifiedAt: new Date(\"2025-04-21T09:16:25.153Z\"),\n id: \"<value>\",\n isArchived: false,\n productId: \"<value>\",\n priceCurrency: \"<value>\",\n minimumAmount: 441086,\n maximumAmount: 497112,\n presetAmount: 930361,\n recurringInterval: \"month\",\n },\n discount: {\n duration: \"repeating\",\n type: \"percentage\",\n amount: 140328,\n currency: \"South Sudanese pound\",\n createdAt: new Date(\"2023-12-03T23:14:09.199Z\"),\n modifiedAt: new Date(\"2024-06-07T18:12:37.600Z\"),\n id: \"<value>\",\n metadata: {\n \"key\": \"<value>\",\n \"key1\": true,\n \"key2\": \"<value>\",\n },\n name: \"<value>\",\n code: \"<value>\",\n startsAt: new Date(\"2024-05-29T10:02:42.701Z\"),\n endsAt: new Date(\"2024-08-22T17:07:21.257Z\"),\n maxRedemptions: 881551,\n redemptionsCount: 373541,\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 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 isRecurring: true,\n isArchived: false,\n organizationId: \"<value>\",\n metadata: {\n\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 priceCurrency: \"<value>\",\n priceAmount: 418755,\n },\n ],\n benefits: [\n {\n createdAt: new Date(\"2025-01-25T02:46:12.208Z\"),\n modifiedAt: new Date(\"2023-10-08T16:07:22.449Z\"),\n id: \"<value>\",\n description: \"boohoo huff wherever gosh bah who dimly sell\",\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: \"/sys\",\n mimeType: \"<value>\",\n size: 580222,\n storageVersion: \"<value>\",\n checksumEtag: \"<value>\",\n checksumSha256Base64: \"<value>\",\n checksumSha256Hex: \"<value>\",\n lastModifiedAt: new Date(\"2025-06-23T21:40:44.558Z\"),\n version: \"<value>\",\n isUploaded: true,\n createdAt: new Date(\"2024-07-20T01:51:58.643Z\"),\n sizeReadable: \"<value>\",\n publicUrl: \"https://dapper-marimba.com/\",\n },\n ],\n attachedCustomFields: [\n\n ],\n },\n price: {\n createdAt: new Date(\"2024-06-15T07:33:50.720Z\"),\n modifiedAt: new Date(\"2023-02-18T09:48:15.743Z\"),\n id: \"<value>\",\n isArchived: false,\n productId: \"<value>\",\n priceCurrency: \"<value>\",\n minimumAmount: 320944,\n maximumAmount: 985796,\n presetAmount: 865738,\n recurringInterval: \"month\",\n },\n discount: {\n duration: \"once\",\n durationInMonths: 25742,\n type: \"fixed\",\n basisPoints: 282087,\n createdAt: new Date(\"2023-09-03T18:06:19.881Z\"),\n modifiedAt: new Date(\"2025-08-27T08:53:33.064Z\"),\n id: \"<value>\",\n metadata: {\n \"key\": true,\n \"key1\": 866264,\n },\n name: \"<value>\",\n code: \"<value>\",\n startsAt: new Date(\"2025-02-24T22:18:59.471Z\"),\n endsAt: new Date(\"2024-11-25T15:12:50.077Z\"),\n maxRedemptions: 380280,\n redemptionsCount: 884322,\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 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 isRecurring: true,\n isArchived: false,\n organizationId: \"<value>\",\n metadata: {\n\n },\n prices: [\n {\n createdAt: new Date(\"2025-05-05T15:05:02.863Z\"),\n modifiedAt: new Date(\"2025-11-17T16:25:39.728Z\"),\n id: \"<value>\",\n isArchived: false,\n productId: \"<value>\",\n priceCurrency: \"<value>\",\n priceAmount: 541579,\n },\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 isArchived: false,\n productId: \"<value>\",\n priceCurrency: \"<value>\",\n priceAmount: 938340,\n recurringInterval: \"year\",\n },\n ],\n benefits: [\n {\n createdAt: new Date(\"2024-01-24T11:12:57.680Z\"),\n modifiedAt: new Date(\"2025-03-01T18:01:54.717Z\"),\n id: \"<value>\",\n description: \"than supposing ready powerfully\",\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(\"2024-11-11T08:35:43.186Z\"),\n modifiedAt: new Date(\"2024-02-16T16:26:12.752Z\"),\n id: \"<value>\",\n description: \"knavishly next unlike\",\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 createdAt: new Date(\"2025-07-16T07:46:09.918Z\"),\n modifiedAt: new Date(\"2023-01-13T13:36:34.460Z\"),\n id: \"<value>\",\n description: \"blowgun accidentally ick blah altruistic vaguely delirious when submissive desk\",\n selectable: false,\n deletable: false,\n organizationId: \"<value>\",\n properties: {\n prefix: \"<value>\",\n expires: {\n ttl: 812657,\n timeframe: \"month\",\n },\n activations: {\n limit: 744460,\n enableCustomerAdmin: false,\n },\n limitUsage: 913032,\n },\n },\n ],\n medias: [\n {\n id: \"<value>\",\n organizationId: \"<value>\",\n name: \"<value>\",\n path: \"/usr/bin\",\n mimeType: \"<value>\",\n size: 406671,\n storageVersion: \"<value>\",\n checksumEtag: \"<value>\",\n checksumSha256Base64: \"<value>\",\n checksumSha256Hex: \"<value>\",\n lastModifiedAt: new Date(\"2025-03-28T05:43:23.560Z\"),\n version: \"<value>\",\n isUploaded: false,\n createdAt: new Date(\"2024-04-23T18:43:10.741Z\"),\n sizeReadable: \"<value>\",\n publicUrl: \"https://fragrant-appliance.name/\",\n },\n {\n id: \"<value>\",\n organizationId: \"<value>\",\n name: \"<value>\",\n path: \"/lost+found\",\n mimeType: \"<value>\",\n size: 76103,\n storageVersion: \"<value>\",\n checksumEtag: \"<value>\",\n checksumSha256Base64: \"<value>\",\n checksumSha256Hex: \"<value>\",\n lastModifiedAt: new Date(\"2024-01-01T17:02:54.395Z\"),\n version: \"<value>\",\n isUploaded: false,\n createdAt: new Date(\"2025-07-29T05:29:45.670Z\"),\n sizeReadable: \"<value>\",\n publicUrl: \"https://calculating-lieu.biz\",\n },\n ],\n attachedCustomFields: [\n\n ],\n },\n price: {\n createdAt: new Date(\"2025-10-29T20:43:04.701Z\"),\n modifiedAt: new Date(\"2023-10-09T19:55:20.541Z\"),\n id: \"<value>\",\n isArchived: false,\n productId: \"<value>\",\n priceCurrency: \"<value>\",\n priceAmount: 741310,\n recurringInterval: \"year\",\n },\n discount: {\n duration: \"repeating\",\n type: \"percentage\",\n amount: 335600,\n currency: \"Canadian Dollar\",\n createdAt: new Date(\"2025-09-30T02:02:28.275Z\"),\n modifiedAt: new Date(\"2024-07-08T12:48:11.186Z\"),\n id: \"<value>\",\n metadata: {\n \"key\": 223411,\n },\n name: \"<value>\",\n code: \"<value>\",\n startsAt: new Date(\"2023-12-25T03:14:41.345Z\"),\n endsAt: new Date(\"2025-02-16T03:38:52.727Z\"),\n maxRedemptions: 99218,\n redemptionsCount: 692485,\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 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 isRecurring: false,\n isArchived: false,\n organizationId: \"<value>\",\n metadata: {\n \"key\": 737248,\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 createdAt: new Date(\"2025-10-15T00:12:13.325Z\"),\n modifiedAt: new Date(\"2024-12-21T23:06:09.697Z\"),\n id: \"<value>\",\n description: \"gloss before ew quarrelsomely\",\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-06-17T22:18:12.913Z\"),\n modifiedAt: new Date(\"2023-10-21T02:42:23.850Z\"),\n id: \"<value>\",\n description: \"cool what whenever ah spectacles bowler overheard righteously culture\",\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: \"/rescue\",\n mimeType: \"<value>\",\n size: 406629,\n storageVersion: \"<value>\",\n checksumEtag: \"<value>\",\n checksumSha256Base64: \"<value>\",\n checksumSha256Hex: \"<value>\",\n lastModifiedAt: new Date(\"2025-11-25T05:13:22.395Z\"),\n version: \"<value>\",\n isUploaded: false,\n createdAt: new Date(\"2024-01-12T01:04:51.744Z\"),\n sizeReadable: \"<value>\",\n publicUrl: \"https://major-scenario.com/\",\n },\n {\n id: \"<value>\",\n organizationId: \"<value>\",\n name: \"<value>\",\n path: \"/System\",\n mimeType: \"<value>\",\n size: 743911,\n storageVersion: \"<value>\",\n checksumEtag: \"<value>\",\n checksumSha256Base64: \"<value>\",\n checksumSha256Hex: \"<value>\",\n lastModifiedAt: new Date(\"2024-07-30T00:48:09.915Z\"),\n version: \"<value>\",\n isUploaded: false,\n createdAt: new Date(\"2023-01-08T04:01:53.027Z\"),\n sizeReadable: \"<value>\",\n publicUrl: \"https://mild-earth.info/\",\n },\n ],\n attachedCustomFields: [\n\n ],\n },\n price: {\n createdAt: new Date(\"2025-04-04T20:20:40.820Z\"),\n modifiedAt: new Date(\"2023-02-16T00:32:25.794Z\"),\n id: \"<value>\",\n isArchived: false,\n productId: \"<value>\",\n priceCurrency: \"<value>\",\n minimumAmount: 356357,\n maximumAmount: 770392,\n presetAmount: 305590,\n recurringInterval: \"year\",\n },\n discount: {\n duration: \"repeating\",\n durationInMonths: 644410,\n type: \"fixed\",\n basisPoints: 835720,\n createdAt: new Date(\"2024-06-07T03:36:01.844Z\"),\n modifiedAt: new Date(\"2025-10-15T21:08:28.981Z\"),\n id: \"<value>\",\n metadata: {\n \"key\": \"<value>\",\n \"key1\": 299401,\n },\n name: \"<value>\",\n code: \"<value>\",\n startsAt: new Date(\"2023-09-27T16:59:20.550Z\"),\n endsAt: new Date(\"2024-08-10T09:10:07.342Z\"),\n maxRedemptions: 607542,\n redemptionsCount: 975704,\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 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 isRecurring: true,\n isArchived: false,\n organizationId: \"<value>\",\n metadata: {\n \"key\": \"<value>\",\n \"key1\": true,\n },\n prices: [\n\n ],\n benefits: [\n {\n createdAt: new Date(\"2025-11-13T10:48:05.575Z\"),\n modifiedAt: new Date(\"2023-11-25T09:50:52.301Z\"),\n id: \"<value>\",\n description: \"afford while lest at important ew yowza whereas demob\",\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: \"/lost+found\",\n mimeType: \"<value>\",\n size: 562154,\n storageVersion: \"<value>\",\n checksumEtag: \"<value>\",\n checksumSha256Base64: \"<value>\",\n checksumSha256Hex: \"<value>\",\n lastModifiedAt: new Date(\"2025-08-06T03:20:53.935Z\"),\n version: \"<value>\",\n isUploaded: false,\n createdAt: new Date(\"2024-09-06T09:54:32.715Z\"),\n sizeReadable: \"<value>\",\n publicUrl: \"https://rare-trash.info\",\n },\n {\n id: \"<value>\",\n organizationId: \"<value>\",\n name: \"<value>\",\n path: \"/etc/ppp\",\n mimeType: \"<value>\",\n size: 66044,\n storageVersion: \"<value>\",\n checksumEtag: \"<value>\",\n checksumSha256Base64: \"<value>\",\n checksumSha256Hex: \"<value>\",\n lastModifiedAt: new Date(\"2025-07-07T23:54:00.303Z\"),\n version: \"<value>\",\n isUploaded: true,\n createdAt: new Date(\"2023-10-11T04:49:26.739Z\"),\n sizeReadable: \"<value>\",\n publicUrl: \"https://worse-ceramic.org\",\n },\n {\n id: \"<value>\",\n organizationId: \"<value>\",\n name: \"<value>\",\n path: \"/home\",\n mimeType: \"<value>\",\n size: 75695,\n storageVersion: \"<value>\",\n checksumEtag: \"<value>\",\n checksumSha256Base64: \"<value>\",\n checksumSha256Hex: \"<value>\",\n lastModifiedAt: new Date(\"2023-09-16T06:56:23.715Z\"),\n version: \"<value>\",\n isUploaded: false,\n createdAt: new Date(\"2024-06-22T20:54:57.375Z\"),\n sizeReadable: \"<value>\",\n publicUrl: \"https://closed-seafood.info\",\n },\n ],\n attachedCustomFields: [\n {\n customFieldId: \"<value>\",\n customField: {\n createdAt: new Date(\"2023-01-16T16:34:25.010Z\"),\n modifiedAt: new Date(\"2023-09-12T21:05:19.143Z\"),\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: 553735,\n required: false,\n },\n {\n customFieldId: \"<value>\",\n customField: {\n createdAt: new Date(\"2023-03-20T07:08:33.141Z\"),\n modifiedAt: new Date(\"2023-05-21T23:14:33.066Z\"),\n id: \"<value>\",\n metadata: {\n \"key\": \"<value>\",\n },\n slug: \"<value>\",\n name: \"<value>\",\n organizationId: \"<value>\",\n properties: {},\n },\n order: 892169,\n required: true,\n },\n {\n customFieldId: \"<value>\",\n customField: {\n createdAt: new Date(\"2025-02-15T13:33:22.624Z\"),\n modifiedAt: new Date(\"2024-10-23T16:11:02.880Z\"),\n id: \"<value>\",\n metadata: {\n \"key\": \"<value>\",\n },\n slug: \"<value>\",\n name: \"<value>\",\n organizationId: \"<value>\",\n properties: {},\n },\n order: 578881,\n required: false,\n },\n ],\n },\n price: {\n createdAt: new Date(\"2023-03-28T22:24:16.436Z\"),\n modifiedAt: new Date(\"2023-06-25T07:31:50.142Z\"),\n id: \"<value>\",\n isArchived: false,\n productId: \"<value>\",\n recurringInterval: \"month\",\n },\n discount: {\n duration: \"forever\",\n durationInMonths: 466774,\n type: \"fixed\",\n basisPoints: 373090,\n createdAt: new Date(\"2025-03-19T15:55:32.315Z\"),\n modifiedAt: new Date(\"2024-03-26T06:41:23.276Z\"),\n id: \"<value>\",\n metadata: {\n \"key\": \"<value>\",\n \"key1\": \"<value>\",\n \"key2\": 94826,\n },\n name: \"<value>\",\n code: \"<value>\",\n startsAt: new Date(\"2024-07-14T14:21:57.379Z\"),\n endsAt: new Date(\"2024-11-19T07:47:16.233Z\"),\n maxRedemptions: 184709,\n redemptionsCount: 388273,\n organizationId: \"<value>\",\n },\n },\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"