@volter/twin-polar 2.0.37 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -27
- package/dist/generated/pack-facts.json +69 -0
- package/dist/journeys/coverage.json +223 -0
- package/dist/journeys/customer-life.json +1222 -0
- package/dist/journeys/customer-life.outline.md +69 -0
- package/dist/journeys/customer-life.outline.verdict.json +41 -0
- package/dist/journeys/customer-life.verdict.json +71 -0
- package/dist/journeys/decisions.json +149 -0
- package/dist/journeys/demand.json +45 -0
- package/dist/journeys/score.json +249 -0
- package/dist/journeys/unreachable.json +13 -0
- package/dist/journeys/vendor-examples.json +9621 -0
- package/dist/journeys/vendor-examples.verdict.json +33 -0
- package/dist/spec/SOURCE.md +25 -0
- package/dist/spec/doc-examples.json +681 -0
- package/dist/spec/openapi.json.gz +0 -0
- package/dist/spec/sources.json +71 -0
- package/dist/src/cli.js +7 -16
- package/dist/src/fetch.d.ts +2 -0
- package/dist/src/fetch.js +24 -0
- package/dist/src/generated/surface.gen.json +1 -0
- package/dist/src/generated/ui.gen.json +1 -0
- package/dist/src/index.d.ts +5 -9
- package/dist/src/index.js +10 -55
- package/dist/src/manifest.d.ts +2 -0
- package/dist/src/manifest.js +123 -0
- package/dist/src/screens/checkout.d.ts +2 -0
- package/dist/src/screens/checkout.js +25 -0
- package/dist/src/screens/portal.d.ts +2 -0
- package/dist/src/screens/portal.js +18 -0
- package/dist/src/semantics/around.d.ts +2 -0
- package/dist/src/semantics/around.js +25 -0
- package/dist/src/semantics/checkouts.d.ts +14 -0
- package/dist/src/semantics/checkouts.js +131 -0
- package/dist/src/semantics/clock.d.ts +2 -0
- package/dist/src/semantics/clock.js +22 -0
- package/dist/src/semantics/customer-sessions.d.ts +2 -0
- package/dist/src/semantics/customer-sessions.js +12 -0
- package/dist/src/semantics/customers.d.ts +9 -0
- package/dist/src/semantics/customers.js +61 -0
- package/dist/src/semantics/doors.d.ts +11 -0
- package/dist/src/semantics/doors.js +47 -0
- package/dist/src/semantics/events.d.ts +12 -0
- package/dist/src/semantics/events.js +60 -0
- package/dist/src/semantics/index.d.ts +2 -0
- package/dist/src/semantics/index.js +27 -0
- package/dist/src/semantics/orders.d.ts +4 -0
- package/dist/src/semantics/orders.js +11 -0
- package/dist/src/semantics/products.d.ts +5 -0
- package/dist/src/semantics/products.js +43 -0
- package/dist/src/semantics/shared.d.ts +82 -0
- package/dist/src/semantics/shared.js +327 -0
- package/dist/src/semantics/states.d.ts +27 -0
- package/dist/src/semantics/states.js +43 -0
- package/dist/src/semantics/subscriptions.d.ts +4 -0
- package/dist/src/semantics/subscriptions.js +15 -0
- package/dist/src/semantics/tenant.d.ts +2 -0
- package/dist/src/semantics/tenant.js +2 -0
- package/dist/src/semantics/webhooks.d.ts +4 -0
- package/dist/src/semantics/webhooks.js +30 -0
- package/dist/src/server.d.ts +7 -0
- package/dist/src/server.js +7 -0
- package/generated/pack-facts.json +69 -0
- package/journeys/coverage.json +223 -0
- package/journeys/customer-life.json +1222 -0
- package/journeys/customer-life.outline.md +69 -0
- package/journeys/customer-life.outline.verdict.json +41 -0
- package/journeys/customer-life.verdict.json +71 -0
- package/journeys/decisions.json +149 -0
- package/journeys/demand.json +45 -0
- package/journeys/score.json +249 -0
- package/journeys/unreachable.json +13 -0
- package/journeys/vendor-examples.json +9621 -0
- package/journeys/vendor-examples.verdict.json +33 -0
- package/package.json +19 -31
- package/spec/SOURCE.md +25 -0
- package/spec/doc-examples.json +681 -0
- package/spec/openapi.json.gz +0 -0
- package/spec/sources.json +71 -0
- package/src/cli.ts +7 -14
- package/src/fetch.ts +25 -0
- package/src/generated/surface.gen.json +1 -0
- package/src/generated/ui.gen.json +1 -0
- package/src/index.ts +11 -85
- package/src/manifest.ts +135 -0
- package/src/screens/checkout.ts +33 -0
- package/src/screens/portal.ts +20 -0
- package/src/semantics/around.ts +25 -0
- package/src/semantics/checkouts.ts +133 -0
- package/src/semantics/clock.ts +24 -0
- package/src/semantics/customer-sessions.ts +13 -0
- package/src/semantics/customers.ts +68 -0
- package/src/semantics/doors.ts +51 -0
- package/src/semantics/events.ts +62 -0
- package/src/semantics/index.ts +31 -0
- package/src/semantics/orders.ts +15 -0
- package/src/semantics/products.ts +45 -0
- package/src/semantics/shared.ts +352 -0
- package/src/semantics/states.ts +50 -0
- package/src/semantics/subscriptions.ts +18 -0
- package/src/semantics/tenant.ts +5 -0
- package/src/semantics/webhooks.ts +29 -0
- package/src/server.ts +8 -0
- package/dist/src/polar-budget.d.ts +0 -83
- package/dist/src/polar-budget.js +0 -413
- package/dist/src/polar-capabilities.d.ts +0 -4
- package/dist/src/polar-capabilities.js +0 -389
- package/dist/src/polar-conformance.d.ts +0 -7
- package/dist/src/polar-conformance.js +0 -25
- package/dist/src/polar-connector.d.ts +0 -113
- package/dist/src/polar-connector.js +0 -146
- package/dist/src/polar-server.d.ts +0 -14
- package/dist/src/polar-server.js +0 -52
- package/dist/src/polar-twin.d.ts +0 -24
- package/dist/src/polar-twin.js +0 -941
- package/src/polar-budget.ts +0 -459
- package/src/polar-capabilities.ts +0 -448
- package/src/polar-conformance.ts +0 -33
- package/src/polar-connector.ts +0 -172
- package/src/polar-server.ts +0 -57
- package/src/polar-twin.ts +0 -938
|
@@ -0,0 +1,681 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"title": "Production product list",
|
|
4
|
+
"source": "https://polar.sh/docs/api-reference/introduction",
|
|
5
|
+
"operation": "products:list",
|
|
6
|
+
"request": {
|
|
7
|
+
"method": "GET",
|
|
8
|
+
"url": "https://api.polar.sh/v1/products/"
|
|
9
|
+
},
|
|
10
|
+
"output": {},
|
|
11
|
+
"means": "Published request; this page publishes no response body."
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"title": "Sandbox product list",
|
|
15
|
+
"source": "https://polar.sh/docs/api-reference/introduction",
|
|
16
|
+
"operation": "products:list",
|
|
17
|
+
"request": {
|
|
18
|
+
"method": "GET",
|
|
19
|
+
"url": "https://sandbox-api.polar.sh/v1/products/"
|
|
20
|
+
},
|
|
21
|
+
"output": {},
|
|
22
|
+
"means": "Published request; this page publishes no response body."
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"title": "SDK checkout",
|
|
26
|
+
"source": "https://polar.sh/docs/features/checkout/session",
|
|
27
|
+
"operation": "checkouts:create",
|
|
28
|
+
"request": {
|
|
29
|
+
"method": "POST",
|
|
30
|
+
"url": "https://api.polar.sh/v1/checkouts/"
|
|
31
|
+
},
|
|
32
|
+
"output": {},
|
|
33
|
+
"means": "Published request; this page publishes no response body.",
|
|
34
|
+
"input": {
|
|
35
|
+
"products": [
|
|
36
|
+
"productId"
|
|
37
|
+
]
|
|
38
|
+
},
|
|
39
|
+
"placeholders": {
|
|
40
|
+
"names": [
|
|
41
|
+
"productId"
|
|
42
|
+
],
|
|
43
|
+
"quote": "For this you'll need at least your Product ID."
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"title": "Ad-hoc checkout",
|
|
48
|
+
"source": "https://polar.sh/docs/features/checkout/session",
|
|
49
|
+
"operation": "checkouts:create",
|
|
50
|
+
"request": {
|
|
51
|
+
"method": "POST",
|
|
52
|
+
"url": "https://api.polar.sh/v1/checkouts/"
|
|
53
|
+
},
|
|
54
|
+
"output": {},
|
|
55
|
+
"means": "Published request; this page publishes no response body.",
|
|
56
|
+
"input": {
|
|
57
|
+
"products": [
|
|
58
|
+
"productId"
|
|
59
|
+
],
|
|
60
|
+
"prices": {
|
|
61
|
+
"productId": [
|
|
62
|
+
{
|
|
63
|
+
"amount_type": "fixed",
|
|
64
|
+
"price_amount": 10000,
|
|
65
|
+
"price_currency": "usd"
|
|
66
|
+
}
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"placeholders": {
|
|
71
|
+
"names": [
|
|
72
|
+
"productId"
|
|
73
|
+
],
|
|
74
|
+
"quote": "For this you'll need at least your Product ID."
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"title": "Authenticated portal link",
|
|
79
|
+
"source": "https://polar.sh/docs/features/customer-portal/navigate-customers",
|
|
80
|
+
"operation": "customer-sessions:create",
|
|
81
|
+
"request": {
|
|
82
|
+
"method": "POST",
|
|
83
|
+
"url": "https://api.polar.sh/v1/customer-sessions/"
|
|
84
|
+
},
|
|
85
|
+
"output": {},
|
|
86
|
+
"means": "Published request; this page publishes no response body.",
|
|
87
|
+
"input": {
|
|
88
|
+
"customer_id": "<value>"
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"title": "SDK ingestion",
|
|
93
|
+
"source": "https://polar.sh/docs/features/usage-based-billing/event-ingestion",
|
|
94
|
+
"operation": "events:ingest",
|
|
95
|
+
"request": {
|
|
96
|
+
"method": "POST",
|
|
97
|
+
"url": "https://api.polar.sh/v1/events/ingest"
|
|
98
|
+
},
|
|
99
|
+
"output": {},
|
|
100
|
+
"means": "Published request; this page publishes no response body.",
|
|
101
|
+
"input": {
|
|
102
|
+
"events": [
|
|
103
|
+
{
|
|
104
|
+
"name": "<value>",
|
|
105
|
+
"external_customer_id": "<id>",
|
|
106
|
+
"metadata": {
|
|
107
|
+
"key": "value"
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
]
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"title": "OpenAPI SDK subscriptions:list",
|
|
115
|
+
"source": "https://polar.sh/docs/openapi.json",
|
|
116
|
+
"operation": "subscriptions:list",
|
|
117
|
+
"request": {
|
|
118
|
+
"method": "GET",
|
|
119
|
+
"url": "https://api.polar.sh/v1/subscriptions/?page=1&limit=10&sorting=-started_at"
|
|
120
|
+
},
|
|
121
|
+
"output": {},
|
|
122
|
+
"means": "List Subscriptions. Both SDK spellings issue the same first-page wire request.",
|
|
123
|
+
"spellings": [
|
|
124
|
+
{
|
|
125
|
+
"lang": "Python (New SDK)",
|
|
126
|
+
"source": "from polar.v2026_04 import Polar\n\npolar = Polar(\"polar_oat_xxx\")\n\nfor item in polar.subscriptions.iter_list(\n page=1,\n limit=10,\n sorting=['-started_at'],\n):\n print(item)\n"
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"lang": "TypeScript (New SDK)",
|
|
130
|
+
"source": "import { createPolar } from \"@polar-sh/sdk/2026-04\";\n\nconst polar = createPolar({\n accessToken: \"polar_oat_xxx\",\n});\n\nfor await (const item of polar.subscriptions.iterList(\n {\n \"page\": 1,\n \"limit\": 10,\n \"sorting\": [\n \"-started_at\"\n ]\n },\n)) {\n console.log(item);\n}\n"
|
|
131
|
+
}
|
|
132
|
+
]
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
"title": "OpenAPI SDK webhooks:list_webhook_endpoints",
|
|
136
|
+
"source": "https://polar.sh/docs/openapi.json",
|
|
137
|
+
"operation": "webhooks:list_webhook_endpoints",
|
|
138
|
+
"request": {
|
|
139
|
+
"method": "GET",
|
|
140
|
+
"url": "https://api.polar.sh/v1/webhooks/endpoints?page=1&limit=10"
|
|
141
|
+
},
|
|
142
|
+
"output": {},
|
|
143
|
+
"means": "List Webhook Endpoints. Both SDK spellings issue the same first-page wire request.",
|
|
144
|
+
"spellings": [
|
|
145
|
+
{
|
|
146
|
+
"lang": "Python (New SDK)",
|
|
147
|
+
"source": "from polar.v2026_04 import Polar\n\npolar = Polar(\"polar_oat_xxx\")\n\nfor item in polar.webhooks.iter_list_webhook_endpoints(\n page=1,\n limit=10,\n):\n print(item)\n"
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
"lang": "TypeScript (New SDK)",
|
|
151
|
+
"source": "import { createPolar } from \"@polar-sh/sdk/2026-04\";\n\nconst polar = createPolar({\n accessToken: \"polar_oat_xxx\",\n});\n\nfor await (const item of polar.webhooks.iterListWebhookEndpoints(\n {\n \"page\": 1,\n \"limit\": 10\n },\n)) {\n console.log(item);\n}\n"
|
|
152
|
+
}
|
|
153
|
+
]
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
"title": "OpenAPI SDK webhooks:create_webhook_endpoint",
|
|
157
|
+
"source": "https://polar.sh/docs/openapi.json",
|
|
158
|
+
"operation": "webhooks:create_webhook_endpoint",
|
|
159
|
+
"request": {
|
|
160
|
+
"method": "POST",
|
|
161
|
+
"url": "https://api.polar.sh/v1/webhooks/endpoints"
|
|
162
|
+
},
|
|
163
|
+
"output": {},
|
|
164
|
+
"means": "Create Webhook Endpoint. Both SDK spellings issue the same first-page wire request.",
|
|
165
|
+
"spellings": [
|
|
166
|
+
{
|
|
167
|
+
"lang": "Python (New SDK)",
|
|
168
|
+
"source": "from polar.v2026_04 import Polar\n\npolar = Polar(\"polar_oat_xxx\")\n\nresponse = polar.webhooks.create_webhook_endpoint(\n url='https://webhook.site/cb791d80-f26e-4f8c-be88-6e56054192b0',\n format='raw',\n events=['checkout.created'],\n)\nprint(response)\n"
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
"lang": "TypeScript (New SDK)",
|
|
172
|
+
"source": "import { createPolar } from \"@polar-sh/sdk/2026-04\";\n\nconst polar = createPolar({\n accessToken: \"polar_oat_xxx\",\n});\n\nconst response = await polar.webhooks.createWebhookEndpoint(\n {\n \"url\": \"https://webhook.site/cb791d80-f26e-4f8c-be88-6e56054192b0\",\n \"format\": \"raw\",\n \"events\": [\n \"checkout.created\"\n ]\n },\n);\nconsole.log(response);\n"
|
|
173
|
+
}
|
|
174
|
+
],
|
|
175
|
+
"input": {
|
|
176
|
+
"url": "https://webhook.site/cb791d80-f26e-4f8c-be88-6e56054192b0",
|
|
177
|
+
"format": "raw",
|
|
178
|
+
"events": [
|
|
179
|
+
"checkout.created"
|
|
180
|
+
]
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
"title": "OpenAPI SDK products:list",
|
|
185
|
+
"source": "https://polar.sh/docs/openapi.json",
|
|
186
|
+
"operation": "products:list",
|
|
187
|
+
"request": {
|
|
188
|
+
"method": "GET",
|
|
189
|
+
"url": "https://api.polar.sh/v1/products/?page=1&limit=10&sorting=-created_at"
|
|
190
|
+
},
|
|
191
|
+
"output": {},
|
|
192
|
+
"means": "List Products. Both SDK spellings issue the same first-page wire request.",
|
|
193
|
+
"spellings": [
|
|
194
|
+
{
|
|
195
|
+
"lang": "Python (New SDK)",
|
|
196
|
+
"source": "from polar.v2026_04 import Polar\n\npolar = Polar(\"polar_oat_xxx\")\n\nfor item in polar.products.iter_list(\n page=1,\n limit=10,\n sorting=['-created_at'],\n):\n print(item)\n"
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
"lang": "TypeScript (New SDK)",
|
|
200
|
+
"source": "import { createPolar } from \"@polar-sh/sdk/2026-04\";\n\nconst polar = createPolar({\n accessToken: \"polar_oat_xxx\",\n});\n\nfor await (const item of polar.products.iterList(\n {\n \"page\": 1,\n \"limit\": 10,\n \"sorting\": [\n \"-created_at\"\n ]\n },\n)) {\n console.log(item);\n}\n"
|
|
201
|
+
}
|
|
202
|
+
]
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
"title": "OpenAPI SDK products:create",
|
|
206
|
+
"source": "https://polar.sh/docs/openapi.json",
|
|
207
|
+
"operation": "products:create",
|
|
208
|
+
"request": {
|
|
209
|
+
"method": "POST",
|
|
210
|
+
"url": "https://api.polar.sh/v1/products/"
|
|
211
|
+
},
|
|
212
|
+
"output": {},
|
|
213
|
+
"means": "Create Product. Both SDK spellings issue the same first-page wire request.",
|
|
214
|
+
"spellings": [
|
|
215
|
+
{
|
|
216
|
+
"lang": "Python (New SDK)",
|
|
217
|
+
"source": "from polar.v2026_04 import Polar\n\npolar = Polar(\"polar_oat_xxx\")\n\nresponse = polar.products.create(\n name='string',\n prices=[{'amount_type': 'fixed', 'price_amount': 0}],\n recurring_interval='day',\n recurring_interval_count=1,\n)\nprint(response)\n"
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
"lang": "TypeScript (New SDK)",
|
|
221
|
+
"source": "import { createPolar } from \"@polar-sh/sdk/2026-04\";\n\nconst polar = createPolar({\n accessToken: \"polar_oat_xxx\",\n});\n\nconst response = await polar.products.create(\n {\n \"name\": \"string\",\n \"prices\": [\n {\n \"amount_type\": \"fixed\",\n \"price_amount\": 0\n }\n ],\n \"recurring_interval\": \"day\",\n \"recurring_interval_count\": 1\n },\n);\nconsole.log(response);\n"
|
|
222
|
+
}
|
|
223
|
+
],
|
|
224
|
+
"input": {
|
|
225
|
+
"name": "string",
|
|
226
|
+
"prices": [
|
|
227
|
+
{
|
|
228
|
+
"amount_type": "fixed",
|
|
229
|
+
"price_amount": 0
|
|
230
|
+
}
|
|
231
|
+
],
|
|
232
|
+
"recurring_interval": "day",
|
|
233
|
+
"recurring_interval_count": 1
|
|
234
|
+
}
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
"title": "OpenAPI SDK orders:list",
|
|
238
|
+
"source": "https://polar.sh/docs/openapi.json",
|
|
239
|
+
"operation": "orders:list",
|
|
240
|
+
"request": {
|
|
241
|
+
"method": "GET",
|
|
242
|
+
"url": "https://api.polar.sh/v1/orders/?page=1&limit=10&sorting=-created_at"
|
|
243
|
+
},
|
|
244
|
+
"output": {},
|
|
245
|
+
"means": "List Orders. Both SDK spellings issue the same first-page wire request.",
|
|
246
|
+
"spellings": [
|
|
247
|
+
{
|
|
248
|
+
"lang": "Python (New SDK)",
|
|
249
|
+
"source": "from polar.v2026_04 import Polar\n\npolar = Polar(\"polar_oat_xxx\")\n\nfor item in polar.orders.iter_list(\n page=1,\n limit=10,\n sorting=['-created_at'],\n):\n print(item)\n"
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
"lang": "TypeScript (New SDK)",
|
|
253
|
+
"source": "import { createPolar } from \"@polar-sh/sdk/2026-04\";\n\nconst polar = createPolar({\n accessToken: \"polar_oat_xxx\",\n});\n\nfor await (const item of polar.orders.iterList(\n {\n \"page\": 1,\n \"limit\": 10,\n \"sorting\": [\n \"-created_at\"\n ]\n },\n)) {\n console.log(item);\n}\n"
|
|
254
|
+
}
|
|
255
|
+
]
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
"title": "OpenAPI SDK checkouts:list",
|
|
259
|
+
"source": "https://polar.sh/docs/openapi.json",
|
|
260
|
+
"operation": "checkouts:list",
|
|
261
|
+
"request": {
|
|
262
|
+
"method": "GET",
|
|
263
|
+
"url": "https://api.polar.sh/v1/checkouts/?page=1&limit=10&sorting=-created_at"
|
|
264
|
+
},
|
|
265
|
+
"output": {},
|
|
266
|
+
"means": "List Checkout Sessions. Both SDK spellings issue the same first-page wire request.",
|
|
267
|
+
"spellings": [
|
|
268
|
+
{
|
|
269
|
+
"lang": "Python (New SDK)",
|
|
270
|
+
"source": "from polar.v2026_04 import Polar\n\npolar = Polar(\"polar_oat_xxx\")\n\nfor item in polar.checkouts.iter_list(\n page=1,\n limit=10,\n sorting=['-created_at'],\n):\n print(item)\n"
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
"lang": "TypeScript (New SDK)",
|
|
274
|
+
"source": "import { createPolar } from \"@polar-sh/sdk/2026-04\";\n\nconst polar = createPolar({\n accessToken: \"polar_oat_xxx\",\n});\n\nfor await (const item of polar.checkouts.iterList(\n {\n \"page\": 1,\n \"limit\": 10,\n \"sorting\": [\n \"-created_at\"\n ]\n },\n)) {\n console.log(item);\n}\n"
|
|
275
|
+
}
|
|
276
|
+
]
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
"title": "OpenAPI SDK checkouts:create",
|
|
280
|
+
"source": "https://polar.sh/docs/openapi.json",
|
|
281
|
+
"operation": "checkouts:create",
|
|
282
|
+
"request": {
|
|
283
|
+
"method": "POST",
|
|
284
|
+
"url": "https://api.polar.sh/v1/checkouts/"
|
|
285
|
+
},
|
|
286
|
+
"output": {},
|
|
287
|
+
"means": "Create Checkout Session. Both SDK spellings issue the same first-page wire request.",
|
|
288
|
+
"spellings": [
|
|
289
|
+
{
|
|
290
|
+
"lang": "Python (New SDK)",
|
|
291
|
+
"source": "from polar.v2026_04 import Polar\n\npolar = Polar(\"polar_oat_xxx\")\n\nresponse = polar.checkouts.create(\n allow_discount_codes=True,\n require_billing_address=False,\n allow_trial=True,\n is_business_customer=False,\n products=['00000000-0000-4000-8000-000000000000'],\n)\nprint(response)\n"
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
"lang": "TypeScript (New SDK)",
|
|
295
|
+
"source": "import { createPolar } from \"@polar-sh/sdk/2026-04\";\n\nconst polar = createPolar({\n accessToken: \"polar_oat_xxx\",\n});\n\nconst response = await polar.checkouts.create(\n {\n \"allow_discount_codes\": true,\n \"require_billing_address\": false,\n \"allow_trial\": true,\n \"is_business_customer\": false,\n \"products\": [\n \"00000000-0000-4000-8000-000000000000\"\n ]\n },\n);\nconsole.log(response);\n"
|
|
296
|
+
}
|
|
297
|
+
],
|
|
298
|
+
"input": {
|
|
299
|
+
"allow_discount_codes": true,
|
|
300
|
+
"require_billing_address": false,
|
|
301
|
+
"allow_trial": true,
|
|
302
|
+
"is_business_customer": false,
|
|
303
|
+
"products": [
|
|
304
|
+
"00000000-0000-4000-8000-000000000000"
|
|
305
|
+
]
|
|
306
|
+
}
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
"title": "OpenAPI SDK checkouts:get",
|
|
310
|
+
"source": "https://polar.sh/docs/openapi.json",
|
|
311
|
+
"operation": "checkouts:get",
|
|
312
|
+
"request": {
|
|
313
|
+
"method": "GET",
|
|
314
|
+
"url": "https://api.polar.sh/v1/checkouts/00000000-0000-4000-8000-000000000000"
|
|
315
|
+
},
|
|
316
|
+
"output": {},
|
|
317
|
+
"means": "Get Checkout Session. Both SDK spellings issue the same first-page wire request.",
|
|
318
|
+
"spellings": [
|
|
319
|
+
{
|
|
320
|
+
"lang": "Python (New SDK)",
|
|
321
|
+
"source": "from polar.v2026_04 import Polar\n\npolar = Polar(\"polar_oat_xxx\")\n\nresponse = polar.checkouts.get(\n '00000000-0000-4000-8000-000000000000',\n)\nprint(response)\n"
|
|
322
|
+
},
|
|
323
|
+
{
|
|
324
|
+
"lang": "TypeScript (New SDK)",
|
|
325
|
+
"source": "import { createPolar } from \"@polar-sh/sdk/2026-04\";\n\nconst polar = createPolar({\n accessToken: \"polar_oat_xxx\",\n});\n\nconst response = await polar.checkouts.get(\n \"00000000-0000-4000-8000-000000000000\",\n);\nconsole.log(response);\n"
|
|
326
|
+
}
|
|
327
|
+
]
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
"title": "OpenAPI SDK checkouts:client_get",
|
|
331
|
+
"source": "https://polar.sh/docs/openapi.json",
|
|
332
|
+
"operation": "checkouts:client_get",
|
|
333
|
+
"request": {
|
|
334
|
+
"method": "GET",
|
|
335
|
+
"url": "https://api.polar.sh/v1/checkouts/client/string"
|
|
336
|
+
},
|
|
337
|
+
"output": {},
|
|
338
|
+
"means": "Get Checkout Session from Client. Both SDK spellings issue the same first-page wire request.",
|
|
339
|
+
"spellings": [
|
|
340
|
+
{
|
|
341
|
+
"lang": "Python (New SDK)",
|
|
342
|
+
"source": "from polar.v2026_04 import Polar\n\npolar = Polar(\"polar_oat_xxx\")\n\nresponse = polar.checkouts.client_get(\n 'string',\n)\nprint(response)\n"
|
|
343
|
+
},
|
|
344
|
+
{
|
|
345
|
+
"lang": "TypeScript (New SDK)",
|
|
346
|
+
"source": "import { createPolar } from \"@polar-sh/sdk/2026-04\";\n\nconst polar = createPolar({\n accessToken: \"polar_oat_xxx\",\n});\n\nconst response = await polar.checkouts.clientGet(\n \"string\",\n);\nconsole.log(response);\n"
|
|
347
|
+
}
|
|
348
|
+
]
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
"title": "OpenAPI SDK checkouts:client_confirm",
|
|
352
|
+
"source": "https://polar.sh/docs/openapi.json",
|
|
353
|
+
"operation": "checkouts:client_confirm",
|
|
354
|
+
"request": {
|
|
355
|
+
"method": "POST",
|
|
356
|
+
"url": "https://api.polar.sh/v1/checkouts/client/string/confirm"
|
|
357
|
+
},
|
|
358
|
+
"output": {},
|
|
359
|
+
"means": "Confirm Checkout Session from Client. Both SDK spellings issue the same first-page wire request.",
|
|
360
|
+
"spellings": [
|
|
361
|
+
{
|
|
362
|
+
"lang": "Python (New SDK)",
|
|
363
|
+
"source": "from polar.v2026_04 import Polar\n\npolar = Polar(\"polar_oat_xxx\")\n\nresponse = polar.checkouts.client_confirm(\n 'string',\n)\nprint(response)\n"
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
"lang": "TypeScript (New SDK)",
|
|
367
|
+
"source": "import { createPolar } from \"@polar-sh/sdk/2026-04\";\n\nconst polar = createPolar({\n accessToken: \"polar_oat_xxx\",\n});\n\nconst response = await polar.checkouts.clientConfirm(\n \"string\",\n {},\n);\nconsole.log(response);\n"
|
|
368
|
+
}
|
|
369
|
+
]
|
|
370
|
+
},
|
|
371
|
+
{
|
|
372
|
+
"title": "OpenAPI SDK customers:list",
|
|
373
|
+
"source": "https://polar.sh/docs/openapi.json",
|
|
374
|
+
"operation": "customers:list",
|
|
375
|
+
"request": {
|
|
376
|
+
"method": "GET",
|
|
377
|
+
"url": "https://api.polar.sh/v1/customers/?page=1&limit=10&sorting=-created_at"
|
|
378
|
+
},
|
|
379
|
+
"output": {},
|
|
380
|
+
"means": "List Customers. Both SDK spellings issue the same first-page wire request.",
|
|
381
|
+
"spellings": [
|
|
382
|
+
{
|
|
383
|
+
"lang": "Python (New SDK)",
|
|
384
|
+
"source": "from polar.v2026_04 import Polar\n\npolar = Polar(\"polar_oat_xxx\")\n\nfor item in polar.customers.iter_list(\n page=1,\n limit=10,\n sorting=['-created_at'],\n):\n print(item)\n"
|
|
385
|
+
},
|
|
386
|
+
{
|
|
387
|
+
"lang": "TypeScript (New SDK)",
|
|
388
|
+
"source": "import { createPolar } from \"@polar-sh/sdk/2026-04\";\n\nconst polar = createPolar({\n accessToken: \"polar_oat_xxx\",\n});\n\nfor await (const item of polar.customers.iterList(\n {\n \"page\": 1,\n \"limit\": 10,\n \"sorting\": [\n \"-created_at\"\n ]\n },\n)) {\n console.log(item);\n}\n"
|
|
389
|
+
}
|
|
390
|
+
]
|
|
391
|
+
},
|
|
392
|
+
{
|
|
393
|
+
"title": "OpenAPI SDK customers:create",
|
|
394
|
+
"source": "https://polar.sh/docs/openapi.json",
|
|
395
|
+
"operation": "customers:create",
|
|
396
|
+
"request": {
|
|
397
|
+
"method": "POST",
|
|
398
|
+
"url": "https://api.polar.sh/v1/customers/"
|
|
399
|
+
},
|
|
400
|
+
"output": {},
|
|
401
|
+
"means": "Create Customer. Both SDK spellings issue the same first-page wire request.",
|
|
402
|
+
"spellings": [
|
|
403
|
+
{
|
|
404
|
+
"lang": "Python (New SDK)",
|
|
405
|
+
"source": "from polar.v2026_04 import Polar\n\npolar = Polar(\"polar_oat_xxx\")\n\nresponse = polar.customers.create(\n external_id='usr_1337',\n type='individual',\n email='customer@example.com',\n)\nprint(response)\n"
|
|
406
|
+
},
|
|
407
|
+
{
|
|
408
|
+
"lang": "TypeScript (New SDK)",
|
|
409
|
+
"source": "import { createPolar } from \"@polar-sh/sdk/2026-04\";\n\nconst polar = createPolar({\n accessToken: \"polar_oat_xxx\",\n});\n\nconst response = await polar.customers.create(\n {\n \"external_id\": \"usr_1337\",\n \"type\": \"individual\",\n \"email\": \"customer@example.com\"\n },\n);\nconsole.log(response);\n"
|
|
410
|
+
}
|
|
411
|
+
],
|
|
412
|
+
"input": {
|
|
413
|
+
"external_id": "usr_1337",
|
|
414
|
+
"type": "individual",
|
|
415
|
+
"email": "customer@example.com"
|
|
416
|
+
}
|
|
417
|
+
},
|
|
418
|
+
{
|
|
419
|
+
"title": "OpenAPI SDK customers:get",
|
|
420
|
+
"source": "https://polar.sh/docs/openapi.json",
|
|
421
|
+
"operation": "customers:get",
|
|
422
|
+
"request": {
|
|
423
|
+
"method": "GET",
|
|
424
|
+
"url": "https://api.polar.sh/v1/customers/00000000-0000-4000-8000-000000000000"
|
|
425
|
+
},
|
|
426
|
+
"output": {},
|
|
427
|
+
"means": "Get Customer. Both SDK spellings issue the same first-page wire request.",
|
|
428
|
+
"spellings": [
|
|
429
|
+
{
|
|
430
|
+
"lang": "Python (New SDK)",
|
|
431
|
+
"source": "from polar.v2026_04 import Polar\n\npolar = Polar(\"polar_oat_xxx\")\n\nresponse = polar.customers.get(\n '00000000-0000-4000-8000-000000000000',\n)\nprint(response)\n"
|
|
432
|
+
},
|
|
433
|
+
{
|
|
434
|
+
"lang": "TypeScript (New SDK)",
|
|
435
|
+
"source": "import { createPolar } from \"@polar-sh/sdk/2026-04\";\n\nconst polar = createPolar({\n accessToken: \"polar_oat_xxx\",\n});\n\nconst response = await polar.customers.get(\n \"00000000-0000-4000-8000-000000000000\",\n);\nconsole.log(response);\n"
|
|
436
|
+
}
|
|
437
|
+
]
|
|
438
|
+
},
|
|
439
|
+
{
|
|
440
|
+
"title": "OpenAPI SDK customers:get_state_external",
|
|
441
|
+
"source": "https://polar.sh/docs/openapi.json",
|
|
442
|
+
"operation": "customers:get_state_external",
|
|
443
|
+
"request": {
|
|
444
|
+
"method": "GET",
|
|
445
|
+
"url": "https://api.polar.sh/v1/customers/external/string/state"
|
|
446
|
+
},
|
|
447
|
+
"output": {},
|
|
448
|
+
"means": "Get Customer State by External ID. Both SDK spellings issue the same first-page wire request.",
|
|
449
|
+
"spellings": [
|
|
450
|
+
{
|
|
451
|
+
"lang": "Python (New SDK)",
|
|
452
|
+
"source": "from polar.v2026_04 import Polar\n\npolar = Polar(\"polar_oat_xxx\")\n\nresponse = polar.customers.get_state_external(\n 'string',\n)\nprint(response)\n"
|
|
453
|
+
},
|
|
454
|
+
{
|
|
455
|
+
"lang": "TypeScript (New SDK)",
|
|
456
|
+
"source": "import { createPolar } from \"@polar-sh/sdk/2026-04\";\n\nconst polar = createPolar({\n accessToken: \"polar_oat_xxx\",\n});\n\nconst response = await polar.customers.getStateExternal(\n \"string\",\n);\nconsole.log(response);\n"
|
|
457
|
+
}
|
|
458
|
+
]
|
|
459
|
+
},
|
|
460
|
+
{
|
|
461
|
+
"title": "OpenAPI SDK customer-sessions:create",
|
|
462
|
+
"source": "https://polar.sh/docs/openapi.json",
|
|
463
|
+
"operation": "customer-sessions:create",
|
|
464
|
+
"request": {
|
|
465
|
+
"method": "POST",
|
|
466
|
+
"url": "https://api.polar.sh/v1/customer-sessions/"
|
|
467
|
+
},
|
|
468
|
+
"output": {},
|
|
469
|
+
"means": "Create Customer Session. Both SDK spellings issue the same first-page wire request.",
|
|
470
|
+
"spellings": [
|
|
471
|
+
{
|
|
472
|
+
"lang": "Python (New SDK)",
|
|
473
|
+
"source": "from polar.v2026_04 import Polar\n\npolar = Polar(\"polar_oat_xxx\")\n\nresponse = polar.customer_sessions.create(\n return_url='https://example.com/account',\n customer_id='00000000-0000-4000-8000-000000000000',\n)\nprint(response)\n"
|
|
474
|
+
},
|
|
475
|
+
{
|
|
476
|
+
"lang": "TypeScript (New SDK)",
|
|
477
|
+
"source": "import { createPolar } from \"@polar-sh/sdk/2026-04\";\n\nconst polar = createPolar({\n accessToken: \"polar_oat_xxx\",\n});\n\nconst response = await polar.customerSessions.create(\n {\n \"return_url\": \"https://example.com/account\",\n \"customer_id\": \"00000000-0000-4000-8000-000000000000\"\n },\n);\nconsole.log(response);\n"
|
|
478
|
+
}
|
|
479
|
+
],
|
|
480
|
+
"input": {
|
|
481
|
+
"return_url": "https://example.com/account",
|
|
482
|
+
"customer_id": "00000000-0000-4000-8000-000000000000"
|
|
483
|
+
}
|
|
484
|
+
},
|
|
485
|
+
{
|
|
486
|
+
"title": "OpenAPI SDK events:list",
|
|
487
|
+
"source": "https://polar.sh/docs/openapi.json",
|
|
488
|
+
"operation": "events:list",
|
|
489
|
+
"request": {
|
|
490
|
+
"method": "GET",
|
|
491
|
+
"url": "https://api.polar.sh/v1/events/?page=1&limit=10&sorting=-timestamp"
|
|
492
|
+
},
|
|
493
|
+
"output": {},
|
|
494
|
+
"means": "List Events. Both SDK spellings issue the same first-page wire request.",
|
|
495
|
+
"spellings": [
|
|
496
|
+
{
|
|
497
|
+
"lang": "Python (New SDK)",
|
|
498
|
+
"source": "from polar.v2026_04 import Polar\n\npolar = Polar(\"polar_oat_xxx\")\n\nresponse = polar.events.list(\n page=1,\n limit=10,\n sorting=['-timestamp'],\n)\nprint(response)\n"
|
|
499
|
+
},
|
|
500
|
+
{
|
|
501
|
+
"lang": "TypeScript (New SDK)",
|
|
502
|
+
"source": "import { createPolar } from \"@polar-sh/sdk/2026-04\";\n\nconst polar = createPolar({\n accessToken: \"polar_oat_xxx\",\n});\n\nconst response = await polar.events.list(\n {\n \"page\": 1,\n \"limit\": 10,\n \"sorting\": [\n \"-timestamp\"\n ]\n },\n);\nconsole.log(response);\n"
|
|
503
|
+
}
|
|
504
|
+
]
|
|
505
|
+
},
|
|
506
|
+
{
|
|
507
|
+
"title": "OpenAPI SDK events:ingest",
|
|
508
|
+
"source": "https://polar.sh/docs/openapi.json",
|
|
509
|
+
"operation": "events:ingest",
|
|
510
|
+
"request": {
|
|
511
|
+
"method": "POST",
|
|
512
|
+
"url": "https://api.polar.sh/v1/events/ingest"
|
|
513
|
+
},
|
|
514
|
+
"output": {},
|
|
515
|
+
"means": "Ingest Events. Both SDK spellings issue the same first-page wire request.",
|
|
516
|
+
"spellings": [
|
|
517
|
+
{
|
|
518
|
+
"lang": "Python (New SDK)",
|
|
519
|
+
"source": "from polar.v2026_04 import Polar\n\npolar = Polar(\"polar_oat_xxx\")\n\nresponse = polar.events.ingest(\n events=[{'name': 'string',\n 'customer_id': '00000000-0000-4000-8000-000000000000'}],\n)\nprint(response)\n"
|
|
520
|
+
},
|
|
521
|
+
{
|
|
522
|
+
"lang": "TypeScript (New SDK)",
|
|
523
|
+
"source": "import { createPolar } from \"@polar-sh/sdk/2026-04\";\n\nconst polar = createPolar({\n accessToken: \"polar_oat_xxx\",\n});\n\nconst response = await polar.events.ingest(\n {\n \"events\": [\n {\n \"name\": \"string\",\n \"customer_id\": \"00000000-0000-4000-8000-000000000000\"\n }\n ]\n },\n);\nconsole.log(response);\n"
|
|
524
|
+
}
|
|
525
|
+
],
|
|
526
|
+
"input": {
|
|
527
|
+
"events": [
|
|
528
|
+
{
|
|
529
|
+
"name": "string",
|
|
530
|
+
"customer_id": "00000000-0000-4000-8000-000000000000"
|
|
531
|
+
}
|
|
532
|
+
]
|
|
533
|
+
}
|
|
534
|
+
},
|
|
535
|
+
{
|
|
536
|
+
"title": "OpenAPI SDK meters:list",
|
|
537
|
+
"source": "https://polar.sh/docs/openapi.json",
|
|
538
|
+
"operation": "meters:list",
|
|
539
|
+
"request": {
|
|
540
|
+
"method": "GET",
|
|
541
|
+
"url": "https://api.polar.sh/v1/meters/?page=1&limit=10&sorting=name"
|
|
542
|
+
},
|
|
543
|
+
"output": {},
|
|
544
|
+
"means": "List Meters. Both SDK spellings issue the same first-page wire request.",
|
|
545
|
+
"spellings": [
|
|
546
|
+
{
|
|
547
|
+
"lang": "Python (New SDK)",
|
|
548
|
+
"source": "from polar.v2026_04 import Polar\n\npolar = Polar(\"polar_oat_xxx\")\n\nfor item in polar.meters.iter_list(\n page=1,\n limit=10,\n sorting=['name'],\n):\n print(item)\n"
|
|
549
|
+
},
|
|
550
|
+
{
|
|
551
|
+
"lang": "TypeScript (New SDK)",
|
|
552
|
+
"source": "import { createPolar } from \"@polar-sh/sdk/2026-04\";\n\nconst polar = createPolar({\n accessToken: \"polar_oat_xxx\",\n});\n\nfor await (const item of polar.meters.iterList(\n {\n \"page\": 1,\n \"limit\": 10,\n \"sorting\": [\n \"name\"\n ]\n },\n)) {\n console.log(item);\n}\n"
|
|
553
|
+
}
|
|
554
|
+
]
|
|
555
|
+
},
|
|
556
|
+
{
|
|
557
|
+
"title": "OpenAPI SDK meters:create",
|
|
558
|
+
"source": "https://polar.sh/docs/openapi.json",
|
|
559
|
+
"operation": "meters:create",
|
|
560
|
+
"request": {
|
|
561
|
+
"method": "POST",
|
|
562
|
+
"url": "https://api.polar.sh/v1/meters/"
|
|
563
|
+
},
|
|
564
|
+
"output": {},
|
|
565
|
+
"means": "Create Meter. Both SDK spellings issue the same first-page wire request.",
|
|
566
|
+
"spellings": [
|
|
567
|
+
{
|
|
568
|
+
"lang": "Python (New SDK)",
|
|
569
|
+
"source": "from polar.v2026_04 import Polar\n\npolar = Polar(\"polar_oat_xxx\")\n\nresponse = polar.meters.create(\n name='string',\n filter={'conjunction': 'and',\n 'clauses': [{'property': 'string',\n 'operator': 'eq',\n 'value': 'string'}]},\n aggregation={'func': 'count'},\n)\nprint(response)\n"
|
|
570
|
+
},
|
|
571
|
+
{
|
|
572
|
+
"lang": "TypeScript (New SDK)",
|
|
573
|
+
"source": "import { createPolar } from \"@polar-sh/sdk/2026-04\";\n\nconst polar = createPolar({\n accessToken: \"polar_oat_xxx\",\n});\n\nconst response = await polar.meters.create(\n {\n \"name\": \"string\",\n \"filter\": {\n \"conjunction\": \"and\",\n \"clauses\": [\n {\n \"property\": \"string\",\n \"operator\": \"eq\",\n \"value\": \"string\"\n }\n ]\n },\n \"aggregation\": {\n \"func\": \"count\"\n }\n },\n);\nconsole.log(response);\n"
|
|
574
|
+
}
|
|
575
|
+
],
|
|
576
|
+
"input": {
|
|
577
|
+
"name": "string",
|
|
578
|
+
"filter": {
|
|
579
|
+
"conjunction": "and",
|
|
580
|
+
"clauses": [
|
|
581
|
+
{
|
|
582
|
+
"property": "string",
|
|
583
|
+
"operator": "eq",
|
|
584
|
+
"value": "string"
|
|
585
|
+
}
|
|
586
|
+
]
|
|
587
|
+
},
|
|
588
|
+
"aggregation": {
|
|
589
|
+
"func": "count"
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
},
|
|
593
|
+
{
|
|
594
|
+
"title": "API overview external customer state",
|
|
595
|
+
"source": "https://polar.sh/docs/api-reference/introduction",
|
|
596
|
+
"operation": "customers:get_state_external",
|
|
597
|
+
"request": {
|
|
598
|
+
"method": "GET",
|
|
599
|
+
"url": "https://api.polar.sh/v1/customers/external/customer_external_id/state"
|
|
600
|
+
},
|
|
601
|
+
"output": {},
|
|
602
|
+
"means": "Published SDK/HTTP request; no literal response body is published."
|
|
603
|
+
},
|
|
604
|
+
{
|
|
605
|
+
"title": "Forward the connecting customer IP",
|
|
606
|
+
"source": "https://polar.sh/docs/features/checkout/session",
|
|
607
|
+
"operation": "checkouts:create",
|
|
608
|
+
"request": {
|
|
609
|
+
"method": "POST",
|
|
610
|
+
"url": "https://api.polar.sh/v1/checkouts/"
|
|
611
|
+
},
|
|
612
|
+
"output": {},
|
|
613
|
+
"means": "Published SDK/HTTP request; no literal response body is published.",
|
|
614
|
+
"input": {
|
|
615
|
+
"products": [
|
|
616
|
+
"productId"
|
|
617
|
+
],
|
|
618
|
+
"customer_ip_address": "<client_ip>"
|
|
619
|
+
},
|
|
620
|
+
"placeholders": {
|
|
621
|
+
"names": [
|
|
622
|
+
"productId",
|
|
623
|
+
"<client_ip>"
|
|
624
|
+
],
|
|
625
|
+
"quote": "forward the customer's IP address as customer_ip_address in the request body"
|
|
626
|
+
}
|
|
627
|
+
},
|
|
628
|
+
{
|
|
629
|
+
"title": "Python checkout legacy product_id spelling",
|
|
630
|
+
"source": "https://polar.sh/docs/features/checkout/session",
|
|
631
|
+
"operation": "checkouts:create",
|
|
632
|
+
"request": {
|
|
633
|
+
"method": "POST",
|
|
634
|
+
"url": "https://api.polar.sh/v1/checkouts/"
|
|
635
|
+
},
|
|
636
|
+
"output": {},
|
|
637
|
+
"means": "Published SDK/HTTP request; no literal response body is published.",
|
|
638
|
+
"input": {
|
|
639
|
+
"allow_discount_codes": true,
|
|
640
|
+
"product_id": "<value>"
|
|
641
|
+
},
|
|
642
|
+
"status": 201
|
|
643
|
+
},
|
|
644
|
+
{
|
|
645
|
+
"title": "Concrete ai_usage event",
|
|
646
|
+
"source": "https://polar.sh/docs/features/usage-based-billing/event-ingestion",
|
|
647
|
+
"operation": "events:ingest",
|
|
648
|
+
"request": {
|
|
649
|
+
"method": "POST",
|
|
650
|
+
"url": "https://api.polar.sh/v1/events/ingest"
|
|
651
|
+
},
|
|
652
|
+
"output": {},
|
|
653
|
+
"means": "Published SDK/HTTP request; no literal response body is published.",
|
|
654
|
+
"input": {
|
|
655
|
+
"events": [
|
|
656
|
+
{
|
|
657
|
+
"name": "ai_usage",
|
|
658
|
+
"external_customer_id": "cus_123",
|
|
659
|
+
"metadata": {
|
|
660
|
+
"model": "gpt-4.1-nano",
|
|
661
|
+
"requests": 1,
|
|
662
|
+
"total_tokens": 77,
|
|
663
|
+
"request_tokens": 58,
|
|
664
|
+
"response_tokens": 19
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
]
|
|
668
|
+
}
|
|
669
|
+
},
|
|
670
|
+
{
|
|
671
|
+
"title": "Paged product request and 250-product illustration",
|
|
672
|
+
"source": "https://polar.sh/docs/api-reference/introduction",
|
|
673
|
+
"operation": "products:list",
|
|
674
|
+
"request": {
|
|
675
|
+
"method": "GET",
|
|
676
|
+
"url": "https://api.polar.sh/v1/products/?page=1&limit=100"
|
|
677
|
+
},
|
|
678
|
+
"output": {},
|
|
679
|
+
"means": "total_count=250 indicates there are 250 total products; limit=100 means each page contains up to100 products; max_page=3 means three pages. The displayed JSON uses ellipses and is an abridged illustration."
|
|
680
|
+
}
|
|
681
|
+
]
|