-
Notifications
You must be signed in to change notification settings - Fork 2
/
codeSamples.yaml
695 lines (695 loc) · 167 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
overlay: 1.0.0
info:
title: CodeSamples overlay for python target
version: 0.0.0
actions:
- target: $["paths"]["/v1/advertisements/"]["get"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.advertisements.list(benefit_id=\"<value>\")\n\n while res is not None:\n # Handle items\n\n res = res.next()"
- target: $["paths"]["/v1/advertisements/{id}"]["get"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.advertisements.get(id=\"<value>\")\n\n # Handle response\n print(res)"
- target: $["paths"]["/v1/benefits/"]["get"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.benefits.list()\n\n while res is not None:\n # Handle items\n\n res = res.next()"
- target: $["paths"]["/v1/benefits/"]["post"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.benefits.create(request={\n \"type\": \"discord\",\n \"description\": \"delightfully fumigate convection though zowie up bulky electronics\",\n \"properties\": {\n \"guild_token\": \"<value>\",\n \"role_id\": \"<id>\",\n },\n })\n\n # Handle response\n print(res)"
- target: $["paths"]["/v1/benefits/{id}"]["delete"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n polar.benefits.delete(id=\"<value>\")\n\n # Use the SDK ..."
- target: $["paths"]["/v1/benefits/{id}"]["get"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.benefits.get(id=\"<value>\")\n\n # Handle response\n print(res)"
- target: $["paths"]["/v1/benefits/{id}"]["patch"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.benefits.update(id=\"<value>\", request_body={\n \"type\": \"license_keys\",\n })\n\n # Handle response\n print(res)"
- target: $["paths"]["/v1/benefits/{id}/grants"]["get"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.benefits.grants(id=\"<value>\")\n\n while res is not None:\n # Handle items\n\n res = res.next()"
- target: $["paths"]["/v1/checkout-links/"]["get"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.checkout_links.list()\n\n while res is not None:\n # Handle items\n\n res = res.next()"
- target: $["paths"]["/v1/checkout-links/"]["post"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.checkout_links.create(request={\n \"payment_processor\": \"stripe\",\n \"product_id\": \"<value>\",\n })\n\n # Handle response\n print(res)"
- target: $["paths"]["/v1/checkout-links/{id}"]["delete"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n polar.checkout_links.delete(id=\"<value>\")\n\n # Use the SDK ..."
- target: $["paths"]["/v1/checkout-links/{id}"]["get"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.checkout_links.get(id=\"<value>\")\n\n # Handle response\n print(res)"
- target: $["paths"]["/v1/checkout-links/{id}"]["patch"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.checkout_links.update(id=\"<value>\", checkout_link_update={})\n\n # Handle response\n print(res)"
- target: $["paths"]["/v1/checkouts/custom/"]["get"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.checkouts.custom.list()\n\n while res is not None:\n # Handle items\n\n res = res.next()"
- target: $["paths"]["/v1/checkouts/custom/"]["post"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.checkouts.custom.create(request={\n \"product_id\": \"<value>\",\n })\n\n # Handle response\n print(res)"
- target: $["paths"]["/v1/checkouts/custom/client/{client_secret}"]["get"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.checkouts.custom.client_get(client_secret=\"<value>\")\n\n # Handle response\n print(res)"
- target: $["paths"]["/v1/checkouts/custom/client/{client_secret}"]["patch"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.checkouts.custom.client_update(client_secret=\"<value>\", checkout_update_public={})\n\n # Handle response\n print(res)"
- target: $["paths"]["/v1/checkouts/custom/client/{client_secret}/confirm"]["post"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.checkouts.custom.client_confirm(client_secret=\"<value>\", checkout_confirm_stripe={})\n\n # Handle response\n print(res)"
- target: $["paths"]["/v1/checkouts/custom/{id}"]["get"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.checkouts.custom.get(id=\"<value>\")\n\n # Handle response\n print(res)"
- target: $["paths"]["/v1/checkouts/custom/{id}"]["patch"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.checkouts.custom.update(id=\"<value>\", checkout_update={})\n\n # Handle response\n print(res)"
- target: $["paths"]["/v1/custom-fields/"]["get"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.custom_fields.list()\n\n while res is not None:\n # Handle items\n\n res = res.next()"
- target: $["paths"]["/v1/custom-fields/"]["post"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.custom_fields.create(request={\n \"type\": \"number\",\n \"slug\": \"<value>\",\n \"name\": \"<value>\",\n \"properties\": {},\n })\n\n # Handle response\n print(res)"
- target: $["paths"]["/v1/custom-fields/{id}"]["delete"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n polar.custom_fields.delete(id=\"<value>\")\n\n # Use the SDK ..."
- target: $["paths"]["/v1/custom-fields/{id}"]["get"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.custom_fields.get(id=\"<value>\")\n\n # Handle response\n print(res)"
- target: $["paths"]["/v1/custom-fields/{id}"]["patch"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.custom_fields.update(id=\"<value>\", custom_field_update={\n \"type\": \"text\",\n })\n\n # Handle response\n print(res)"
- target: $["paths"]["/v1/customer-portal/benefit-grants/"]["get"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.customer_portal.benefit_grants.list()\n\n while res is not None:\n # Handle items\n\n res = res.next()"
- target: $["paths"]["/v1/customer-portal/benefit-grants/{id}"]["get"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.customer_portal.benefit_grants.get(id=\"<value>\")\n\n # Handle response\n print(res)"
- target: $["paths"]["/v1/customer-portal/benefit-grants/{id}"]["patch"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.customer_portal.benefit_grants.update(id=\"<value>\", customer_benefit_grant_update={\n \"benefit_type\": \"license_keys\",\n })\n\n # Handle response\n print(res)"
- target: $["paths"]["/v1/customer-portal/customers/{id}"]["get"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.customer_portal.customers.get(id=\"<value>\")\n\n # Handle response\n print(res)"
- target: $["paths"]["/v1/customer-portal/downloadables/"]["get"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.customer_portal.downloadables.list()\n\n while res is not None:\n # Handle items\n\n res = res.next()"
- target: $["paths"]["/v1/customer-portal/downloadables/{token}"]["get"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.customer_portal.downloadables.get(token=\"<value>\")\n\n assert res is not None\n\n # Handle response\n print(res)"
- target: $["paths"]["/v1/customer-portal/license-keys/"]["get"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.customer_portal.license_keys.list()\n\n while res is not None:\n # Handle items\n\n res = res.next()"
- target: $["paths"]["/v1/customer-portal/license-keys/activate"]["post"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.customer_portal.license_keys.activate(request={\n \"key\": \"<key>\",\n \"organization_id\": \"<value>\",\n \"label\": \"<value>\",\n })\n\n # Handle response\n print(res)"
- target: $["paths"]["/v1/customer-portal/license-keys/deactivate"]["post"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n polar.customer_portal.license_keys.deactivate(request={\n \"key\": \"<key>\",\n \"organization_id\": \"<value>\",\n \"activation_id\": \"<value>\",\n })\n\n # Use the SDK ..."
- target: $["paths"]["/v1/customer-portal/license-keys/validate"]["post"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.customer_portal.license_keys.validate(request={\n \"key\": \"<key>\",\n \"organization_id\": \"<value>\",\n })\n\n # Handle response\n print(res)"
- target: $["paths"]["/v1/customer-portal/license-keys/{id}"]["get"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.customer_portal.license_keys.get(id=\"<value>\")\n\n # Handle response\n print(res)"
- target: $["paths"]["/v1/customer-portal/orders/"]["get"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.customer_portal.orders.list()\n\n while res is not None:\n # Handle items\n\n res = res.next()"
- target: $["paths"]["/v1/customer-portal/orders/{id}"]["get"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.customer_portal.orders.get(id=\"<value>\")\n\n # Handle response\n print(res)"
- target: $["paths"]["/v1/customer-portal/orders/{id}/invoice"]["get"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.customer_portal.orders.invoice(id=\"<value>\")\n\n # Handle response\n print(res)"
- target: $["paths"]["/v1/customer-portal/organizations/{slug}"]["get"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.customer_portal.organizations.get(slug=\"<value>\")\n\n # Handle response\n print(res)"
- target: $["paths"]["/v1/customer-portal/subscriptions/"]["get"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.customer_portal.subscriptions.list()\n\n while res is not None:\n # Handle items\n\n res = res.next()"
- target: $["paths"]["/v1/customer-portal/subscriptions/{id}"]["delete"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.customer_portal.subscriptions.cancel(id=\"<value>\")\n\n # Handle response\n print(res)"
- target: $["paths"]["/v1/customer-portal/subscriptions/{id}"]["get"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.customer_portal.subscriptions.get(id=\"<value>\")\n\n # Handle response\n print(res)"
- target: $["paths"]["/v1/customer-portal/subscriptions/{id}"]["patch"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.customer_portal.subscriptions.update(id=\"<value>\", customer_subscription_update={})\n\n # Handle response\n print(res)"
- target: $["paths"]["/v1/customer-sessions/"]["post"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.customer_sessions.create(request={\n \"customer_id\": \"<value>\",\n })\n\n # Handle response\n print(res)"
- target: $["paths"]["/v1/customers/"]["get"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.customers.list()\n\n while res is not None:\n # Handle items\n\n res = res.next()"
- target: $["paths"]["/v1/customers/"]["post"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.customers.create(request={\n \"email\": \"Loyal79@yahoo.com\",\n })\n\n # Handle response\n print(res)"
- target: $["paths"]["/v1/customers/{id}"]["delete"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n polar.customers.delete(id=\"<value>\")\n\n # Use the SDK ..."
- target: $["paths"]["/v1/customers/{id}"]["get"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.customers.get(id=\"<value>\")\n\n # Handle response\n print(res)"
- target: $["paths"]["/v1/customers/{id}"]["patch"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.customers.update(id=\"<value>\", customer_update={})\n\n # Handle response\n print(res)"
- target: $["paths"]["/v1/discounts/"]["get"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.discounts.list()\n\n while res is not None:\n # Handle items\n\n res = res.next()"
- target: $["paths"]["/v1/discounts/"]["post"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "import polar_sdk\nfrom polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.discounts.create(request={\n \"duration\": polar_sdk.DiscountDuration.FOREVER,\n \"duration_in_months\": 417458,\n \"type\": polar_sdk.DiscountType.FIXED,\n \"amount\": 69025,\n \"name\": \"<value>\",\n })\n\n # Handle response\n print(res)"
- target: $["paths"]["/v1/discounts/{id}"]["delete"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n polar.discounts.delete(id=\"<value>\")\n\n # Use the SDK ..."
- target: $["paths"]["/v1/discounts/{id}"]["get"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.discounts.get(id=\"<value>\")\n\n # Handle response\n print(res)"
- target: $["paths"]["/v1/discounts/{id}"]["patch"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.discounts.update(id=\"<value>\", discount_update={})\n\n # Handle response\n print(res)"
- target: $["paths"]["/v1/external_organizations/"]["get"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.external_organizations.list()\n\n while res is not None:\n # Handle items\n\n res = res.next()"
- target: $["paths"]["/v1/files/"]["get"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.files.list()\n\n while res is not None:\n # Handle items\n\n res = res.next()"
- target: $["paths"]["/v1/files/"]["post"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.files.create(request={\n \"name\": \"<value>\",\n \"mime_type\": \"<value>\",\n \"size\": 638424,\n \"upload\": {\n \"parts\": [\n {\n \"number\": 417458,\n \"chunk_start\": 134365,\n \"chunk_end\": 69025,\n },\n ],\n },\n \"service\": \"organization_avatar\",\n })\n\n # Handle response\n print(res)"
- target: $["paths"]["/v1/files/{id}"]["delete"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n polar.files.delete(id=\"<value>\")\n\n # Use the SDK ..."
- target: $["paths"]["/v1/files/{id}"]["patch"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.files.update(id=\"<value>\", file_patch={})\n\n # Handle response\n print(res)"
- target: $["paths"]["/v1/files/{id}/uploaded"]["post"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.files.uploaded(id=\"<value>\", file_upload_completed={\n \"id\": \"<id>\",\n \"path\": \"/sys\",\n \"parts\": [\n {\n \"number\": 173116,\n \"checksum_etag\": \"<value>\",\n \"checksum_sha256_base64\": \"<value>\",\n },\n {\n \"number\": 894030,\n \"checksum_etag\": \"<value>\",\n \"checksum_sha256_base64\": \"<value>\",\n },\n {\n \"number\": 673715,\n \"checksum_etag\": \"<value>\",\n \"checksum_sha256_base64\": \"<value>\",\n },\n ],\n })\n\n # Handle response\n print(res)"
- target: $["paths"]["/v1/license-keys"]["get"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.license_keys.list()\n\n while res is not None:\n # Handle items\n\n res = res.next()"
- target: $["paths"]["/v1/license-keys/{id}"]["get"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.license_keys.get(id=\"<value>\")\n\n # Handle response\n print(res)"
- target: $["paths"]["/v1/license-keys/{id}"]["patch"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.license_keys.update(id=\"<value>\", license_key_update={})\n\n # Handle response\n print(res)"
- target: $["paths"]["/v1/license-keys/{id}/activations/{activation_id}"]["get"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.license_keys.get_activation(id=\"<value>\", activation_id=\"<value>\")\n\n # Handle response\n print(res)"
- target: $["paths"]["/v1/metrics/"]["get"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "import dateutil.parser\nimport polar_sdk\nfrom polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.metrics.get(start_date=dateutil.parser.parse(\"2025-02-06\").date(), end_date=dateutil.parser.parse(\"2024-09-04\").date(), interval=polar_sdk.Interval.WEEK)\n\n # Handle response\n print(res)"
- target: $["paths"]["/v1/metrics/limits"]["get"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.metrics.limits()\n\n # Handle response\n print(res)"
- target: $["paths"]["/v1/oauth2/"]["get"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.oauth2.clients.list()\n\n while res is not None:\n # Handle items\n\n res = res.next()"
- target: $["paths"]["/v1/oauth2/authorize"]["get"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.oauth2.authorize()\n\n # Handle response\n print(res)"
- target: $["paths"]["/v1/oauth2/introspect"]["post"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.oauth2.introspect(request={\n \"token\": \"<value>\",\n \"client_id\": \"<id>\",\n \"client_secret\": \"<value>\",\n })\n\n # Handle response\n print(res)"
- target: $["paths"]["/v1/oauth2/register"]["post"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.oauth2.clients.create(request={\n \"redirect_uris\": [\n \"https://inferior-chainstay.com\",\n ],\n \"client_name\": \"<value>\",\n })\n\n # Handle response\n print(res)"
- target: $["paths"]["/v1/oauth2/register/{client_id}"]["delete"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.oauth2.clients.delete(client_id=\"<id>\")\n\n # Handle response\n print(res)"
- target: $["paths"]["/v1/oauth2/register/{client_id}"]["get"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.oauth2.clients.get(client_id=\"<id>\")\n\n # Handle response\n print(res)"
- target: $["paths"]["/v1/oauth2/register/{client_id}"]["put"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.oauth2.clients.update(client_id=\"<id>\", o_auth2_client_configuration_update={\n \"redirect_uris\": [\n \"https://grown-worth.name\",\n \"https://worthwhile-avalanche.org/\",\n \"https://general-digit.com/\",\n ],\n \"client_name\": \"<value>\",\n \"client_id\": \"<id>\",\n })\n\n # Handle response\n print(res)"
- target: $["paths"]["/v1/oauth2/revoke"]["post"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.oauth2.revoke(request={\n \"token\": \"<value>\",\n \"client_id\": \"<id>\",\n \"client_secret\": \"<value>\",\n })\n\n # Handle response\n print(res)"
- target: $["paths"]["/v1/oauth2/token"]["post"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.oauth2.token(request={\n \"grant_type\": \"authorization_code\",\n \"client_id\": \"<id>\",\n \"client_secret\": \"<value>\",\n \"code\": \"<value>\",\n \"redirect_uri\": \"https://old-fort.name\",\n })\n\n # Handle response\n print(res)"
- target: $["paths"]["/v1/oauth2/userinfo"]["get"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.oauth2.userinfo()\n\n # Handle response\n print(res)"
- target: $["paths"]["/v1/orders/"]["get"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.orders.list()\n\n while res is not None:\n # Handle items\n\n res = res.next()"
- target: $["paths"]["/v1/orders/{id}"]["get"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.orders.get(id=\"<value>\")\n\n # Handle response\n print(res)"
- target: $["paths"]["/v1/orders/{id}/invoice"]["get"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.orders.invoice(id=\"<value>\")\n\n # Handle response\n print(res)"
- target: $["paths"]["/v1/organizations/"]["get"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.organizations.list()\n\n while res is not None:\n # Handle items\n\n res = res.next()"
- target: $["paths"]["/v1/organizations/"]["post"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.organizations.create(request={\n \"name\": \"<value>\",\n \"slug\": \"<value>\",\n })\n\n # Handle response\n print(res)"
- target: $["paths"]["/v1/organizations/{id}"]["get"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.organizations.get(id=\"<value>\")\n\n # Handle response\n print(res)"
- target: $["paths"]["/v1/organizations/{id}"]["patch"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.organizations.update(id=\"<value>\", organization_update={})\n\n # Handle response\n print(res)"
- target: $["paths"]["/v1/products/"]["get"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.products.list()\n\n while res is not None:\n # Handle items\n\n res = res.next()"
- target: $["paths"]["/v1/products/"]["post"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "import polar_sdk\nfrom polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.products.create(request={\n \"name\": \"<value>\",\n \"prices\": [\n {\n \"type\": \"recurring\",\n \"amount_type\": \"free\",\n \"recurring_interval\": polar_sdk.SubscriptionRecurringInterval.MONTH,\n },\n ],\n })\n\n # Handle response\n print(res)"
- target: $["paths"]["/v1/products/{id}"]["get"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.products.get(id=\"<value>\")\n\n # Handle response\n print(res)"
- target: $["paths"]["/v1/products/{id}"]["patch"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.products.update(id=\"<value>\", product_update={})\n\n # Handle response\n print(res)"
- target: $["paths"]["/v1/products/{id}/benefits"]["post"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.products.update_benefits(id=\"<value>\", product_benefits_update={\n \"benefits\": [\n \"<value>\",\n ],\n })\n\n # Handle response\n print(res)"
- target: $["paths"]["/v1/repositories/"]["get"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.repositories.list()\n\n while res is not None:\n # Handle items\n\n res = res.next()"
- target: $["paths"]["/v1/repositories/{id}"]["get"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.repositories.get(id=\"<value>\")\n\n # Handle response\n print(res)"
- target: $["paths"]["/v1/repositories/{id}"]["patch"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.repositories.update(id=\"<value>\", repository_update={})\n\n # Handle response\n print(res)"
- target: $["paths"]["/v1/subscriptions/"]["get"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.subscriptions.list()\n\n while res is not None:\n # Handle items\n\n res = res.next()"
- target: $["paths"]["/v1/subscriptions/export"]["get"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.subscriptions.export()\n\n # Handle response\n print(res)"
- target: $["paths"]["/v1/subscriptions/{id}"]["delete"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.subscriptions.revoke(id=\"<value>\")\n\n # Handle response\n print(res)"
- target: $["paths"]["/v1/subscriptions/{id}"]["patch"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"<YOUR_BEARER_TOKEN_HERE>\",\n) as polar:\n\n res = polar.subscriptions.update(id=\"<value>\", subscription_update={\n \"revoke\": True,\n })\n\n # Handle response\n print(res)"
- target: $["paths"]["benefit.created"]["post"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "import dateutil.parser\nfrom polar_sdk import Polar\n\nwith Polar() as polar:\n\n res = polar.endpointbenefit_created_post(request={\n \"type\": \"benefit.created\",\n \"data\": {\n \"created_at\": dateutil.parser.isoparse(\"2023-04-15T11:45:18.891Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2025-06-17T12:04:55.002Z\"),\n \"id\": \"<value>\",\n \"type\": \"downloadables\",\n \"description\": \"vastly lest but\",\n \"selectable\": False,\n \"deletable\": False,\n \"organization_id\": \"<value>\",\n \"properties\": {\n \"archived\": {\n \"key\": False,\n },\n \"files\": [\n \"<value>\",\n ],\n },\n },\n })\n\n # Handle response\n print(res)"
- target: $["paths"]["benefit.updated"]["post"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "import dateutil.parser\nimport polar_sdk\nfrom polar_sdk import Polar\n\nwith Polar() as polar:\n\n res = polar.endpointbenefit_updated_post(request={\n \"type\": \"benefit.updated\",\n \"data\": {\n \"created_at\": dateutil.parser.isoparse(\"2025-11-19T14:31:03.333Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2023-08-21T02:54:25.671Z\"),\n \"id\": \"<value>\",\n \"type\": \"github_repository\",\n \"description\": \"merge when gratefully sparse hmph throughout honesty untried gripping um\",\n \"selectable\": False,\n \"deletable\": False,\n \"organization_id\": \"<value>\",\n \"properties\": {\n \"repository_owner\": \"polarsource\",\n \"repository_name\": \"private_repo\",\n \"permission\": polar_sdk.Permission.PUSH,\n },\n },\n })\n\n # Handle response\n print(res)"
- target: $["paths"]["benefit_grant.created"]["post"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "import dateutil.parser\nimport polar_sdk\nfrom polar_sdk import Polar\n\nwith Polar() as polar:\n\n res = polar.endpointbenefit_grant_created_post(request=polar_sdk.WebhookBenefitGrantCreatedPayload(\n type=\"benefit_grant.created\",\n data=polar_sdk.BenefitGrantWebhook(\n created_at=dateutil.parser.isoparse(\"2025-01-04T13:03:27.870Z\"),\n modified_at=dateutil.parser.isoparse(\"2023-05-08T00:47:14.556Z\"),\n id=\"<value>\",\n is_granted=True,\n is_revoked=False,\n subscription_id=\"<value>\",\n order_id=\"<value>\",\n customer_id=\"<value>\",\n user_id=\"<value>\",\n benefit_id=\"<value>\",\n customer={\n \"created_at\": dateutil.parser.isoparse(\"2025-08-25T12:22:42.430Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2023-03-03T22:39:55.256Z\"),\n \"id\": \"<value>\",\n \"metadata\": {\n\n },\n \"email\": \"Holden_Wilkinson@yahoo.com\",\n \"email_verified\": False,\n \"name\": \"<value>\",\n \"billing_address\": {\n \"country\": \"El Salvador\",\n },\n \"tax_id\": [\n \"<value>\",\n \"ae_trn\",\n \"is_vat\",\n ],\n \"organization_id\": \"<value>\",\n \"avatar_url\": \"https://frightened-secrecy.biz\",\n },\n properties={\n \"advertisement_campaign_id\": \"<id>\",\n },\n benefit={\n \"created_at\": dateutil.parser.isoparse(\"2023-02-20T12:28:33.166Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2024-07-18T18:10:25.895Z\"),\n \"id\": \"<value>\",\n \"type\": \"ads\",\n \"description\": \"though oof geez ha scuffle um inwardly narrow waterlogged normal\",\n \"selectable\": False,\n \"deletable\": False,\n \"organization_id\": \"<value>\",\n \"properties\": {},\n },\n ),\n ))\n\n # Handle response\n print(res)"
- target: $["paths"]["benefit_grant.revoked"]["post"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "import dateutil.parser\nimport polar_sdk\nfrom polar_sdk import Polar\n\nwith Polar() as polar:\n\n res = polar.endpointbenefit_grant_revoked_post(request=polar_sdk.WebhookBenefitGrantRevokedPayload(\n type=\"benefit_grant.revoked\",\n data=polar_sdk.BenefitGrantWebhook(\n created_at=dateutil.parser.isoparse(\"2025-03-12T10:35:36.881Z\"),\n modified_at=dateutil.parser.isoparse(\"2025-04-12T13:10:16.426Z\"),\n id=\"<value>\",\n is_granted=True,\n is_revoked=False,\n subscription_id=\"<value>\",\n order_id=\"<value>\",\n customer_id=\"<value>\",\n user_id=\"<value>\",\n benefit_id=\"<value>\",\n customer={\n \"created_at\": dateutil.parser.isoparse(\"2025-03-29T21:56:48.008Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2025-07-18T16:16:40.562Z\"),\n \"id\": \"<value>\",\n \"metadata\": {\n\n },\n \"email\": \"Anita21@hotmail.com\",\n \"email_verified\": True,\n \"name\": \"<value>\",\n \"billing_address\": {\n \"country\": \"Poland\",\n },\n \"tax_id\": [\n \"<value>\",\n \"<value>\",\n \"au_arn\",\n ],\n \"organization_id\": \"<value>\",\n \"avatar_url\": \"https://bouncy-granny.net\",\n },\n properties={\n \"advertisement_campaign_id\": \"<id>\",\n },\n benefit={\n \"created_at\": dateutil.parser.isoparse(\"2025-04-12T13:10:16.426Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2024-03-08T05:20:11.943Z\"),\n \"id\": \"<value>\",\n \"type\": \"downloadables\",\n \"description\": \"incidentally immense scotch meh quaff generously supposing however ugh kindly\",\n \"selectable\": False,\n \"deletable\": False,\n \"organization_id\": \"<value>\",\n \"properties\": {\n \"archived\": {\n \"key\": False,\n },\n \"files\": [\n \"<value>\",\n ],\n },\n },\n ),\n ))\n\n # Handle response\n print(res)"
- target: $["paths"]["benefit_grant.updated"]["post"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "import dateutil.parser\nimport polar_sdk\nfrom polar_sdk import Polar\n\nwith Polar() as polar:\n\n res = polar.endpointbenefit_grant_updated_post(request=polar_sdk.WebhookBenefitGrantUpdatedPayload(\n type=\"benefit_grant.updated\",\n data=polar_sdk.BenefitGrantWebhook(\n created_at=dateutil.parser.isoparse(\"2025-01-02T13:54:42.243Z\"),\n modified_at=dateutil.parser.isoparse(\"2024-02-25T11:58:59.486Z\"),\n id=\"<value>\",\n is_granted=False,\n is_revoked=False,\n subscription_id=\"<value>\",\n order_id=\"<value>\",\n customer_id=\"<value>\",\n user_id=\"<value>\",\n benefit_id=\"<value>\",\n customer={\n \"created_at\": dateutil.parser.isoparse(\"2025-08-08T07:44:28.757Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2024-08-31T04:19:19.970Z\"),\n \"id\": \"<value>\",\n \"metadata\": {\n \"key\": \"<value>\",\n \"key1\": 549371,\n \"key2\": 502350,\n },\n \"email\": \"Yvette.Bins@hotmail.com\",\n \"email_verified\": False,\n \"name\": \"<value>\",\n \"billing_address\": {\n \"country\": \"Israel\",\n },\n \"tax_id\": [\n \"<value>\",\n ],\n \"organization_id\": \"<value>\",\n \"avatar_url\": \"https://teeming-formamide.com/\",\n },\n properties={\n \"advertisement_campaign_id\": \"<id>\",\n },\n benefit={\n \"created_at\": dateutil.parser.isoparse(\"2025-04-04T12:08:04.168Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2025-02-22T02:27:57.903Z\"),\n \"id\": \"<value>\",\n \"type\": \"discord\",\n \"description\": \"meager merit by pish intermesh gah out muddy ah\",\n \"selectable\": False,\n \"deletable\": False,\n \"organization_id\": \"<value>\",\n \"properties\": {\n \"guild_id\": \"<id>\",\n \"role_id\": \"<id>\",\n \"guild_token\": \"<value>\",\n },\n },\n ),\n ))\n\n # Handle response\n print(res)"
- target: $["paths"]["checkout.created"]["post"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "import dateutil.parser\nimport polar_sdk\nfrom polar_sdk import Polar\n\nwith Polar() as polar:\n\n res = polar.endpointcheckout_created_post(request=polar_sdk.WebhookCheckoutCreatedPayload(\n type=\"checkout.created\",\n data=polar_sdk.Checkout(\n created_at=dateutil.parser.isoparse(\"2025-11-12T14:26:42.882Z\"),\n modified_at=dateutil.parser.isoparse(\"2024-05-27T05:08:06.235Z\"),\n id=\"<value>\",\n payment_processor=polar_sdk.PaymentProcessor.STRIPE,\n status=polar_sdk.CheckoutStatus.FAILED,\n client_secret=\"<value>\",\n url=\"https://heavy-beret.com/\",\n expires_at=dateutil.parser.isoparse(\"2023-02-25T02:26:48.460Z\"),\n success_url=\"https://sardonic-final.info/\",\n embed_origin=\"<value>\",\n amount=962818,\n tax_amount=6400,\n currency=\"Yen\",\n subtotal_amount=648726,\n total_amount=210702,\n product_id=\"<value>\",\n product_price_id=\"<value>\",\n discount_id=\"<value>\",\n allow_discount_codes=True,\n is_discount_applicable=False,\n is_free_product_price=False,\n is_payment_required=False,\n is_payment_setup_required=False,\n is_payment_form_required=False,\n customer_id=\"<value>\",\n customer_name=\"<value>\",\n customer_email=\"Ryley_Erdman@hotmail.com\",\n customer_ip_address=\"<value>\",\n customer_billing_address={\n \"country\": \"South Africa\",\n },\n customer_tax_id=\"<id>\",\n payment_processor_metadata={},\n metadata={\n \"key\": 18677,\n \"key1\": 95370,\n },\n product={\n \"created_at\": dateutil.parser.isoparse(\"2023-04-02T00:05:42.586Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2024-12-15T03:02:38.803Z\"),\n \"id\": \"<value>\",\n \"name\": \"<value>\",\n \"description\": \"for embarrassment untidy long-term near honestly separate yet\",\n \"is_recurring\": True,\n \"is_archived\": False,\n \"organization_id\": \"<value>\",\n \"prices\": [\n {\n \"created_at\": dateutil.parser.isoparse(\"2025-11-19T15:59:15.588Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2023-11-17T00:11:23.972Z\"),\n \"id\": \"<value>\",\n \"amount_type\": \"custom\",\n \"is_archived\": False,\n \"product_id\": \"<value>\",\n \"price_currency\": \"<value>\",\n \"minimum_amount\": 363560,\n \"maximum_amount\": 75876,\n \"preset_amount\": 82334,\n \"type\": \"one_time\",\n },\n ],\n \"benefits\": [\n {\n \"created_at\": dateutil.parser.isoparse(\"2024-08-21T00:47:02.059Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2024-06-03T10:32:44.101Z\"),\n \"id\": \"<value>\",\n \"type\": polar_sdk.BenefitType.LICENSE_KEYS,\n \"description\": \"within jacket unless\",\n \"selectable\": False,\n \"deletable\": False,\n \"organization_id\": \"<value>\",\n },\n ],\n \"medias\": [\n {\n \"id\": \"<value>\",\n \"organization_id\": \"<value>\",\n \"name\": \"<value>\",\n \"path\": \"/private/var\",\n \"mime_type\": \"<value>\",\n \"size\": 245189,\n \"storage_version\": \"<value>\",\n \"checksum_etag\": \"<value>\",\n \"checksum_sha256_base64\": \"<value>\",\n \"checksum_sha256_hex\": \"<value>\",\n \"last_modified_at\": dateutil.parser.isoparse(\"2023-11-03T15:00:03.276Z\"),\n \"version\": \"<value>\",\n \"service\": \"product_media\",\n \"is_uploaded\": False,\n \"created_at\": dateutil.parser.isoparse(\"2025-06-07T13:47:02.365Z\"),\n \"size_readable\": \"<value>\",\n \"public_url\": \"https://webbed-experience.name/\",\n },\n ],\n },\n product_price={\n \"created_at\": dateutil.parser.isoparse(\"2025-02-14T09:22:19.644Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2023-12-28T20:59:29.904Z\"),\n \"id\": \"<value>\",\n \"amount_type\": \"custom\",\n \"is_archived\": False,\n \"product_id\": \"<value>\",\n \"price_currency\": \"<value>\",\n \"minimum_amount\": 417896,\n \"maximum_amount\": 962818,\n \"preset_amount\": 6400,\n \"type\": \"recurring\",\n \"recurring_interval\": polar_sdk.SubscriptionRecurringInterval.MONTH,\n },\n discount={\n \"duration\": polar_sdk.DiscountDuration.REPEATING,\n \"type\": polar_sdk.DiscountType.FIXED,\n \"basis_points\": 341163,\n \"id\": \"<value>\",\n \"name\": \"<value>\",\n \"code\": \"<value>\",\n },\n subscription_id=\"<value>\",\n attached_custom_fields=[\n {\n \"custom_field_id\": \"<value>\",\n \"custom_field\": {\n \"created_at\": dateutil.parser.isoparse(\"2023-08-19T22:18:44.316Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2024-04-28T23:39:10.699Z\"),\n \"id\": \"<value>\",\n \"metadata\": {\n \"key\": False,\n },\n \"type\": \"select\",\n \"slug\": \"<value>\",\n \"name\": \"<value>\",\n \"organization_id\": \"<value>\",\n \"properties\": {\n \"options\": [\n {\n \"value\": \"<value>\",\n \"label\": \"<value>\",\n },\n ],\n },\n },\n \"order\": 996863,\n \"required\": False,\n },\n {\n \"custom_field_id\": \"<value>\",\n \"custom_field\": {\n \"created_at\": dateutil.parser.isoparse(\"2024-07-02T09:46:29.338Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2025-01-24T18:08:49.597Z\"),\n \"id\": \"<value>\",\n \"metadata\": {\n \"key\": False,\n },\n \"type\": \"number\",\n \"slug\": \"<value>\",\n \"name\": \"<value>\",\n \"organization_id\": \"<value>\",\n \"properties\": {},\n },\n \"order\": 72589,\n \"required\": True,\n },\n {\n \"custom_field_id\": \"<value>\",\n \"custom_field\": {\n \"created_at\": dateutil.parser.isoparse(\"2025-07-31T13:25:31.669Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2023-11-12T09:40:10.044Z\"),\n \"id\": \"<value>\",\n \"metadata\": {\n \"key\": \"<value>\",\n },\n \"type\": \"text\",\n \"slug\": \"<value>\",\n \"name\": \"<value>\",\n \"organization_id\": \"<value>\",\n \"properties\": {},\n },\n \"order\": 161325,\n \"required\": True,\n },\n ],\n customer_metadata={\n \"key\": 385218,\n \"key1\": \"<value>\",\n },\n ),\n ))\n\n # Handle response\n print(res)"
- target: $["paths"]["checkout.updated"]["post"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "import dateutil.parser\nimport polar_sdk\nfrom polar_sdk import Polar\n\nwith Polar() as polar:\n\n res = polar.endpointcheckout_updated_post(request=polar_sdk.WebhookCheckoutUpdatedPayload(\n type=\"checkout.updated\",\n data=polar_sdk.Checkout(\n created_at=dateutil.parser.isoparse(\"2025-10-04T13:06:10.658Z\"),\n modified_at=dateutil.parser.isoparse(\"2024-10-02T21:25:15.366Z\"),\n id=\"<value>\",\n payment_processor=polar_sdk.PaymentProcessor.STRIPE,\n status=polar_sdk.CheckoutStatus.FAILED,\n client_secret=\"<value>\",\n url=\"https://square-cafe.biz/\",\n expires_at=dateutil.parser.isoparse(\"2025-03-25T08:55:11.873Z\"),\n success_url=\"https://physical-import.name/\",\n embed_origin=\"<value>\",\n amount=245418,\n tax_amount=624213,\n currency=\"Naira\",\n subtotal_amount=24587,\n total_amount=447013,\n product_id=\"<value>\",\n product_price_id=\"<value>\",\n discount_id=\"<value>\",\n allow_discount_codes=True,\n is_discount_applicable=True,\n is_free_product_price=True,\n is_payment_required=False,\n is_payment_setup_required=False,\n is_payment_form_required=True,\n customer_id=\"<value>\",\n customer_name=\"<value>\",\n customer_email=\"Jairo39@hotmail.com\",\n customer_ip_address=\"<value>\",\n customer_billing_address={\n \"country\": \"Greenland\",\n },\n customer_tax_id=\"<id>\",\n payment_processor_metadata={},\n metadata={\n\n },\n product={\n \"created_at\": dateutil.parser.isoparse(\"2025-01-24T14:28:29.444Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2025-09-21T12:18:51.327Z\"),\n \"id\": \"<value>\",\n \"name\": \"<value>\",\n \"description\": \"engender reopen yahoo draft\",\n \"is_recurring\": False,\n \"is_archived\": True,\n \"organization_id\": \"<value>\",\n \"prices\": [\n {\n \"created_at\": dateutil.parser.isoparse(\"2025-10-20T04:48:05.954Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2024-03-12T21:45:21.173Z\"),\n \"id\": \"<value>\",\n \"amount_type\": \"custom\",\n \"is_archived\": False,\n \"product_id\": \"<value>\",\n \"price_currency\": \"<value>\",\n \"minimum_amount\": 789773,\n \"maximum_amount\": 108579,\n \"preset_amount\": 316079,\n \"type\": \"one_time\",\n },\n ],\n \"benefits\": [\n {\n \"created_at\": dateutil.parser.isoparse(\"2025-04-09T09:30:36.910Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2023-10-16T19:52:50.377Z\"),\n \"id\": \"<value>\",\n \"type\": polar_sdk.BenefitType.GITHUB_REPOSITORY,\n \"description\": \"posh hm meatloaf politely ugh fidget to inborn putrid\",\n \"selectable\": False,\n \"deletable\": True,\n \"organization_id\": \"<value>\",\n },\n {\n \"created_at\": dateutil.parser.isoparse(\"2024-12-30T03:17:46.406Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2023-11-12T16:32:46.306Z\"),\n \"id\": \"<value>\",\n \"type\": polar_sdk.BenefitType.LICENSE_KEYS,\n \"description\": \"blah likewise whose notwithstanding airline aboard frightened enfold colorfully\",\n \"selectable\": True,\n \"deletable\": True,\n \"organization_id\": \"<value>\",\n },\n ],\n \"medias\": [\n {\n \"id\": \"<value>\",\n \"organization_id\": \"<value>\",\n \"name\": \"<value>\",\n \"path\": \"/home/user\",\n \"mime_type\": \"<value>\",\n \"size\": 767806,\n \"storage_version\": \"<value>\",\n \"checksum_etag\": \"<value>\",\n \"checksum_sha256_base64\": \"<value>\",\n \"checksum_sha256_hex\": \"<value>\",\n \"last_modified_at\": dateutil.parser.isoparse(\"2024-01-15T18:22:33.094Z\"),\n \"version\": \"<value>\",\n \"service\": \"product_media\",\n \"is_uploaded\": False,\n \"created_at\": dateutil.parser.isoparse(\"2024-02-14T06:20:54.950Z\"),\n \"size_readable\": \"<value>\",\n \"public_url\": \"https://pushy-tomatillo.org/\",\n },\n {\n \"id\": \"<value>\",\n \"organization_id\": \"<value>\",\n \"name\": \"<value>\",\n \"path\": \"/private\",\n \"mime_type\": \"<value>\",\n \"size\": 432333,\n \"storage_version\": \"<value>\",\n \"checksum_etag\": \"<value>\",\n \"checksum_sha256_base64\": \"<value>\",\n \"checksum_sha256_hex\": \"<value>\",\n \"last_modified_at\": dateutil.parser.isoparse(\"2024-03-07T18:51:14.729Z\"),\n \"version\": \"<value>\",\n \"service\": \"product_media\",\n \"is_uploaded\": False,\n \"created_at\": dateutil.parser.isoparse(\"2023-11-18T09:33:10.032Z\"),\n \"size_readable\": \"<value>\",\n \"public_url\": \"https://affectionate-charm.net\",\n },\n ],\n },\n product_price={\n \"created_at\": dateutil.parser.isoparse(\"2024-10-28T13:46:29.597Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2024-05-15T07:46:47.748Z\"),\n \"id\": \"<value>\",\n \"amount_type\": \"fixed\",\n \"is_archived\": False,\n \"product_id\": \"<value>\",\n \"price_currency\": \"<value>\",\n \"price_amount\": 585155,\n \"type\": \"one_time\",\n },\n discount={\n \"duration\": polar_sdk.DiscountDuration.ONCE,\n \"type\": polar_sdk.DiscountType.PERCENTAGE,\n \"amount\": 883154,\n \"currency\": \"East Caribbean Dollar\",\n \"id\": \"<value>\",\n \"name\": \"<value>\",\n \"code\": \"<value>\",\n },\n subscription_id=\"<value>\",\n attached_custom_fields=[\n {\n \"custom_field_id\": \"<value>\",\n \"custom_field\": {\n \"created_at\": dateutil.parser.isoparse(\"2024-11-15T03:18:06.755Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2024-11-05T16:13:01.569Z\"),\n \"id\": \"<value>\",\n \"metadata\": {\n \"key\": \"<value>\",\n },\n \"type\": \"date\",\n \"slug\": \"<value>\",\n \"name\": \"<value>\",\n \"organization_id\": \"<value>\",\n \"properties\": {},\n },\n \"order\": 108303,\n \"required\": False,\n },\n ],\n customer_metadata={\n \"key\": 371362,\n \"key1\": True,\n },\n ),\n ))\n\n # Handle response\n print(res)"
- target: $["paths"]["order.created"]["post"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "import dateutil.parser\nimport polar_sdk\nfrom polar_sdk import Polar\n\nwith Polar() as polar:\n\n res = polar.endpointorder_created_post(request=polar_sdk.WebhookOrderCreatedPayload(\n type=\"order.created\",\n data=polar_sdk.Order(\n created_at=dateutil.parser.isoparse(\"2024-11-11T12:46:15.007Z\"),\n modified_at=dateutil.parser.isoparse(\"2024-03-23T03:54:38.261Z\"),\n id=\"<value>\",\n metadata={\n \"key\": \"<value>\",\n \"key1\": \"<value>\",\n },\n amount=485666,\n tax_amount=81588,\n currency=\"Metical\",\n billing_reason=polar_sdk.OrderBillingReason.SUBSCRIPTION_CYCLE,\n billing_address={\n \"country\": \"Hungary\",\n },\n customer_id=\"<value>\",\n product_id=\"<value>\",\n product_price_id=\"<value>\",\n discount_id=\"<value>\",\n subscription_id=\"<value>\",\n checkout_id=\"<value>\",\n customer={\n \"created_at\": dateutil.parser.isoparse(\"2023-09-09T08:07:10.665Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2024-08-18T18:18:41.438Z\"),\n \"id\": \"<value>\",\n \"metadata\": {\n \"key\": 407995,\n \"key1\": \"<value>\",\n \"key2\": \"<value>\",\n },\n \"email\": \"Gia.Boyer87@yahoo.com\",\n \"email_verified\": False,\n \"name\": \"<value>\",\n \"billing_address\": {\n \"country\": \"Reunion\",\n },\n \"tax_id\": [\n \"<value>\",\n \"my_sst\",\n \"br_cpf\",\n ],\n \"organization_id\": \"<value>\",\n \"avatar_url\": \"https://darling-kit.org\",\n },\n user_id=\"<value>\",\n user={\n \"id\": \"<value>\",\n \"email\": \"Delphine_Weber@hotmail.com\",\n \"public_name\": \"<value>\",\n },\n product={\n \"created_at\": dateutil.parser.isoparse(\"2025-12-27T14:05:37.748Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2025-01-01T22:00:53.940Z\"),\n \"id\": \"<value>\",\n \"name\": \"<value>\",\n \"description\": \"circle colorize given\",\n \"is_recurring\": True,\n \"is_archived\": True,\n \"organization_id\": \"<value>\",\n },\n product_price={\n \"created_at\": dateutil.parser.isoparse(\"2023-08-04T05:13:22.817Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2024-06-16T06:57:11.062Z\"),\n \"id\": \"<value>\",\n \"amount_type\": \"fixed\",\n \"is_archived\": False,\n \"product_id\": \"<value>\",\n \"price_currency\": \"<value>\",\n \"price_amount\": 81588,\n \"type\": \"one_time\",\n },\n discount={\n \"duration\": polar_sdk.DiscountDuration.REPEATING,\n \"type\": polar_sdk.DiscountType.FIXED,\n \"basis_points\": 229323,\n \"created_at\": dateutil.parser.isoparse(\"2024-08-18T18:18:41.438Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2025-09-23T11:59:51.286Z\"),\n \"id\": \"<value>\",\n \"metadata\": {\n \"key\": False,\n },\n \"name\": \"<value>\",\n \"code\": \"<value>\",\n \"starts_at\": dateutil.parser.isoparse(\"2025-12-09T16:33:38.176Z\"),\n \"ends_at\": dateutil.parser.isoparse(\"2023-12-26T14:42:24.925Z\"),\n \"max_redemptions\": 248386,\n \"redemptions_count\": 506985,\n \"organization_id\": \"<value>\",\n },\n subscription={\n \"metadata\": {\n \"key\": 838937,\n \"key1\": True,\n },\n \"created_at\": dateutil.parser.isoparse(\"2025-05-09T06:10:47.548Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2025-02-13T18:51:37.875Z\"),\n \"id\": \"<value>\",\n \"amount\": 420337,\n \"currency\": \"New Zealand Dollar\",\n \"recurring_interval\": polar_sdk.SubscriptionRecurringInterval.YEAR,\n \"status\": polar_sdk.SubscriptionStatus.INCOMPLETE,\n \"current_period_start\": dateutil.parser.isoparse(\"2025-12-01T13:27:57.927Z\"),\n \"current_period_end\": dateutil.parser.isoparse(\"2023-06-23T18:54:19.334Z\"),\n \"cancel_at_period_end\": False,\n \"canceled_at\": dateutil.parser.isoparse(\"2024-11-15T11:53:36.436Z\"),\n \"started_at\": dateutil.parser.isoparse(\"2025-11-18T03:47:21.756Z\"),\n \"ends_at\": dateutil.parser.isoparse(\"2023-02-02T12:07:22.717Z\"),\n \"ended_at\": dateutil.parser.isoparse(\"2023-02-15T16:05:22.828Z\"),\n \"customer_id\": \"<value>\",\n \"product_id\": \"<value>\",\n \"price_id\": \"<value>\",\n \"discount_id\": \"<value>\",\n \"checkout_id\": \"<value>\",\n \"customer_cancellation_reason\": polar_sdk.CustomerCancellationReason.SWITCHED_SERVICE,\n \"customer_cancellation_comment\": \"<value>\",\n \"user_id\": \"<value>\",\n },\n ),\n ))\n\n # Handle response\n print(res)"
- target: $["paths"]["organization.updated"]["post"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "import dateutil.parser\nfrom polar_sdk import Polar\n\nwith Polar() as polar:\n\n res = polar.endpointorganization_updated_post(request={\n \"type\": \"organization.updated\",\n \"data\": {\n \"created_at\": dateutil.parser.isoparse(\"2023-08-12T18:45:04.236Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2025-12-29T16:35:25.119Z\"),\n \"id\": \"<value>\",\n \"name\": \"<value>\",\n \"slug\": \"<value>\",\n \"avatar_url\": \"https://devoted-bump.net\",\n \"bio\": \"<value>\",\n \"company\": \"Torp, Kuhlman and Howell\",\n \"blog\": \"<value>\",\n \"location\": \"<value>\",\n \"email\": \"Dock_Friesen57@yahoo.com\",\n \"twitter_username\": \"<value>\",\n \"pledge_minimum_amount\": 105265,\n \"pledge_badge_show_amount\": True,\n \"default_upfront_split_to_contributors\": 907160,\n \"profile_settings\": {},\n \"feature_settings\": {},\n },\n })\n\n # Handle response\n print(res)"
- target: $["paths"]["pledge.created"]["post"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "import dateutil.parser\nimport polar_sdk\nfrom polar_sdk import Polar\n\nwith Polar() as polar:\n\n res = polar.endpointpledge_created_post(request=polar_sdk.WebhookPledgeCreatedPayload(\n type=\"pledge.created\",\n data=polar_sdk.Pledge(\n created_at=dateutil.parser.isoparse(\"2025-03-12T00:19:41.487Z\"),\n modified_at=dateutil.parser.isoparse(\"2023-04-19T01:42:59.169Z\"),\n id=\"<value>\",\n amount=330877,\n currency=\"Jamaican Dollar\",\n state=polar_sdk.PledgeState.DISPUTED,\n type=polar_sdk.PledgeType.PAY_DIRECTLY,\n issue=polar_sdk.Issue(\n id=\"66524b69-aa0b-47ac-bb9a-0cee5d3a9110\",\n platform=polar_sdk.Platforms.GITHUB,\n number=280857,\n title=\"<value>\",\n state=polar_sdk.State.OPEN,\n issue_created_at=dateutil.parser.isoparse(\"2024-02-26T00:33:35.289Z\"),\n needs_confirmation_solved=False,\n funding=polar_sdk.Funding(),\n repository=polar_sdk.Repository(\n id=\"356e14cb-87a4-484c-bcfa-ebfe50487706\",\n platform=polar_sdk.Platforms.GITHUB,\n is_private=True,\n name=\"MyOrg\",\n description=\"different premium tinderbox peter under often buzzing hastily\",\n stars=1337,\n license=\"<value>\",\n homepage=\"<value>\",\n profile_settings={},\n organization={\n \"id\": \"29159f56-74c0-464d-b598-8d5bc3b9cdda\",\n \"platform\": polar_sdk.Platforms.GITHUB,\n \"name\": \"<value>\",\n \"avatar_url\": \"https://frightened-poppy.com/\",\n \"is_personal\": False,\n \"bio\": \"<value>\",\n \"pretty_name\": \"<value>\",\n \"company\": \"Bailey - Towne\",\n \"blog\": \"<value>\",\n \"location\": \"<value>\",\n \"email\": \"Cortez_Stehr70@yahoo.com\",\n \"twitter_username\": \"<value>\",\n \"organization_id\": \"<value>\",\n },\n internal_organization={\n \"created_at\": dateutil.parser.isoparse(\"2025-01-03T15:27:13.109Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2024-02-15T22:10:17.041Z\"),\n \"id\": \"<value>\",\n \"name\": \"<value>\",\n \"slug\": \"<value>\",\n \"avatar_url\": \"https://hard-to-find-thyme.org\",\n \"bio\": \"<value>\",\n \"company\": \"Schinner - Wiegand\",\n \"blog\": \"<value>\",\n \"location\": \"<value>\",\n \"email\": \"Pearline_Brekke@hotmail.com\",\n \"twitter_username\": \"<value>\",\n \"pledge_minimum_amount\": 273260,\n \"pledge_badge_show_amount\": False,\n \"default_upfront_split_to_contributors\": 976949,\n \"profile_settings\": {},\n \"feature_settings\": {},\n },\n ),\n pledge_badge_currently_embedded=True,\n ),\n ),\n ))\n\n # Handle response\n print(res)"
- target: $["paths"]["pledge.updated"]["post"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "import dateutil.parser\nimport polar_sdk\nfrom polar_sdk import Polar\n\nwith Polar() as polar:\n\n res = polar.endpointpledge_updated_post(request=polar_sdk.WebhookPledgeUpdatedPayload(\n type=\"pledge.updated\",\n data=polar_sdk.Pledge(\n created_at=dateutil.parser.isoparse(\"2024-11-29T00:10:39.674Z\"),\n modified_at=dateutil.parser.isoparse(\"2025-10-02T21:42:49.754Z\"),\n id=\"<value>\",\n amount=634567,\n currency=\"Singapore Dollar\",\n state=polar_sdk.PledgeState.REFUNDED,\n type=polar_sdk.PledgeType.PAY_ON_COMPLETION,\n issue=polar_sdk.Issue(\n id=\"d2e1349d-085a-441c-abf4-379a1f21d0da\",\n platform=polar_sdk.Platforms.GITHUB,\n number=218372,\n title=\"<value>\",\n state=polar_sdk.State.CLOSED,\n issue_created_at=dateutil.parser.isoparse(\"2024-08-12T14:08:31.083Z\"),\n needs_confirmation_solved=True,\n funding=polar_sdk.Funding(),\n repository=polar_sdk.Repository(\n id=\"814bd7c6-3412-4f11-b523-7b38c659f44a\",\n platform=polar_sdk.Platforms.GITHUB,\n is_private=False,\n name=\"MyOrg\",\n description=\"hm however microchip\",\n stars=1337,\n license=\"<value>\",\n homepage=\"<value>\",\n profile_settings={},\n organization={\n \"id\": \"3ddd5cc2-de10-41ef-baa1-7551cf671cc3\",\n \"platform\": polar_sdk.Platforms.GITHUB,\n \"name\": \"<value>\",\n \"avatar_url\": \"https://gummy-interviewer.biz\",\n \"is_personal\": False,\n \"bio\": \"<value>\",\n \"pretty_name\": \"<value>\",\n \"company\": \"Ferry - Tremblay\",\n \"blog\": \"<value>\",\n \"location\": \"<value>\",\n \"email\": \"Reggie_Crist@yahoo.com\",\n \"twitter_username\": \"<value>\",\n \"organization_id\": \"<value>\",\n },\n internal_organization={\n \"created_at\": dateutil.parser.isoparse(\"2025-12-13T11:00:39.217Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2025-12-02T09:51:26.214Z\"),\n \"id\": \"<value>\",\n \"name\": \"<value>\",\n \"slug\": \"<value>\",\n \"avatar_url\": \"https://memorable-numeracy.com/\",\n \"bio\": \"<value>\",\n \"company\": \"Schuster - Crooks\",\n \"blog\": \"<value>\",\n \"location\": \"<value>\",\n \"email\": \"Tatum.Block37@yahoo.com\",\n \"twitter_username\": \"<value>\",\n \"pledge_minimum_amount\": 653584,\n \"pledge_badge_show_amount\": False,\n \"default_upfront_split_to_contributors\": 175899,\n \"profile_settings\": {},\n \"feature_settings\": {},\n },\n ),\n pledge_badge_currently_embedded=False,\n ),\n ),\n ))\n\n # Handle response\n print(res)"
- target: $["paths"]["product.created"]["post"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "import dateutil.parser\nimport polar_sdk\nfrom polar_sdk import Polar\n\nwith Polar() as polar:\n\n res = polar.endpointproduct_created_post(request={\n \"type\": \"product.created\",\n \"data\": {\n \"created_at\": dateutil.parser.isoparse(\"2023-03-27T06:36:20.130Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2025-04-21T12:05:16.637Z\"),\n \"id\": \"<value>\",\n \"name\": \"<value>\",\n \"description\": \"into horst metal grimy clinch big grounded industrialize\",\n \"is_recurring\": True,\n \"is_archived\": True,\n \"organization_id\": \"<value>\",\n \"metadata\": {\n\n },\n \"prices\": [\n {\n \"created_at\": dateutil.parser.isoparse(\"2024-12-07T23:31:39.577Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2024-04-25T10:21:28.587Z\"),\n \"id\": \"<value>\",\n \"amount_type\": \"free\",\n \"is_archived\": False,\n \"product_id\": \"<value>\",\n \"type\": \"recurring\",\n \"recurring_interval\": polar_sdk.SubscriptionRecurringInterval.MONTH,\n },\n {\n \"created_at\": dateutil.parser.isoparse(\"2024-09-06T02:23:36.299Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2024-10-09T12:20:00.039Z\"),\n \"id\": \"<value>\",\n \"amount_type\": \"custom\",\n \"is_archived\": False,\n \"product_id\": \"<value>\",\n \"price_currency\": \"<value>\",\n \"minimum_amount\": 527608,\n \"maximum_amount\": 32202,\n \"preset_amount\": 66164,\n \"type\": \"one_time\",\n },\n ],\n \"benefits\": [\n {\n \"created_at\": dateutil.parser.isoparse(\"2023-08-11T12:50:57.278Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2023-03-26T05:55:13.113Z\"),\n \"id\": \"<value>\",\n \"type\": \"custom\",\n \"description\": \"tromp these near throughout shear\",\n \"selectable\": False,\n \"deletable\": False,\n \"organization_id\": \"<value>\",\n \"properties\": {\n \"note\": \"<value>\",\n },\n \"is_tax_applicable\": False,\n },\n {\n \"created_at\": dateutil.parser.isoparse(\"2025-05-03T09:49:30.012Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2025-02-19T10:03:27.777Z\"),\n \"id\": \"<value>\",\n \"type\": \"discord\",\n \"description\": \"creature think tuber best\",\n \"selectable\": False,\n \"deletable\": False,\n \"organization_id\": \"<value>\",\n \"properties\": {\n \"guild_id\": \"<id>\",\n \"role_id\": \"<id>\",\n \"guild_token\": \"<value>\",\n },\n },\n {\n \"created_at\": dateutil.parser.isoparse(\"2024-04-17T11:46:21.794Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2023-04-09T12:26:58.282Z\"),\n \"id\": \"<value>\",\n \"type\": \"license_keys\",\n \"description\": \"massage super even\",\n \"selectable\": False,\n \"deletable\": False,\n \"organization_id\": \"<value>\",\n \"properties\": {\n \"prefix\": \"<value>\",\n \"expires\": {\n \"ttl\": 935647,\n \"timeframe\": polar_sdk.Timeframe.MONTH,\n },\n \"activations\": {\n \"limit\": 136136,\n \"enable_customer_admin\": False,\n },\n \"limit_usage\": 923812,\n },\n },\n ],\n \"medias\": [\n {\n \"id\": \"<value>\",\n \"organization_id\": \"<value>\",\n \"name\": \"<value>\",\n \"path\": \"/Users\",\n \"mime_type\": \"<value>\",\n \"size\": 692895,\n \"storage_version\": \"<value>\",\n \"checksum_etag\": \"<value>\",\n \"checksum_sha256_base64\": \"<value>\",\n \"checksum_sha256_hex\": \"<value>\",\n \"last_modified_at\": dateutil.parser.isoparse(\"2023-02-28T01:03:14.537Z\"),\n \"version\": \"<value>\",\n \"service\": \"product_media\",\n \"is_uploaded\": True,\n \"created_at\": dateutil.parser.isoparse(\"2023-06-03T00:39:20.038Z\"),\n \"size_readable\": \"<value>\",\n \"public_url\": \"https://monstrous-cop-out.net\",\n },\n {\n \"id\": \"<value>\",\n \"organization_id\": \"<value>\",\n \"name\": \"<value>\",\n \"path\": \"/var/mail\",\n \"mime_type\": \"<value>\",\n \"size\": 843323,\n \"storage_version\": \"<value>\",\n \"checksum_etag\": \"<value>\",\n \"checksum_sha256_base64\": \"<value>\",\n \"checksum_sha256_hex\": \"<value>\",\n \"last_modified_at\": dateutil.parser.isoparse(\"2023-04-23T21:31:25.476Z\"),\n \"version\": \"<value>\",\n \"service\": \"product_media\",\n \"is_uploaded\": True,\n \"created_at\": dateutil.parser.isoparse(\"2023-07-19T01:29:35.587Z\"),\n \"size_readable\": \"<value>\",\n \"public_url\": \"https://well-made-farm.com\",\n },\n {\n \"id\": \"<value>\",\n \"organization_id\": \"<value>\",\n \"name\": \"<value>\",\n \"path\": \"/root\",\n \"mime_type\": \"<value>\",\n \"size\": 849549,\n \"storage_version\": \"<value>\",\n \"checksum_etag\": \"<value>\",\n \"checksum_sha256_base64\": \"<value>\",\n \"checksum_sha256_hex\": \"<value>\",\n \"last_modified_at\": dateutil.parser.isoparse(\"2023-07-30T13:09:33.963Z\"),\n \"version\": \"<value>\",\n \"service\": \"product_media\",\n \"is_uploaded\": False,\n \"created_at\": dateutil.parser.isoparse(\"2024-10-02T20:39:40.444Z\"),\n \"size_readable\": \"<value>\",\n \"public_url\": \"https://simplistic-devastation.com\",\n },\n ],\n \"attached_custom_fields\": [\n {\n \"custom_field_id\": \"<value>\",\n \"custom_field\": {\n \"created_at\": dateutil.parser.isoparse(\"2023-03-24T09:30:48.572Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2023-02-09T00:26:32.257Z\"),\n \"id\": \"<value>\",\n \"metadata\": {\n \"key\": 657365,\n },\n \"type\": \"select\",\n \"slug\": \"<value>\",\n \"name\": \"<value>\",\n \"organization_id\": \"<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 \"custom_field_id\": \"<value>\",\n \"custom_field\": {\n \"created_at\": dateutil.parser.isoparse(\"2023-11-16T07:29:59.811Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2023-04-09T18:35:32.219Z\"),\n \"id\": \"<value>\",\n \"metadata\": {\n \"key\": \"<value>\",\n },\n \"type\": \"date\",\n \"slug\": \"<value>\",\n \"name\": \"<value>\",\n \"organization_id\": \"<value>\",\n \"properties\": {},\n },\n \"order\": 492053,\n \"required\": True,\n },\n {\n \"custom_field_id\": \"<value>\",\n \"custom_field\": {\n \"created_at\": dateutil.parser.isoparse(\"2023-03-07T07:24:39.165Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2025-01-25T07:31:37.106Z\"),\n \"id\": \"<value>\",\n \"metadata\": {\n \"key\": False,\n },\n \"type\": \"text\",\n \"slug\": \"<value>\",\n \"name\": \"<value>\",\n \"organization_id\": \"<value>\",\n \"properties\": {},\n },\n \"order\": 17631,\n \"required\": True,\n },\n ],\n },\n })\n\n # Handle response\n print(res)"
- target: $["paths"]["product.updated"]["post"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "import dateutil.parser\nimport polar_sdk\nfrom polar_sdk import Polar\n\nwith Polar() as polar:\n\n res = polar.endpointproduct_updated_post(request={\n \"type\": \"product.updated\",\n \"data\": {\n \"created_at\": dateutil.parser.isoparse(\"2024-06-25T03:46:32.479Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2023-06-04T01:47:33.158Z\"),\n \"id\": \"<value>\",\n \"name\": \"<value>\",\n \"description\": \"er ick birdcage\",\n \"is_recurring\": True,\n \"is_archived\": False,\n \"organization_id\": \"<value>\",\n \"metadata\": {\n\n },\n \"prices\": [\n {\n \"created_at\": dateutil.parser.isoparse(\"2023-04-14T23:22:06.974Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2023-11-27T16:49:54.775Z\"),\n \"id\": \"<value>\",\n \"amount_type\": \"fixed\",\n \"is_archived\": False,\n \"product_id\": \"<value>\",\n \"price_currency\": \"<value>\",\n \"price_amount\": 320395,\n \"type\": \"recurring\",\n \"recurring_interval\": polar_sdk.SubscriptionRecurringInterval.MONTH,\n },\n ],\n \"benefits\": [\n {\n \"created_at\": dateutil.parser.isoparse(\"2023-06-01T01:28:53.091Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2024-02-29T01:53:23.154Z\"),\n \"id\": \"<value>\",\n \"type\": \"discord\",\n \"description\": \"ick birdcage manage shark along always modulo fidget inside lightly\",\n \"selectable\": False,\n \"deletable\": False,\n \"organization_id\": \"<value>\",\n \"properties\": {\n \"guild_id\": \"<id>\",\n \"role_id\": \"<id>\",\n \"guild_token\": \"<value>\",\n },\n },\n {\n \"created_at\": dateutil.parser.isoparse(\"2024-02-12T19:04:33.442Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2024-03-30T22:30:29.668Z\"),\n \"id\": \"<value>\",\n \"type\": \"github_repository\",\n \"description\": \"lotion role till by yuck terribly\",\n \"selectable\": False,\n \"deletable\": False,\n \"organization_id\": \"<value>\",\n \"properties\": {\n \"repository_owner\": \"polarsource\",\n \"repository_name\": \"private_repo\",\n \"permission\": polar_sdk.Permission.MAINTAIN,\n },\n },\n {\n \"created_at\": dateutil.parser.isoparse(\"2023-05-05T14:08:08.545Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2023-10-20T01:25:33.770Z\"),\n \"id\": \"<value>\",\n \"type\": \"github_repository\",\n \"description\": \"minor aha boohoo team\",\n \"selectable\": False,\n \"deletable\": False,\n \"organization_id\": \"<value>\",\n \"properties\": {\n \"repository_owner\": \"polarsource\",\n \"repository_name\": \"private_repo\",\n \"permission\": polar_sdk.Permission.PULL,\n },\n },\n ],\n \"medias\": [\n {\n \"id\": \"<value>\",\n \"organization_id\": \"<value>\",\n \"name\": \"<value>\",\n \"path\": \"/usr/libexec\",\n \"mime_type\": \"<value>\",\n \"size\": 151389,\n \"storage_version\": \"<value>\",\n \"checksum_etag\": \"<value>\",\n \"checksum_sha256_base64\": \"<value>\",\n \"checksum_sha256_hex\": \"<value>\",\n \"last_modified_at\": dateutil.parser.isoparse(\"2023-12-22T05:20:03.719Z\"),\n \"version\": \"<value>\",\n \"service\": \"product_media\",\n \"is_uploaded\": False,\n \"created_at\": dateutil.parser.isoparse(\"2025-02-18T02:35:29.302Z\"),\n \"size_readable\": \"<value>\",\n \"public_url\": \"https://meager-dividend.biz\",\n },\n ],\n \"attached_custom_fields\": [\n {\n \"custom_field_id\": \"<value>\",\n \"custom_field\": {\n \"created_at\": dateutil.parser.isoparse(\"2023-10-31T20:54:51.973Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2025-06-25T07:43:21.903Z\"),\n \"id\": \"<value>\",\n \"metadata\": {\n \"key\": False,\n },\n \"type\": \"date\",\n \"slug\": \"<value>\",\n \"name\": \"<value>\",\n \"organization_id\": \"<value>\",\n \"properties\": {},\n },\n \"order\": 19557,\n \"required\": True,\n },\n {\n \"custom_field_id\": \"<value>\",\n \"custom_field\": {\n \"created_at\": dateutil.parser.isoparse(\"2024-06-27T03:01:35.144Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2023-03-31T13:51:41.910Z\"),\n \"id\": \"<value>\",\n \"metadata\": {\n \"key\": \"<value>\",\n },\n \"type\": \"text\",\n \"slug\": \"<value>\",\n \"name\": \"<value>\",\n \"organization_id\": \"<value>\",\n \"properties\": {},\n },\n \"order\": 753420,\n \"required\": True,\n },\n {\n \"custom_field_id\": \"<value>\",\n \"custom_field\": {\n \"created_at\": dateutil.parser.isoparse(\"2023-12-10T00:18:34.847Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2025-08-19T11:13:30.301Z\"),\n \"id\": \"<value>\",\n \"metadata\": {\n \"key\": 700832,\n },\n \"type\": \"date\",\n \"slug\": \"<value>\",\n \"name\": \"<value>\",\n \"organization_id\": \"<value>\",\n \"properties\": {},\n },\n \"order\": 454407,\n \"required\": True,\n },\n ],\n },\n })\n\n # Handle response\n print(res)"
- target: $["paths"]["subscription.active"]["post"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "import dateutil.parser\nimport polar_sdk\nfrom polar_sdk import Polar\n\nwith Polar() as polar:\n\n res = polar.endpointsubscription_active_post(request=polar_sdk.WebhookSubscriptionActivePayload(\n type=\"subscription.active\",\n data=polar_sdk.Subscription(\n created_at=dateutil.parser.isoparse(\"2023-09-17T11:03:44.679Z\"),\n modified_at=dateutil.parser.isoparse(\"2025-07-24T20:02:17.426Z\"),\n id=\"<value>\",\n amount=116760,\n currency=\"Quetzal\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.MONTH,\n status=polar_sdk.SubscriptionStatus.INCOMPLETE,\n current_period_start=dateutil.parser.isoparse(\"2023-08-25T00:14:50.252Z\"),\n current_period_end=dateutil.parser.isoparse(\"2023-12-10T18:25:01.577Z\"),\n cancel_at_period_end=False,\n canceled_at=dateutil.parser.isoparse(\"2024-07-05T14:07:23.099Z\"),\n started_at=dateutil.parser.isoparse(\"2024-06-30T08:12:48.355Z\"),\n ends_at=dateutil.parser.isoparse(\"2023-06-29T07:42:54.895Z\"),\n ended_at=dateutil.parser.isoparse(\"2025-10-30T02:51:06.576Z\"),\n customer_id=\"<value>\",\n product_id=\"<value>\",\n price_id=\"<value>\",\n discount_id=\"<value>\",\n checkout_id=\"<value>\",\n customer_cancellation_reason=polar_sdk.CustomerCancellationReason.SWITCHED_SERVICE,\n customer_cancellation_comment=\"<value>\",\n metadata={\n \"key\": True,\n \"key1\": \"<value>\",\n \"key2\": 615212,\n },\n customer={\n \"created_at\": dateutil.parser.isoparse(\"2023-04-25T08:49:41.567Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2025-09-05T08:50:11.879Z\"),\n \"id\": \"<value>\",\n \"metadata\": {\n\n },\n \"email\": \"Felicia87@hotmail.com\",\n \"email_verified\": True,\n \"name\": \"<value>\",\n \"billing_address\": {\n \"country\": \"Cuba\",\n },\n \"tax_id\": [\n \"pe_ruc\",\n \"tr_tin\",\n ],\n \"organization_id\": \"<value>\",\n \"avatar_url\": \"https://steel-zebra.biz/\",\n },\n user_id=\"<value>\",\n user={\n \"id\": \"<value>\",\n \"email\": \"Raven_Feil@gmail.com\",\n \"public_name\": \"<value>\",\n },\n product={\n \"created_at\": dateutil.parser.isoparse(\"2024-08-26T12:17:17.429Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2025-06-15T18:12:34.300Z\"),\n \"id\": \"<value>\",\n \"name\": \"<value>\",\n \"description\": \"during boo place enchanting\",\n \"is_recurring\": False,\n \"is_archived\": False,\n \"organization_id\": \"<value>\",\n \"metadata\": {\n\n },\n \"prices\": [\n {\n \"created_at\": dateutil.parser.isoparse(\"2023-05-08T23:16:06.519Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2023-12-23T21:06:29.057Z\"),\n \"id\": \"<value>\",\n \"amount_type\": \"free\",\n \"is_archived\": False,\n \"product_id\": \"<value>\",\n \"type\": \"recurring\",\n \"recurring_interval\": polar_sdk.SubscriptionRecurringInterval.MONTH,\n },\n ],\n \"benefits\": [\n {\n \"created_at\": dateutil.parser.isoparse(\"2023-08-25T00:14:50.252Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2023-12-10T18:25:01.577Z\"),\n \"id\": \"<value>\",\n \"type\": \"ads\",\n \"description\": \"repeat catalyst wiggly table while amidst during\",\n \"selectable\": False,\n \"deletable\": False,\n \"organization_id\": \"<value>\",\n \"properties\": {},\n },\n {\n \"created_at\": dateutil.parser.isoparse(\"2023-06-02T05:19:01.352Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2023-07-07T22:15:53.860Z\"),\n \"id\": \"<value>\",\n \"type\": \"ads\",\n \"description\": \"until below barring\",\n \"selectable\": False,\n \"deletable\": False,\n \"organization_id\": \"<value>\",\n \"properties\": {},\n },\n ],\n \"medias\": [\n {\n \"id\": \"<value>\",\n \"organization_id\": \"<value>\",\n \"name\": \"<value>\",\n \"path\": \"/media\",\n \"mime_type\": \"<value>\",\n \"size\": 931655,\n \"storage_version\": \"<value>\",\n \"checksum_etag\": \"<value>\",\n \"checksum_sha256_base64\": \"<value>\",\n \"checksum_sha256_hex\": \"<value>\",\n \"last_modified_at\": dateutil.parser.isoparse(\"2023-06-07T17:40:48.757Z\"),\n \"version\": \"<value>\",\n \"service\": \"product_media\",\n \"is_uploaded\": False,\n \"created_at\": dateutil.parser.isoparse(\"2024-07-27T18:04:02.928Z\"),\n \"size_readable\": \"<value>\",\n \"public_url\": \"https://remorseful-hamburger.name\",\n },\n ],\n \"attached_custom_fields\": [\n {\n \"custom_field_id\": \"<value>\",\n \"custom_field\": {\n \"created_at\": dateutil.parser.isoparse(\"2024-03-04T01:17:37.967Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2023-06-12T20:00:04.431Z\"),\n \"id\": \"<value>\",\n \"metadata\": {\n \"key\": \"<value>\",\n },\n \"type\": \"number\",\n \"slug\": \"<value>\",\n \"name\": \"<value>\",\n \"organization_id\": \"<value>\",\n \"properties\": {},\n },\n \"order\": 769742,\n \"required\": False,\n },\n {\n \"custom_field_id\": \"<value>\",\n \"custom_field\": {\n \"created_at\": dateutil.parser.isoparse(\"2023-06-14T23:00:03.799Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2024-02-09T05:47:51.810Z\"),\n \"id\": \"<value>\",\n \"metadata\": {\n \"key\": \"<value>\",\n },\n \"type\": \"number\",\n \"slug\": \"<value>\",\n \"name\": \"<value>\",\n \"organization_id\": \"<value>\",\n \"properties\": {},\n },\n \"order\": 61975,\n \"required\": False,\n },\n {\n \"custom_field_id\": \"<value>\",\n \"custom_field\": {\n \"created_at\": dateutil.parser.isoparse(\"2025-02-15T09:26:15.001Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2025-12-17T07:08:38.057Z\"),\n \"id\": \"<value>\",\n \"metadata\": {\n \"key\": False,\n },\n \"type\": \"select\",\n \"slug\": \"<value>\",\n \"name\": \"<value>\",\n \"organization_id\": \"<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 \"created_at\": dateutil.parser.isoparse(\"2025-09-06T01:15:07.788Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2024-06-24T14:24:29.896Z\"),\n \"id\": \"<value>\",\n \"amount_type\": \"custom\",\n \"is_archived\": False,\n \"product_id\": \"<value>\",\n \"price_currency\": \"<value>\",\n \"minimum_amount\": 135533,\n \"maximum_amount\": 811194,\n \"preset_amount\": 58418,\n \"type\": \"recurring\",\n \"recurring_interval\": polar_sdk.SubscriptionRecurringInterval.MONTH,\n },\n discount={\n \"duration\": polar_sdk.DiscountDuration.REPEATING,\n \"duration_in_months\": 584149,\n \"type\": polar_sdk.DiscountType.PERCENTAGE,\n \"basis_points\": 322734,\n \"created_at\": dateutil.parser.isoparse(\"2023-05-15T20:51:57.377Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2023-02-17T01:45:27.746Z\"),\n \"id\": \"<value>\",\n \"metadata\": {\n \"key\": \"<value>\",\n },\n \"name\": \"<value>\",\n \"code\": \"<value>\",\n \"starts_at\": dateutil.parser.isoparse(\"2025-02-17T13:39:50.808Z\"),\n \"ends_at\": dateutil.parser.isoparse(\"2025-03-27T06:27:09.035Z\"),\n \"max_redemptions\": 471788,\n \"redemptions_count\": 775460,\n \"organization_id\": \"<value>\",\n },\n ),\n ))\n\n # Handle response\n print(res)"
- target: $["paths"]["subscription.canceled"]["post"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "import dateutil.parser\nimport polar_sdk\nfrom polar_sdk import Polar\n\nwith Polar() as polar:\n\n res = polar.endpointsubscription_canceled_post(request=polar_sdk.WebhookSubscriptionCanceledPayload(\n type=\"subscription.canceled\",\n data=polar_sdk.Subscription(\n created_at=dateutil.parser.isoparse(\"2024-02-08T10:04:43.200Z\"),\n modified_at=dateutil.parser.isoparse(\"2023-02-20T09:16:44.963Z\"),\n id=\"<value>\",\n amount=384017,\n currency=\"Nakfa\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.MONTH,\n status=polar_sdk.SubscriptionStatus.CANCELED,\n current_period_start=dateutil.parser.isoparse(\"2025-08-29T23:51:26.505Z\"),\n current_period_end=dateutil.parser.isoparse(\"2024-01-30T14:57:29.126Z\"),\n cancel_at_period_end=False,\n canceled_at=dateutil.parser.isoparse(\"2023-05-31T10:57:35.559Z\"),\n started_at=dateutil.parser.isoparse(\"2024-10-31T08:13:37.012Z\"),\n ends_at=dateutil.parser.isoparse(\"2023-08-22T21:50:14.399Z\"),\n ended_at=dateutil.parser.isoparse(\"2023-07-13T20:08:34.251Z\"),\n customer_id=\"<value>\",\n product_id=\"<value>\",\n price_id=\"<value>\",\n discount_id=\"<value>\",\n checkout_id=\"<value>\",\n customer_cancellation_reason=polar_sdk.CustomerCancellationReason.TOO_EXPENSIVE,\n customer_cancellation_comment=\"<value>\",\n metadata={\n \"key\": \"<value>\",\n \"key1\": \"<value>\",\n \"key2\": 199269,\n },\n customer={\n \"created_at\": dateutil.parser.isoparse(\"2023-12-04T19:57:16.999Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2025-01-03T00:48:16.846Z\"),\n \"id\": \"<value>\",\n \"metadata\": {\n \"key\": \"<value>\",\n },\n \"email\": \"Ila.Waters90@hotmail.com\",\n \"email_verified\": False,\n \"name\": \"<value>\",\n \"billing_address\": {\n \"country\": \"Costa Rica\",\n },\n \"tax_id\": [\n \"eu_oss_vat\",\n \"in_gst\",\n ],\n \"organization_id\": \"<value>\",\n \"avatar_url\": \"https://pretty-t-shirt.info/\",\n },\n user_id=\"<value>\",\n user={\n \"id\": \"<value>\",\n \"email\": \"Hubert4@yahoo.com\",\n \"public_name\": \"<value>\",\n },\n product={\n \"created_at\": dateutil.parser.isoparse(\"2024-12-23T22:35:56.583Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2023-10-09T20:16:33.963Z\"),\n \"id\": \"<value>\",\n \"name\": \"<value>\",\n \"description\": \"where yogurt atop\",\n \"is_recurring\": False,\n \"is_archived\": False,\n \"organization_id\": \"<value>\",\n \"metadata\": {\n \"key\": \"<value>\",\n \"key1\": 62716,\n \"key2\": 45973,\n },\n \"prices\": [\n {\n \"created_at\": dateutil.parser.isoparse(\"2024-04-19T18:43:33.089Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2025-05-30T17:50:59.070Z\"),\n \"id\": \"<value>\",\n \"amount_type\": \"fixed\",\n \"is_archived\": False,\n \"product_id\": \"<value>\",\n \"price_currency\": \"<value>\",\n \"price_amount\": 886856,\n \"type\": \"recurring\",\n \"recurring_interval\": polar_sdk.SubscriptionRecurringInterval.MONTH,\n },\n {\n \"created_at\": dateutil.parser.isoparse(\"2024-10-31T08:13:37.012Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2023-08-22T21:50:14.399Z\"),\n \"id\": \"<value>\",\n \"amount_type\": \"fixed\",\n \"is_archived\": False,\n \"product_id\": \"<value>\",\n \"price_currency\": \"<value>\",\n \"price_amount\": 176860,\n \"type\": \"one_time\",\n },\n {\n \"created_at\": dateutil.parser.isoparse(\"2023-10-29T03:39:59.256Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2023-02-12T13:18:53.912Z\"),\n \"id\": \"<value>\",\n \"amount_type\": \"free\",\n \"is_archived\": False,\n \"product_id\": \"<value>\",\n \"type\": \"one_time\",\n },\n ],\n \"benefits\": [\n {\n \"created_at\": dateutil.parser.isoparse(\"2023-08-07T09:34:29.827Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2023-12-04T19:57:16.999Z\"),\n \"id\": \"<value>\",\n \"type\": \"discord\",\n \"description\": \"lost hm quickly though aside ick ha intermix\",\n \"selectable\": False,\n \"deletable\": False,\n \"organization_id\": \"<value>\",\n \"properties\": {\n \"guild_id\": \"<id>\",\n \"role_id\": \"<id>\",\n \"guild_token\": \"<value>\",\n },\n },\n ],\n \"medias\": [\n {\n \"id\": \"<value>\",\n \"organization_id\": \"<value>\",\n \"name\": \"<value>\",\n \"path\": \"/root\",\n \"mime_type\": \"<value>\",\n \"size\": 856792,\n \"storage_version\": \"<value>\",\n \"checksum_etag\": \"<value>\",\n \"checksum_sha256_base64\": \"<value>\",\n \"checksum_sha256_hex\": \"<value>\",\n \"last_modified_at\": dateutil.parser.isoparse(\"2023-05-15T05:51:11.123Z\"),\n \"version\": \"<value>\",\n \"service\": \"product_media\",\n \"is_uploaded\": True,\n \"created_at\": dateutil.parser.isoparse(\"2023-10-19T06:08:48.337Z\"),\n \"size_readable\": \"<value>\",\n \"public_url\": \"https://delirious-stir-fry.name\",\n },\n {\n \"id\": \"<value>\",\n \"organization_id\": \"<value>\",\n \"name\": \"<value>\",\n \"path\": \"/mnt\",\n \"mime_type\": \"<value>\",\n \"size\": 683673,\n \"storage_version\": \"<value>\",\n \"checksum_etag\": \"<value>\",\n \"checksum_sha256_base64\": \"<value>\",\n \"checksum_sha256_hex\": \"<value>\",\n \"last_modified_at\": dateutil.parser.isoparse(\"2025-12-28T00:16:36.233Z\"),\n \"version\": \"<value>\",\n \"service\": \"product_media\",\n \"is_uploaded\": True,\n \"created_at\": dateutil.parser.isoparse(\"2024-07-03T23:27:48.693Z\"),\n \"size_readable\": \"<value>\",\n \"public_url\": \"https://self-reliant-comestible.org\",\n },\n ],\n \"attached_custom_fields\": [\n {\n \"custom_field_id\": \"<value>\",\n \"custom_field\": {\n \"created_at\": dateutil.parser.isoparse(\"2025-11-13T05:08:44.367Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2024-07-21T08:02:14.955Z\"),\n \"id\": \"<value>\",\n \"metadata\": {\n \"key\": False,\n },\n \"type\": \"checkbox\",\n \"slug\": \"<value>\",\n \"name\": \"<value>\",\n \"organization_id\": \"<value>\",\n \"properties\": {},\n },\n \"order\": 765648,\n \"required\": False,\n },\n ],\n },\n price={\n \"created_at\": dateutil.parser.isoparse(\"2023-10-22T11:03:54.228Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2025-10-01T18:39:54.278Z\"),\n \"id\": \"<value>\",\n \"amount_type\": \"free\",\n \"is_archived\": False,\n \"product_id\": \"<value>\",\n \"type\": \"recurring\",\n \"recurring_interval\": polar_sdk.SubscriptionRecurringInterval.MONTH,\n },\n discount={\n \"duration\": polar_sdk.DiscountDuration.ONCE,\n \"duration_in_months\": 438878,\n \"type\": polar_sdk.DiscountType.FIXED,\n \"basis_points\": 438478,\n \"created_at\": dateutil.parser.isoparse(\"2024-09-23T18:38:00.001Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2024-08-14T01:44:53.657Z\"),\n \"id\": \"<value>\",\n \"metadata\": {\n \"key\": 15348,\n },\n \"name\": \"<value>\",\n \"code\": \"<value>\",\n \"starts_at\": dateutil.parser.isoparse(\"2024-06-25T21:45:27.684Z\"),\n \"ends_at\": dateutil.parser.isoparse(\"2025-06-29T16:54:58.368Z\"),\n \"max_redemptions\": 135038,\n \"redemptions_count\": 955669,\n \"organization_id\": \"<value>\",\n },\n ),\n ))\n\n # Handle response\n print(res)"
- target: $["paths"]["subscription.created"]["post"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "import dateutil.parser\nimport polar_sdk\nfrom polar_sdk import Polar\n\nwith Polar() as polar:\n\n res = polar.endpointsubscription_created_post(request=polar_sdk.WebhookSubscriptionCreatedPayload(\n type=\"subscription.created\",\n data=polar_sdk.Subscription(\n created_at=dateutil.parser.isoparse(\"2024-07-03T01:29:40.920Z\"),\n modified_at=dateutil.parser.isoparse(\"2023-02-20T03:35:25.500Z\"),\n id=\"<value>\",\n amount=78980,\n currency=\"Dong\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.MONTH,\n status=polar_sdk.SubscriptionStatus.INCOMPLETE_EXPIRED,\n current_period_start=dateutil.parser.isoparse(\"2025-01-25T02:46:12.208Z\"),\n current_period_end=dateutil.parser.isoparse(\"2023-10-08T16:07:22.449Z\"),\n cancel_at_period_end=False,\n canceled_at=dateutil.parser.isoparse(\"2025-10-17T20:21:29.819Z\"),\n started_at=dateutil.parser.isoparse(\"2023-02-26T17:52:17.099Z\"),\n ends_at=dateutil.parser.isoparse(\"2023-07-04T19:46:53.033Z\"),\n ended_at=dateutil.parser.isoparse(\"2023-09-06T09:33:34.348Z\"),\n customer_id=\"<value>\",\n product_id=\"<value>\",\n price_id=\"<value>\",\n discount_id=\"<value>\",\n checkout_id=\"<value>\",\n customer_cancellation_reason=polar_sdk.CustomerCancellationReason.UNUSED,\n customer_cancellation_comment=\"<value>\",\n metadata={\n \"key\": \"<value>\",\n \"key1\": 229409,\n },\n customer={\n \"created_at\": dateutil.parser.isoparse(\"2023-04-01T11:22:10.531Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2024-06-26T00:08:47.301Z\"),\n \"id\": \"<value>\",\n \"metadata\": {\n \"key\": True,\n },\n \"email\": \"Lia42@hotmail.com\",\n \"email_verified\": False,\n \"name\": \"<value>\",\n \"billing_address\": {\n \"country\": \"Bhutan\",\n },\n \"tax_id\": [\n \"il_vat\",\n ],\n \"organization_id\": \"<value>\",\n \"avatar_url\": \"https://tense-convection.net/\",\n },\n user_id=\"<value>\",\n user={\n \"id\": \"<value>\",\n \"email\": \"Carson_Raynor@gmail.com\",\n \"public_name\": \"<value>\",\n },\n product={\n \"created_at\": dateutil.parser.isoparse(\"2023-03-19T22:51:30.621Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2025-04-17T16:08:26.249Z\"),\n \"id\": \"<value>\",\n \"name\": \"<value>\",\n \"description\": \"twine deed um on sudden\",\n \"is_recurring\": True,\n \"is_archived\": False,\n \"organization_id\": \"<value>\",\n \"metadata\": {\n\n },\n \"prices\": [\n {\n \"created_at\": dateutil.parser.isoparse(\"2023-03-28T13:29:27.613Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2025-10-05T17:53:50.261Z\"),\n \"id\": \"<value>\",\n \"amount_type\": \"fixed\",\n \"is_archived\": False,\n \"product_id\": \"<value>\",\n \"price_currency\": \"<value>\",\n \"price_amount\": 418755,\n \"type\": \"one_time\",\n },\n ],\n \"benefits\": [\n {\n \"created_at\": dateutil.parser.isoparse(\"2025-01-25T02:46:12.208Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2023-10-08T16:07:22.449Z\"),\n \"id\": \"<value>\",\n \"type\": \"custom\",\n \"description\": \"boohoo huff wherever gosh bah who dimly sell\",\n \"selectable\": False,\n \"deletable\": False,\n \"organization_id\": \"<value>\",\n \"properties\": {\n \"note\": \"<value>\",\n },\n \"is_tax_applicable\": False,\n },\n ],\n \"medias\": [\n {\n \"id\": \"<value>\",\n \"organization_id\": \"<value>\",\n \"name\": \"<value>\",\n \"path\": \"/sys\",\n \"mime_type\": \"<value>\",\n \"size\": 580222,\n \"storage_version\": \"<value>\",\n \"checksum_etag\": \"<value>\",\n \"checksum_sha256_base64\": \"<value>\",\n \"checksum_sha256_hex\": \"<value>\",\n \"last_modified_at\": dateutil.parser.isoparse(\"2025-06-23T21:40:44.558Z\"),\n \"version\": \"<value>\",\n \"service\": \"product_media\",\n \"is_uploaded\": True,\n \"created_at\": dateutil.parser.isoparse(\"2024-07-20T01:51:58.643Z\"),\n \"size_readable\": \"<value>\",\n \"public_url\": \"https://dapper-marimba.com/\",\n },\n ],\n \"attached_custom_fields\": [\n {\n \"custom_field_id\": \"<value>\",\n \"custom_field\": {\n \"created_at\": dateutil.parser.isoparse(\"2024-06-15T07:33:50.720Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2023-02-18T09:48:15.743Z\"),\n \"id\": \"<value>\",\n \"metadata\": {\n \"key\": \"<value>\",\n },\n \"type\": \"number\",\n \"slug\": \"<value>\",\n \"name\": \"<value>\",\n \"organization_id\": \"<value>\",\n \"properties\": {},\n },\n \"order\": 985796,\n \"required\": False,\n },\n ],\n },\n price={\n \"created_at\": dateutil.parser.isoparse(\"2023-07-07T19:12:22.984Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2025-04-01T08:49:19.831Z\"),\n \"id\": \"<value>\",\n \"amount_type\": \"free\",\n \"is_archived\": False,\n \"product_id\": \"<value>\",\n \"type\": \"recurring\",\n \"recurring_interval\": polar_sdk.SubscriptionRecurringInterval.YEAR,\n },\n discount={\n \"duration\": polar_sdk.DiscountDuration.ONCE,\n \"type\": polar_sdk.DiscountType.PERCENTAGE,\n \"amount\": 966867,\n \"currency\": \"New Taiwan Dollar\",\n \"created_at\": dateutil.parser.isoparse(\"2024-01-18T07:13:43.618Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2025-03-25T07:32:09.500Z\"),\n \"id\": \"<value>\",\n \"metadata\": {\n \"key\": 601487,\n },\n \"name\": \"<value>\",\n \"code\": \"<value>\",\n \"starts_at\": dateutil.parser.isoparse(\"2025-06-17T14:49:05.261Z\"),\n \"ends_at\": dateutil.parser.isoparse(\"2024-04-08T12:02:25.241Z\"),\n \"max_redemptions\": 966758,\n \"redemptions_count\": 120361,\n \"organization_id\": \"<value>\",\n },\n ),\n ))\n\n # Handle response\n print(res)"
- target: $["paths"]["subscription.revoked"]["post"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "import dateutil.parser\nimport polar_sdk\nfrom polar_sdk import Polar\n\nwith Polar() as polar:\n\n res = polar.endpointsubscription_revoked_post(request=polar_sdk.WebhookSubscriptionRevokedPayload(\n type=\"subscription.revoked\",\n data=polar_sdk.Subscription(\n created_at=dateutil.parser.isoparse(\"2025-11-29T12:00:55.925Z\"),\n modified_at=dateutil.parser.isoparse(\"2023-03-13T04:36:55.320Z\"),\n id=\"<value>\",\n amount=780683,\n currency=\"CFP Franc\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.YEAR,\n status=polar_sdk.SubscriptionStatus.TRIALING,\n current_period_start=dateutil.parser.isoparse(\"2023-06-20T05:55:42.170Z\"),\n current_period_end=dateutil.parser.isoparse(\"2024-05-16T17:55:53.899Z\"),\n cancel_at_period_end=True,\n canceled_at=dateutil.parser.isoparse(\"2025-10-25T10:04:20.460Z\"),\n started_at=dateutil.parser.isoparse(\"2024-09-29T18:36:35.285Z\"),\n ends_at=dateutil.parser.isoparse(\"2024-02-23T17:26:12.806Z\"),\n ended_at=dateutil.parser.isoparse(\"2024-01-24T11:12:57.680Z\"),\n customer_id=\"<value>\",\n product_id=\"<value>\",\n price_id=\"<value>\",\n discount_id=\"<value>\",\n checkout_id=\"<value>\",\n customer_cancellation_reason=polar_sdk.CustomerCancellationReason.TOO_EXPENSIVE,\n customer_cancellation_comment=\"<value>\",\n metadata={\n\n },\n customer={\n \"created_at\": dateutil.parser.isoparse(\"2025-09-02T15:09:07.489Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2025-06-23T22:13:15.423Z\"),\n \"id\": \"<value>\",\n \"metadata\": {\n \"key\": \"<value>\",\n \"key1\": 182663,\n },\n \"email\": \"Arvilla_Walsh62@yahoo.com\",\n \"email_verified\": False,\n \"name\": \"<value>\",\n \"billing_address\": {\n \"country\": \"Portugal\",\n },\n \"tax_id\": [\n polar_sdk.TaxIDFormat.AU_ARN,\n ],\n \"organization_id\": \"<value>\",\n \"avatar_url\": \"https://exotic-traffic.com/\",\n },\n user_id=\"<value>\",\n user={\n \"id\": \"<value>\",\n \"email\": \"Percival.Schuster21@hotmail.com\",\n \"public_name\": \"<value>\",\n },\n product={\n \"created_at\": dateutil.parser.isoparse(\"2024-10-17T20:35:01.045Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2025-05-01T17:14:35.906Z\"),\n \"id\": \"<value>\",\n \"name\": \"<value>\",\n \"description\": \"scout second management whose underachieve weakly yippee\",\n \"is_recurring\": True,\n \"is_archived\": False,\n \"organization_id\": \"<value>\",\n \"metadata\": {\n\n },\n \"prices\": [\n {\n \"created_at\": dateutil.parser.isoparse(\"2024-08-16T13:41:14.572Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2023-12-18T14:14:00.851Z\"),\n \"id\": \"<value>\",\n \"amount_type\": \"free\",\n \"is_archived\": False,\n \"product_id\": \"<value>\",\n \"type\": \"one_time\",\n },\n {\n \"created_at\": dateutil.parser.isoparse(\"2024-06-24T17:28:30.971Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2025-10-25T10:04:20.460Z\"),\n \"id\": \"<value>\",\n \"amount_type\": \"custom\",\n \"is_archived\": False,\n \"product_id\": \"<value>\",\n \"price_currency\": \"<value>\",\n \"minimum_amount\": 581912,\n \"maximum_amount\": 382050,\n \"preset_amount\": 354441,\n \"type\": \"recurring\",\n \"recurring_interval\": polar_sdk.SubscriptionRecurringInterval.YEAR,\n },\n ],\n \"benefits\": [\n {\n \"created_at\": dateutil.parser.isoparse(\"2025-09-02T15:09:07.489Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2025-06-23T22:13:15.423Z\"),\n \"id\": \"<value>\",\n \"type\": \"ads\",\n \"description\": \"up bar slime ghost in unfortunate nucleotidase\",\n \"selectable\": False,\n \"deletable\": False,\n \"organization_id\": \"<value>\",\n \"properties\": {},\n },\n {\n \"created_at\": dateutil.parser.isoparse(\"2025-11-03T18:34:11.634Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2025-07-16T07:46:09.918Z\"),\n \"id\": \"<value>\",\n \"type\": \"license_keys\",\n \"description\": \"kick cinder comestible\",\n \"selectable\": False,\n \"deletable\": False,\n \"organization_id\": \"<value>\",\n \"properties\": {\n \"prefix\": \"<value>\",\n \"expires\": {\n \"ttl\": 936440,\n \"timeframe\": polar_sdk.Timeframe.MONTH,\n },\n \"activations\": {\n \"limit\": 307478,\n \"enable_customer_admin\": False,\n },\n \"limit_usage\": 533914,\n },\n },\n {\n \"created_at\": dateutil.parser.isoparse(\"2025-03-19T06:48:17.921Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2025-05-02T04:57:51.538Z\"),\n \"id\": \"<value>\",\n \"type\": \"ads\",\n \"description\": \"altruistic vaguely delirious\",\n \"selectable\": False,\n \"deletable\": False,\n \"organization_id\": \"<value>\",\n \"properties\": {},\n },\n ],\n \"medias\": [\n {\n \"id\": \"<value>\",\n \"organization_id\": \"<value>\",\n \"name\": \"<value>\",\n \"path\": \"/usr/bin\",\n \"mime_type\": \"<value>\",\n \"size\": 406671,\n \"storage_version\": \"<value>\",\n \"checksum_etag\": \"<value>\",\n \"checksum_sha256_base64\": \"<value>\",\n \"checksum_sha256_hex\": \"<value>\",\n \"last_modified_at\": dateutil.parser.isoparse(\"2025-03-28T05:43:23.560Z\"),\n \"version\": \"<value>\",\n \"service\": \"product_media\",\n \"is_uploaded\": False,\n \"created_at\": dateutil.parser.isoparse(\"2024-04-23T18:43:10.741Z\"),\n \"size_readable\": \"<value>\",\n \"public_url\": \"https://fragrant-appliance.name/\",\n },\n {\n \"id\": \"<value>\",\n \"organization_id\": \"<value>\",\n \"name\": \"<value>\",\n \"path\": \"/lost+found\",\n \"mime_type\": \"<value>\",\n \"size\": 76103,\n \"storage_version\": \"<value>\",\n \"checksum_etag\": \"<value>\",\n \"checksum_sha256_base64\": \"<value>\",\n \"checksum_sha256_hex\": \"<value>\",\n \"last_modified_at\": dateutil.parser.isoparse(\"2024-01-01T17:02:54.395Z\"),\n \"version\": \"<value>\",\n \"service\": \"product_media\",\n \"is_uploaded\": False,\n \"created_at\": dateutil.parser.isoparse(\"2025-07-29T05:29:45.670Z\"),\n \"size_readable\": \"<value>\",\n \"public_url\": \"https://calculating-lieu.biz\",\n },\n ],\n \"attached_custom_fields\": [\n {\n \"custom_field_id\": \"<value>\",\n \"custom_field\": {\n \"created_at\": dateutil.parser.isoparse(\"2024-10-25T16:43:54.572Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2023-06-30T10:25:57.370Z\"),\n \"id\": \"<value>\",\n \"metadata\": {\n \"key\": \"<value>\",\n },\n \"type\": \"text\",\n \"slug\": \"<value>\",\n \"name\": \"<value>\",\n \"organization_id\": \"<value>\",\n \"properties\": {},\n },\n \"order\": 628055,\n \"required\": False,\n },\n ],\n },\n price={\n \"created_at\": dateutil.parser.isoparse(\"2025-04-10T09:20:53.588Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2025-07-20T00:25:29.865Z\"),\n \"id\": \"<value>\",\n \"amount_type\": \"custom\",\n \"is_archived\": False,\n \"product_id\": \"<value>\",\n \"price_currency\": \"<value>\",\n \"minimum_amount\": 425288,\n \"maximum_amount\": 450102,\n \"preset_amount\": 374556,\n \"type\": \"recurring\",\n \"recurring_interval\": polar_sdk.SubscriptionRecurringInterval.MONTH,\n },\n discount={\n \"duration\": polar_sdk.DiscountDuration.REPEATING,\n \"type\": polar_sdk.DiscountType.PERCENTAGE,\n \"basis_points\": 928922,\n \"created_at\": dateutil.parser.isoparse(\"2023-05-15T22:26:54.006Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2024-10-17T16:46:10.227Z\"),\n \"id\": \"<value>\",\n \"metadata\": {\n \"key\": False,\n },\n \"name\": \"<value>\",\n \"code\": \"<value>\",\n \"starts_at\": dateutil.parser.isoparse(\"2025-11-02T20:54:50.367Z\"),\n \"ends_at\": dateutil.parser.isoparse(\"2023-09-22T21:33:21.170Z\"),\n \"max_redemptions\": 812657,\n \"redemptions_count\": 625027,\n \"organization_id\": \"<value>\",\n },\n ),\n ))\n\n # Handle response\n print(res)"
- target: $["paths"]["subscription.uncanceled"]["post"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "import dateutil.parser\nimport polar_sdk\nfrom polar_sdk import Polar\n\nwith Polar() as polar:\n\n res = polar.endpointsubscription_uncanceled_post(request=polar_sdk.WebhookSubscriptionUncanceledPayload(\n type=\"subscription.uncanceled\",\n data=polar_sdk.Subscription(\n created_at=dateutil.parser.isoparse(\"2024-06-17T13:11:57.598Z\"),\n modified_at=dateutil.parser.isoparse(\"2025-03-19T00:33:29.972Z\"),\n id=\"<value>\",\n amount=243909,\n currency=\"Swiss Franc\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.MONTH,\n status=polar_sdk.SubscriptionStatus.PAST_DUE,\n current_period_start=dateutil.parser.isoparse(\"2025-04-10T22:53:35.005Z\"),\n current_period_end=dateutil.parser.isoparse(\"2025-11-06T14:37:36.152Z\"),\n cancel_at_period_end=False,\n canceled_at=dateutil.parser.isoparse(\"2025-11-20T17:26:51.612Z\"),\n started_at=dateutil.parser.isoparse(\"2023-03-17T23:30:29.508Z\"),\n ends_at=dateutil.parser.isoparse(\"2024-09-26T10:53:58.966Z\"),\n ended_at=dateutil.parser.isoparse(\"2023-07-03T15:11:27.108Z\"),\n customer_id=\"<value>\",\n product_id=\"<value>\",\n price_id=\"<value>\",\n discount_id=\"<value>\",\n checkout_id=\"<value>\",\n customer_cancellation_reason=polar_sdk.CustomerCancellationReason.LOW_QUALITY,\n customer_cancellation_comment=\"<value>\",\n metadata={\n \"key\": 21399,\n \"key1\": \"<value>\",\n },\n customer={\n \"created_at\": dateutil.parser.isoparse(\"2023-12-13T17:38:34.053Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2025-01-30T22:08:30.455Z\"),\n \"id\": \"<value>\",\n \"metadata\": {\n\n },\n \"email\": \"Tess.Veum@yahoo.com\",\n \"email_verified\": False,\n \"name\": \"<value>\",\n \"billing_address\": {\n \"country\": \"Bangladesh\",\n },\n \"tax_id\": [\n \"us_ein\",\n \"jp_trn\",\n \"ca_gst_hst\",\n ],\n \"organization_id\": \"<value>\",\n \"avatar_url\": \"https://direct-ferret.org/\",\n },\n user_id=\"<value>\",\n user={\n \"id\": \"<value>\",\n \"email\": \"Everardo_Wilkinson@yahoo.com\",\n \"public_name\": \"<value>\",\n },\n product={\n \"created_at\": dateutil.parser.isoparse(\"2023-03-30T10:41:05.586Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2025-10-18T00:21:05.189Z\"),\n \"id\": \"<value>\",\n \"name\": \"<value>\",\n \"description\": \"fully pepper hm jovially outside coal bah fax midst\",\n \"is_recurring\": False,\n \"is_archived\": False,\n \"organization_id\": \"<value>\",\n \"metadata\": {\n \"key\": 737248,\n },\n \"prices\": [\n {\n \"created_at\": dateutil.parser.isoparse(\"2024-03-27T14:57:46.256Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2024-12-23T17:31:05.840Z\"),\n \"id\": \"<value>\",\n \"amount_type\": \"fixed\",\n \"is_archived\": False,\n \"product_id\": \"<value>\",\n \"price_currency\": \"<value>\",\n \"price_amount\": 758170,\n \"type\": \"recurring\",\n \"recurring_interval\": polar_sdk.SubscriptionRecurringInterval.YEAR,\n },\n ],\n \"benefits\": [\n {\n \"created_at\": dateutil.parser.isoparse(\"2025-11-20T17:26:51.612Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2023-03-17T23:30:29.508Z\"),\n \"id\": \"<value>\",\n \"type\": \"downloadables\",\n \"description\": \"besides along versus inasmuch uh-huh throughout yowza\",\n \"selectable\": False,\n \"deletable\": False,\n \"organization_id\": \"<value>\",\n \"properties\": {\n \"archived\": {\n \"key\": False,\n },\n \"files\": [\n \"<value>\",\n ],\n },\n },\n {\n \"created_at\": dateutil.parser.isoparse(\"2024-06-27T01:43:24.808Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2025-10-15T00:12:13.325Z\"),\n \"id\": \"<value>\",\n \"type\": \"license_keys\",\n \"description\": \"hm jovially outside coal bah fax midst tray\",\n \"selectable\": False,\n \"deletable\": False,\n \"organization_id\": \"<value>\",\n \"properties\": {\n \"prefix\": \"<value>\",\n \"expires\": {\n \"ttl\": 935806,\n \"timeframe\": polar_sdk.Timeframe.YEAR,\n },\n \"activations\": {\n \"limit\": 161102,\n \"enable_customer_admin\": False,\n },\n \"limit_usage\": 294527,\n },\n },\n {\n \"created_at\": dateutil.parser.isoparse(\"2024-02-04T13:14:10.428Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2023-01-29T13:29:57.900Z\"),\n \"id\": \"<value>\",\n \"type\": \"custom\",\n \"description\": \"faraway loudly well-made er oh upon overconfidently apprehensive tomb\",\n \"selectable\": False,\n \"deletable\": False,\n \"organization_id\": \"<value>\",\n \"properties\": {\n \"note\": \"<value>\",\n },\n \"is_tax_applicable\": False,\n },\n ],\n \"medias\": [\n {\n \"id\": \"<value>\",\n \"organization_id\": \"<value>\",\n \"name\": \"<value>\",\n \"path\": \"/rescue\",\n \"mime_type\": \"<value>\",\n \"size\": 406629,\n \"storage_version\": \"<value>\",\n \"checksum_etag\": \"<value>\",\n \"checksum_sha256_base64\": \"<value>\",\n \"checksum_sha256_hex\": \"<value>\",\n \"last_modified_at\": dateutil.parser.isoparse(\"2025-11-25T05:13:22.395Z\"),\n \"version\": \"<value>\",\n \"service\": \"product_media\",\n \"is_uploaded\": False,\n \"created_at\": dateutil.parser.isoparse(\"2024-01-12T01:04:51.744Z\"),\n \"size_readable\": \"<value>\",\n \"public_url\": \"https://major-scenario.com/\",\n },\n {\n \"id\": \"<value>\",\n \"organization_id\": \"<value>\",\n \"name\": \"<value>\",\n \"path\": \"/System\",\n \"mime_type\": \"<value>\",\n \"size\": 743911,\n \"storage_version\": \"<value>\",\n \"checksum_etag\": \"<value>\",\n \"checksum_sha256_base64\": \"<value>\",\n \"checksum_sha256_hex\": \"<value>\",\n \"last_modified_at\": dateutil.parser.isoparse(\"2024-07-30T00:48:09.915Z\"),\n \"version\": \"<value>\",\n \"service\": \"product_media\",\n \"is_uploaded\": False,\n \"created_at\": dateutil.parser.isoparse(\"2023-01-08T04:01:53.027Z\"),\n \"size_readable\": \"<value>\",\n \"public_url\": \"https://mild-earth.info/\",\n },\n ],\n \"attached_custom_fields\": [\n {\n \"custom_field_id\": \"<value>\",\n \"custom_field\": {\n \"created_at\": dateutil.parser.isoparse(\"2025-06-28T02:22:05.259Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2024-02-11T19:17:01.107Z\"),\n \"id\": \"<value>\",\n \"metadata\": {\n \"key\": False,\n },\n \"type\": \"checkbox\",\n \"slug\": \"<value>\",\n \"name\": \"<value>\",\n \"organization_id\": \"<value>\",\n \"properties\": {},\n },\n \"order\": 892005,\n \"required\": False,\n },\n ],\n },\n price={\n \"created_at\": dateutil.parser.isoparse(\"2023-10-31T23:41:23.146Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2023-01-02T21:20:54.004Z\"),\n \"id\": \"<value>\",\n \"amount_type\": \"fixed\",\n \"is_archived\": False,\n \"product_id\": \"<value>\",\n \"price_currency\": \"<value>\",\n \"price_amount\": 913586,\n \"type\": \"recurring\",\n \"recurring_interval\": polar_sdk.SubscriptionRecurringInterval.MONTH,\n },\n discount={\n \"duration\": polar_sdk.DiscountDuration.ONCE,\n \"type\": polar_sdk.DiscountType.FIXED,\n \"basis_points\": 958725,\n \"created_at\": dateutil.parser.isoparse(\"2024-02-03T22:58:13.335Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2023-12-04T23:56:43.538Z\"),\n \"id\": \"<value>\",\n \"metadata\": {\n \"key\": \"<value>\",\n },\n \"name\": \"<value>\",\n \"code\": \"<value>\",\n \"starts_at\": dateutil.parser.isoparse(\"2023-05-30T06:21:31.559Z\"),\n \"ends_at\": dateutil.parser.isoparse(\"2023-02-08T03:05:46.894Z\"),\n \"max_redemptions\": 389717,\n \"redemptions_count\": 23014,\n \"organization_id\": \"<value>\",\n },\n ),\n ))\n\n # Handle response\n print(res)"
- target: $["paths"]["subscription.updated"]["post"]
update:
"x-codeSamples":
- "lang": "python"
"label": "Python (SDK)"
"source": "import dateutil.parser\nimport polar_sdk\nfrom polar_sdk import Polar\n\nwith Polar() as polar:\n\n res = polar.endpointsubscription_updated_post(request=polar_sdk.WebhookSubscriptionUpdatedPayload(\n type=\"subscription.updated\",\n data=polar_sdk.Subscription(\n created_at=dateutil.parser.isoparse(\"2023-08-16T06:35:49.390Z\"),\n modified_at=dateutil.parser.isoparse(\"2025-11-13T10:48:05.575Z\"),\n id=\"<value>\",\n amount=299644,\n currency=\"Baht\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.YEAR,\n status=polar_sdk.SubscriptionStatus.TRIALING,\n current_period_start=dateutil.parser.isoparse(\"2025-10-06T07:01:55.000Z\"),\n current_period_end=dateutil.parser.isoparse(\"2025-01-20T06:59:31.349Z\"),\n cancel_at_period_end=False,\n canceled_at=dateutil.parser.isoparse(\"2023-10-04T04:56:04.382Z\"),\n started_at=dateutil.parser.isoparse(\"2023-01-22T12:57:07.430Z\"),\n ends_at=dateutil.parser.isoparse(\"2025-08-08T17:53:12.513Z\"),\n ended_at=dateutil.parser.isoparse(\"2023-10-08T02:40:52.099Z\"),\n customer_id=\"<value>\",\n product_id=\"<value>\",\n price_id=\"<value>\",\n discount_id=\"<value>\",\n checkout_id=\"<value>\",\n customer_cancellation_reason=polar_sdk.CustomerCancellationReason.TOO_EXPENSIVE,\n customer_cancellation_comment=\"<value>\",\n metadata={\n \"key\": 394013,\n },\n customer={\n \"created_at\": dateutil.parser.isoparse(\"2025-09-14T04:37:19.722Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2025-03-24T00:03:13.207Z\"),\n \"id\": \"<value>\",\n \"metadata\": {\n \"key\": \"<value>\",\n \"key1\": True,\n \"key2\": 392900,\n },\n \"email\": \"Dominic.Toy27@yahoo.com\",\n \"email_verified\": False,\n \"name\": \"<value>\",\n \"billing_address\": {\n \"country\": \"Sweden\",\n },\n \"tax_id\": [\n \"mx_rfc\",\n \"gb_vat\",\n \"<value>\",\n ],\n \"organization_id\": \"<value>\",\n \"avatar_url\": \"https://worthy-place.biz\",\n },\n user_id=\"<value>\",\n user={\n \"id\": \"<value>\",\n \"email\": \"Domenico_Franecki46@hotmail.com\",\n \"public_name\": \"<value>\",\n },\n product={\n \"created_at\": dateutil.parser.isoparse(\"2024-06-11T14:55:33.574Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2023-06-02T07:14:13.619Z\"),\n \"id\": \"<value>\",\n \"name\": \"<value>\",\n \"description\": \"intent that yowza\",\n \"is_recurring\": True,\n \"is_archived\": False,\n \"organization_id\": \"<value>\",\n \"metadata\": {\n \"key\": \"<value>\",\n \"key1\": True,\n },\n \"prices\": [\n {\n \"created_at\": dateutil.parser.isoparse(\"2023-11-25T09:50:52.301Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2025-06-16T22:58:18.488Z\"),\n \"id\": \"<value>\",\n \"amount_type\": \"free\",\n \"is_archived\": False,\n \"product_id\": \"<value>\",\n \"type\": \"recurring\",\n \"recurring_interval\": polar_sdk.SubscriptionRecurringInterval.YEAR,\n },\n ],\n \"benefits\": [\n {\n \"created_at\": dateutil.parser.isoparse(\"2025-10-06T07:01:55.000Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2025-01-20T06:59:31.349Z\"),\n \"id\": \"<value>\",\n \"type\": \"custom\",\n \"description\": \"meanwhile amount accurate pleasing delicious book frenetically brr considering huzzah\",\n \"selectable\": False,\n \"deletable\": False,\n \"organization_id\": \"<value>\",\n \"properties\": {\n \"note\": \"<value>\",\n },\n \"is_tax_applicable\": False,\n },\n ],\n \"medias\": [\n {\n \"id\": \"<value>\",\n \"organization_id\": \"<value>\",\n \"name\": \"<value>\",\n \"path\": \"/lost+found\",\n \"mime_type\": \"<value>\",\n \"size\": 562154,\n \"storage_version\": \"<value>\",\n \"checksum_etag\": \"<value>\",\n \"checksum_sha256_base64\": \"<value>\",\n \"checksum_sha256_hex\": \"<value>\",\n \"last_modified_at\": dateutil.parser.isoparse(\"2025-08-06T03:20:53.935Z\"),\n \"version\": \"<value>\",\n \"service\": \"product_media\",\n \"is_uploaded\": False,\n \"created_at\": dateutil.parser.isoparse(\"2024-09-06T09:54:32.715Z\"),\n \"size_readable\": \"<value>\",\n \"public_url\": \"https://rare-trash.info\",\n },\n {\n \"id\": \"<value>\",\n \"organization_id\": \"<value>\",\n \"name\": \"<value>\",\n \"path\": \"/etc/ppp\",\n \"mime_type\": \"<value>\",\n \"size\": 66044,\n \"storage_version\": \"<value>\",\n \"checksum_etag\": \"<value>\",\n \"checksum_sha256_base64\": \"<value>\",\n \"checksum_sha256_hex\": \"<value>\",\n \"last_modified_at\": dateutil.parser.isoparse(\"2025-07-07T23:54:00.303Z\"),\n \"version\": \"<value>\",\n \"service\": \"product_media\",\n \"is_uploaded\": True,\n \"created_at\": dateutil.parser.isoparse(\"2023-10-11T04:49:26.739Z\"),\n \"size_readable\": \"<value>\",\n \"public_url\": \"https://worse-ceramic.org\",\n },\n {\n \"id\": \"<value>\",\n \"organization_id\": \"<value>\",\n \"name\": \"<value>\",\n \"path\": \"/home\",\n \"mime_type\": \"<value>\",\n \"size\": 75695,\n \"storage_version\": \"<value>\",\n \"checksum_etag\": \"<value>\",\n \"checksum_sha256_base64\": \"<value>\",\n \"checksum_sha256_hex\": \"<value>\",\n \"last_modified_at\": dateutil.parser.isoparse(\"2023-09-16T06:56:23.715Z\"),\n \"version\": \"<value>\",\n \"service\": \"product_media\",\n \"is_uploaded\": False,\n \"created_at\": dateutil.parser.isoparse(\"2024-06-22T20:54:57.375Z\"),\n \"size_readable\": \"<value>\",\n \"public_url\": \"https://closed-seafood.info\",\n },\n ],\n \"attached_custom_fields\": [\n {\n \"custom_field_id\": \"<value>\",\n \"custom_field\": {\n \"created_at\": dateutil.parser.isoparse(\"2023-03-28T22:24:16.436Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2023-06-25T07:31:50.142Z\"),\n \"id\": \"<value>\",\n \"metadata\": {\n \"key\": 471294,\n },\n \"type\": \"select\",\n \"slug\": \"<value>\",\n \"name\": \"<value>\",\n \"organization_id\": \"<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 \"custom_field_id\": \"<value>\",\n \"custom_field\": {\n \"created_at\": dateutil.parser.isoparse(\"2024-04-26T03:42:46.919Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2023-07-10T15:18:31.478Z\"),\n \"id\": \"<value>\",\n \"metadata\": {\n \"key\": False,\n },\n \"type\": \"number\",\n \"slug\": \"<value>\",\n \"name\": \"<value>\",\n \"organization_id\": \"<value>\",\n \"properties\": {},\n },\n \"order\": 892169,\n \"required\": True,\n },\n {\n \"custom_field_id\": \"<value>\",\n \"custom_field\": {\n \"created_at\": dateutil.parser.isoparse(\"2024-03-06T23:45:11.850Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2025-12-11T04:05:14.451Z\"),\n \"id\": \"<value>\",\n \"metadata\": {\n \"key\": \"<value>\",\n },\n \"type\": \"select\",\n \"slug\": \"<value>\",\n \"name\": \"<value>\",\n \"organization_id\": \"<value>\",\n \"properties\": {\n \"options\": [\n {\n \"value\": \"<value>\",\n \"label\": \"<value>\",\n },\n ],\n },\n },\n \"order\": 578881,\n \"required\": False,\n },\n ],\n },\n price={\n \"created_at\": dateutil.parser.isoparse(\"2025-10-02T04:07:15.390Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2024-09-27T09:04:47.791Z\"),\n \"id\": \"<value>\",\n \"amount_type\": \"free\",\n \"is_archived\": False,\n \"product_id\": \"<value>\",\n \"type\": \"recurring\",\n \"recurring_interval\": polar_sdk.SubscriptionRecurringInterval.MONTH,\n },\n discount={\n \"duration\": polar_sdk.DiscountDuration.FOREVER,\n \"duration_in_months\": 539267,\n \"type\": polar_sdk.DiscountType.PERCENTAGE,\n \"amount\": 440126,\n \"currency\": \"Liberian Dollar\",\n \"created_at\": dateutil.parser.isoparse(\"2024-12-14T11:44:25.253Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2024-03-05T16:20:52.572Z\"),\n \"id\": \"<value>\",\n \"metadata\": {\n \"key\": \"<value>\",\n },\n \"name\": \"<value>\",\n \"code\": \"<value>\",\n \"starts_at\": dateutil.parser.isoparse(\"2024-11-04T14:17:31.159Z\"),\n \"ends_at\": dateutil.parser.isoparse(\"2025-07-18T17:11:43.309Z\"),\n \"max_redemptions\": 542595,\n \"redemptions_count\": 673893,\n \"organization_id\": \"<value>\",\n },\n ),\n ))\n\n # Handle response\n print(res)"