dodopayments-mcp 2.32.1 → 2.32.2

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.
Files changed (48) hide show
  1. package/code-tool.d.mts.map +1 -1
  2. package/code-tool.d.ts.map +1 -1
  3. package/code-tool.js +2 -56
  4. package/code-tool.js.map +1 -1
  5. package/code-tool.mjs +3 -57
  6. package/code-tool.mjs.map +1 -1
  7. package/docs-search-tool.d.mts.map +1 -1
  8. package/docs-search-tool.d.ts.map +1 -1
  9. package/docs-search-tool.js +1 -41
  10. package/docs-search-tool.js.map +1 -1
  11. package/docs-search-tool.mjs +1 -41
  12. package/docs-search-tool.mjs.map +1 -1
  13. package/instructions.d.mts.map +1 -1
  14. package/instructions.d.ts.map +1 -1
  15. package/instructions.js +2 -18
  16. package/instructions.js.map +1 -1
  17. package/instructions.mjs +2 -18
  18. package/instructions.mjs.map +1 -1
  19. package/local-docs-search.d.mts.map +1 -1
  20. package/local-docs-search.d.ts.map +1 -1
  21. package/local-docs-search.js +400 -926
  22. package/local-docs-search.js.map +1 -1
  23. package/local-docs-search.mjs +400 -926
  24. package/local-docs-search.mjs.map +1 -1
  25. package/methods.js +205 -205
  26. package/methods.js.map +1 -1
  27. package/methods.mjs +205 -205
  28. package/methods.mjs.map +1 -1
  29. package/options.d.mts +2 -2
  30. package/options.d.mts.map +1 -1
  31. package/options.d.ts +2 -2
  32. package/options.d.ts.map +1 -1
  33. package/options.js +6 -6
  34. package/options.js.map +1 -1
  35. package/options.mjs +6 -6
  36. package/options.mjs.map +1 -1
  37. package/package.json +2 -2
  38. package/server.js +1 -1
  39. package/server.js.map +1 -1
  40. package/server.mjs +1 -1
  41. package/server.mjs.map +1 -1
  42. package/src/code-tool.ts +4 -87
  43. package/src/docs-search-tool.ts +2 -61
  44. package/src/instructions.ts +2 -28
  45. package/src/local-docs-search.ts +531 -1151
  46. package/src/methods.ts +205 -205
  47. package/src/options.ts +9 -9
  48. package/src/server.ts +1 -1
@@ -84,6 +84,9 @@ const EMBEDDED_METHODS = [
84
84
  method: 'client.checkoutSessions.create',
85
85
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst checkoutSessionResponse = await client.checkoutSessions.create({\n product_cart: [{ product_id: 'product_id', quantity: 0 }],\n});\n\nconsole.log(checkoutSessionResponse.session_id);",
86
86
  },
87
+ http: {
88
+ example: 'curl https://live.dodopayments.com/checkouts \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY" \\\n -d \'{\n "product_cart": [\n {\n "product_id": "product_id",\n "quantity": 0\n }\n ]\n }\'',
89
+ },
87
90
  python: {
88
91
  method: 'checkout_sessions.create',
89
92
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\ncheckout_session_response = client.checkout_sessions.create(\n product_cart=[{\n "product_id": "product_id",\n "quantity": 0,\n }],\n)\nprint(checkout_session_response.session_id)',
@@ -104,10 +107,6 @@ const EMBEDDED_METHODS = [
104
107
  method: 'checkout_sessions.create',
105
108
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\ncheckout_session_response = dodo_payments.checkout_sessions.create(product_cart: [{product_id: "product_id", quantity: 0}])\n\nputs(checkout_session_response)',
106
109
  },
107
- cli: {
108
- method: 'checkout_sessions create',
109
- example: "dodo-payments-cli checkout-sessions create \\\n --bearer-token 'My Bearer Token' \\\n --product-cart '{product_id: product_id, quantity: 0}'",
110
- },
111
110
  php: {
112
111
  method: 'checkoutSessions->create',
113
112
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$checkoutSessionResponse = $client->checkoutSessions->create(\n productCart: [\n [\n 'productID' => 'product_id',\n 'quantity' => 0,\n 'addons' => [['addonID' => 'addon_id', 'quantity' => 0]],\n 'amount' => 0,\n 'creditEntitlements' => [\n [\n 'creditEntitlementID' => 'credit_entitlement_id',\n 'creditsAmount' => 'credits_amount',\n ],\n ],\n ],\n ],\n allowedPaymentMethodTypes: [PaymentMethodTypes::ACH],\n billingAddress: [\n 'country' => CountryCode::AF,\n 'city' => 'city',\n 'state' => 'state',\n 'street' => 'street',\n 'zipcode' => 'zipcode',\n ],\n billingCurrency: Currency::AED,\n cancelURL: 'cancel_url',\n confirm: true,\n customFields: [\n [\n 'fieldType' => 'text',\n 'key' => 'key',\n 'label' => 'label',\n 'options' => ['string'],\n 'placeholder' => 'placeholder',\n 'required' => true,\n ],\n ],\n customer: ['customerID' => 'customer_id'],\n customerBusinessName: 'customer_business_name',\n customization: [\n 'forceLanguage' => 'force_language',\n 'showOnDemandTag' => true,\n 'showOrderDetails' => true,\n 'theme' => 'dark',\n 'themeConfig' => [\n 'dark' => [\n 'bgPrimary' => 'bg_primary',\n 'bgSecondary' => 'bg_secondary',\n 'borderPrimary' => 'border_primary',\n 'borderSecondary' => 'border_secondary',\n 'buttonPrimary' => 'button_primary',\n 'buttonPrimaryHover' => 'button_primary_hover',\n 'buttonSecondary' => 'button_secondary',\n 'buttonSecondaryHover' => 'button_secondary_hover',\n 'buttonTextPrimary' => 'button_text_primary',\n 'buttonTextSecondary' => 'button_text_secondary',\n 'inputFocusBorder' => 'input_focus_border',\n 'textError' => 'text_error',\n 'textPlaceholder' => 'text_placeholder',\n 'textPrimary' => 'text_primary',\n 'textSecondary' => 'text_secondary',\n 'textSuccess' => 'text_success',\n ],\n 'fontPrimaryURL' => 'font_primary_url',\n 'fontSecondaryURL' => 'font_secondary_url',\n 'fontSize' => 'xs',\n 'fontWeight' => 'normal',\n 'light' => [\n 'bgPrimary' => 'bg_primary',\n 'bgSecondary' => 'bg_secondary',\n 'borderPrimary' => 'border_primary',\n 'borderSecondary' => 'border_secondary',\n 'buttonPrimary' => 'button_primary',\n 'buttonPrimaryHover' => 'button_primary_hover',\n 'buttonSecondary' => 'button_secondary',\n 'buttonSecondaryHover' => 'button_secondary_hover',\n 'buttonTextPrimary' => 'button_text_primary',\n 'buttonTextSecondary' => 'button_text_secondary',\n 'inputFocusBorder' => 'input_focus_border',\n 'textError' => 'text_error',\n 'textPlaceholder' => 'text_placeholder',\n 'textPrimary' => 'text_primary',\n 'textSecondary' => 'text_secondary',\n 'textSuccess' => 'text_success',\n ],\n 'payButtonText' => 'pay_button_text',\n 'radius' => 'radius',\n ],\n ],\n discountCode: 'discount_code',\n discountCodes: ['string'],\n featureFlags: [\n 'allowCurrencySelection' => true,\n 'allowCustomerEditingBusinessName' => true,\n 'allowCustomerEditingCity' => true,\n 'allowCustomerEditingCountry' => true,\n 'allowCustomerEditingEmail' => true,\n 'allowCustomerEditingName' => true,\n 'allowCustomerEditingState' => true,\n 'allowCustomerEditingStreet' => true,\n 'allowCustomerEditingTaxID' => true,\n 'allowCustomerEditingZipcode' => true,\n 'allowDiscountCode' => true,\n 'allowPhoneNumberCollection' => true,\n 'allowTaxID' => true,\n 'alwaysCreateNewCustomer' => true,\n 'redirectImmediately' => true,\n 'requirePhoneNumber' => true,\n ],\n force3DS: true,\n mandateMinAmountInrPaise: 0,\n metadata: ['foo' => 'string'],\n minimalAddress: true,\n paymentMethodID: 'payment_method_id',\n productCollectionID: 'product_collection_id',\n returnURL: 'return_url',\n shortLink: true,\n showSavedPaymentMethods: true,\n subscriptionData: [\n 'onDemand' => [\n 'mandateOnly' => true,\n 'adaptiveCurrencyFeesInclusive' => true,\n 'productCurrency' => Currency::AED,\n 'productDescription' => 'product_description',\n 'productPrice' => 0,\n ],\n 'trialPeriodDays' => 0,\n ],\n taxID: 'tax_id',\n);\n\nvar_dump($checkoutSessionResponse);",
@@ -116,9 +115,6 @@ const EMBEDDED_METHODS = [
116
115
  method: 'CheckoutSessions.Create',
117
116
  example: 'CheckoutSessionCreateParams parameters = new()\n{\n ProductCart =\n [\n new()\n {\n ProductID = "product_id",\n Quantity = 0,\n Addons =\n [\n new()\n {\n AddonID = "addon_id",\n Quantity = 0,\n },\n ],\n Amount = 0,\n CreditEntitlements =\n [\n new()\n {\n CreditEntitlementID = "credit_entitlement_id",\n CreditsAmount = "credits_amount",\n },\n ],\n },\n ],\n};\n\nvar checkoutSessionResponse = await client.CheckoutSessions.Create(parameters);\n\nConsole.WriteLine(checkoutSessionResponse);',
118
117
  },
119
- http: {
120
- example: 'curl https://live.dodopayments.com/checkouts \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY" \\\n -d \'{\n "product_cart": [\n {\n "product_id": "product_id",\n "quantity": 0\n }\n ]\n }\'',
121
- },
122
118
  },
123
119
  },
124
120
  {
@@ -137,6 +133,9 @@ const EMBEDDED_METHODS = [
137
133
  method: 'client.checkoutSessions.retrieve',
138
134
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst checkoutSessionStatus = await client.checkoutSessions.retrieve('id');\n\nconsole.log(checkoutSessionStatus.id);",
139
135
  },
136
+ http: {
137
+ example: 'curl https://live.dodopayments.com/checkouts/$ID \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
138
+ },
140
139
  python: {
141
140
  method: 'checkout_sessions.retrieve',
142
141
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\ncheckout_session_status = client.checkout_sessions.retrieve(\n "id",\n)\nprint(checkout_session_status.id)',
@@ -157,10 +156,6 @@ const EMBEDDED_METHODS = [
157
156
  method: 'checkout_sessions.retrieve',
158
157
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\ncheckout_session_status = dodo_payments.checkout_sessions.retrieve("id")\n\nputs(checkout_session_status)',
159
158
  },
160
- cli: {
161
- method: 'checkout_sessions retrieve',
162
- example: "dodo-payments-cli checkout-sessions retrieve \\\n --bearer-token 'My Bearer Token' \\\n --id id",
163
- },
164
159
  php: {
165
160
  method: 'checkoutSessions->retrieve',
166
161
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$checkoutSessionStatus = $client->checkoutSessions->retrieve('id');\n\nvar_dump($checkoutSessionStatus);",
@@ -169,9 +164,6 @@ const EMBEDDED_METHODS = [
169
164
  method: 'CheckoutSessions.Retrieve',
170
165
  example: 'CheckoutSessionRetrieveParams parameters = new() { ID = "id" };\n\nvar checkoutSessionStatus = await client.CheckoutSessions.Retrieve(parameters);\n\nConsole.WriteLine(checkoutSessionStatus);',
171
166
  },
172
- http: {
173
- example: 'curl https://live.dodopayments.com/checkouts/$ID \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
174
- },
175
167
  },
176
168
  },
177
169
  {
@@ -215,6 +207,9 @@ const EMBEDDED_METHODS = [
215
207
  method: 'client.checkoutSessions.preview',
216
208
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.checkoutSessions.preview({\n product_cart: [{ product_id: 'product_id', quantity: 0 }],\n});\n\nconsole.log(response.tax_id_err_msg);",
217
209
  },
210
+ http: {
211
+ example: 'curl https://live.dodopayments.com/checkouts/preview \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY" \\\n -d \'{\n "product_cart": [\n {\n "product_id": "product_id",\n "quantity": 0\n }\n ]\n }\'',
212
+ },
218
213
  python: {
219
214
  method: 'checkout_sessions.preview',
220
215
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.checkout_sessions.preview(\n product_cart=[{\n "product_id": "product_id",\n "quantity": 0,\n }],\n)\nprint(response.tax_id_err_msg)',
@@ -235,10 +230,6 @@ const EMBEDDED_METHODS = [
235
230
  method: 'checkout_sessions.preview',
236
231
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nresponse = dodo_payments.checkout_sessions.preview(product_cart: [{product_id: "product_id", quantity: 0}])\n\nputs(response)',
237
232
  },
238
- cli: {
239
- method: 'checkout_sessions preview',
240
- example: "dodo-payments-cli checkout-sessions preview \\\n --bearer-token 'My Bearer Token' \\\n --product-cart '{product_id: product_id, quantity: 0}'",
241
- },
242
233
  php: {
243
234
  method: 'checkoutSessions->preview',
244
235
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$response = $client->checkoutSessions->preview(\n productCart: [\n [\n 'productID' => 'product_id',\n 'quantity' => 0,\n 'addons' => [['addonID' => 'addon_id', 'quantity' => 0]],\n 'amount' => 0,\n 'creditEntitlements' => [\n [\n 'creditEntitlementID' => 'credit_entitlement_id',\n 'creditsAmount' => 'credits_amount',\n ],\n ],\n ],\n ],\n allowedPaymentMethodTypes: [PaymentMethodTypes::ACH],\n billingAddress: [\n 'country' => CountryCode::AF,\n 'city' => 'city',\n 'state' => 'state',\n 'street' => 'street',\n 'zipcode' => 'zipcode',\n ],\n billingCurrency: Currency::AED,\n cancelURL: 'cancel_url',\n confirm: true,\n customFields: [\n [\n 'fieldType' => 'text',\n 'key' => 'key',\n 'label' => 'label',\n 'options' => ['string'],\n 'placeholder' => 'placeholder',\n 'required' => true,\n ],\n ],\n customer: ['customerID' => 'customer_id'],\n customerBusinessName: 'customer_business_name',\n customization: [\n 'forceLanguage' => 'force_language',\n 'showOnDemandTag' => true,\n 'showOrderDetails' => true,\n 'theme' => 'dark',\n 'themeConfig' => [\n 'dark' => [\n 'bgPrimary' => 'bg_primary',\n 'bgSecondary' => 'bg_secondary',\n 'borderPrimary' => 'border_primary',\n 'borderSecondary' => 'border_secondary',\n 'buttonPrimary' => 'button_primary',\n 'buttonPrimaryHover' => 'button_primary_hover',\n 'buttonSecondary' => 'button_secondary',\n 'buttonSecondaryHover' => 'button_secondary_hover',\n 'buttonTextPrimary' => 'button_text_primary',\n 'buttonTextSecondary' => 'button_text_secondary',\n 'inputFocusBorder' => 'input_focus_border',\n 'textError' => 'text_error',\n 'textPlaceholder' => 'text_placeholder',\n 'textPrimary' => 'text_primary',\n 'textSecondary' => 'text_secondary',\n 'textSuccess' => 'text_success',\n ],\n 'fontPrimaryURL' => 'font_primary_url',\n 'fontSecondaryURL' => 'font_secondary_url',\n 'fontSize' => 'xs',\n 'fontWeight' => 'normal',\n 'light' => [\n 'bgPrimary' => 'bg_primary',\n 'bgSecondary' => 'bg_secondary',\n 'borderPrimary' => 'border_primary',\n 'borderSecondary' => 'border_secondary',\n 'buttonPrimary' => 'button_primary',\n 'buttonPrimaryHover' => 'button_primary_hover',\n 'buttonSecondary' => 'button_secondary',\n 'buttonSecondaryHover' => 'button_secondary_hover',\n 'buttonTextPrimary' => 'button_text_primary',\n 'buttonTextSecondary' => 'button_text_secondary',\n 'inputFocusBorder' => 'input_focus_border',\n 'textError' => 'text_error',\n 'textPlaceholder' => 'text_placeholder',\n 'textPrimary' => 'text_primary',\n 'textSecondary' => 'text_secondary',\n 'textSuccess' => 'text_success',\n ],\n 'payButtonText' => 'pay_button_text',\n 'radius' => 'radius',\n ],\n ],\n discountCode: 'discount_code',\n discountCodes: ['string'],\n featureFlags: [\n 'allowCurrencySelection' => true,\n 'allowCustomerEditingBusinessName' => true,\n 'allowCustomerEditingCity' => true,\n 'allowCustomerEditingCountry' => true,\n 'allowCustomerEditingEmail' => true,\n 'allowCustomerEditingName' => true,\n 'allowCustomerEditingState' => true,\n 'allowCustomerEditingStreet' => true,\n 'allowCustomerEditingTaxID' => true,\n 'allowCustomerEditingZipcode' => true,\n 'allowDiscountCode' => true,\n 'allowPhoneNumberCollection' => true,\n 'allowTaxID' => true,\n 'alwaysCreateNewCustomer' => true,\n 'redirectImmediately' => true,\n 'requirePhoneNumber' => true,\n ],\n force3DS: true,\n mandateMinAmountInrPaise: 0,\n metadata: ['foo' => 'string'],\n minimalAddress: true,\n paymentMethodID: 'payment_method_id',\n productCollectionID: 'product_collection_id',\n returnURL: 'return_url',\n shortLink: true,\n showSavedPaymentMethods: true,\n subscriptionData: [\n 'onDemand' => [\n 'mandateOnly' => true,\n 'adaptiveCurrencyFeesInclusive' => true,\n 'productCurrency' => Currency::AED,\n 'productDescription' => 'product_description',\n 'productPrice' => 0,\n ],\n 'trialPeriodDays' => 0,\n ],\n taxID: 'tax_id',\n);\n\nvar_dump($response);",
@@ -247,9 +238,6 @@ const EMBEDDED_METHODS = [
247
238
  method: 'CheckoutSessions.Preview',
248
239
  example: 'CheckoutSessionPreviewParams parameters = new()\n{\n ProductCart =\n [\n new()\n {\n ProductID = "product_id",\n Quantity = 0,\n Addons =\n [\n new()\n {\n AddonID = "addon_id",\n Quantity = 0,\n },\n ],\n Amount = 0,\n CreditEntitlements =\n [\n new()\n {\n CreditEntitlementID = "credit_entitlement_id",\n CreditsAmount = "credits_amount",\n },\n ],\n },\n ],\n};\n\nvar response = await client.CheckoutSessions.Preview(parameters);\n\nConsole.WriteLine(response);',
249
240
  },
250
- http: {
251
- example: 'curl https://live.dodopayments.com/checkouts/preview \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY" \\\n -d \'{\n "product_cart": [\n {\n "product_id": "product_id",\n "quantity": 0\n }\n ]\n }\'',
252
- },
253
241
  },
254
242
  },
255
243
  {
@@ -278,6 +266,9 @@ const EMBEDDED_METHODS = [
278
266
  method: 'client.payments.list',
279
267
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const paymentListResponse of client.payments.list()) {\n console.log(paymentListResponse.brand_id);\n}",
280
268
  },
269
+ http: {
270
+ example: 'curl https://live.dodopayments.com/payments \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
271
+ },
281
272
  python: {
282
273
  method: 'payments.list',
283
274
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\npage = client.payments.list()\npage = page.items[0]\nprint(page.brand_id)',
@@ -298,10 +289,6 @@ const EMBEDDED_METHODS = [
298
289
  method: 'payments.list',
299
290
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\npage = dodo_payments.payments.list\n\nputs(page)',
300
291
  },
301
- cli: {
302
- method: 'payments list',
303
- example: "dodo-payments-cli payments list \\\n --bearer-token 'My Bearer Token'",
304
- },
305
292
  php: {
306
293
  method: 'payments->list',
307
294
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$page = $client->payments->list(\n brandID: 'brand_id',\n createdAtGte: new \\DateTimeImmutable('2019-12-27T18:11:19.117Z'),\n createdAtLte: new \\DateTimeImmutable('2019-12-27T18:11:19.117Z'),\n customerID: 'customer_id',\n pageNumber: 0,\n pageSize: 0,\n productID: 'product_id',\n status: 'succeeded',\n subscriptionID: 'subscription_id',\n);\n\nvar_dump($page);",
@@ -310,9 +297,6 @@ const EMBEDDED_METHODS = [
310
297
  method: 'Payments.List',
311
298
  example: 'PaymentListParams parameters = new();\n\nvar page = await client.Payments.List(parameters);\nawait foreach (var item in page.Paginate())\n{\n Console.WriteLine(item);\n}',
312
299
  },
313
- http: {
314
- example: 'curl https://live.dodopayments.com/payments \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
315
- },
316
300
  },
317
301
  },
318
302
  {
@@ -351,6 +335,9 @@ const EMBEDDED_METHODS = [
351
335
  method: 'client.payments.create',
352
336
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst payment = await client.payments.create({\n billing: { country: 'AF' },\n customer: { customer_id: 'customer_id' },\n product_cart: [{ product_id: 'product_id', quantity: 0 }],\n});\n\nconsole.log(payment.payment_id);",
353
337
  },
338
+ http: {
339
+ example: 'curl https://live.dodopayments.com/payments \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY" \\\n -d \'{\n "billing": {\n "country": "AF"\n },\n "customer": {\n "customer_id": "customer_id"\n },\n "product_cart": [\n {\n "product_id": "product_id",\n "quantity": 0\n }\n ]\n }\'',
340
+ },
354
341
  python: {
355
342
  method: 'payments.create',
356
343
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\npayment = client.payments.create(\n billing={\n "country": "AF"\n },\n customer={\n "customer_id": "customer_id"\n },\n product_cart=[{\n "product_id": "product_id",\n "quantity": 0,\n }],\n)\nprint(payment.payment_id)',
@@ -371,10 +358,6 @@ const EMBEDDED_METHODS = [
371
358
  method: 'payments.create',
372
359
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\npayment = dodo_payments.payments.create(\n billing: {country: :AF},\n customer: {customer_id: "customer_id"},\n product_cart: [{product_id: "product_id", quantity: 0}]\n)\n\nputs(payment)',
373
360
  },
374
- cli: {
375
- method: 'payments create',
376
- example: "dodo-payments-cli payments create \\\n --bearer-token 'My Bearer Token' \\\n --billing '{country: AF}' \\\n --customer '{customer_id: customer_id}' \\\n --product-cart '{product_id: product_id, quantity: 0}'",
377
- },
378
361
  php: {
379
362
  method: 'payments->create',
380
363
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$payment = $client->payments->create(\n billing: [\n 'country' => CountryCode::AF,\n 'city' => 'city',\n 'state' => 'state',\n 'street' => 'street',\n 'zipcode' => 'zipcode',\n ],\n customer: ['customerID' => 'customer_id'],\n productCart: [['productID' => 'product_id', 'quantity' => 0, 'amount' => 0]],\n adaptiveCurrencyFeesInclusive: true,\n allowedPaymentMethodTypes: [PaymentMethodTypes::ACH],\n billingCurrency: Currency::AED,\n customerBusinessName: 'customer_business_name',\n discountCode: 'discount_code',\n discountCodes: ['string'],\n force3DS: true,\n metadata: ['foo' => 'string'],\n paymentLink: true,\n paymentMethodID: 'payment_method_id',\n redirectImmediately: true,\n requirePhoneNumber: true,\n returnURL: 'return_url',\n shortLink: true,\n showSavedPaymentMethods: true,\n taxID: 'tax_id',\n);\n\nvar_dump($payment);",
@@ -383,9 +366,6 @@ const EMBEDDED_METHODS = [
383
366
  method: 'Payments.Create',
384
367
  example: 'PaymentCreateParams parameters = new()\n{\n Billing = new()\n {\n Country = CountryCode.Af,\n City = "city",\n State = "state",\n Street = "street",\n Zipcode = "zipcode",\n },\n Customer = new AttachExistingCustomer("customer_id"),\n ProductCart =\n [\n new()\n {\n ProductID = "product_id",\n Quantity = 0,\n Amount = 0,\n },\n ],\n};\n\nvar payment = await client.Payments.Create(parameters);\n\nConsole.WriteLine(payment);',
385
368
  },
386
- http: {
387
- example: 'curl https://live.dodopayments.com/payments \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY" \\\n -d \'{\n "billing": {\n "country": "AF"\n },\n "customer": {\n "customer_id": "customer_id"\n },\n "product_cart": [\n {\n "product_id": "product_id",\n "quantity": 0\n }\n ]\n }\'',
388
- },
389
369
  },
390
370
  },
391
371
  {
@@ -404,6 +384,9 @@ const EMBEDDED_METHODS = [
404
384
  method: 'client.payments.retrieve',
405
385
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst payment = await client.payments.retrieve('payment_id');\n\nconsole.log(payment.brand_id);",
406
386
  },
387
+ http: {
388
+ example: 'curl https://live.dodopayments.com/payments/$PAYMENT_ID \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
389
+ },
407
390
  python: {
408
391
  method: 'payments.retrieve',
409
392
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\npayment = client.payments.retrieve(\n "payment_id",\n)\nprint(payment.brand_id)',
@@ -424,10 +407,6 @@ const EMBEDDED_METHODS = [
424
407
  method: 'payments.retrieve',
425
408
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\npayment = dodo_payments.payments.retrieve("payment_id")\n\nputs(payment)',
426
409
  },
427
- cli: {
428
- method: 'payments retrieve',
429
- example: "dodo-payments-cli payments retrieve \\\n --bearer-token 'My Bearer Token' \\\n --payment-id payment_id",
430
- },
431
410
  php: {
432
411
  method: 'payments->retrieve',
433
412
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$payment = $client->payments->retrieve('payment_id');\n\nvar_dump($payment);",
@@ -436,9 +415,6 @@ const EMBEDDED_METHODS = [
436
415
  method: 'Payments.Retrieve',
437
416
  example: 'PaymentRetrieveParams parameters = new() { PaymentID = "payment_id" };\n\nvar payment = await client.Payments.Retrieve(parameters);\n\nConsole.WriteLine(payment);',
438
417
  },
439
- http: {
440
- example: 'curl https://live.dodopayments.com/payments/$PAYMENT_ID \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
441
- },
442
418
  },
443
419
  },
444
420
  {
@@ -457,6 +433,9 @@ const EMBEDDED_METHODS = [
457
433
  method: 'client.payments.retrieveLineItems',
458
434
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.payments.retrieveLineItems('payment_id');\n\nconsole.log(response.currency);",
459
435
  },
436
+ http: {
437
+ example: 'curl https://live.dodopayments.com/payments/$PAYMENT_ID/line-items \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
438
+ },
460
439
  python: {
461
440
  method: 'payments.retrieve_line_items',
462
441
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.payments.retrieve_line_items(\n "payment_id",\n)\nprint(response.currency)',
@@ -477,10 +456,6 @@ const EMBEDDED_METHODS = [
477
456
  method: 'payments.retrieve_line_items',
478
457
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nresponse = dodo_payments.payments.retrieve_line_items("payment_id")\n\nputs(response)',
479
458
  },
480
- cli: {
481
- method: 'payments retrieve_line_items',
482
- example: "dodo-payments-cli payments retrieve-line-items \\\n --bearer-token 'My Bearer Token' \\\n --payment-id payment_id",
483
- },
484
459
  php: {
485
460
  method: 'payments->retrieveLineItems',
486
461
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$response = $client->payments->retrieveLineItems('payment_id');\n\nvar_dump($response);",
@@ -489,9 +464,6 @@ const EMBEDDED_METHODS = [
489
464
  method: 'Payments.RetrieveLineItems',
490
465
  example: 'PaymentRetrieveLineItemsParams parameters = new() { PaymentID = "payment_id" };\n\nvar response = await client.Payments.RetrieveLineItems(parameters);\n\nConsole.WriteLine(response);',
491
466
  },
492
- http: {
493
- example: 'curl https://live.dodopayments.com/payments/$PAYMENT_ID/line-items \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
494
- },
495
467
  },
496
468
  },
497
469
  {
@@ -519,6 +491,9 @@ const EMBEDDED_METHODS = [
519
491
  method: 'client.subscriptions.list',
520
492
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const subscriptionListResponse of client.subscriptions.list()) {\n console.log(subscriptionListResponse.product_id);\n}",
521
493
  },
494
+ http: {
495
+ example: 'curl https://live.dodopayments.com/subscriptions \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
496
+ },
522
497
  python: {
523
498
  method: 'subscriptions.list',
524
499
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\npage = client.subscriptions.list()\npage = page.items[0]\nprint(page.product_id)',
@@ -539,10 +514,6 @@ const EMBEDDED_METHODS = [
539
514
  method: 'subscriptions.list',
540
515
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\npage = dodo_payments.subscriptions.list\n\nputs(page)',
541
516
  },
542
- cli: {
543
- method: 'subscriptions list',
544
- example: "dodo-payments-cli subscriptions list \\\n --bearer-token 'My Bearer Token'",
545
- },
546
517
  php: {
547
518
  method: 'subscriptions->list',
548
519
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$page = $client->subscriptions->list(\n brandID: 'brand_id',\n createdAtGte: new \\DateTimeImmutable('2019-12-27T18:11:19.117Z'),\n createdAtLte: new \\DateTimeImmutable('2019-12-27T18:11:19.117Z'),\n customerID: 'customer_id',\n pageNumber: 0,\n pageSize: 0,\n productID: 'product_id',\n status: 'pending',\n);\n\nvar_dump($page);",
@@ -551,9 +522,6 @@ const EMBEDDED_METHODS = [
551
522
  method: 'Subscriptions.List',
552
523
  example: 'SubscriptionListParams parameters = new();\n\nvar page = await client.Subscriptions.List(parameters);\nawait foreach (var item in page.Paginate())\n{\n Console.WriteLine(item);\n}',
553
524
  },
554
- http: {
555
- example: 'curl https://live.dodopayments.com/subscriptions \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
556
- },
557
525
  },
558
526
  },
559
527
  {
@@ -597,6 +565,9 @@ const EMBEDDED_METHODS = [
597
565
  method: 'client.subscriptions.create',
598
566
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst subscription = await client.subscriptions.create({\n billing: { country: 'AF' },\n customer: { customer_id: 'customer_id' },\n product_id: 'product_id',\n quantity: 0,\n});\n\nconsole.log(subscription.payment_id);",
599
567
  },
568
+ http: {
569
+ example: 'curl https://live.dodopayments.com/subscriptions \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY" \\\n -d \'{\n "billing": {\n "country": "AF"\n },\n "customer": {\n "customer_id": "customer_id"\n },\n "product_id": "product_id",\n "quantity": 0\n }\'',
570
+ },
600
571
  python: {
601
572
  method: 'subscriptions.create',
602
573
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nsubscription = client.subscriptions.create(\n billing={\n "country": "AF"\n },\n customer={\n "customer_id": "customer_id"\n },\n product_id="product_id",\n quantity=0,\n)\nprint(subscription.payment_id)',
@@ -617,10 +588,6 @@ const EMBEDDED_METHODS = [
617
588
  method: 'subscriptions.create',
618
589
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nsubscription = dodo_payments.subscriptions.create(\n billing: {country: :AF},\n customer: {customer_id: "customer_id"},\n product_id: "product_id",\n quantity: 0\n)\n\nputs(subscription)',
619
590
  },
620
- cli: {
621
- method: 'subscriptions create',
622
- example: "dodo-payments-cli subscriptions create \\\n --bearer-token 'My Bearer Token' \\\n --billing '{country: AF}' \\\n --customer '{customer_id: customer_id}' \\\n --product-id product_id \\\n --quantity 0",
623
- },
624
591
  php: {
625
592
  method: 'subscriptions->create',
626
593
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$subscription = $client->subscriptions->create(\n billing: [\n 'country' => CountryCode::AF,\n 'city' => 'city',\n 'state' => 'state',\n 'street' => 'street',\n 'zipcode' => 'zipcode',\n ],\n customer: ['customerID' => 'customer_id'],\n productID: 'product_id',\n quantity: 0,\n addons: [['addonID' => 'addon_id', 'quantity' => 0]],\n allowedPaymentMethodTypes: [PaymentMethodTypes::ACH],\n billingCurrency: Currency::AED,\n customerBusinessName: 'customer_business_name',\n discountCode: 'discount_code',\n discountCodes: ['string'],\n force3DS: true,\n mandateMinAmountInrPaise: 0,\n metadata: ['foo' => 'string'],\n onDemand: [\n 'mandateOnly' => true,\n 'adaptiveCurrencyFeesInclusive' => true,\n 'productCurrency' => Currency::AED,\n 'productDescription' => 'product_description',\n 'productPrice' => 0,\n ],\n oneTimeProductCart: [\n ['productID' => 'product_id', 'quantity' => 0, 'amount' => 0]\n ],\n paymentLink: true,\n paymentMethodID: 'payment_method_id',\n redirectImmediately: true,\n requirePhoneNumber: true,\n returnURL: 'return_url',\n shortLink: true,\n showSavedPaymentMethods: true,\n taxID: 'tax_id',\n trialPeriodDays: 0,\n);\n\nvar_dump($subscription);",
@@ -629,9 +596,6 @@ const EMBEDDED_METHODS = [
629
596
  method: 'Subscriptions.Create',
630
597
  example: 'SubscriptionCreateParams parameters = new()\n{\n Billing = new()\n {\n Country = CountryCode.Af,\n City = "city",\n State = "state",\n Street = "street",\n Zipcode = "zipcode",\n },\n Customer = new AttachExistingCustomer("customer_id"),\n ProductID = "product_id",\n Quantity = 0,\n};\n\nvar subscription = await client.Subscriptions.Create(parameters);\n\nConsole.WriteLine(subscription);',
631
598
  },
632
- http: {
633
- example: 'curl https://live.dodopayments.com/subscriptions \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY" \\\n -d \'{\n "billing": {\n "country": "AF"\n },\n "customer": {\n "customer_id": "customer_id"\n },\n "product_id": "product_id",\n "quantity": 0\n }\'',
634
- },
635
599
  },
636
600
  },
637
601
  {
@@ -650,6 +614,9 @@ const EMBEDDED_METHODS = [
650
614
  method: 'client.subscriptions.retrieve',
651
615
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst subscription = await client.subscriptions.retrieve('subscription_id');\n\nconsole.log(subscription.product_id);",
652
616
  },
617
+ http: {
618
+ example: 'curl https://live.dodopayments.com/subscriptions/$SUBSCRIPTION_ID \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
619
+ },
653
620
  python: {
654
621
  method: 'subscriptions.retrieve',
655
622
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nsubscription = client.subscriptions.retrieve(\n "subscription_id",\n)\nprint(subscription.product_id)',
@@ -670,10 +637,6 @@ const EMBEDDED_METHODS = [
670
637
  method: 'subscriptions.retrieve',
671
638
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nsubscription = dodo_payments.subscriptions.retrieve("subscription_id")\n\nputs(subscription)',
672
639
  },
673
- cli: {
674
- method: 'subscriptions retrieve',
675
- example: "dodo-payments-cli subscriptions retrieve \\\n --bearer-token 'My Bearer Token' \\\n --subscription-id subscription_id",
676
- },
677
640
  php: {
678
641
  method: 'subscriptions->retrieve',
679
642
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$subscription = $client->subscriptions->retrieve('subscription_id');\n\nvar_dump($subscription);",
@@ -682,9 +645,6 @@ const EMBEDDED_METHODS = [
682
645
  method: 'Subscriptions.Retrieve',
683
646
  example: 'SubscriptionRetrieveParams parameters = new()\n{\n SubscriptionID = "subscription_id"\n};\n\nvar subscription = await client.Subscriptions.Retrieve(parameters);\n\nConsole.WriteLine(subscription);',
684
647
  },
685
- http: {
686
- example: 'curl https://live.dodopayments.com/subscriptions/$SUBSCRIPTION_ID \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
687
- },
688
648
  },
689
649
  },
690
650
  {
@@ -718,6 +678,9 @@ const EMBEDDED_METHODS = [
718
678
  method: 'client.subscriptions.update',
719
679
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst subscription = await client.subscriptions.update('subscription_id');\n\nconsole.log(subscription.product_id);",
720
680
  },
681
+ http: {
682
+ example: "curl https://live.dodopayments.com/subscriptions/$SUBSCRIPTION_ID \\\n -X PATCH \\\n -H 'Content-Type: application/json' \\\n -H \"Authorization: Bearer $DODO_PAYMENTS_API_KEY\" \\\n -d '{}'",
683
+ },
721
684
  python: {
722
685
  method: 'subscriptions.update',
723
686
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nsubscription = client.subscriptions.update(\n subscription_id="subscription_id",\n)\nprint(subscription.product_id)',
@@ -738,10 +701,6 @@ const EMBEDDED_METHODS = [
738
701
  method: 'subscriptions.update',
739
702
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nsubscription = dodo_payments.subscriptions.update("subscription_id")\n\nputs(subscription)',
740
703
  },
741
- cli: {
742
- method: 'subscriptions update',
743
- example: "dodo-payments-cli subscriptions update \\\n --bearer-token 'My Bearer Token' \\\n --subscription-id subscription_id",
744
- },
745
704
  php: {
746
705
  method: 'subscriptions->update',
747
706
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$subscription = $client->subscriptions->update(\n 'subscription_id',\n billing: [\n 'country' => CountryCode::AF,\n 'city' => 'city',\n 'state' => 'state',\n 'street' => 'street',\n 'zipcode' => 'zipcode',\n ],\n cancelAtNextBillingDate: true,\n cancelReason: 'cancelled_by_customer',\n cancellationComment: 'cancellation_comment',\n cancellationFeedback: CancellationFeedback::TOO_EXPENSIVE,\n creditEntitlementCart: [\n [\n 'creditEntitlementID' => 'credit_entitlement_id',\n 'creditsAmount' => 'credits_amount',\n 'expiresAfterDays' => 0,\n 'lowBalanceThresholdPercent' => 0,\n 'maxRolloverCount' => 0,\n 'overageEnabled' => true,\n 'overageLimit' => 'overage_limit',\n 'rolloverEnabled' => true,\n 'rolloverPercentage' => 0,\n 'rolloverTimeframeCount' => 0,\n 'rolloverTimeframeInterval' => TimeInterval::DAY,\n ],\n ],\n customerBusinessName: 'customer_business_name',\n customerName: 'customer_name',\n disableOnDemand: [\n 'nextBillingDate' => new \\DateTimeImmutable('2019-12-27T18:11:19.117Z')\n ],\n metadata: ['foo' => 'string'],\n nextBillingDate: new \\DateTimeImmutable('2019-12-27T18:11:19.117Z'),\n status: SubscriptionStatus::PENDING,\n taxID: 'tax_id',\n);\n\nvar_dump($subscription);",
@@ -750,9 +709,6 @@ const EMBEDDED_METHODS = [
750
709
  method: 'Subscriptions.Update',
751
710
  example: 'SubscriptionUpdateParams parameters = new()\n{\n SubscriptionID = "subscription_id"\n};\n\nvar subscription = await client.Subscriptions.Update(parameters);\n\nConsole.WriteLine(subscription);',
752
711
  },
753
- http: {
754
- example: "curl https://live.dodopayments.com/subscriptions/$SUBSCRIPTION_ID \\\n -X PATCH \\\n -H 'Content-Type: application/json' \\\n -H \"Authorization: Bearer $DODO_PAYMENTS_API_KEY\" \\\n -d '{}'",
755
- },
756
712
  },
757
713
  },
758
714
  {
@@ -779,6 +735,9 @@ const EMBEDDED_METHODS = [
779
735
  method: 'client.subscriptions.charge',
780
736
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.subscriptions.charge('subscription_id', { product_price: 0 });\n\nconsole.log(response.payment_id);",
781
737
  },
738
+ http: {
739
+ example: 'curl https://live.dodopayments.com/subscriptions/$SUBSCRIPTION_ID/charge \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY" \\\n -d \'{\n "product_price": 0\n }\'',
740
+ },
782
741
  python: {
783
742
  method: 'subscriptions.charge',
784
743
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.subscriptions.charge(\n subscription_id="subscription_id",\n product_price=0,\n)\nprint(response.payment_id)',
@@ -799,10 +758,6 @@ const EMBEDDED_METHODS = [
799
758
  method: 'subscriptions.charge',
800
759
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nresponse = dodo_payments.subscriptions.charge("subscription_id", product_price: 0)\n\nputs(response)',
801
760
  },
802
- cli: {
803
- method: 'subscriptions charge',
804
- example: "dodo-payments-cli subscriptions charge \\\n --bearer-token 'My Bearer Token' \\\n --subscription-id subscription_id \\\n --product-price 0",
805
- },
806
761
  php: {
807
762
  method: 'subscriptions->charge',
808
763
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$response = $client->subscriptions->charge(\n 'subscription_id',\n productPrice: 0,\n adaptiveCurrencyFeesInclusive: true,\n customerBalanceConfig: [\n 'allowCustomerCreditsPurchase' => true, 'allowCustomerCreditsUsage' => true\n ],\n metadata: ['foo' => 'string'],\n productCurrency: Currency::AED,\n productDescription: 'product_description',\n);\n\nvar_dump($response);",
@@ -811,9 +766,6 @@ const EMBEDDED_METHODS = [
811
766
  method: 'Subscriptions.Charge',
812
767
  example: 'SubscriptionChargeParams parameters = new()\n{\n SubscriptionID = "subscription_id",\n ProductPrice = 0,\n};\n\nvar response = await client.Subscriptions.Charge(parameters);\n\nConsole.WriteLine(response);',
813
768
  },
814
- http: {
815
- example: 'curl https://live.dodopayments.com/subscriptions/$SUBSCRIPTION_ID/charge \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY" \\\n -d \'{\n "product_price": 0\n }\'',
816
- },
817
769
  },
818
770
  },
819
771
  {
@@ -843,6 +795,9 @@ const EMBEDDED_METHODS = [
843
795
  method: 'client.subscriptions.changePlan',
844
796
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.subscriptions.changePlan('subscription_id', {\n product_id: 'product_id',\n proration_billing_mode: 'prorated_immediately',\n quantity: 0,\n});",
845
797
  },
798
+ http: {
799
+ example: 'curl https://live.dodopayments.com/subscriptions/$SUBSCRIPTION_ID/change-plan \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY" \\\n -d \'{\n "product_id": "product_id",\n "proration_billing_mode": "prorated_immediately",\n "quantity": 0\n }\'',
800
+ },
846
801
  python: {
847
802
  method: 'subscriptions.change_plan',
848
803
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nclient.subscriptions.change_plan(\n subscription_id="subscription_id",\n product_id="product_id",\n proration_billing_mode="prorated_immediately",\n quantity=0,\n)',
@@ -863,10 +818,6 @@ const EMBEDDED_METHODS = [
863
818
  method: 'subscriptions.change_plan',
864
819
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nresult = dodo_payments.subscriptions.change_plan(\n "subscription_id",\n product_id: "product_id",\n proration_billing_mode: :prorated_immediately,\n quantity: 0\n)\n\nputs(result)',
865
820
  },
866
- cli: {
867
- method: 'subscriptions change_plan',
868
- example: "dodo-payments-cli subscriptions change-plan \\\n --bearer-token 'My Bearer Token' \\\n --subscription-id subscription_id \\\n --product-id product_id \\\n --proration-billing-mode prorated_immediately \\\n --quantity 0",
869
- },
870
821
  php: {
871
822
  method: 'subscriptions->changePlan',
872
823
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$result = $client->subscriptions->changePlan(\n 'subscription_id',\n productID: 'product_id',\n prorationBillingMode: 'prorated_immediately',\n quantity: 0,\n adaptiveCurrencyFeesInclusive: true,\n addons: [['addonID' => 'addon_id', 'quantity' => 0]],\n discountCode: 'discount_code',\n discountCodes: ['string'],\n effectiveAt: 'immediately',\n metadata: ['foo' => 'string'],\n onPaymentFailure: 'prevent_change',\n);\n\nvar_dump($result);",
@@ -875,9 +826,6 @@ const EMBEDDED_METHODS = [
875
826
  method: 'Subscriptions.ChangePlan',
876
827
  example: 'SubscriptionChangePlanParams parameters = new()\n{\n SubscriptionID = "subscription_id",\n ProductID = "product_id",\n ProrationBillingMode = ProrationBillingMode.ProratedImmediately,\n Quantity = 0,\n};\n\nawait client.Subscriptions.ChangePlan(parameters);',
877
828
  },
878
- http: {
879
- example: 'curl https://live.dodopayments.com/subscriptions/$SUBSCRIPTION_ID/change-plan \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY" \\\n -d \'{\n "product_id": "product_id",\n "proration_billing_mode": "prorated_immediately",\n "quantity": 0\n }\'',
880
- },
881
829
  },
882
830
  },
883
831
  {
@@ -903,6 +851,9 @@ const EMBEDDED_METHODS = [
903
851
  method: 'client.subscriptions.retrieveUsageHistory',
904
852
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const subscriptionRetrieveUsageHistoryResponse of client.subscriptions.retrieveUsageHistory(\n 'subscription_id',\n)) {\n console.log(subscriptionRetrieveUsageHistoryResponse.end_date);\n}",
905
853
  },
854
+ http: {
855
+ example: 'curl https://live.dodopayments.com/subscriptions/$SUBSCRIPTION_ID/usage-history \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
856
+ },
906
857
  python: {
907
858
  method: 'subscriptions.retrieve_usage_history',
908
859
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\npage = client.subscriptions.retrieve_usage_history(\n subscription_id="subscription_id",\n)\npage = page.items[0]\nprint(page.end_date)',
@@ -923,10 +874,6 @@ const EMBEDDED_METHODS = [
923
874
  method: 'subscriptions.retrieve_usage_history',
924
875
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\npage = dodo_payments.subscriptions.retrieve_usage_history("subscription_id")\n\nputs(page)',
925
876
  },
926
- cli: {
927
- method: 'subscriptions retrieve_usage_history',
928
- example: "dodo-payments-cli subscriptions retrieve-usage-history \\\n --bearer-token 'My Bearer Token' \\\n --subscription-id subscription_id",
929
- },
930
877
  php: {
931
878
  method: 'subscriptions->retrieveUsageHistory',
932
879
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$page = $client->subscriptions->retrieveUsageHistory(\n 'subscription_id',\n endDate: new \\DateTimeImmutable('2019-12-27T18:11:19.117Z'),\n meterID: 'meter_id',\n pageNumber: 0,\n pageSize: 0,\n startDate: new \\DateTimeImmutable('2019-12-27T18:11:19.117Z'),\n);\n\nvar_dump($page);",
@@ -935,9 +882,6 @@ const EMBEDDED_METHODS = [
935
882
  method: 'Subscriptions.RetrieveUsageHistory',
936
883
  example: 'SubscriptionRetrieveUsageHistoryParams parameters = new()\n{\n SubscriptionID = "subscription_id"\n};\n\nvar page = await client.Subscriptions.RetrieveUsageHistory(parameters);\nawait foreach (var item in page.Paginate())\n{\n Console.WriteLine(item);\n}',
937
884
  },
938
- http: {
939
- example: 'curl https://live.dodopayments.com/subscriptions/$SUBSCRIPTION_ID/usage-history \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
940
- },
941
885
  },
942
886
  },
943
887
  {
@@ -959,6 +903,9 @@ const EMBEDDED_METHODS = [
959
903
  method: 'client.subscriptions.updatePaymentMethod',
960
904
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.subscriptions.updatePaymentMethod('subscription_id', {\n payment_method: { type: 'new' },\n});\n\nconsole.log(response.payment_id);",
961
905
  },
906
+ http: {
907
+ example: 'curl https://live.dodopayments.com/subscriptions/$SUBSCRIPTION_ID/update-payment-method \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY" \\\n -d \'{\n "type": "new",\n "return_url": "return_url"\n }\'',
908
+ },
962
909
  python: {
963
910
  method: 'subscriptions.update_payment_method',
964
911
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.subscriptions.update_payment_method(\n subscription_id="subscription_id",\n payment_method={\n "type": "new"\n },\n)\nprint(response.payment_id)',
@@ -979,10 +926,6 @@ const EMBEDDED_METHODS = [
979
926
  method: 'subscriptions.update_payment_method',
980
927
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nresponse = dodo_payments.subscriptions.update_payment_method("subscription_id", payment_method: {type: :new})\n\nputs(response)',
981
928
  },
982
- cli: {
983
- method: 'subscriptions update_payment_method',
984
- example: "dodo-payments-cli subscriptions update-payment-method \\\n --bearer-token 'My Bearer Token' \\\n --subscription-id subscription_id \\\n --payment-method '{type: new}'",
985
- },
986
929
  php: {
987
930
  method: 'subscriptions->updatePaymentMethod',
988
931
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$response = $client->subscriptions->updatePaymentMethod(\n 'subscription_id',\n paymentMethod: ['type' => 'new', 'returnURL' => 'return_url'],\n);\n\nvar_dump($response);",
@@ -991,9 +934,6 @@ const EMBEDDED_METHODS = [
991
934
  method: 'Subscriptions.UpdatePaymentMethod',
992
935
  example: 'SubscriptionUpdatePaymentMethodParams parameters = new()\n{\n SubscriptionID = "subscription_id",\n PaymentMethod = new New() { ReturnUrl = "return_url" },\n};\n\nvar response = await client.Subscriptions.UpdatePaymentMethod(parameters);\n\nConsole.WriteLine(response);',
993
936
  },
994
- http: {
995
- example: 'curl https://live.dodopayments.com/subscriptions/$SUBSCRIPTION_ID/update-payment-method \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY" \\\n -d \'{\n "type": "new",\n "return_url": "return_url"\n }\'',
996
- },
997
937
  },
998
938
  },
999
939
  {
@@ -1024,6 +964,9 @@ const EMBEDDED_METHODS = [
1024
964
  method: 'client.subscriptions.previewChangePlan',
1025
965
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.subscriptions.previewChangePlan('subscription_id', {\n product_id: 'product_id',\n proration_billing_mode: 'prorated_immediately',\n quantity: 0,\n});\n\nconsole.log(response.immediate_charge);",
1026
966
  },
967
+ http: {
968
+ example: 'curl https://live.dodopayments.com/subscriptions/$SUBSCRIPTION_ID/change-plan/preview \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY" \\\n -d \'{\n "product_id": "product_id",\n "proration_billing_mode": "prorated_immediately",\n "quantity": 0\n }\'',
969
+ },
1027
970
  python: {
1028
971
  method: 'subscriptions.preview_change_plan',
1029
972
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.subscriptions.preview_change_plan(\n subscription_id="subscription_id",\n product_id="product_id",\n proration_billing_mode="prorated_immediately",\n quantity=0,\n)\nprint(response.immediate_charge)',
@@ -1044,10 +987,6 @@ const EMBEDDED_METHODS = [
1044
987
  method: 'subscriptions.preview_change_plan',
1045
988
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nresponse = dodo_payments.subscriptions.preview_change_plan(\n "subscription_id",\n product_id: "product_id",\n proration_billing_mode: :prorated_immediately,\n quantity: 0\n)\n\nputs(response)',
1046
989
  },
1047
- cli: {
1048
- method: 'subscriptions preview_change_plan',
1049
- example: "dodo-payments-cli subscriptions preview-change-plan \\\n --bearer-token 'My Bearer Token' \\\n --subscription-id subscription_id \\\n --product-id product_id \\\n --proration-billing-mode prorated_immediately \\\n --quantity 0",
1050
- },
1051
990
  php: {
1052
991
  method: 'subscriptions->previewChangePlan',
1053
992
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$response = $client->subscriptions->previewChangePlan(\n 'subscription_id',\n productID: 'product_id',\n prorationBillingMode: 'prorated_immediately',\n quantity: 0,\n adaptiveCurrencyFeesInclusive: true,\n addons: [['addonID' => 'addon_id', 'quantity' => 0]],\n discountCode: 'discount_code',\n discountCodes: ['string'],\n effectiveAt: 'immediately',\n metadata: ['foo' => 'string'],\n onPaymentFailure: 'prevent_change',\n);\n\nvar_dump($response);",
@@ -1056,9 +995,6 @@ const EMBEDDED_METHODS = [
1056
995
  method: 'Subscriptions.PreviewChangePlan',
1057
996
  example: 'SubscriptionPreviewChangePlanParams parameters = new()\n{\n SubscriptionID = "subscription_id",\n ProductID = "product_id",\n ProrationBillingMode = ProrationBillingMode.ProratedImmediately,\n Quantity = 0,\n};\n\nvar response = await client.Subscriptions.PreviewChangePlan(parameters);\n\nConsole.WriteLine(response);',
1058
997
  },
1059
- http: {
1060
- example: 'curl https://live.dodopayments.com/subscriptions/$SUBSCRIPTION_ID/change-plan/preview \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY" \\\n -d \'{\n "product_id": "product_id",\n "proration_billing_mode": "prorated_immediately",\n "quantity": 0\n }\'',
1061
- },
1062
998
  },
1063
999
  },
1064
1000
  {
@@ -1077,6 +1013,9 @@ const EMBEDDED_METHODS = [
1077
1013
  method: 'client.subscriptions.retrieveCreditUsage',
1078
1014
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.subscriptions.retrieveCreditUsage('subscription_id');\n\nconsole.log(response.subscription_id);",
1079
1015
  },
1016
+ http: {
1017
+ example: 'curl https://live.dodopayments.com/subscriptions/$SUBSCRIPTION_ID/credit-usage \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
1018
+ },
1080
1019
  python: {
1081
1020
  method: 'subscriptions.retrieve_credit_usage',
1082
1021
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.subscriptions.retrieve_credit_usage(\n "subscription_id",\n)\nprint(response.subscription_id)',
@@ -1097,10 +1036,6 @@ const EMBEDDED_METHODS = [
1097
1036
  method: 'subscriptions.retrieve_credit_usage',
1098
1037
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nresponse = dodo_payments.subscriptions.retrieve_credit_usage("subscription_id")\n\nputs(response)',
1099
1038
  },
1100
- cli: {
1101
- method: 'subscriptions retrieve_credit_usage',
1102
- example: "dodo-payments-cli subscriptions retrieve-credit-usage \\\n --bearer-token 'My Bearer Token' \\\n --subscription-id subscription_id",
1103
- },
1104
1039
  php: {
1105
1040
  method: 'subscriptions->retrieveCreditUsage',
1106
1041
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$response = $client->subscriptions->retrieveCreditUsage('subscription_id');\n\nvar_dump($response);",
@@ -1109,9 +1044,6 @@ const EMBEDDED_METHODS = [
1109
1044
  method: 'Subscriptions.RetrieveCreditUsage',
1110
1045
  example: 'SubscriptionRetrieveCreditUsageParams parameters = new()\n{\n SubscriptionID = "subscription_id"\n};\n\nvar response = await client.Subscriptions.RetrieveCreditUsage(parameters);\n\nConsole.WriteLine(response);',
1111
1046
  },
1112
- http: {
1113
- example: 'curl https://live.dodopayments.com/subscriptions/$SUBSCRIPTION_ID/credit-usage \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
1114
- },
1115
1047
  },
1116
1048
  },
1117
1049
  {
@@ -1129,6 +1061,9 @@ const EMBEDDED_METHODS = [
1129
1061
  method: 'client.subscriptions.cancelChangePlan',
1130
1062
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.subscriptions.cancelChangePlan('subscription_id');",
1131
1063
  },
1064
+ http: {
1065
+ example: 'curl https://live.dodopayments.com/subscriptions/$SUBSCRIPTION_ID/change-plan/scheduled \\\n -X DELETE \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
1066
+ },
1132
1067
  python: {
1133
1068
  method: 'subscriptions.cancel_change_plan',
1134
1069
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nclient.subscriptions.cancel_change_plan(\n "subscription_id",\n)',
@@ -1149,10 +1084,6 @@ const EMBEDDED_METHODS = [
1149
1084
  method: 'subscriptions.cancel_change_plan',
1150
1085
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nresult = dodo_payments.subscriptions.cancel_change_plan("subscription_id")\n\nputs(result)',
1151
1086
  },
1152
- cli: {
1153
- method: 'subscriptions cancel_change_plan',
1154
- example: "dodo-payments-cli subscriptions cancel-change-plan \\\n --bearer-token 'My Bearer Token' \\\n --subscription-id subscription_id",
1155
- },
1156
1087
  php: {
1157
1088
  method: 'subscriptions->cancelChangePlan',
1158
1089
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$result = $client->subscriptions->cancelChangePlan('subscription_id');\n\nvar_dump($result);",
@@ -1161,9 +1092,6 @@ const EMBEDDED_METHODS = [
1161
1092
  method: 'Subscriptions.CancelChangePlan',
1162
1093
  example: 'SubscriptionCancelChangePlanParams parameters = new()\n{\n SubscriptionID = "subscription_id"\n};\n\nawait client.Subscriptions.CancelChangePlan(parameters);',
1163
1094
  },
1164
- http: {
1165
- example: 'curl https://live.dodopayments.com/subscriptions/$SUBSCRIPTION_ID/change-plan/scheduled \\\n -X DELETE \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
1166
- },
1167
1095
  },
1168
1096
  },
1169
1097
  {
@@ -1182,6 +1110,9 @@ const EMBEDDED_METHODS = [
1182
1110
  method: 'client.invoices.payments.retrieve',
1183
1111
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst payment = await client.invoices.payments.retrieve('payment_id');\n\nconsole.log(payment);\n\nconst content = await payment.blob();\nconsole.log(content);",
1184
1112
  },
1113
+ http: {
1114
+ example: 'curl https://live.dodopayments.com/invoices/payments/$PAYMENT_ID \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
1115
+ },
1185
1116
  python: {
1186
1117
  method: 'invoices.payments.retrieve',
1187
1118
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\npayment = client.invoices.payments.retrieve(\n "payment_id",\n)\nprint(payment)\ncontent = payment.read()\nprint(content)',
@@ -1202,10 +1133,6 @@ const EMBEDDED_METHODS = [
1202
1133
  method: 'invoices.payments.retrieve',
1203
1134
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\npayment = dodo_payments.invoices.payments.retrieve("payment_id")\n\nputs(payment)',
1204
1135
  },
1205
- cli: {
1206
- method: 'payments retrieve',
1207
- example: "dodo-payments-cli invoices:payments retrieve \\\n --bearer-token 'My Bearer Token' \\\n --payment-id payment_id",
1208
- },
1209
1136
  php: {
1210
1137
  method: 'invoices->payments->retrieve',
1211
1138
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$payment = $client->invoices->payments->retrieve('payment_id');\n\nvar_dump($payment);",
@@ -1214,9 +1141,6 @@ const EMBEDDED_METHODS = [
1214
1141
  method: 'Invoices.Payments.Retrieve',
1215
1142
  example: 'PaymentRetrieveParams parameters = new() { PaymentID = "payment_id" };\n\nvar payment = await client.Invoices.Payments.Retrieve(parameters);\n\nConsole.WriteLine(payment);',
1216
1143
  },
1217
- http: {
1218
- example: 'curl https://live.dodopayments.com/invoices/payments/$PAYMENT_ID \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
1219
- },
1220
1144
  },
1221
1145
  },
1222
1146
  {
@@ -1235,6 +1159,9 @@ const EMBEDDED_METHODS = [
1235
1159
  method: 'client.invoices.payments.retrieveRefund',
1236
1160
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.invoices.payments.retrieveRefund('refund_id');\n\nconsole.log(response);\n\nconst content = await response.blob();\nconsole.log(content);",
1237
1161
  },
1162
+ http: {
1163
+ example: 'curl https://live.dodopayments.com/invoices/refunds/$REFUND_ID \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
1164
+ },
1238
1165
  python: {
1239
1166
  method: 'invoices.payments.retrieve_refund',
1240
1167
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.invoices.payments.retrieve_refund(\n "refund_id",\n)\nprint(response)\ncontent = response.read()\nprint(content)',
@@ -1255,10 +1182,6 @@ const EMBEDDED_METHODS = [
1255
1182
  method: 'invoices.payments.retrieve_refund',
1256
1183
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nresponse = dodo_payments.invoices.payments.retrieve_refund("refund_id")\n\nputs(response)',
1257
1184
  },
1258
- cli: {
1259
- method: 'payments retrieve_refund',
1260
- example: "dodo-payments-cli invoices:payments retrieve-refund \\\n --bearer-token 'My Bearer Token' \\\n --refund-id refund_id",
1261
- },
1262
1185
  php: {
1263
1186
  method: 'invoices->payments->retrieveRefund',
1264
1187
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$response = $client->invoices->payments->retrieveRefund('refund_id');\n\nvar_dump($response);",
@@ -1267,9 +1190,6 @@ const EMBEDDED_METHODS = [
1267
1190
  method: 'Invoices.Payments.RetrieveRefund',
1268
1191
  example: 'PaymentRetrieveRefundParams parameters = new() { RefundID = "refund_id" };\n\nvar response = await client.Invoices.Payments.RetrieveRefund(parameters);\n\nConsole.WriteLine(response);',
1269
1192
  },
1270
- http: {
1271
- example: 'curl https://live.dodopayments.com/invoices/refunds/$REFUND_ID \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
1272
- },
1273
1193
  },
1274
1194
  },
1275
1195
  {
@@ -1288,6 +1208,9 @@ const EMBEDDED_METHODS = [
1288
1208
  method: 'client.invoices.payments.retrievePayout',
1289
1209
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.invoices.payments.retrievePayout('payout_id');\n\nconsole.log(response);\n\nconst content = await response.blob();\nconsole.log(content);",
1290
1210
  },
1211
+ http: {
1212
+ example: 'curl https://live.dodopayments.com/invoices/payouts/$PAYOUT_ID \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
1213
+ },
1291
1214
  python: {
1292
1215
  method: 'invoices.payments.retrieve_payout',
1293
1216
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.invoices.payments.retrieve_payout(\n "payout_id",\n)\nprint(response)\ncontent = response.read()\nprint(content)',
@@ -1308,10 +1231,6 @@ const EMBEDDED_METHODS = [
1308
1231
  method: 'invoices.payments.retrieve_payout',
1309
1232
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nresponse = dodo_payments.invoices.payments.retrieve_payout("payout_id")\n\nputs(response)',
1310
1233
  },
1311
- cli: {
1312
- method: 'payments retrieve_payout',
1313
- example: "dodo-payments-cli invoices:payments retrieve-payout \\\n --bearer-token 'My Bearer Token' \\\n --payout-id payout_id",
1314
- },
1315
1234
  php: {
1316
1235
  method: 'invoices->payments->retrievePayout',
1317
1236
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$response = $client->invoices->payments->retrievePayout('payout_id');\n\nvar_dump($response);",
@@ -1320,9 +1239,6 @@ const EMBEDDED_METHODS = [
1320
1239
  method: 'Invoices.Payments.RetrievePayout',
1321
1240
  example: 'PaymentRetrievePayoutParams parameters = new() { PayoutID = "payout_id" };\n\nvar response = await client.Invoices.Payments.RetrievePayout(parameters);\n\nConsole.WriteLine(response);',
1322
1241
  },
1323
- http: {
1324
- example: 'curl https://live.dodopayments.com/invoices/payouts/$PAYOUT_ID \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
1325
- },
1326
1242
  },
1327
1243
  },
1328
1244
  {
@@ -1341,6 +1257,9 @@ const EMBEDDED_METHODS = [
1341
1257
  method: 'client.licenses.activate',
1342
1258
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.licenses.activate({ license_key: 'license_key', name: 'name' });\n\nconsole.log(response.id);",
1343
1259
  },
1260
+ http: {
1261
+ example: 'curl https://live.dodopayments.com/licenses/activate \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY" \\\n -d \'{\n "license_key": "license_key",\n "name": "name"\n }\'',
1262
+ },
1344
1263
  python: {
1345
1264
  method: 'licenses.activate',
1346
1265
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.licenses.activate(\n license_key="license_key",\n name="name",\n)\nprint(response.id)',
@@ -1361,10 +1280,6 @@ const EMBEDDED_METHODS = [
1361
1280
  method: 'licenses.activate',
1362
1281
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nresponse = dodo_payments.licenses.activate(license_key: "license_key", name: "name")\n\nputs(response)',
1363
1282
  },
1364
- cli: {
1365
- method: 'licenses activate',
1366
- example: "dodo-payments-cli licenses activate \\\n --bearer-token 'My Bearer Token' \\\n --license-key license_key \\\n --name name",
1367
- },
1368
1283
  php: {
1369
1284
  method: 'licenses->activate',
1370
1285
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$response = $client->licenses->activate(\n licenseKey: 'license_key', name: 'name'\n);\n\nvar_dump($response);",
@@ -1373,9 +1288,6 @@ const EMBEDDED_METHODS = [
1373
1288
  method: 'Licenses.Activate',
1374
1289
  example: 'LicenseActivateParams parameters = new()\n{\n LicenseKey = "license_key",\n Name = "name",\n};\n\nvar response = await client.Licenses.Activate(parameters);\n\nConsole.WriteLine(response);',
1375
1290
  },
1376
- http: {
1377
- example: 'curl https://live.dodopayments.com/licenses/activate \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY" \\\n -d \'{\n "license_key": "license_key",\n "name": "name"\n }\'',
1378
- },
1379
1291
  },
1380
1292
  },
1381
1293
  {
@@ -1393,6 +1305,9 @@ const EMBEDDED_METHODS = [
1393
1305
  method: 'client.licenses.deactivate',
1394
1306
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.licenses.deactivate({\n license_key: 'license_key',\n license_key_instance_id: 'license_key_instance_id',\n});",
1395
1307
  },
1308
+ http: {
1309
+ example: 'curl https://live.dodopayments.com/licenses/deactivate \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY" \\\n -d \'{\n "license_key": "license_key",\n "license_key_instance_id": "license_key_instance_id"\n }\'',
1310
+ },
1396
1311
  python: {
1397
1312
  method: 'licenses.deactivate',
1398
1313
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nclient.licenses.deactivate(\n license_key="license_key",\n license_key_instance_id="license_key_instance_id",\n)',
@@ -1413,10 +1328,6 @@ const EMBEDDED_METHODS = [
1413
1328
  method: 'licenses.deactivate',
1414
1329
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nresult = dodo_payments.licenses.deactivate(\n license_key: "license_key",\n license_key_instance_id: "license_key_instance_id"\n)\n\nputs(result)',
1415
1330
  },
1416
- cli: {
1417
- method: 'licenses deactivate',
1418
- example: "dodo-payments-cli licenses deactivate \\\n --bearer-token 'My Bearer Token' \\\n --license-key license_key \\\n --license-key-instance-id license_key_instance_id",
1419
- },
1420
1331
  php: {
1421
1332
  method: 'licenses->deactivate',
1422
1333
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$result = $client->licenses->deactivate(\n licenseKey: 'license_key', licenseKeyInstanceID: 'license_key_instance_id'\n);\n\nvar_dump($result);",
@@ -1425,9 +1336,6 @@ const EMBEDDED_METHODS = [
1425
1336
  method: 'Licenses.Deactivate',
1426
1337
  example: 'LicenseDeactivateParams parameters = new()\n{\n LicenseKey = "license_key",\n LicenseKeyInstanceID = "license_key_instance_id",\n};\n\nawait client.Licenses.Deactivate(parameters);',
1427
1338
  },
1428
- http: {
1429
- example: 'curl https://live.dodopayments.com/licenses/deactivate \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY" \\\n -d \'{\n "license_key": "license_key",\n "license_key_instance_id": "license_key_instance_id"\n }\'',
1430
- },
1431
1339
  },
1432
1340
  },
1433
1341
  {
@@ -1446,6 +1354,9 @@ const EMBEDDED_METHODS = [
1446
1354
  method: 'client.licenses.validate',
1447
1355
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.licenses.validate({\n license_key: '2b1f8e2d-c41e-4e8f-b2d3-d9fd61c38f43',\n});\n\nconsole.log(response.valid);",
1448
1356
  },
1357
+ http: {
1358
+ example: 'curl https://live.dodopayments.com/licenses/validate \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY" \\\n -d \'{\n "license_key": "2b1f8e2d-c41e-4e8f-b2d3-d9fd61c38f43",\n "license_key_instance_id": "lki_123"\n }\'',
1359
+ },
1449
1360
  python: {
1450
1361
  method: 'licenses.validate',
1451
1362
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.licenses.validate(\n license_key="2b1f8e2d-c41e-4e8f-b2d3-d9fd61c38f43",\n)\nprint(response.valid)',
@@ -1466,10 +1377,6 @@ const EMBEDDED_METHODS = [
1466
1377
  method: 'licenses.validate',
1467
1378
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nresponse = dodo_payments.licenses.validate(license_key: "2b1f8e2d-c41e-4e8f-b2d3-d9fd61c38f43")\n\nputs(response)',
1468
1379
  },
1469
- cli: {
1470
- method: 'licenses validate',
1471
- example: "dodo-payments-cli licenses validate \\\n --bearer-token 'My Bearer Token' \\\n --license-key 2b1f8e2d-c41e-4e8f-b2d3-d9fd61c38f43",
1472
- },
1473
1380
  php: {
1474
1381
  method: 'licenses->validate',
1475
1382
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$response = $client->licenses->validate(\n licenseKey: '2b1f8e2d-c41e-4e8f-b2d3-d9fd61c38f43',\n licenseKeyInstanceID: 'lki_123',\n);\n\nvar_dump($response);",
@@ -1478,9 +1385,6 @@ const EMBEDDED_METHODS = [
1478
1385
  method: 'Licenses.Validate',
1479
1386
  example: 'LicenseValidateParams parameters = new()\n{\n LicenseKey = "2b1f8e2d-c41e-4e8f-b2d3-d9fd61c38f43"\n};\n\nvar response = await client.Licenses.Validate(parameters);\n\nConsole.WriteLine(response);',
1480
1387
  },
1481
- http: {
1482
- example: 'curl https://live.dodopayments.com/licenses/validate \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY" \\\n -d \'{\n "license_key": "2b1f8e2d-c41e-4e8f-b2d3-d9fd61c38f43",\n "license_key_instance_id": "lki_123"\n }\'',
1483
- },
1484
1388
  },
1485
1389
  },
1486
1390
  {
@@ -1508,6 +1412,9 @@ const EMBEDDED_METHODS = [
1508
1412
  method: 'client.licenseKeys.list',
1509
1413
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const licenseKey of client.licenseKeys.list()) {\n console.log(licenseKey.id);\n}",
1510
1414
  },
1415
+ http: {
1416
+ example: 'curl https://live.dodopayments.com/license_keys \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
1417
+ },
1511
1418
  python: {
1512
1419
  method: 'license_keys.list',
1513
1420
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\npage = client.license_keys.list()\npage = page.items[0]\nprint(page.id)',
@@ -1528,10 +1435,6 @@ const EMBEDDED_METHODS = [
1528
1435
  method: 'license_keys.list',
1529
1436
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\npage = dodo_payments.license_keys.list\n\nputs(page)',
1530
1437
  },
1531
- cli: {
1532
- method: 'license_keys list',
1533
- example: "dodo-payments-cli license-keys list \\\n --bearer-token 'My Bearer Token'",
1534
- },
1535
1438
  php: {
1536
1439
  method: 'licenseKeys->list',
1537
1440
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$page = $client->licenseKeys->list(\n createdAtGte: new \\DateTimeImmutable('2019-12-27T18:11:19.117Z'),\n createdAtLte: new \\DateTimeImmutable('2019-12-27T18:11:19.117Z'),\n customerID: 'customer_id',\n pageNumber: 0,\n pageSize: 0,\n productID: 'product_id',\n source: 'auto',\n status: 'active',\n);\n\nvar_dump($page);",
@@ -1540,9 +1443,6 @@ const EMBEDDED_METHODS = [
1540
1443
  method: 'LicenseKeys.List',
1541
1444
  example: 'LicenseKeyListParams parameters = new();\n\nvar page = await client.LicenseKeys.List(parameters);\nawait foreach (var item in page.Paginate())\n{\n Console.WriteLine(item);\n}',
1542
1445
  },
1543
- http: {
1544
- example: 'curl https://live.dodopayments.com/license_keys \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
1545
- },
1546
1446
  },
1547
1447
  },
1548
1448
  {
@@ -1561,6 +1461,9 @@ const EMBEDDED_METHODS = [
1561
1461
  method: 'client.licenseKeys.retrieve',
1562
1462
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst licenseKey = await client.licenseKeys.retrieve('lic_123');\n\nconsole.log(licenseKey.id);",
1563
1463
  },
1464
+ http: {
1465
+ example: 'curl https://live.dodopayments.com/license_keys/$ID \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
1466
+ },
1564
1467
  python: {
1565
1468
  method: 'license_keys.retrieve',
1566
1469
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nlicense_key = client.license_keys.retrieve(\n "lic_123",\n)\nprint(license_key.id)',
@@ -1581,10 +1484,6 @@ const EMBEDDED_METHODS = [
1581
1484
  method: 'license_keys.retrieve',
1582
1485
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nlicense_key = dodo_payments.license_keys.retrieve("lic_123")\n\nputs(license_key)',
1583
1486
  },
1584
- cli: {
1585
- method: 'license_keys retrieve',
1586
- example: "dodo-payments-cli license-keys retrieve \\\n --bearer-token 'My Bearer Token' \\\n --id lic_123",
1587
- },
1588
1487
  php: {
1589
1488
  method: 'licenseKeys->retrieve',
1590
1489
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$licenseKey = $client->licenseKeys->retrieve('lic_123');\n\nvar_dump($licenseKey);",
@@ -1593,9 +1492,6 @@ const EMBEDDED_METHODS = [
1593
1492
  method: 'LicenseKeys.Retrieve',
1594
1493
  example: 'LicenseKeyRetrieveParams parameters = new() { ID = "lic_123" };\n\nvar licenseKey = await client.LicenseKeys.Retrieve(parameters);\n\nConsole.WriteLine(licenseKey);',
1595
1494
  },
1596
- http: {
1597
- example: 'curl https://live.dodopayments.com/license_keys/$ID \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
1598
- },
1599
1495
  },
1600
1496
  },
1601
1497
  {
@@ -1614,6 +1510,9 @@ const EMBEDDED_METHODS = [
1614
1510
  method: 'client.licenseKeys.update',
1615
1511
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst licenseKey = await client.licenseKeys.update('lic_123');\n\nconsole.log(licenseKey.id);",
1616
1512
  },
1513
+ http: {
1514
+ example: "curl https://live.dodopayments.com/license_keys/$ID \\\n -X PATCH \\\n -H 'Content-Type: application/json' \\\n -H \"Authorization: Bearer $DODO_PAYMENTS_API_KEY\" \\\n -d '{}'",
1515
+ },
1617
1516
  python: {
1618
1517
  method: 'license_keys.update',
1619
1518
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nlicense_key = client.license_keys.update(\n id="lic_123",\n)\nprint(license_key.id)',
@@ -1634,10 +1533,6 @@ const EMBEDDED_METHODS = [
1634
1533
  method: 'license_keys.update',
1635
1534
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nlicense_key = dodo_payments.license_keys.update("lic_123")\n\nputs(license_key)',
1636
1535
  },
1637
- cli: {
1638
- method: 'license_keys update',
1639
- example: "dodo-payments-cli license-keys update \\\n --bearer-token 'My Bearer Token' \\\n --id lic_123",
1640
- },
1641
1536
  php: {
1642
1537
  method: 'licenseKeys->update',
1643
1538
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$licenseKey = $client->licenseKeys->update(\n 'lic_123',\n activationsLimit: 0,\n disabled: true,\n expiresAt: new \\DateTimeImmutable('2019-12-27T18:11:19.117Z'),\n);\n\nvar_dump($licenseKey);",
@@ -1646,9 +1541,6 @@ const EMBEDDED_METHODS = [
1646
1541
  method: 'LicenseKeys.Update',
1647
1542
  example: 'LicenseKeyUpdateParams parameters = new() { ID = "lic_123" };\n\nvar licenseKey = await client.LicenseKeys.Update(parameters);\n\nConsole.WriteLine(licenseKey);',
1648
1543
  },
1649
- http: {
1650
- example: "curl https://live.dodopayments.com/license_keys/$ID \\\n -X PATCH \\\n -H 'Content-Type: application/json' \\\n -H \"Authorization: Bearer $DODO_PAYMENTS_API_KEY\" \\\n -d '{}'",
1651
- },
1652
1544
  },
1653
1545
  },
1654
1546
  {
@@ -1673,6 +1565,9 @@ const EMBEDDED_METHODS = [
1673
1565
  method: 'client.licenseKeys.create',
1674
1566
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst licenseKey = await client.licenseKeys.create({\n customer_id: 'customer_id',\n key: 'key',\n product_id: 'product_id',\n});\n\nconsole.log(licenseKey.id);",
1675
1567
  },
1568
+ http: {
1569
+ example: 'curl https://live.dodopayments.com/license_keys \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY" \\\n -d \'{\n "customer_id": "customer_id",\n "key": "key",\n "product_id": "product_id"\n }\'',
1570
+ },
1676
1571
  python: {
1677
1572
  method: 'license_keys.create',
1678
1573
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nlicense_key = client.license_keys.create(\n customer_id="customer_id",\n key="key",\n product_id="product_id",\n)\nprint(license_key.id)',
@@ -1693,10 +1588,6 @@ const EMBEDDED_METHODS = [
1693
1588
  method: 'license_keys.create',
1694
1589
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nlicense_key = dodo_payments.license_keys.create(customer_id: "customer_id", key: "key", product_id: "product_id")\n\nputs(license_key)',
1695
1590
  },
1696
- cli: {
1697
- method: 'license_keys create',
1698
- example: "dodo-payments-cli license-keys create \\\n --bearer-token 'My Bearer Token' \\\n --customer-id customer_id \\\n --key key \\\n --product-id product_id",
1699
- },
1700
1591
  php: {
1701
1592
  method: 'licenseKeys->create',
1702
1593
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$licenseKey = $client->licenseKeys->create(\n customerID: 'customer_id',\n key: 'key',\n productID: 'product_id',\n activationsLimit: 0,\n expiresAt: new \\DateTimeImmutable('2019-12-27T18:11:19.117Z'),\n);\n\nvar_dump($licenseKey);",
@@ -1705,9 +1596,6 @@ const EMBEDDED_METHODS = [
1705
1596
  method: 'LicenseKeys.Create',
1706
1597
  example: 'LicenseKeyCreateParams parameters = new()\n{\n CustomerID = "customer_id",\n Key = "key",\n ProductID = "product_id",\n};\n\nvar licenseKey = await client.LicenseKeys.Create(parameters);\n\nConsole.WriteLine(licenseKey);',
1707
1598
  },
1708
- http: {
1709
- example: 'curl https://live.dodopayments.com/license_keys \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY" \\\n -d \'{\n "customer_id": "customer_id",\n "key": "key",\n "product_id": "product_id"\n }\'',
1710
- },
1711
1599
  },
1712
1600
  },
1713
1601
  {
@@ -1731,6 +1619,9 @@ const EMBEDDED_METHODS = [
1731
1619
  method: 'client.licenseKeyInstances.list',
1732
1620
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const licenseKeyInstance of client.licenseKeyInstances.list()) {\n console.log(licenseKeyInstance.id);\n}",
1733
1621
  },
1622
+ http: {
1623
+ example: 'curl https://live.dodopayments.com/license_key_instances \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
1624
+ },
1734
1625
  python: {
1735
1626
  method: 'license_key_instances.list',
1736
1627
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\npage = client.license_key_instances.list()\npage = page.items[0]\nprint(page.id)',
@@ -1751,10 +1642,6 @@ const EMBEDDED_METHODS = [
1751
1642
  method: 'license_key_instances.list',
1752
1643
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\npage = dodo_payments.license_key_instances.list\n\nputs(page)',
1753
1644
  },
1754
- cli: {
1755
- method: 'license_key_instances list',
1756
- example: "dodo-payments-cli license-key-instances list \\\n --bearer-token 'My Bearer Token'",
1757
- },
1758
1645
  php: {
1759
1646
  method: 'licenseKeyInstances->list',
1760
1647
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$page = $client->licenseKeyInstances->list(\n grantID: 'grant_id',\n licenseKeyID: 'license_key_id',\n pageNumber: 0,\n pageSize: 0,\n);\n\nvar_dump($page);",
@@ -1763,9 +1650,6 @@ const EMBEDDED_METHODS = [
1763
1650
  method: 'LicenseKeyInstances.List',
1764
1651
  example: 'LicenseKeyInstanceListParams parameters = new();\n\nvar page = await client.LicenseKeyInstances.List(parameters);\nawait foreach (var item in page.Paginate())\n{\n Console.WriteLine(item);\n}',
1765
1652
  },
1766
- http: {
1767
- example: 'curl https://live.dodopayments.com/license_key_instances \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
1768
- },
1769
1653
  },
1770
1654
  },
1771
1655
  {
@@ -1784,6 +1668,9 @@ const EMBEDDED_METHODS = [
1784
1668
  method: 'client.licenseKeyInstances.retrieve',
1785
1669
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst licenseKeyInstance = await client.licenseKeyInstances.retrieve('lki_123');\n\nconsole.log(licenseKeyInstance.id);",
1786
1670
  },
1671
+ http: {
1672
+ example: 'curl https://live.dodopayments.com/license_key_instances/$ID \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
1673
+ },
1787
1674
  python: {
1788
1675
  method: 'license_key_instances.retrieve',
1789
1676
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nlicense_key_instance = client.license_key_instances.retrieve(\n "lki_123",\n)\nprint(license_key_instance.id)',
@@ -1804,10 +1691,6 @@ const EMBEDDED_METHODS = [
1804
1691
  method: 'license_key_instances.retrieve',
1805
1692
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nlicense_key_instance = dodo_payments.license_key_instances.retrieve("lki_123")\n\nputs(license_key_instance)',
1806
1693
  },
1807
- cli: {
1808
- method: 'license_key_instances retrieve',
1809
- example: "dodo-payments-cli license-key-instances retrieve \\\n --bearer-token 'My Bearer Token' \\\n --id lki_123",
1810
- },
1811
1694
  php: {
1812
1695
  method: 'licenseKeyInstances->retrieve',
1813
1696
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$licenseKeyInstance = $client->licenseKeyInstances->retrieve('lki_123');\n\nvar_dump($licenseKeyInstance);",
@@ -1816,9 +1699,6 @@ const EMBEDDED_METHODS = [
1816
1699
  method: 'LicenseKeyInstances.Retrieve',
1817
1700
  example: 'LicenseKeyInstanceRetrieveParams parameters = new() { ID = "lki_123" };\n\nvar licenseKeyInstance = await client.LicenseKeyInstances.Retrieve(parameters);\n\nConsole.WriteLine(licenseKeyInstance);',
1818
1701
  },
1819
- http: {
1820
- example: 'curl https://live.dodopayments.com/license_key_instances/$ID \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
1821
- },
1822
1702
  },
1823
1703
  },
1824
1704
  {
@@ -1837,6 +1717,9 @@ const EMBEDDED_METHODS = [
1837
1717
  method: 'client.licenseKeyInstances.update',
1838
1718
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst licenseKeyInstance = await client.licenseKeyInstances.update('lki_123', { name: 'name' });\n\nconsole.log(licenseKeyInstance.id);",
1839
1719
  },
1720
+ http: {
1721
+ example: 'curl https://live.dodopayments.com/license_key_instances/$ID \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY" \\\n -d \'{\n "name": "name"\n }\'',
1722
+ },
1840
1723
  python: {
1841
1724
  method: 'license_key_instances.update',
1842
1725
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nlicense_key_instance = client.license_key_instances.update(\n id="lki_123",\n name="name",\n)\nprint(license_key_instance.id)',
@@ -1857,10 +1740,6 @@ const EMBEDDED_METHODS = [
1857
1740
  method: 'license_key_instances.update',
1858
1741
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nlicense_key_instance = dodo_payments.license_key_instances.update("lki_123", name: "name")\n\nputs(license_key_instance)',
1859
1742
  },
1860
- cli: {
1861
- method: 'license_key_instances update',
1862
- example: "dodo-payments-cli license-key-instances update \\\n --bearer-token 'My Bearer Token' \\\n --id lki_123 \\\n --name name",
1863
- },
1864
1743
  php: {
1865
1744
  method: 'licenseKeyInstances->update',
1866
1745
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$licenseKeyInstance = $client->licenseKeyInstances->update(\n 'lki_123', name: 'name'\n);\n\nvar_dump($licenseKeyInstance);",
@@ -1869,9 +1748,6 @@ const EMBEDDED_METHODS = [
1869
1748
  method: 'LicenseKeyInstances.Update',
1870
1749
  example: 'LicenseKeyInstanceUpdateParams parameters = new()\n{\n ID = "lki_123",\n Name = "name",\n};\n\nvar licenseKeyInstance = await client.LicenseKeyInstances.Update(parameters);\n\nConsole.WriteLine(licenseKeyInstance);',
1871
1750
  },
1872
- http: {
1873
- example: 'curl https://live.dodopayments.com/license_key_instances/$ID \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY" \\\n -d \'{\n "name": "name"\n }\'',
1874
- },
1875
1751
  },
1876
1752
  },
1877
1753
  {
@@ -1897,6 +1773,9 @@ const EMBEDDED_METHODS = [
1897
1773
  method: 'client.customers.list',
1898
1774
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const customer of client.customers.list()) {\n console.log(customer.business_id);\n}",
1899
1775
  },
1776
+ http: {
1777
+ example: 'curl https://live.dodopayments.com/customers \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
1778
+ },
1900
1779
  python: {
1901
1780
  method: 'customers.list',
1902
1781
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\npage = client.customers.list()\npage = page.items[0]\nprint(page.business_id)',
@@ -1917,10 +1796,6 @@ const EMBEDDED_METHODS = [
1917
1796
  method: 'customers.list',
1918
1797
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\npage = dodo_payments.customers.list\n\nputs(page)',
1919
1798
  },
1920
- cli: {
1921
- method: 'customers list',
1922
- example: "dodo-payments-cli customers list \\\n --bearer-token 'My Bearer Token'",
1923
- },
1924
1799
  php: {
1925
1800
  method: 'customers->list',
1926
1801
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$page = $client->customers->list(\n createdAtGte: new \\DateTimeImmutable('2019-12-27T18:11:19.117Z'),\n createdAtLte: new \\DateTimeImmutable('2019-12-27T18:11:19.117Z'),\n email: 'email',\n name: 'name',\n pageNumber: 0,\n pageSize: 0,\n);\n\nvar_dump($page);",
@@ -1929,9 +1804,6 @@ const EMBEDDED_METHODS = [
1929
1804
  method: 'Customers.List',
1930
1805
  example: 'CustomerListParams parameters = new();\n\nvar page = await client.Customers.List(parameters);\nawait foreach (var item in page.Paginate())\n{\n Console.WriteLine(item);\n}',
1931
1806
  },
1932
- http: {
1933
- example: 'curl https://live.dodopayments.com/customers \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
1934
- },
1935
1807
  },
1936
1808
  },
1937
1809
  {
@@ -1950,6 +1822,9 @@ const EMBEDDED_METHODS = [
1950
1822
  method: 'client.customers.retrieve',
1951
1823
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst customer = await client.customers.retrieve('customer_id');\n\nconsole.log(customer.business_id);",
1952
1824
  },
1825
+ http: {
1826
+ example: 'curl https://live.dodopayments.com/customers/$CUSTOMER_ID \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
1827
+ },
1953
1828
  python: {
1954
1829
  method: 'customers.retrieve',
1955
1830
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\ncustomer = client.customers.retrieve(\n "customer_id",\n)\nprint(customer.business_id)',
@@ -1970,10 +1845,6 @@ const EMBEDDED_METHODS = [
1970
1845
  method: 'customers.retrieve',
1971
1846
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\ncustomer = dodo_payments.customers.retrieve("customer_id")\n\nputs(customer)',
1972
1847
  },
1973
- cli: {
1974
- method: 'customers retrieve',
1975
- example: "dodo-payments-cli customers retrieve \\\n --bearer-token 'My Bearer Token' \\\n --customer-id customer_id",
1976
- },
1977
1848
  php: {
1978
1849
  method: 'customers->retrieve',
1979
1850
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$customer = $client->customers->retrieve('customer_id');\n\nvar_dump($customer);",
@@ -1982,9 +1853,6 @@ const EMBEDDED_METHODS = [
1982
1853
  method: 'Customers.Retrieve',
1983
1854
  example: 'CustomerRetrieveParams parameters = new() { CustomerID = "customer_id" };\n\nvar customer = await client.Customers.Retrieve(parameters);\n\nConsole.WriteLine(customer);',
1984
1855
  },
1985
- http: {
1986
- example: 'curl https://live.dodopayments.com/customers/$CUSTOMER_ID \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
1987
- },
1988
1856
  },
1989
1857
  },
1990
1858
  {
@@ -2003,6 +1871,9 @@ const EMBEDDED_METHODS = [
2003
1871
  method: 'client.customers.create',
2004
1872
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst customer = await client.customers.create({ email: 'email', name: 'name' });\n\nconsole.log(customer.business_id);",
2005
1873
  },
1874
+ http: {
1875
+ example: 'curl https://live.dodopayments.com/customers \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY" \\\n -d \'{\n "email": "email",\n "name": "name"\n }\'',
1876
+ },
2006
1877
  python: {
2007
1878
  method: 'customers.create',
2008
1879
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\ncustomer = client.customers.create(\n email="email",\n name="name",\n)\nprint(customer.business_id)',
@@ -2023,10 +1894,6 @@ const EMBEDDED_METHODS = [
2023
1894
  method: 'customers.create',
2024
1895
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\ncustomer = dodo_payments.customers.create(email: "email", name: "name")\n\nputs(customer)',
2025
1896
  },
2026
- cli: {
2027
- method: 'customers create',
2028
- example: "dodo-payments-cli customers create \\\n --bearer-token 'My Bearer Token' \\\n --email email \\\n --name name",
2029
- },
2030
1897
  php: {
2031
1898
  method: 'customers->create',
2032
1899
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$customer = $client->customers->create(\n email: 'email',\n name: 'name',\n metadata: ['foo' => 'string'],\n phoneNumber: 'phone_number',\n);\n\nvar_dump($customer);",
@@ -2035,9 +1902,6 @@ const EMBEDDED_METHODS = [
2035
1902
  method: 'Customers.Create',
2036
1903
  example: 'CustomerCreateParams parameters = new()\n{\n Email = "email",\n Name = "name",\n};\n\nvar customer = await client.Customers.Create(parameters);\n\nConsole.WriteLine(customer);',
2037
1904
  },
2038
- http: {
2039
- example: 'curl https://live.dodopayments.com/customers \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY" \\\n -d \'{\n "email": "email",\n "name": "name"\n }\'',
2040
- },
2041
1905
  },
2042
1906
  },
2043
1907
  {
@@ -2062,6 +1926,9 @@ const EMBEDDED_METHODS = [
2062
1926
  method: 'client.customers.update',
2063
1927
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst customer = await client.customers.update('customer_id');\n\nconsole.log(customer.business_id);",
2064
1928
  },
1929
+ http: {
1930
+ example: "curl https://live.dodopayments.com/customers/$CUSTOMER_ID \\\n -X PATCH \\\n -H 'Content-Type: application/json' \\\n -H \"Authorization: Bearer $DODO_PAYMENTS_API_KEY\" \\\n -d '{}'",
1931
+ },
2065
1932
  python: {
2066
1933
  method: 'customers.update',
2067
1934
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\ncustomer = client.customers.update(\n customer_id="customer_id",\n)\nprint(customer.business_id)',
@@ -2082,10 +1949,6 @@ const EMBEDDED_METHODS = [
2082
1949
  method: 'customers.update',
2083
1950
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\ncustomer = dodo_payments.customers.update("customer_id")\n\nputs(customer)',
2084
1951
  },
2085
- cli: {
2086
- method: 'customers update',
2087
- example: "dodo-payments-cli customers update \\\n --bearer-token 'My Bearer Token' \\\n --customer-id customer_id",
2088
- },
2089
1952
  php: {
2090
1953
  method: 'customers->update',
2091
1954
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$customer = $client->customers->update(\n 'customer_id',\n email: 'email',\n metadata: ['foo' => 'string'],\n name: 'name',\n phoneNumber: 'phone_number',\n);\n\nvar_dump($customer);",
@@ -2094,9 +1957,6 @@ const EMBEDDED_METHODS = [
2094
1957
  method: 'Customers.Update',
2095
1958
  example: 'CustomerUpdateParams parameters = new() { CustomerID = "customer_id" };\n\nvar customer = await client.Customers.Update(parameters);\n\nConsole.WriteLine(customer);',
2096
1959
  },
2097
- http: {
2098
- example: "curl https://live.dodopayments.com/customers/$CUSTOMER_ID \\\n -X PATCH \\\n -H 'Content-Type: application/json' \\\n -H \"Authorization: Bearer $DODO_PAYMENTS_API_KEY\" \\\n -d '{}'",
2099
- },
2100
1960
  },
2101
1961
  },
2102
1962
  {
@@ -2115,6 +1975,9 @@ const EMBEDDED_METHODS = [
2115
1975
  method: 'client.customers.retrievePaymentMethods',
2116
1976
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.customers.retrievePaymentMethods('customer_id');\n\nconsole.log(response.items);",
2117
1977
  },
1978
+ http: {
1979
+ example: 'curl https://live.dodopayments.com/customers/$CUSTOMER_ID/payment-methods \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
1980
+ },
2118
1981
  python: {
2119
1982
  method: 'customers.retrieve_payment_methods',
2120
1983
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.customers.retrieve_payment_methods(\n "customer_id",\n)\nprint(response.items)',
@@ -2135,10 +1998,6 @@ const EMBEDDED_METHODS = [
2135
1998
  method: 'customers.retrieve_payment_methods',
2136
1999
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nresponse = dodo_payments.customers.retrieve_payment_methods("customer_id")\n\nputs(response)',
2137
2000
  },
2138
- cli: {
2139
- method: 'customers retrieve_payment_methods',
2140
- example: "dodo-payments-cli customers retrieve-payment-methods \\\n --bearer-token 'My Bearer Token' \\\n --customer-id customer_id",
2141
- },
2142
2001
  php: {
2143
2002
  method: 'customers->retrievePaymentMethods',
2144
2003
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$response = $client->customers->retrievePaymentMethods('customer_id');\n\nvar_dump($response);",
@@ -2147,9 +2006,6 @@ const EMBEDDED_METHODS = [
2147
2006
  method: 'Customers.RetrievePaymentMethods',
2148
2007
  example: 'CustomerRetrievePaymentMethodsParams parameters = new()\n{\n CustomerID = "customer_id"\n};\n\nvar response = await client.Customers.RetrievePaymentMethods(parameters);\n\nConsole.WriteLine(response);',
2149
2008
  },
2150
- http: {
2151
- example: 'curl https://live.dodopayments.com/customers/$CUSTOMER_ID/payment-methods \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
2152
- },
2153
2009
  },
2154
2010
  },
2155
2011
  {
@@ -2168,6 +2024,9 @@ const EMBEDDED_METHODS = [
2168
2024
  method: 'client.customers.listCreditEntitlements',
2169
2025
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.customers.listCreditEntitlements('customer_id');\n\nconsole.log(response.items);",
2170
2026
  },
2027
+ http: {
2028
+ example: 'curl https://live.dodopayments.com/customers/$CUSTOMER_ID/credit-entitlements \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
2029
+ },
2171
2030
  python: {
2172
2031
  method: 'customers.list_credit_entitlements',
2173
2032
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.customers.list_credit_entitlements(\n "customer_id",\n)\nprint(response.items)',
@@ -2188,10 +2047,6 @@ const EMBEDDED_METHODS = [
2188
2047
  method: 'customers.list_credit_entitlements',
2189
2048
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nresponse = dodo_payments.customers.list_credit_entitlements("customer_id")\n\nputs(response)',
2190
2049
  },
2191
- cli: {
2192
- method: 'customers list_credit_entitlements',
2193
- example: "dodo-payments-cli customers list-credit-entitlements \\\n --bearer-token 'My Bearer Token' \\\n --customer-id customer_id",
2194
- },
2195
2050
  php: {
2196
2051
  method: 'customers->listCreditEntitlements',
2197
2052
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$response = $client->customers->listCreditEntitlements('customer_id');\n\nvar_dump($response);",
@@ -2200,9 +2055,6 @@ const EMBEDDED_METHODS = [
2200
2055
  method: 'Customers.ListCreditEntitlements',
2201
2056
  example: 'CustomerListCreditEntitlementsParams parameters = new()\n{\n CustomerID = "customer_id"\n};\n\nvar response = await client.Customers.ListCreditEntitlements(parameters);\n\nConsole.WriteLine(response);',
2202
2057
  },
2203
- http: {
2204
- example: 'curl https://live.dodopayments.com/customers/$CUSTOMER_ID/credit-entitlements \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
2205
- },
2206
2058
  },
2207
2059
  },
2208
2060
  {
@@ -2220,6 +2072,9 @@ const EMBEDDED_METHODS = [
2220
2072
  method: 'client.customers.deletePaymentMethod',
2221
2073
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.customers.deletePaymentMethod('payment_method_id', { customer_id: 'customer_id' });",
2222
2074
  },
2075
+ http: {
2076
+ example: 'curl https://live.dodopayments.com/customers/$CUSTOMER_ID/payment-methods/$PAYMENT_METHOD_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
2077
+ },
2223
2078
  python: {
2224
2079
  method: 'customers.delete_payment_method',
2225
2080
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nclient.customers.delete_payment_method(\n payment_method_id="payment_method_id",\n customer_id="customer_id",\n)',
@@ -2240,10 +2095,6 @@ const EMBEDDED_METHODS = [
2240
2095
  method: 'customers.delete_payment_method',
2241
2096
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nresult = dodo_payments.customers.delete_payment_method("payment_method_id", customer_id: "customer_id")\n\nputs(result)',
2242
2097
  },
2243
- cli: {
2244
- method: 'customers delete_payment_method',
2245
- example: "dodo-payments-cli customers delete-payment-method \\\n --bearer-token 'My Bearer Token' \\\n --customer-id customer_id \\\n --payment-method-id payment_method_id",
2246
- },
2247
2098
  php: {
2248
2099
  method: 'customers->deletePaymentMethod',
2249
2100
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$result = $client->customers->deletePaymentMethod(\n 'payment_method_id', customerID: 'customer_id'\n);\n\nvar_dump($result);",
@@ -2252,9 +2103,6 @@ const EMBEDDED_METHODS = [
2252
2103
  method: 'Customers.DeletePaymentMethod',
2253
2104
  example: 'CustomerDeletePaymentMethodParams parameters = new()\n{\n CustomerID = "customer_id",\n PaymentMethodID = "payment_method_id",\n};\n\nawait client.Customers.DeletePaymentMethod(parameters);',
2254
2105
  },
2255
- http: {
2256
- example: 'curl https://live.dodopayments.com/customers/$CUSTOMER_ID/payment-methods/$PAYMENT_METHOD_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
2257
- },
2258
2106
  },
2259
2107
  },
2260
2108
  {
@@ -2273,6 +2121,9 @@ const EMBEDDED_METHODS = [
2273
2121
  method: 'client.customers.listEntitlements',
2274
2122
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.customers.listEntitlements('customer_id');\n\nconsole.log(response.items);",
2275
2123
  },
2124
+ http: {
2125
+ example: 'curl https://live.dodopayments.com/customers/$CUSTOMER_ID/entitlements \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
2126
+ },
2276
2127
  python: {
2277
2128
  method: 'customers.list_entitlements',
2278
2129
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.customers.list_entitlements(\n "customer_id",\n)\nprint(response.items)',
@@ -2293,10 +2144,6 @@ const EMBEDDED_METHODS = [
2293
2144
  method: 'customers.list_entitlements',
2294
2145
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nresponse = dodo_payments.customers.list_entitlements("customer_id")\n\nputs(response)',
2295
2146
  },
2296
- cli: {
2297
- method: 'customers list_entitlements',
2298
- example: "dodo-payments-cli customers list-entitlements \\\n --bearer-token 'My Bearer Token' \\\n --customer-id customer_id",
2299
- },
2300
2147
  php: {
2301
2148
  method: 'customers->listEntitlements',
2302
2149
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$response = $client->customers->listEntitlements('customer_id');\n\nvar_dump($response);",
@@ -2305,9 +2152,6 @@ const EMBEDDED_METHODS = [
2305
2152
  method: 'Customers.ListEntitlements',
2306
2153
  example: 'CustomerListEntitlementsParams parameters = new()\n{\n CustomerID = "customer_id"\n};\n\nvar response = await client.Customers.ListEntitlements(parameters);\n\nConsole.WriteLine(response);',
2307
2154
  },
2308
- http: {
2309
- example: 'curl https://live.dodopayments.com/customers/$CUSTOMER_ID/entitlements \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
2310
- },
2311
2155
  },
2312
2156
  },
2313
2157
  {
@@ -2326,6 +2170,9 @@ const EMBEDDED_METHODS = [
2326
2170
  method: 'client.customers.customerPortal.create',
2327
2171
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst customerPortalSession = await client.customers.customerPortal.create('customer_id');\n\nconsole.log(customerPortalSession.link);",
2328
2172
  },
2173
+ http: {
2174
+ example: 'curl https://live.dodopayments.com/customers/$CUSTOMER_ID/customer-portal/session \\\n -X POST \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
2175
+ },
2329
2176
  python: {
2330
2177
  method: 'customers.customer_portal.create',
2331
2178
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\ncustomer_portal_session = client.customers.customer_portal.create(\n customer_id="customer_id",\n)\nprint(customer_portal_session.link)',
@@ -2346,10 +2193,6 @@ const EMBEDDED_METHODS = [
2346
2193
  method: 'customers.customer_portal.create',
2347
2194
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\ncustomer_portal_session = dodo_payments.customers.customer_portal.create("customer_id")\n\nputs(customer_portal_session)',
2348
2195
  },
2349
- cli: {
2350
- method: 'customer_portal create',
2351
- example: "dodo-payments-cli customers:customer-portal create \\\n --bearer-token 'My Bearer Token' \\\n --customer-id customer_id",
2352
- },
2353
2196
  php: {
2354
2197
  method: 'customers->customerPortal->create',
2355
2198
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$customerPortalSession = $client->customers->customerPortal->create(\n 'customer_id', returnURL: 'return_url', sendEmail: true\n);\n\nvar_dump($customerPortalSession);",
@@ -2358,9 +2201,6 @@ const EMBEDDED_METHODS = [
2358
2201
  method: 'Customers.CustomerPortal.Create',
2359
2202
  example: 'CustomerPortalCreateParams parameters = new() { CustomerID = "customer_id" };\n\nvar customerPortalSession = await client.Customers.CustomerPortal.Create(parameters);\n\nConsole.WriteLine(customerPortalSession);',
2360
2203
  },
2361
- http: {
2362
- example: 'curl https://live.dodopayments.com/customers/$CUSTOMER_ID/customer-portal/session \\\n -X POST \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
2363
- },
2364
2204
  },
2365
2205
  },
2366
2206
  {
@@ -2379,6 +2219,9 @@ const EMBEDDED_METHODS = [
2379
2219
  method: 'client.customers.wallets.list',
2380
2220
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst wallets = await client.customers.wallets.list('customer_id');\n\nconsole.log(wallets.items);",
2381
2221
  },
2222
+ http: {
2223
+ example: 'curl https://live.dodopayments.com/customers/$CUSTOMER_ID/wallets \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
2224
+ },
2382
2225
  python: {
2383
2226
  method: 'customers.wallets.list',
2384
2227
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nwallets = client.customers.wallets.list(\n "customer_id",\n)\nprint(wallets.items)',
@@ -2399,10 +2242,6 @@ const EMBEDDED_METHODS = [
2399
2242
  method: 'customers.wallets.list',
2400
2243
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nwallets = dodo_payments.customers.wallets.list("customer_id")\n\nputs(wallets)',
2401
2244
  },
2402
- cli: {
2403
- method: 'wallets list',
2404
- example: "dodo-payments-cli customers:wallets list \\\n --bearer-token 'My Bearer Token' \\\n --customer-id customer_id",
2405
- },
2406
2245
  php: {
2407
2246
  method: 'customers->wallets->list',
2408
2247
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$wallets = $client->customers->wallets->list('customer_id');\n\nvar_dump($wallets);",
@@ -2411,9 +2250,6 @@ const EMBEDDED_METHODS = [
2411
2250
  method: 'Customers.Wallets.List',
2412
2251
  example: 'WalletListParams parameters = new() { CustomerID = "customer_id" };\n\nvar wallets = await client.Customers.Wallets.List(parameters);\n\nConsole.WriteLine(wallets);',
2413
2252
  },
2414
- http: {
2415
- example: 'curl https://live.dodopayments.com/customers/$CUSTOMER_ID/wallets \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
2416
- },
2417
2253
  },
2418
2254
  },
2419
2255
  {
@@ -2432,6 +2268,9 @@ const EMBEDDED_METHODS = [
2432
2268
  method: 'client.customers.wallets.ledgerEntries.list',
2433
2269
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const customerWalletTransaction of client.customers.wallets.ledgerEntries.list(\n 'customer_id',\n)) {\n console.log(customerWalletTransaction.id);\n}",
2434
2270
  },
2271
+ http: {
2272
+ example: 'curl https://live.dodopayments.com/customers/$CUSTOMER_ID/wallets/ledger-entries \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
2273
+ },
2435
2274
  python: {
2436
2275
  method: 'customers.wallets.ledger_entries.list',
2437
2276
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\npage = client.customers.wallets.ledger_entries.list(\n customer_id="customer_id",\n)\npage = page.items[0]\nprint(page.id)',
@@ -2452,10 +2291,6 @@ const EMBEDDED_METHODS = [
2452
2291
  method: 'customers.wallets.ledger_entries.list',
2453
2292
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\npage = dodo_payments.customers.wallets.ledger_entries.list("customer_id")\n\nputs(page)',
2454
2293
  },
2455
- cli: {
2456
- method: 'ledger_entries list',
2457
- example: "dodo-payments-cli customers:wallets:ledger-entries list \\\n --bearer-token 'My Bearer Token' \\\n --customer-id customer_id",
2458
- },
2459
2294
  php: {
2460
2295
  method: 'customers->wallets->ledgerEntries->list',
2461
2296
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$page = $client->customers->wallets->ledgerEntries->list(\n 'customer_id', currency: Currency::AED, pageNumber: 0, pageSize: 0\n);\n\nvar_dump($page);",
@@ -2464,9 +2299,6 @@ const EMBEDDED_METHODS = [
2464
2299
  method: 'Customers.Wallets.LedgerEntries.List',
2465
2300
  example: 'LedgerEntryListParams parameters = new() { CustomerID = "customer_id" };\n\nvar page = await client.Customers.Wallets.LedgerEntries.List(parameters);\nawait foreach (var item in page.Paginate())\n{\n Console.WriteLine(item);\n}',
2466
2301
  },
2467
- http: {
2468
- example: 'curl https://live.dodopayments.com/customers/$CUSTOMER_ID/wallets/ledger-entries \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
2469
- },
2470
2302
  },
2471
2303
  },
2472
2304
  {
@@ -2492,6 +2324,9 @@ const EMBEDDED_METHODS = [
2492
2324
  method: 'client.customers.wallets.ledgerEntries.create',
2493
2325
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst customerWallet = await client.customers.wallets.ledgerEntries.create('customer_id', {\n amount: 0,\n currency: 'AED',\n entry_type: 'credit',\n});\n\nconsole.log(customerWallet.customer_id);",
2494
2326
  },
2327
+ http: {
2328
+ example: 'curl https://live.dodopayments.com/customers/$CUSTOMER_ID/wallets/ledger-entries \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY" \\\n -d \'{\n "amount": 0,\n "currency": "AED",\n "entry_type": "credit"\n }\'',
2329
+ },
2495
2330
  python: {
2496
2331
  method: 'customers.wallets.ledger_entries.create',
2497
2332
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\ncustomer_wallet = client.customers.wallets.ledger_entries.create(\n customer_id="customer_id",\n amount=0,\n currency="AED",\n entry_type="credit",\n)\nprint(customer_wallet.customer_id)',
@@ -2512,10 +2347,6 @@ const EMBEDDED_METHODS = [
2512
2347
  method: 'customers.wallets.ledger_entries.create',
2513
2348
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\ncustomer_wallet = dodo_payments.customers.wallets.ledger_entries.create(\n "customer_id",\n amount: 0,\n currency: :AED,\n entry_type: :credit\n)\n\nputs(customer_wallet)',
2514
2349
  },
2515
- cli: {
2516
- method: 'ledger_entries create',
2517
- example: "dodo-payments-cli customers:wallets:ledger-entries create \\\n --bearer-token 'My Bearer Token' \\\n --customer-id customer_id \\\n --amount 0 \\\n --currency AED \\\n --entry-type credit",
2518
- },
2519
2350
  php: {
2520
2351
  method: 'customers->wallets->ledgerEntries->create',
2521
2352
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$customerWallet = $client->customers->wallets->ledgerEntries->create(\n 'customer_id',\n amount: 0,\n currency: Currency::AED,\n entryType: 'credit',\n idempotencyKey: 'idempotency_key',\n reason: 'reason',\n);\n\nvar_dump($customerWallet);",
@@ -2524,9 +2355,6 @@ const EMBEDDED_METHODS = [
2524
2355
  method: 'Customers.Wallets.LedgerEntries.Create',
2525
2356
  example: 'LedgerEntryCreateParams parameters = new()\n{\n CustomerID = "customer_id",\n Amount = 0,\n Currency = Currency.Aed,\n EntryType = EntryType.Credit,\n};\n\nvar customerWallet = await client.Customers.Wallets.LedgerEntries.Create(parameters);\n\nConsole.WriteLine(customerWallet);',
2526
2357
  },
2527
- http: {
2528
- example: 'curl https://live.dodopayments.com/customers/$CUSTOMER_ID/wallets/ledger-entries \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY" \\\n -d \'{\n "amount": 0,\n "currency": "AED",\n "entry_type": "credit"\n }\'',
2529
- },
2530
2358
  },
2531
2359
  },
2532
2360
  {
@@ -2553,6 +2381,9 @@ const EMBEDDED_METHODS = [
2553
2381
  method: 'client.refunds.list',
2554
2382
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const refundListItem of client.refunds.list()) {\n console.log(refundListItem.business_id);\n}",
2555
2383
  },
2384
+ http: {
2385
+ example: 'curl https://live.dodopayments.com/refunds \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
2386
+ },
2556
2387
  python: {
2557
2388
  method: 'refunds.list',
2558
2389
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\npage = client.refunds.list()\npage = page.items[0]\nprint(page.business_id)',
@@ -2573,10 +2404,6 @@ const EMBEDDED_METHODS = [
2573
2404
  method: 'refunds.list',
2574
2405
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\npage = dodo_payments.refunds.list\n\nputs(page)',
2575
2406
  },
2576
- cli: {
2577
- method: 'refunds list',
2578
- example: "dodo-payments-cli refunds list \\\n --bearer-token 'My Bearer Token'",
2579
- },
2580
2407
  php: {
2581
2408
  method: 'refunds->list',
2582
2409
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$page = $client->refunds->list(\n createdAtGte: new \\DateTimeImmutable('2019-12-27T18:11:19.117Z'),\n createdAtLte: new \\DateTimeImmutable('2019-12-27T18:11:19.117Z'),\n customerID: 'customer_id',\n pageNumber: 0,\n pageSize: 0,\n status: 'succeeded',\n subscriptionID: 'subscription_id',\n);\n\nvar_dump($page);",
@@ -2585,9 +2412,6 @@ const EMBEDDED_METHODS = [
2585
2412
  method: 'Refunds.List',
2586
2413
  example: 'RefundListParams parameters = new();\n\nvar page = await client.Refunds.List(parameters);\nawait foreach (var item in page.Paginate())\n{\n Console.WriteLine(item);\n}',
2587
2414
  },
2588
- http: {
2589
- example: 'curl https://live.dodopayments.com/refunds \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
2590
- },
2591
2415
  },
2592
2416
  },
2593
2417
  {
@@ -2611,6 +2435,9 @@ const EMBEDDED_METHODS = [
2611
2435
  method: 'client.refunds.create',
2612
2436
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst refund = await client.refunds.create({ payment_id: 'payment_id' });\n\nconsole.log(refund.business_id);",
2613
2437
  },
2438
+ http: {
2439
+ example: 'curl https://live.dodopayments.com/refunds \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY" \\\n -d \'{\n "payment_id": "payment_id"\n }\'',
2440
+ },
2614
2441
  python: {
2615
2442
  method: 'refunds.create',
2616
2443
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nrefund = client.refunds.create(\n payment_id="payment_id",\n)\nprint(refund.business_id)',
@@ -2631,10 +2458,6 @@ const EMBEDDED_METHODS = [
2631
2458
  method: 'refunds.create',
2632
2459
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nrefund = dodo_payments.refunds.create(payment_id: "payment_id")\n\nputs(refund)',
2633
2460
  },
2634
- cli: {
2635
- method: 'refunds create',
2636
- example: "dodo-payments-cli refunds create \\\n --bearer-token 'My Bearer Token' \\\n --payment-id payment_id",
2637
- },
2638
2461
  php: {
2639
2462
  method: 'refunds->create',
2640
2463
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$refund = $client->refunds->create(\n paymentID: 'payment_id',\n items: [['itemID' => 'item_id', 'amount' => 0, 'taxInclusive' => true]],\n metadata: ['foo' => 'string'],\n reason: 'reason',\n);\n\nvar_dump($refund);",
@@ -2643,9 +2466,6 @@ const EMBEDDED_METHODS = [
2643
2466
  method: 'Refunds.Create',
2644
2467
  example: 'RefundCreateParams parameters = new() { PaymentID = "payment_id" };\n\nvar refund = await client.Refunds.Create(parameters);\n\nConsole.WriteLine(refund);',
2645
2468
  },
2646
- http: {
2647
- example: 'curl https://live.dodopayments.com/refunds \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY" \\\n -d \'{\n "payment_id": "payment_id"\n }\'',
2648
- },
2649
2469
  },
2650
2470
  },
2651
2471
  {
@@ -2664,6 +2484,9 @@ const EMBEDDED_METHODS = [
2664
2484
  method: 'client.refunds.retrieve',
2665
2485
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst refund = await client.refunds.retrieve('refund_id');\n\nconsole.log(refund.business_id);",
2666
2486
  },
2487
+ http: {
2488
+ example: 'curl https://live.dodopayments.com/refunds/$REFUND_ID \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
2489
+ },
2667
2490
  python: {
2668
2491
  method: 'refunds.retrieve',
2669
2492
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nrefund = client.refunds.retrieve(\n "refund_id",\n)\nprint(refund.business_id)',
@@ -2684,10 +2507,6 @@ const EMBEDDED_METHODS = [
2684
2507
  method: 'refunds.retrieve',
2685
2508
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nrefund = dodo_payments.refunds.retrieve("refund_id")\n\nputs(refund)',
2686
2509
  },
2687
- cli: {
2688
- method: 'refunds retrieve',
2689
- example: "dodo-payments-cli refunds retrieve \\\n --bearer-token 'My Bearer Token' \\\n --refund-id refund_id",
2690
- },
2691
2510
  php: {
2692
2511
  method: 'refunds->retrieve',
2693
2512
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$refund = $client->refunds->retrieve('refund_id');\n\nvar_dump($refund);",
@@ -2696,9 +2515,6 @@ const EMBEDDED_METHODS = [
2696
2515
  method: 'Refunds.Retrieve',
2697
2516
  example: 'RefundRetrieveParams parameters = new() { RefundID = "refund_id" };\n\nvar refund = await client.Refunds.Retrieve(parameters);\n\nConsole.WriteLine(refund);',
2698
2517
  },
2699
- http: {
2700
- example: 'curl https://live.dodopayments.com/refunds/$REFUND_ID \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
2701
- },
2702
2518
  },
2703
2519
  },
2704
2520
  {
@@ -2725,6 +2541,9 @@ const EMBEDDED_METHODS = [
2725
2541
  method: 'client.disputes.list',
2726
2542
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const disputeListResponse of client.disputes.list()) {\n console.log(disputeListResponse.business_id);\n}",
2727
2543
  },
2544
+ http: {
2545
+ example: 'curl https://live.dodopayments.com/disputes \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
2546
+ },
2728
2547
  python: {
2729
2548
  method: 'disputes.list',
2730
2549
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\npage = client.disputes.list()\npage = page.items[0]\nprint(page.business_id)',
@@ -2745,10 +2564,6 @@ const EMBEDDED_METHODS = [
2745
2564
  method: 'disputes.list',
2746
2565
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\npage = dodo_payments.disputes.list\n\nputs(page)',
2747
2566
  },
2748
- cli: {
2749
- method: 'disputes list',
2750
- example: "dodo-payments-cli disputes list \\\n --bearer-token 'My Bearer Token'",
2751
- },
2752
2567
  php: {
2753
2568
  method: 'disputes->list',
2754
2569
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$page = $client->disputes->list(\n createdAtGte: new \\DateTimeImmutable('2019-12-27T18:11:19.117Z'),\n createdAtLte: new \\DateTimeImmutable('2019-12-27T18:11:19.117Z'),\n customerID: 'customer_id',\n disputeStage: 'pre_dispute',\n disputeStatus: 'dispute_opened',\n pageNumber: 0,\n pageSize: 0,\n);\n\nvar_dump($page);",
@@ -2757,9 +2572,6 @@ const EMBEDDED_METHODS = [
2757
2572
  method: 'Disputes.List',
2758
2573
  example: 'DisputeListParams parameters = new();\n\nvar page = await client.Disputes.List(parameters);\nawait foreach (var item in page.Paginate())\n{\n Console.WriteLine(item);\n}',
2759
2574
  },
2760
- http: {
2761
- example: 'curl https://live.dodopayments.com/disputes \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
2762
- },
2763
2575
  },
2764
2576
  },
2765
2577
  {
@@ -2778,6 +2590,9 @@ const EMBEDDED_METHODS = [
2778
2590
  method: 'client.disputes.retrieve',
2779
2591
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst getDispute = await client.disputes.retrieve('dispute_id');\n\nconsole.log(getDispute.business_id);",
2780
2592
  },
2593
+ http: {
2594
+ example: 'curl https://live.dodopayments.com/disputes/$DISPUTE_ID \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
2595
+ },
2781
2596
  python: {
2782
2597
  method: 'disputes.retrieve',
2783
2598
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nget_dispute = client.disputes.retrieve(\n "dispute_id",\n)\nprint(get_dispute.business_id)',
@@ -2798,10 +2613,6 @@ const EMBEDDED_METHODS = [
2798
2613
  method: 'disputes.retrieve',
2799
2614
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nget_dispute = dodo_payments.disputes.retrieve("dispute_id")\n\nputs(get_dispute)',
2800
2615
  },
2801
- cli: {
2802
- method: 'disputes retrieve',
2803
- example: "dodo-payments-cli disputes retrieve \\\n --bearer-token 'My Bearer Token' \\\n --dispute-id dispute_id",
2804
- },
2805
2616
  php: {
2806
2617
  method: 'disputes->retrieve',
2807
2618
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$getDispute = $client->disputes->retrieve('dispute_id');\n\nvar_dump($getDispute);",
@@ -2810,9 +2621,6 @@ const EMBEDDED_METHODS = [
2810
2621
  method: 'Disputes.Retrieve',
2811
2622
  example: 'DisputeRetrieveParams parameters = new() { DisputeID = "dispute_id" };\n\nvar getDispute = await client.Disputes.Retrieve(parameters);\n\nConsole.WriteLine(getDispute);',
2812
2623
  },
2813
- http: {
2814
- example: 'curl https://live.dodopayments.com/disputes/$DISPUTE_ID \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
2815
- },
2816
2624
  },
2817
2625
  },
2818
2626
  {
@@ -2836,6 +2644,9 @@ const EMBEDDED_METHODS = [
2836
2644
  method: 'client.payouts.list',
2837
2645
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const payoutListResponse of client.payouts.list()) {\n console.log(payoutListResponse.business_id);\n}",
2838
2646
  },
2647
+ http: {
2648
+ example: 'curl https://live.dodopayments.com/payouts \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
2649
+ },
2839
2650
  python: {
2840
2651
  method: 'payouts.list',
2841
2652
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\npage = client.payouts.list()\npage = page.items[0]\nprint(page.business_id)',
@@ -2856,10 +2667,6 @@ const EMBEDDED_METHODS = [
2856
2667
  method: 'payouts.list',
2857
2668
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\npage = dodo_payments.payouts.list\n\nputs(page)',
2858
2669
  },
2859
- cli: {
2860
- method: 'payouts list',
2861
- example: "dodo-payments-cli payouts list \\\n --bearer-token 'My Bearer Token'",
2862
- },
2863
2670
  php: {
2864
2671
  method: 'payouts->list',
2865
2672
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$page = $client->payouts->list(\n createdAtGte: new \\DateTimeImmutable('2019-12-27T18:11:19.117Z'),\n createdAtLte: new \\DateTimeImmutable('2019-12-27T18:11:19.117Z'),\n pageNumber: 0,\n pageSize: 0,\n);\n\nvar_dump($page);",
@@ -2868,9 +2675,6 @@ const EMBEDDED_METHODS = [
2868
2675
  method: 'Payouts.List',
2869
2676
  example: 'PayoutListParams parameters = new();\n\nvar page = await client.Payouts.List(parameters);\nawait foreach (var item in page.Paginate())\n{\n Console.WriteLine(item);\n}',
2870
2677
  },
2871
- http: {
2872
- example: 'curl https://live.dodopayments.com/payouts \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
2873
- },
2874
2678
  },
2875
2679
  },
2876
2680
  {
@@ -2889,6 +2693,9 @@ const EMBEDDED_METHODS = [
2889
2693
  method: 'client.payouts.breakup.retrieve',
2890
2694
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst breakups = await client.payouts.breakup.retrieve('payout_id');\n\nconsole.log(breakups);",
2891
2695
  },
2696
+ http: {
2697
+ example: 'curl https://live.dodopayments.com/payouts/$PAYOUT_ID/breakup \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
2698
+ },
2892
2699
  python: {
2893
2700
  method: 'payouts.breakup.retrieve',
2894
2701
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nbreakups = client.payouts.breakup.retrieve(\n "payout_id",\n)\nprint(breakups)',
@@ -2909,10 +2716,6 @@ const EMBEDDED_METHODS = [
2909
2716
  method: 'payouts.breakup.retrieve',
2910
2717
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nbreakups = dodo_payments.payouts.breakup.retrieve("payout_id")\n\nputs(breakups)',
2911
2718
  },
2912
- cli: {
2913
- method: 'breakup retrieve',
2914
- example: "dodo-payments-cli payouts:breakup retrieve \\\n --bearer-token 'My Bearer Token' \\\n --payout-id payout_id",
2915
- },
2916
2719
  php: {
2917
2720
  method: 'payouts->breakup->retrieve',
2918
2721
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$breakups = $client->payouts->breakup->retrieve('payout_id');\n\nvar_dump($breakups);",
@@ -2921,9 +2724,6 @@ const EMBEDDED_METHODS = [
2921
2724
  method: 'Payouts.Breakup.Retrieve',
2922
2725
  example: 'BreakupRetrieveParams parameters = new() { PayoutID = "payout_id" };\n\nvar breakups = await client.Payouts.Breakup.Retrieve(parameters);\n\nConsole.WriteLine(breakups);',
2923
2726
  },
2924
- http: {
2925
- example: 'curl https://live.dodopayments.com/payouts/$PAYOUT_ID/breakup \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
2926
- },
2927
2727
  },
2928
2728
  },
2929
2729
  {
@@ -2942,6 +2742,9 @@ const EMBEDDED_METHODS = [
2942
2742
  method: 'client.payouts.breakup.details.list',
2943
2743
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const detailListResponse of client.payouts.breakup.details.list('payout_id')) {\n console.log(detailListResponse.id);\n}",
2944
2744
  },
2745
+ http: {
2746
+ example: 'curl https://live.dodopayments.com/payouts/$PAYOUT_ID/breakup/details \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
2747
+ },
2945
2748
  python: {
2946
2749
  method: 'payouts.breakup.details.list',
2947
2750
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\npage = client.payouts.breakup.details.list(\n payout_id="payout_id",\n)\npage = page.items[0]\nprint(page.id)',
@@ -2962,10 +2765,6 @@ const EMBEDDED_METHODS = [
2962
2765
  method: 'payouts.breakup.details.list',
2963
2766
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\npage = dodo_payments.payouts.breakup.details.list("payout_id")\n\nputs(page)',
2964
2767
  },
2965
- cli: {
2966
- method: 'details list',
2967
- example: "dodo-payments-cli payouts:breakup:details list \\\n --bearer-token 'My Bearer Token' \\\n --payout-id payout_id",
2968
- },
2969
2768
  php: {
2970
2769
  method: 'payouts->breakup->details->list',
2971
2770
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$page = $client->payouts->breakup->details->list(\n 'payout_id', pageNumber: 0, pageSize: 0\n);\n\nvar_dump($page);",
@@ -2974,9 +2773,6 @@ const EMBEDDED_METHODS = [
2974
2773
  method: 'Payouts.Breakup.Details.List',
2975
2774
  example: 'DetailListParams parameters = new() { PayoutID = "payout_id" };\n\nvar page = await client.Payouts.Breakup.Details.List(parameters);\nawait foreach (var item in page.Paginate())\n{\n Console.WriteLine(item);\n}',
2976
2775
  },
2977
- http: {
2978
- example: 'curl https://live.dodopayments.com/payouts/$PAYOUT_ID/breakup/details \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
2979
- },
2980
2776
  },
2981
2777
  },
2982
2778
  {
@@ -2994,6 +2790,9 @@ const EMBEDDED_METHODS = [
2994
2790
  method: 'client.payouts.breakup.details.downloadCsv',
2995
2791
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.payouts.breakup.details.downloadCsv('payout_id');",
2996
2792
  },
2793
+ http: {
2794
+ example: 'curl https://live.dodopayments.com/payouts/$PAYOUT_ID/breakup/details/csv \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
2795
+ },
2997
2796
  python: {
2998
2797
  method: 'payouts.breakup.details.download_csv',
2999
2798
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nclient.payouts.breakup.details.download_csv(\n "payout_id",\n)',
@@ -3014,10 +2813,6 @@ const EMBEDDED_METHODS = [
3014
2813
  method: 'payouts.breakup.details.download_csv',
3015
2814
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nresult = dodo_payments.payouts.breakup.details.download_csv("payout_id")\n\nputs(result)',
3016
2815
  },
3017
- cli: {
3018
- method: 'details download_csv',
3019
- example: "dodo-payments-cli payouts:breakup:details download-csv \\\n --bearer-token 'My Bearer Token' \\\n --payout-id payout_id",
3020
- },
3021
2816
  php: {
3022
2817
  method: 'payouts->breakup->details->downloadCsv',
3023
2818
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$result = $client->payouts->breakup->details->downloadCsv('payout_id');\n\nvar_dump($result);",
@@ -3026,9 +2821,6 @@ const EMBEDDED_METHODS = [
3026
2821
  method: 'Payouts.Breakup.Details.DownloadCsv',
3027
2822
  example: 'DetailDownloadCsvParams parameters = new() { PayoutID = "payout_id" };\n\nawait client.Payouts.Breakup.Details.DownloadCsv(parameters);',
3028
2823
  },
3029
- http: {
3030
- example: 'curl https://live.dodopayments.com/payouts/$PAYOUT_ID/breakup/details/csv \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
3031
- },
3032
2824
  },
3033
2825
  },
3034
2826
  {
@@ -3053,6 +2845,9 @@ const EMBEDDED_METHODS = [
3053
2845
  method: 'client.products.list',
3054
2846
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const productListResponse of client.products.list()) {\n console.log(productListResponse.business_id);\n}",
3055
2847
  },
2848
+ http: {
2849
+ example: 'curl https://live.dodopayments.com/products \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
2850
+ },
3056
2851
  python: {
3057
2852
  method: 'products.list',
3058
2853
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\npage = client.products.list()\npage = page.items[0]\nprint(page.business_id)',
@@ -3073,10 +2868,6 @@ const EMBEDDED_METHODS = [
3073
2868
  method: 'products.list',
3074
2869
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\npage = dodo_payments.products.list\n\nputs(page)',
3075
2870
  },
3076
- cli: {
3077
- method: 'products list',
3078
- example: "dodo-payments-cli products list \\\n --bearer-token 'My Bearer Token'",
3079
- },
3080
2871
  php: {
3081
2872
  method: 'products->list',
3082
2873
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$page = $client->products->list(\n archived: true,\n brandID: 'brand_id',\n pageNumber: 0,\n pageSize: 0,\n recurring: true,\n);\n\nvar_dump($page);",
@@ -3085,9 +2876,6 @@ const EMBEDDED_METHODS = [
3085
2876
  method: 'Products.List',
3086
2877
  example: 'ProductListParams parameters = new();\n\nvar page = await client.Products.List(parameters);\nawait foreach (var item in page.Paginate())\n{\n Console.WriteLine(item);\n}',
3087
2878
  },
3088
- http: {
3089
- example: 'curl https://live.dodopayments.com/products \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
3090
- },
3091
2879
  },
3092
2880
  },
3093
2881
  {
@@ -3121,6 +2909,9 @@ const EMBEDDED_METHODS = [
3121
2909
  method: 'client.products.create',
3122
2910
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst product = await client.products.create({\n name: 'name',\n price: {\n currency: 'AED',\n discount: 0,\n price: 0,\n purchasing_power_parity: true,\n type: 'one_time_price',\n },\n tax_category: 'digital_products',\n});\n\nconsole.log(product.brand_id);",
3123
2911
  },
2912
+ http: {
2913
+ example: 'curl https://live.dodopayments.com/products \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY" \\\n -d \'{\n "name": "name",\n "price": {\n "currency": "AED",\n "discount": 0,\n "price": 0,\n "purchasing_power_parity": true,\n "type": "one_time_price"\n },\n "tax_category": "digital_products"\n }\'',
2914
+ },
3124
2915
  python: {
3125
2916
  method: 'products.create',
3126
2917
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nproduct = client.products.create(\n name="name",\n price={\n "currency": "AED",\n "discount": 0,\n "price": 0,\n "purchasing_power_parity": True,\n "type": "one_time_price",\n },\n tax_category="digital_products",\n)\nprint(product.brand_id)',
@@ -3141,10 +2932,6 @@ const EMBEDDED_METHODS = [
3141
2932
  method: 'products.create',
3142
2933
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nproduct = dodo_payments.products.create(\n name: "name",\n price: {currency: :AED, discount: 0, price: 0, purchasing_power_parity: true, type: :one_time_price},\n tax_category: :digital_products\n)\n\nputs(product)',
3143
2934
  },
3144
- cli: {
3145
- method: 'products create',
3146
- example: "dodo-payments-cli products create \\\n --bearer-token 'My Bearer Token' \\\n --name name \\\n --price '{currency: AED, discount: 0, price: 0, purchasing_power_parity: true, type: one_time_price}' \\\n --tax-category digital_products",
3147
- },
3148
2935
  php: {
3149
2936
  method: 'products->create',
3150
2937
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$product = $client->products->create(\n name: 'name',\n price: [\n 'currency' => Currency::AED,\n 'discount' => 0,\n 'price' => 0,\n 'purchasingPowerParity' => true,\n 'type' => 'one_time_price',\n 'payWhatYouWant' => true,\n 'suggestedPrice' => 0,\n 'taxInclusive' => true,\n ],\n taxCategory: TaxCategory::DIGITAL_PRODUCTS,\n addons: ['string'],\n brandID: 'brand_id',\n creditEntitlements: [\n [\n 'creditEntitlementID' => 'credit_entitlement_id',\n 'creditsAmount' => 'credits_amount',\n 'currency' => Currency::AED,\n 'expiresAfterDays' => 0,\n 'lowBalanceThresholdPercent' => 0,\n 'maxRolloverCount' => 0,\n 'overageBehavior' => CbbOverageBehavior::FORGIVE_AT_RESET,\n 'overageEnabled' => true,\n 'overageLimit' => 'overage_limit',\n 'pricePerUnit' => 'price_per_unit',\n 'prorationBehavior' => CbbProrationBehavior::PRORATE,\n 'rolloverEnabled' => true,\n 'rolloverPercentage' => 0,\n 'rolloverTimeframeCount' => 0,\n 'rolloverTimeframeInterval' => TimeInterval::DAY,\n 'trialCredits' => 'trial_credits',\n 'trialCreditsExpireAfterTrial' => true,\n ],\n ],\n description: 'description',\n digitalProductDelivery: [\n 'externalURL' => 'external_url', 'instructions' => 'instructions'\n ],\n entitlements: [['entitlementID' => 'entitlement_id']],\n licenseKeyActivationMessage: 'license_key_activation_message',\n licenseKeyActivationsLimit: 0,\n licenseKeyDuration: ['count' => 0, 'interval' => TimeInterval::DAY],\n licenseKeyEnabled: true,\n metadata: ['foo' => 'string'],\n);\n\nvar_dump($product);",
@@ -3153,9 +2940,6 @@ const EMBEDDED_METHODS = [
3153
2940
  method: 'Products.Create',
3154
2941
  example: 'ProductCreateParams parameters = new()\n{\n Name = "name",\n Price = new OneTimePrice()\n {\n Currency = Currency.Aed,\n Discount = 0,\n Price = 0,\n PurchasingPowerParity = true,\n PayWhatYouWant = true,\n SuggestedPrice = 0,\n TaxInclusive = true,\n },\n TaxCategory = TaxCategory.DigitalProducts,\n};\n\nvar product = await client.Products.Create(parameters);\n\nConsole.WriteLine(product);',
3155
2942
  },
3156
- http: {
3157
- example: 'curl https://live.dodopayments.com/products \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY" \\\n -d \'{\n "name": "name",\n "price": {\n "currency": "AED",\n "discount": 0,\n "price": 0,\n "purchasing_power_parity": true,\n "type": "one_time_price"\n },\n "tax_category": "digital_products"\n }\'',
3158
- },
3159
2943
  },
3160
2944
  },
3161
2945
  {
@@ -3174,6 +2958,9 @@ const EMBEDDED_METHODS = [
3174
2958
  method: 'client.products.retrieve',
3175
2959
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst product = await client.products.retrieve('id');\n\nconsole.log(product.brand_id);",
3176
2960
  },
2961
+ http: {
2962
+ example: 'curl https://live.dodopayments.com/products/$ID \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
2963
+ },
3177
2964
  python: {
3178
2965
  method: 'products.retrieve',
3179
2966
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nproduct = client.products.retrieve(\n "id",\n)\nprint(product.brand_id)',
@@ -3194,10 +2981,6 @@ const EMBEDDED_METHODS = [
3194
2981
  method: 'products.retrieve',
3195
2982
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nproduct = dodo_payments.products.retrieve("id")\n\nputs(product)',
3196
2983
  },
3197
- cli: {
3198
- method: 'products retrieve',
3199
- example: "dodo-payments-cli products retrieve \\\n --bearer-token 'My Bearer Token' \\\n --id id",
3200
- },
3201
2984
  php: {
3202
2985
  method: 'products->retrieve',
3203
2986
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$product = $client->products->retrieve('id');\n\nvar_dump($product);",
@@ -3206,9 +2989,6 @@ const EMBEDDED_METHODS = [
3206
2989
  method: 'Products.Retrieve',
3207
2990
  example: 'ProductRetrieveParams parameters = new() { ID = "id" };\n\nvar product = await client.Products.Retrieve(parameters);\n\nConsole.WriteLine(product);',
3208
2991
  },
3209
- http: {
3210
- example: 'curl https://live.dodopayments.com/products/$ID \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
3211
- },
3212
2992
  },
3213
2993
  },
3214
2994
  {
@@ -3243,6 +3023,9 @@ const EMBEDDED_METHODS = [
3243
3023
  method: 'client.products.update',
3244
3024
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.products.update('id');",
3245
3025
  },
3026
+ http: {
3027
+ example: "curl https://live.dodopayments.com/products/$ID \\\n -X PATCH \\\n -H 'Content-Type: application/json' \\\n -H \"Authorization: Bearer $DODO_PAYMENTS_API_KEY\" \\\n -d '{}'",
3028
+ },
3246
3029
  python: {
3247
3030
  method: 'products.update',
3248
3031
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nclient.products.update(\n id="id",\n)',
@@ -3263,10 +3046,6 @@ const EMBEDDED_METHODS = [
3263
3046
  method: 'products.update',
3264
3047
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nresult = dodo_payments.products.update("id")\n\nputs(result)',
3265
3048
  },
3266
- cli: {
3267
- method: 'products update',
3268
- example: "dodo-payments-cli products update \\\n --bearer-token 'My Bearer Token' \\\n --id id",
3269
- },
3270
3049
  php: {
3271
3050
  method: 'products->update',
3272
3051
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$result = $client->products->update(\n 'id',\n addons: ['string'],\n brandID: 'brand_id',\n creditEntitlements: [\n [\n 'creditEntitlementID' => 'credit_entitlement_id',\n 'creditsAmount' => 'credits_amount',\n 'currency' => Currency::AED,\n 'expiresAfterDays' => 0,\n 'lowBalanceThresholdPercent' => 0,\n 'maxRolloverCount' => 0,\n 'overageBehavior' => CbbOverageBehavior::FORGIVE_AT_RESET,\n 'overageEnabled' => true,\n 'overageLimit' => 'overage_limit',\n 'pricePerUnit' => 'price_per_unit',\n 'prorationBehavior' => CbbProrationBehavior::PRORATE,\n 'rolloverEnabled' => true,\n 'rolloverPercentage' => 0,\n 'rolloverTimeframeCount' => 0,\n 'rolloverTimeframeInterval' => TimeInterval::DAY,\n 'trialCredits' => 'trial_credits',\n 'trialCreditsExpireAfterTrial' => true,\n ],\n ],\n description: 'description',\n digitalProductDelivery: [\n 'externalURL' => 'external_url',\n 'files' => ['182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'],\n 'instructions' => 'instructions',\n ],\n entitlements: [['entitlementID' => 'entitlement_id']],\n imageID: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n licenseKeyActivationMessage: 'license_key_activation_message',\n licenseKeyActivationsLimit: 0,\n licenseKeyDuration: ['count' => 0, 'interval' => TimeInterval::DAY],\n licenseKeyEnabled: true,\n metadata: ['foo' => 'string'],\n name: 'name',\n price: [\n 'currency' => Currency::AED,\n 'discount' => 0,\n 'price' => 0,\n 'purchasingPowerParity' => true,\n 'type' => 'one_time_price',\n 'payWhatYouWant' => true,\n 'suggestedPrice' => 0,\n 'taxInclusive' => true,\n ],\n taxCategory: TaxCategory::DIGITAL_PRODUCTS,\n);\n\nvar_dump($result);",
@@ -3275,9 +3054,6 @@ const EMBEDDED_METHODS = [
3275
3054
  method: 'Products.Update',
3276
3055
  example: 'ProductUpdateParams parameters = new() { ID = "id" };\n\nawait client.Products.Update(parameters);',
3277
3056
  },
3278
- http: {
3279
- example: "curl https://live.dodopayments.com/products/$ID \\\n -X PATCH \\\n -H 'Content-Type: application/json' \\\n -H \"Authorization: Bearer $DODO_PAYMENTS_API_KEY\" \\\n -d '{}'",
3280
- },
3281
3057
  },
3282
3058
  },
3283
3059
  {
@@ -3295,6 +3071,9 @@ const EMBEDDED_METHODS = [
3295
3071
  method: 'client.products.archive',
3296
3072
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.products.archive('id');",
3297
3073
  },
3074
+ http: {
3075
+ example: 'curl https://live.dodopayments.com/products/$ID \\\n -X DELETE \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
3076
+ },
3298
3077
  python: {
3299
3078
  method: 'products.archive',
3300
3079
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nclient.products.archive(\n "id",\n)',
@@ -3315,10 +3094,6 @@ const EMBEDDED_METHODS = [
3315
3094
  method: 'products.archive',
3316
3095
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nresult = dodo_payments.products.archive("id")\n\nputs(result)',
3317
3096
  },
3318
- cli: {
3319
- method: 'products archive',
3320
- example: "dodo-payments-cli products archive \\\n --bearer-token 'My Bearer Token' \\\n --id id",
3321
- },
3322
3097
  php: {
3323
3098
  method: 'products->archive',
3324
3099
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$result = $client->products->archive('id');\n\nvar_dump($result);",
@@ -3327,9 +3102,6 @@ const EMBEDDED_METHODS = [
3327
3102
  method: 'Products.Archive',
3328
3103
  example: 'ProductArchiveParams parameters = new() { ID = "id" };\n\nawait client.Products.Archive(parameters);',
3329
3104
  },
3330
- http: {
3331
- example: 'curl https://live.dodopayments.com/products/$ID \\\n -X DELETE \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
3332
- },
3333
3105
  },
3334
3106
  },
3335
3107
  {
@@ -3347,6 +3119,9 @@ const EMBEDDED_METHODS = [
3347
3119
  method: 'client.products.unarchive',
3348
3120
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.products.unarchive('id');",
3349
3121
  },
3122
+ http: {
3123
+ example: 'curl https://live.dodopayments.com/products/$ID/unarchive \\\n -X POST \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
3124
+ },
3350
3125
  python: {
3351
3126
  method: 'products.unarchive',
3352
3127
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nclient.products.unarchive(\n "id",\n)',
@@ -3367,10 +3142,6 @@ const EMBEDDED_METHODS = [
3367
3142
  method: 'products.unarchive',
3368
3143
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nresult = dodo_payments.products.unarchive("id")\n\nputs(result)',
3369
3144
  },
3370
- cli: {
3371
- method: 'products unarchive',
3372
- example: "dodo-payments-cli products unarchive \\\n --bearer-token 'My Bearer Token' \\\n --id id",
3373
- },
3374
3145
  php: {
3375
3146
  method: 'products->unarchive',
3376
3147
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$result = $client->products->unarchive('id');\n\nvar_dump($result);",
@@ -3379,9 +3150,6 @@ const EMBEDDED_METHODS = [
3379
3150
  method: 'Products.Unarchive',
3380
3151
  example: 'ProductUnarchiveParams parameters = new() { ID = "id" };\n\nawait client.Products.Unarchive(parameters);',
3381
3152
  },
3382
- http: {
3383
- example: 'curl https://live.dodopayments.com/products/$ID/unarchive \\\n -X POST \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
3384
- },
3385
3153
  },
3386
3154
  },
3387
3155
  {
@@ -3400,6 +3168,9 @@ const EMBEDDED_METHODS = [
3400
3168
  method: 'client.products.updateFiles',
3401
3169
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.products.updateFiles('id', { file_name: 'file_name' });\n\nconsole.log(response.file_id);",
3402
3170
  },
3171
+ http: {
3172
+ example: 'curl https://live.dodopayments.com/products/$ID/files \\\n -X PUT \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY" \\\n -d \'{\n "file_name": "file_name"\n }\'',
3173
+ },
3403
3174
  python: {
3404
3175
  method: 'products.update_files',
3405
3176
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.products.update_files(\n id="id",\n file_name="file_name",\n)\nprint(response.file_id)',
@@ -3420,10 +3191,6 @@ const EMBEDDED_METHODS = [
3420
3191
  method: 'products.update_files',
3421
3192
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nresponse = dodo_payments.products.update_files("id", file_name: "file_name")\n\nputs(response)',
3422
3193
  },
3423
- cli: {
3424
- method: 'products update_files',
3425
- example: "dodo-payments-cli products update-files \\\n --bearer-token 'My Bearer Token' \\\n --id id \\\n --file-name file_name",
3426
- },
3427
3194
  php: {
3428
3195
  method: 'products->updateFiles',
3429
3196
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$response = $client->products->updateFiles('id', fileName: 'file_name');\n\nvar_dump($response);",
@@ -3432,9 +3199,6 @@ const EMBEDDED_METHODS = [
3432
3199
  method: 'Products.UpdateFiles',
3433
3200
  example: 'ProductUpdateFilesParams parameters = new()\n{\n ID = "id",\n FileName = "file_name",\n};\n\nvar response = await client.Products.UpdateFiles(parameters);\n\nConsole.WriteLine(response);',
3434
3201
  },
3435
- http: {
3436
- example: 'curl https://live.dodopayments.com/products/$ID/files \\\n -X PUT \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY" \\\n -d \'{\n "file_name": "file_name"\n }\'',
3437
- },
3438
3202
  },
3439
3203
  },
3440
3204
  {
@@ -3453,6 +3217,9 @@ const EMBEDDED_METHODS = [
3453
3217
  method: 'client.products.images.update',
3454
3218
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst image = await client.products.images.update('id');\n\nconsole.log(image.image_id);",
3455
3219
  },
3220
+ http: {
3221
+ example: 'curl https://live.dodopayments.com/products/$ID/images \\\n -X PUT \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
3222
+ },
3456
3223
  python: {
3457
3224
  method: 'products.images.update',
3458
3225
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nimage = client.products.images.update(\n id="id",\n)\nprint(image.image_id)',
@@ -3473,10 +3240,6 @@ const EMBEDDED_METHODS = [
3473
3240
  method: 'products.images.update',
3474
3241
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nimage = dodo_payments.products.images.update("id")\n\nputs(image)',
3475
3242
  },
3476
- cli: {
3477
- method: 'images update',
3478
- example: "dodo-payments-cli products:images update \\\n --bearer-token 'My Bearer Token' \\\n --id id",
3479
- },
3480
3243
  php: {
3481
3244
  method: 'products->images->update',
3482
3245
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$image = $client->products->images->update('id', forceUpdate: true);\n\nvar_dump($image);",
@@ -3485,9 +3248,6 @@ const EMBEDDED_METHODS = [
3485
3248
  method: 'Products.Images.Update',
3486
3249
  example: 'ImageUpdateParams parameters = new() { ID = "id" };\n\nvar image = await client.Products.Images.Update(parameters);\n\nConsole.WriteLine(image);',
3487
3250
  },
3488
- http: {
3489
- example: 'curl https://live.dodopayments.com/products/$ID/images \\\n -X PUT \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
3490
- },
3491
3251
  },
3492
3252
  },
3493
3253
  {
@@ -3506,6 +3266,9 @@ const EMBEDDED_METHODS = [
3506
3266
  method: 'client.products.shortLinks.list',
3507
3267
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const shortLinkListResponse of client.products.shortLinks.list()) {\n console.log(shortLinkListResponse.product_id);\n}",
3508
3268
  },
3269
+ http: {
3270
+ example: 'curl https://live.dodopayments.com/products/short_links \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
3271
+ },
3509
3272
  python: {
3510
3273
  method: 'products.short_links.list',
3511
3274
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\npage = client.products.short_links.list()\npage = page.items[0]\nprint(page.product_id)',
@@ -3526,10 +3289,6 @@ const EMBEDDED_METHODS = [
3526
3289
  method: 'products.short_links.list',
3527
3290
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\npage = dodo_payments.products.short_links.list\n\nputs(page)',
3528
3291
  },
3529
- cli: {
3530
- method: 'short_links list',
3531
- example: "dodo-payments-cli products:short-links list \\\n --bearer-token 'My Bearer Token'",
3532
- },
3533
3292
  php: {
3534
3293
  method: 'products->shortLinks->list',
3535
3294
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$page = $client->products->shortLinks->list(\n pageNumber: 0, pageSize: 0, productID: 'product_id'\n);\n\nvar_dump($page);",
@@ -3538,9 +3297,6 @@ const EMBEDDED_METHODS = [
3538
3297
  method: 'Products.ShortLinks.List',
3539
3298
  example: 'ShortLinkListParams parameters = new();\n\nvar page = await client.Products.ShortLinks.List(parameters);\nawait foreach (var item in page.Paginate())\n{\n Console.WriteLine(item);\n}',
3540
3299
  },
3541
- http: {
3542
- example: 'curl https://live.dodopayments.com/products/short_links \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
3543
- },
3544
3300
  },
3545
3301
  },
3546
3302
  {
@@ -3559,6 +3315,9 @@ const EMBEDDED_METHODS = [
3559
3315
  method: 'client.products.shortLinks.create',
3560
3316
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst shortLink = await client.products.shortLinks.create('id', { slug: 'slug' });\n\nconsole.log(shortLink.full_url);",
3561
3317
  },
3318
+ http: {
3319
+ example: 'curl https://live.dodopayments.com/products/$ID/short_links \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY" \\\n -d \'{\n "slug": "slug"\n }\'',
3320
+ },
3562
3321
  python: {
3563
3322
  method: 'products.short_links.create',
3564
3323
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nshort_link = client.products.short_links.create(\n id="id",\n slug="slug",\n)\nprint(short_link.full_url)',
@@ -3579,10 +3338,6 @@ const EMBEDDED_METHODS = [
3579
3338
  method: 'products.short_links.create',
3580
3339
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nshort_link = dodo_payments.products.short_links.create("id", slug: "slug")\n\nputs(short_link)',
3581
3340
  },
3582
- cli: {
3583
- method: 'short_links create',
3584
- example: "dodo-payments-cli products:short-links create \\\n --bearer-token 'My Bearer Token' \\\n --id id \\\n --slug slug",
3585
- },
3586
3341
  php: {
3587
3342
  method: 'products->shortLinks->create',
3588
3343
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$shortLink = $client->products->shortLinks->create(\n 'id', slug: 'slug', staticCheckoutParams: ['foo' => 'string']\n);\n\nvar_dump($shortLink);",
@@ -3591,9 +3346,6 @@ const EMBEDDED_METHODS = [
3591
3346
  method: 'Products.ShortLinks.Create',
3592
3347
  example: 'ShortLinkCreateParams parameters = new()\n{\n ID = "id",\n Slug = "slug",\n};\n\nvar shortLink = await client.Products.ShortLinks.Create(parameters);\n\nConsole.WriteLine(shortLink);',
3593
3348
  },
3594
- http: {
3595
- example: 'curl https://live.dodopayments.com/products/$ID/short_links \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY" \\\n -d \'{\n "slug": "slug"\n }\'',
3596
- },
3597
3349
  },
3598
3350
  },
3599
3351
  {
@@ -3611,6 +3363,9 @@ const EMBEDDED_METHODS = [
3611
3363
  method: 'client.misc.listSupportedCountries',
3612
3364
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst countryCodes = await client.misc.listSupportedCountries();\n\nconsole.log(countryCodes);",
3613
3365
  },
3366
+ http: {
3367
+ example: 'curl https://live.dodopayments.com/checkout/supported_countries \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
3368
+ },
3614
3369
  python: {
3615
3370
  method: 'misc.list_supported_countries',
3616
3371
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\ncountry_codes = client.misc.list_supported_countries()\nprint(country_codes)',
@@ -3631,10 +3386,6 @@ const EMBEDDED_METHODS = [
3631
3386
  method: 'misc.list_supported_countries',
3632
3387
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\ncountry_codes = dodo_payments.misc.list_supported_countries\n\nputs(country_codes)',
3633
3388
  },
3634
- cli: {
3635
- method: 'misc list_supported_countries',
3636
- example: "dodo-payments-cli misc list-supported-countries \\\n --bearer-token 'My Bearer Token'",
3637
- },
3638
3389
  php: {
3639
3390
  method: 'misc->listSupportedCountries',
3640
3391
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$countryCodes = $client->misc->listSupportedCountries();\n\nvar_dump($countryCodes);",
@@ -3643,9 +3394,6 @@ const EMBEDDED_METHODS = [
3643
3394
  method: 'Misc.ListSupportedCountries',
3644
3395
  example: 'MiscListSupportedCountriesParams parameters = new();\n\nvar countryCodes = await client.Misc.ListSupportedCountries(parameters);\n\nConsole.WriteLine(countryCodes);',
3645
3396
  },
3646
- http: {
3647
- example: 'curl https://live.dodopayments.com/checkout/supported_countries \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
3648
- },
3649
3397
  },
3650
3398
  },
3651
3399
  {
@@ -3671,6 +3419,9 @@ const EMBEDDED_METHODS = [
3671
3419
  method: 'client.discounts.list',
3672
3420
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const discount of client.discounts.list()) {\n console.log(discount.business_id);\n}",
3673
3421
  },
3422
+ http: {
3423
+ example: 'curl https://live.dodopayments.com/discounts \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
3424
+ },
3674
3425
  python: {
3675
3426
  method: 'discounts.list',
3676
3427
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\npage = client.discounts.list()\npage = page.items[0]\nprint(page.business_id)',
@@ -3691,10 +3442,6 @@ const EMBEDDED_METHODS = [
3691
3442
  method: 'discounts.list',
3692
3443
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\npage = dodo_payments.discounts.list\n\nputs(page)',
3693
3444
  },
3694
- cli: {
3695
- method: 'discounts list',
3696
- example: "dodo-payments-cli discounts list \\\n --bearer-token 'My Bearer Token'",
3697
- },
3698
3445
  php: {
3699
3446
  method: 'discounts->list',
3700
3447
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$page = $client->discounts->list(\n active: true,\n code: 'code',\n discountType: DiscountType::PERCENTAGE,\n pageNumber: 0,\n pageSize: 0,\n productID: 'product_id',\n);\n\nvar_dump($page);",
@@ -3703,9 +3450,6 @@ const EMBEDDED_METHODS = [
3703
3450
  method: 'Discounts.List',
3704
3451
  example: 'DiscountListParams parameters = new();\n\nvar page = await client.Discounts.List(parameters);\nawait foreach (var item in page.Paginate())\n{\n Console.WriteLine(item);\n}',
3705
3452
  },
3706
- http: {
3707
- example: 'curl https://live.dodopayments.com/discounts \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
3708
- },
3709
3453
  },
3710
3454
  },
3711
3455
  {
@@ -3735,6 +3479,9 @@ const EMBEDDED_METHODS = [
3735
3479
  method: 'client.discounts.create',
3736
3480
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst discount = await client.discounts.create({ amount: 0, type: 'percentage' });\n\nconsole.log(discount.business_id);",
3737
3481
  },
3482
+ http: {
3483
+ example: 'curl https://live.dodopayments.com/discounts \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY" \\\n -d \'{\n "amount": 0,\n "type": "percentage"\n }\'',
3484
+ },
3738
3485
  python: {
3739
3486
  method: 'discounts.create',
3740
3487
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\ndiscount = client.discounts.create(\n amount=0,\n type="percentage",\n)\nprint(discount.business_id)',
@@ -3755,10 +3502,6 @@ const EMBEDDED_METHODS = [
3755
3502
  method: 'discounts.create',
3756
3503
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\ndiscount = dodo_payments.discounts.create(amount: 0, type: :percentage)\n\nputs(discount)',
3757
3504
  },
3758
- cli: {
3759
- method: 'discounts create',
3760
- example: "dodo-payments-cli discounts create \\\n --bearer-token 'My Bearer Token' \\\n --amount 0 \\\n --type percentage",
3761
- },
3762
3505
  php: {
3763
3506
  method: 'discounts->create',
3764
3507
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$discount = $client->discounts->create(\n amount: 0,\n type: DiscountType::PERCENTAGE,\n code: 'code',\n expiresAt: new \\DateTimeImmutable('2019-12-27T18:11:19.117Z'),\n metadata: ['foo' => 'string'],\n name: 'name',\n preserveOnPlanChange: true,\n restrictedTo: ['string'],\n subscriptionCycles: 0,\n usageLimit: 0,\n);\n\nvar_dump($discount);",
@@ -3767,9 +3510,6 @@ const EMBEDDED_METHODS = [
3767
3510
  method: 'Discounts.Create',
3768
3511
  example: 'DiscountCreateParams parameters = new()\n{\n Amount = 0,\n Type = DiscountType.Percentage,\n};\n\nvar discount = await client.Discounts.Create(parameters);\n\nConsole.WriteLine(discount);',
3769
3512
  },
3770
- http: {
3771
- example: 'curl https://live.dodopayments.com/discounts \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY" \\\n -d \'{\n "amount": 0,\n "type": "percentage"\n }\'',
3772
- },
3773
3513
  },
3774
3514
  },
3775
3515
  {
@@ -3788,6 +3528,9 @@ const EMBEDDED_METHODS = [
3788
3528
  method: 'client.discounts.retrieve',
3789
3529
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst discount = await client.discounts.retrieve('discount_id');\n\nconsole.log(discount.business_id);",
3790
3530
  },
3531
+ http: {
3532
+ example: 'curl https://live.dodopayments.com/discounts/$DISCOUNT_ID \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
3533
+ },
3791
3534
  python: {
3792
3535
  method: 'discounts.retrieve',
3793
3536
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\ndiscount = client.discounts.retrieve(\n "discount_id",\n)\nprint(discount.business_id)',
@@ -3808,10 +3551,6 @@ const EMBEDDED_METHODS = [
3808
3551
  method: 'discounts.retrieve',
3809
3552
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\ndiscount = dodo_payments.discounts.retrieve("discount_id")\n\nputs(discount)',
3810
3553
  },
3811
- cli: {
3812
- method: 'discounts retrieve',
3813
- example: "dodo-payments-cli discounts retrieve \\\n --bearer-token 'My Bearer Token' \\\n --discount-id discount_id",
3814
- },
3815
3554
  php: {
3816
3555
  method: 'discounts->retrieve',
3817
3556
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$discount = $client->discounts->retrieve('discount_id');\n\nvar_dump($discount);",
@@ -3820,9 +3559,6 @@ const EMBEDDED_METHODS = [
3820
3559
  method: 'Discounts.Retrieve',
3821
3560
  example: 'DiscountRetrieveParams parameters = new() { DiscountID = "discount_id" };\n\nvar discount = await client.Discounts.Retrieve(parameters);\n\nConsole.WriteLine(discount);',
3822
3561
  },
3823
- http: {
3824
- example: 'curl https://live.dodopayments.com/discounts/$DISCOUNT_ID \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
3825
- },
3826
3562
  },
3827
3563
  },
3828
3564
  {
@@ -3840,6 +3576,9 @@ const EMBEDDED_METHODS = [
3840
3576
  method: 'client.discounts.delete',
3841
3577
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.discounts.delete('discount_id');",
3842
3578
  },
3579
+ http: {
3580
+ example: 'curl https://live.dodopayments.com/discounts/$DISCOUNT_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
3581
+ },
3843
3582
  python: {
3844
3583
  method: 'discounts.delete',
3845
3584
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nclient.discounts.delete(\n "discount_id",\n)',
@@ -3860,10 +3599,6 @@ const EMBEDDED_METHODS = [
3860
3599
  method: 'discounts.delete',
3861
3600
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nresult = dodo_payments.discounts.delete("discount_id")\n\nputs(result)',
3862
3601
  },
3863
- cli: {
3864
- method: 'discounts delete',
3865
- example: "dodo-payments-cli discounts delete \\\n --bearer-token 'My Bearer Token' \\\n --discount-id discount_id",
3866
- },
3867
3602
  php: {
3868
3603
  method: 'discounts->delete',
3869
3604
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$result = $client->discounts->delete('discount_id');\n\nvar_dump($result);",
@@ -3872,9 +3607,6 @@ const EMBEDDED_METHODS = [
3872
3607
  method: 'Discounts.Delete',
3873
3608
  example: 'DiscountDeleteParams parameters = new() { DiscountID = "discount_id" };\n\nawait client.Discounts.Delete(parameters);',
3874
3609
  },
3875
- http: {
3876
- example: 'curl https://live.dodopayments.com/discounts/$DISCOUNT_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
3877
- },
3878
3610
  },
3879
3611
  },
3880
3612
  {
@@ -3905,6 +3637,9 @@ const EMBEDDED_METHODS = [
3905
3637
  method: 'client.discounts.update',
3906
3638
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst discount = await client.discounts.update('discount_id');\n\nconsole.log(discount.business_id);",
3907
3639
  },
3640
+ http: {
3641
+ example: "curl https://live.dodopayments.com/discounts/$DISCOUNT_ID \\\n -X PATCH \\\n -H 'Content-Type: application/json' \\\n -H \"Authorization: Bearer $DODO_PAYMENTS_API_KEY\" \\\n -d '{}'",
3642
+ },
3908
3643
  python: {
3909
3644
  method: 'discounts.update',
3910
3645
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\ndiscount = client.discounts.update(\n discount_id="discount_id",\n)\nprint(discount.business_id)',
@@ -3925,10 +3660,6 @@ const EMBEDDED_METHODS = [
3925
3660
  method: 'discounts.update',
3926
3661
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\ndiscount = dodo_payments.discounts.update("discount_id")\n\nputs(discount)',
3927
3662
  },
3928
- cli: {
3929
- method: 'discounts update',
3930
- example: "dodo-payments-cli discounts update \\\n --bearer-token 'My Bearer Token' \\\n --discount-id discount_id",
3931
- },
3932
3663
  php: {
3933
3664
  method: 'discounts->update',
3934
3665
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$discount = $client->discounts->update(\n 'discount_id',\n amount: 0,\n code: 'code',\n expiresAt: new \\DateTimeImmutable('2019-12-27T18:11:19.117Z'),\n metadata: ['foo' => 'string'],\n name: 'name',\n preserveOnPlanChange: true,\n restrictedTo: ['string'],\n subscriptionCycles: 0,\n type: DiscountType::PERCENTAGE,\n usageLimit: 0,\n);\n\nvar_dump($discount);",
@@ -3937,9 +3668,6 @@ const EMBEDDED_METHODS = [
3937
3668
  method: 'Discounts.Update',
3938
3669
  example: 'DiscountUpdateParams parameters = new() { DiscountID = "discount_id" };\n\nvar discount = await client.Discounts.Update(parameters);\n\nConsole.WriteLine(discount);',
3939
3670
  },
3940
- http: {
3941
- example: "curl https://live.dodopayments.com/discounts/$DISCOUNT_ID \\\n -X PATCH \\\n -H 'Content-Type: application/json' \\\n -H \"Authorization: Bearer $DODO_PAYMENTS_API_KEY\" \\\n -d '{}'",
3942
- },
3943
3671
  },
3944
3672
  },
3945
3673
  {
@@ -3958,6 +3686,9 @@ const EMBEDDED_METHODS = [
3958
3686
  method: 'client.discounts.retrieveByCode',
3959
3687
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst discount = await client.discounts.retrieveByCode('code');\n\nconsole.log(discount.business_id);",
3960
3688
  },
3689
+ http: {
3690
+ example: 'curl https://live.dodopayments.com/discounts/code/$CODE \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
3691
+ },
3961
3692
  python: {
3962
3693
  method: 'discounts.retrieve_by_code',
3963
3694
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\ndiscount = client.discounts.retrieve_by_code(\n "code",\n)\nprint(discount.business_id)',
@@ -3978,10 +3709,6 @@ const EMBEDDED_METHODS = [
3978
3709
  method: 'discounts.retrieve_by_code',
3979
3710
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\ndiscount = dodo_payments.discounts.retrieve_by_code("code")\n\nputs(discount)',
3980
3711
  },
3981
- cli: {
3982
- method: 'discounts retrieve_by_code',
3983
- example: "dodo-payments-cli discounts retrieve-by-code \\\n --bearer-token 'My Bearer Token' \\\n --code code",
3984
- },
3985
3712
  php: {
3986
3713
  method: 'discounts->retrieveByCode',
3987
3714
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$discount = $client->discounts->retrieveByCode('code');\n\nvar_dump($discount);",
@@ -3990,9 +3717,6 @@ const EMBEDDED_METHODS = [
3990
3717
  method: 'Discounts.RetrieveByCode',
3991
3718
  example: 'DiscountRetrieveByCodeParams parameters = new() { Code = "code" };\n\nvar discount = await client.Discounts.RetrieveByCode(parameters);\n\nConsole.WriteLine(discount);',
3992
3719
  },
3993
- http: {
3994
- example: 'curl https://live.dodopayments.com/discounts/code/$CODE \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
3995
- },
3996
3720
  },
3997
3721
  },
3998
3722
  {
@@ -4011,6 +3735,9 @@ const EMBEDDED_METHODS = [
4011
3735
  method: 'client.addons.list',
4012
3736
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const addonResponse of client.addons.list()) {\n console.log(addonResponse.id);\n}",
4013
3737
  },
3738
+ http: {
3739
+ example: 'curl https://live.dodopayments.com/addons \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
3740
+ },
4014
3741
  python: {
4015
3742
  method: 'addons.list',
4016
3743
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\npage = client.addons.list()\npage = page.items[0]\nprint(page.id)',
@@ -4031,10 +3758,6 @@ const EMBEDDED_METHODS = [
4031
3758
  method: 'addons.list',
4032
3759
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\npage = dodo_payments.addons.list\n\nputs(page)',
4033
3760
  },
4034
- cli: {
4035
- method: 'addons list',
4036
- example: "dodo-payments-cli addons list \\\n --bearer-token 'My Bearer Token'",
4037
- },
4038
3761
  php: {
4039
3762
  method: 'addons->list',
4040
3763
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$page = $client->addons->list(pageNumber: 0, pageSize: 0);\n\nvar_dump($page);",
@@ -4043,9 +3766,6 @@ const EMBEDDED_METHODS = [
4043
3766
  method: 'Addons.List',
4044
3767
  example: 'AddonListParams parameters = new();\n\nvar page = await client.Addons.List(parameters);\nawait foreach (var item in page.Paginate())\n{\n Console.WriteLine(item);\n}',
4045
3768
  },
4046
- http: {
4047
- example: 'curl https://live.dodopayments.com/addons \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
4048
- },
4049
3769
  },
4050
3770
  },
4051
3771
  {
@@ -4070,6 +3790,9 @@ const EMBEDDED_METHODS = [
4070
3790
  method: 'client.addons.create',
4071
3791
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst addonResponse = await client.addons.create({\n currency: 'AED',\n name: 'name',\n price: 0,\n tax_category: 'digital_products',\n});\n\nconsole.log(addonResponse.id);",
4072
3792
  },
3793
+ http: {
3794
+ example: 'curl https://live.dodopayments.com/addons \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY" \\\n -d \'{\n "currency": "AED",\n "name": "name",\n "price": 0,\n "tax_category": "digital_products"\n }\'',
3795
+ },
4073
3796
  python: {
4074
3797
  method: 'addons.create',
4075
3798
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\naddon_response = client.addons.create(\n currency="AED",\n name="name",\n price=0,\n tax_category="digital_products",\n)\nprint(addon_response.id)',
@@ -4090,10 +3813,6 @@ const EMBEDDED_METHODS = [
4090
3813
  method: 'addons.create',
4091
3814
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\naddon_response = dodo_payments.addons.create(currency: :AED, name: "name", price: 0, tax_category: :digital_products)\n\nputs(addon_response)',
4092
3815
  },
4093
- cli: {
4094
- method: 'addons create',
4095
- example: "dodo-payments-cli addons create \\\n --bearer-token 'My Bearer Token' \\\n --currency AED \\\n --name name \\\n --price 0 \\\n --tax-category digital_products",
4096
- },
4097
3816
  php: {
4098
3817
  method: 'addons->create',
4099
3818
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$addonResponse = $client->addons->create(\n currency: Currency::AED,\n name: 'name',\n price: 0,\n taxCategory: TaxCategory::DIGITAL_PRODUCTS,\n description: 'description',\n);\n\nvar_dump($addonResponse);",
@@ -4102,9 +3821,6 @@ const EMBEDDED_METHODS = [
4102
3821
  method: 'Addons.Create',
4103
3822
  example: 'AddonCreateParams parameters = new()\n{\n Currency = Currency.Aed,\n Name = "name",\n Price = 0,\n TaxCategory = TaxCategory.DigitalProducts,\n};\n\nvar addonResponse = await client.Addons.Create(parameters);\n\nConsole.WriteLine(addonResponse);',
4104
3823
  },
4105
- http: {
4106
- example: 'curl https://live.dodopayments.com/addons \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY" \\\n -d \'{\n "currency": "AED",\n "name": "name",\n "price": 0,\n "tax_category": "digital_products"\n }\'',
4107
- },
4108
3824
  },
4109
3825
  },
4110
3826
  {
@@ -4123,6 +3839,9 @@ const EMBEDDED_METHODS = [
4123
3839
  method: 'client.addons.retrieve',
4124
3840
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst addonResponse = await client.addons.retrieve('id');\n\nconsole.log(addonResponse.id);",
4125
3841
  },
3842
+ http: {
3843
+ example: 'curl https://live.dodopayments.com/addons/$ID \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
3844
+ },
4126
3845
  python: {
4127
3846
  method: 'addons.retrieve',
4128
3847
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\naddon_response = client.addons.retrieve(\n "id",\n)\nprint(addon_response.id)',
@@ -4143,10 +3862,6 @@ const EMBEDDED_METHODS = [
4143
3862
  method: 'addons.retrieve',
4144
3863
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\naddon_response = dodo_payments.addons.retrieve("id")\n\nputs(addon_response)',
4145
3864
  },
4146
- cli: {
4147
- method: 'addons retrieve',
4148
- example: "dodo-payments-cli addons retrieve \\\n --bearer-token 'My Bearer Token' \\\n --id id",
4149
- },
4150
3865
  php: {
4151
3866
  method: 'addons->retrieve',
4152
3867
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$addonResponse = $client->addons->retrieve('id');\n\nvar_dump($addonResponse);",
@@ -4155,9 +3870,6 @@ const EMBEDDED_METHODS = [
4155
3870
  method: 'Addons.Retrieve',
4156
3871
  example: 'AddonRetrieveParams parameters = new() { ID = "id" };\n\nvar addonResponse = await client.Addons.Retrieve(parameters);\n\nConsole.WriteLine(addonResponse);',
4157
3872
  },
4158
- http: {
4159
- example: 'curl https://live.dodopayments.com/addons/$ID \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
4160
- },
4161
3873
  },
4162
3874
  },
4163
3875
  {
@@ -4184,6 +3896,9 @@ const EMBEDDED_METHODS = [
4184
3896
  method: 'client.addons.update',
4185
3897
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst addonResponse = await client.addons.update('id');\n\nconsole.log(addonResponse.id);",
4186
3898
  },
3899
+ http: {
3900
+ example: "curl https://live.dodopayments.com/addons/$ID \\\n -X PATCH \\\n -H 'Content-Type: application/json' \\\n -H \"Authorization: Bearer $DODO_PAYMENTS_API_KEY\" \\\n -d '{}'",
3901
+ },
4187
3902
  python: {
4188
3903
  method: 'addons.update',
4189
3904
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\naddon_response = client.addons.update(\n id="id",\n)\nprint(addon_response.id)',
@@ -4204,10 +3919,6 @@ const EMBEDDED_METHODS = [
4204
3919
  method: 'addons.update',
4205
3920
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\naddon_response = dodo_payments.addons.update("id")\n\nputs(addon_response)',
4206
3921
  },
4207
- cli: {
4208
- method: 'addons update',
4209
- example: "dodo-payments-cli addons update \\\n --bearer-token 'My Bearer Token' \\\n --id id",
4210
- },
4211
3922
  php: {
4212
3923
  method: 'addons->update',
4213
3924
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$addonResponse = $client->addons->update(\n 'id',\n currency: Currency::AED,\n description: 'description',\n imageID: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n name: 'name',\n price: 0,\n taxCategory: TaxCategory::DIGITAL_PRODUCTS,\n);\n\nvar_dump($addonResponse);",
@@ -4216,9 +3927,6 @@ const EMBEDDED_METHODS = [
4216
3927
  method: 'Addons.Update',
4217
3928
  example: 'AddonUpdateParams parameters = new() { ID = "id" };\n\nvar addonResponse = await client.Addons.Update(parameters);\n\nConsole.WriteLine(addonResponse);',
4218
3929
  },
4219
- http: {
4220
- example: "curl https://live.dodopayments.com/addons/$ID \\\n -X PATCH \\\n -H 'Content-Type: application/json' \\\n -H \"Authorization: Bearer $DODO_PAYMENTS_API_KEY\" \\\n -d '{}'",
4221
- },
4222
3930
  },
4223
3931
  },
4224
3932
  {
@@ -4237,7 +3945,10 @@ const EMBEDDED_METHODS = [
4237
3945
  method: 'client.addons.updateImages',
4238
3946
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.addons.updateImages('id');\n\nconsole.log(response.image_id);",
4239
3947
  },
4240
- python: {
3948
+ http: {
3949
+ example: 'curl https://live.dodopayments.com/addons/$ID/images \\\n -X PUT \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
3950
+ },
3951
+ python: {
4241
3952
  method: 'addons.update_images',
4242
3953
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.addons.update_images(\n "id",\n)\nprint(response.image_id)',
4243
3954
  },
@@ -4257,10 +3968,6 @@ const EMBEDDED_METHODS = [
4257
3968
  method: 'addons.update_images',
4258
3969
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nresponse = dodo_payments.addons.update_images("id")\n\nputs(response)',
4259
3970
  },
4260
- cli: {
4261
- method: 'addons update_images',
4262
- example: "dodo-payments-cli addons update-images \\\n --bearer-token 'My Bearer Token' \\\n --id id",
4263
- },
4264
3971
  php: {
4265
3972
  method: 'addons->updateImages',
4266
3973
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$response = $client->addons->updateImages('id');\n\nvar_dump($response);",
@@ -4269,9 +3976,6 @@ const EMBEDDED_METHODS = [
4269
3976
  method: 'Addons.UpdateImages',
4270
3977
  example: 'AddonUpdateImagesParams parameters = new() { ID = "id" };\n\nvar response = await client.Addons.UpdateImages(parameters);\n\nConsole.WriteLine(response);',
4271
3978
  },
4272
- http: {
4273
- example: 'curl https://live.dodopayments.com/addons/$ID/images \\\n -X PUT \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
4274
- },
4275
3979
  },
4276
3980
  },
4277
3981
  {
@@ -4289,6 +3993,9 @@ const EMBEDDED_METHODS = [
4289
3993
  method: 'client.brands.list',
4290
3994
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst brands = await client.brands.list();\n\nconsole.log(brands.items);",
4291
3995
  },
3996
+ http: {
3997
+ example: 'curl https://live.dodopayments.com/brands \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
3998
+ },
4292
3999
  python: {
4293
4000
  method: 'brands.list',
4294
4001
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nbrands = client.brands.list()\nprint(brands.items)',
@@ -4309,10 +4016,6 @@ const EMBEDDED_METHODS = [
4309
4016
  method: 'brands.list',
4310
4017
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nbrands = dodo_payments.brands.list\n\nputs(brands)',
4311
4018
  },
4312
- cli: {
4313
- method: 'brands list',
4314
- example: "dodo-payments-cli brands list \\\n --bearer-token 'My Bearer Token'",
4315
- },
4316
4019
  php: {
4317
4020
  method: 'brands->list',
4318
4021
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$brands = $client->brands->list();\n\nvar_dump($brands);",
@@ -4321,9 +4024,6 @@ const EMBEDDED_METHODS = [
4321
4024
  method: 'Brands.List',
4322
4025
  example: 'BrandListParams parameters = new();\n\nvar brands = await client.Brands.List(parameters);\n\nConsole.WriteLine(brands);',
4323
4026
  },
4324
- http: {
4325
- example: 'curl https://live.dodopayments.com/brands \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
4326
- },
4327
4027
  },
4328
4028
  },
4329
4029
  {
@@ -4348,6 +4048,9 @@ const EMBEDDED_METHODS = [
4348
4048
  method: 'client.brands.create',
4349
4049
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst brand = await client.brands.create();\n\nconsole.log(brand.brand_id);",
4350
4050
  },
4051
+ http: {
4052
+ example: "curl https://live.dodopayments.com/brands \\\n -H 'Content-Type: application/json' \\\n -H \"Authorization: Bearer $DODO_PAYMENTS_API_KEY\" \\\n -d '{}'",
4053
+ },
4351
4054
  python: {
4352
4055
  method: 'brands.create',
4353
4056
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nbrand = client.brands.create()\nprint(brand.brand_id)',
@@ -4368,10 +4071,6 @@ const EMBEDDED_METHODS = [
4368
4071
  method: 'brands.create',
4369
4072
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nbrand = dodo_payments.brands.create\n\nputs(brand)',
4370
4073
  },
4371
- cli: {
4372
- method: 'brands create',
4373
- example: "dodo-payments-cli brands create \\\n --bearer-token 'My Bearer Token'",
4374
- },
4375
4074
  php: {
4376
4075
  method: 'brands->create',
4377
4076
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$brand = $client->brands->create(\n description: 'description',\n name: 'name',\n statementDescriptor: 'statement_descriptor',\n supportEmail: 'support_email',\n url: 'url',\n);\n\nvar_dump($brand);",
@@ -4380,9 +4079,6 @@ const EMBEDDED_METHODS = [
4380
4079
  method: 'Brands.Create',
4381
4080
  example: 'BrandCreateParams parameters = new();\n\nvar brand = await client.Brands.Create(parameters);\n\nConsole.WriteLine(brand);',
4382
4081
  },
4383
- http: {
4384
- example: "curl https://live.dodopayments.com/brands \\\n -H 'Content-Type: application/json' \\\n -H \"Authorization: Bearer $DODO_PAYMENTS_API_KEY\" \\\n -d '{}'",
4385
- },
4386
4082
  },
4387
4083
  },
4388
4084
  {
@@ -4401,6 +4097,9 @@ const EMBEDDED_METHODS = [
4401
4097
  method: 'client.brands.retrieve',
4402
4098
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst brand = await client.brands.retrieve('id');\n\nconsole.log(brand.brand_id);",
4403
4099
  },
4100
+ http: {
4101
+ example: 'curl https://live.dodopayments.com/brands/$ID \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
4102
+ },
4404
4103
  python: {
4405
4104
  method: 'brands.retrieve',
4406
4105
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nbrand = client.brands.retrieve(\n "id",\n)\nprint(brand.brand_id)',
@@ -4421,10 +4120,6 @@ const EMBEDDED_METHODS = [
4421
4120
  method: 'brands.retrieve',
4422
4121
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nbrand = dodo_payments.brands.retrieve("id")\n\nputs(brand)',
4423
4122
  },
4424
- cli: {
4425
- method: 'brands retrieve',
4426
- example: "dodo-payments-cli brands retrieve \\\n --bearer-token 'My Bearer Token' \\\n --id id",
4427
- },
4428
4123
  php: {
4429
4124
  method: 'brands->retrieve',
4430
4125
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$brand = $client->brands->retrieve('id');\n\nvar_dump($brand);",
@@ -4433,9 +4128,6 @@ const EMBEDDED_METHODS = [
4433
4128
  method: 'Brands.Retrieve',
4434
4129
  example: 'BrandRetrieveParams parameters = new() { ID = "id" };\n\nvar brand = await client.Brands.Retrieve(parameters);\n\nConsole.WriteLine(brand);',
4435
4130
  },
4436
- http: {
4437
- example: 'curl https://live.dodopayments.com/brands/$ID \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
4438
- },
4439
4131
  },
4440
4132
  },
4441
4133
  {
@@ -4462,6 +4154,9 @@ const EMBEDDED_METHODS = [
4462
4154
  method: 'client.brands.update',
4463
4155
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst brand = await client.brands.update('id');\n\nconsole.log(brand.brand_id);",
4464
4156
  },
4157
+ http: {
4158
+ example: "curl https://live.dodopayments.com/brands/$ID \\\n -X PATCH \\\n -H 'Content-Type: application/json' \\\n -H \"Authorization: Bearer $DODO_PAYMENTS_API_KEY\" \\\n -d '{}'",
4159
+ },
4465
4160
  python: {
4466
4161
  method: 'brands.update',
4467
4162
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nbrand = client.brands.update(\n id="id",\n)\nprint(brand.brand_id)',
@@ -4482,10 +4177,6 @@ const EMBEDDED_METHODS = [
4482
4177
  method: 'brands.update',
4483
4178
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nbrand = dodo_payments.brands.update("id")\n\nputs(brand)',
4484
4179
  },
4485
- cli: {
4486
- method: 'brands update',
4487
- example: "dodo-payments-cli brands update \\\n --bearer-token 'My Bearer Token' \\\n --id id",
4488
- },
4489
4180
  php: {
4490
4181
  method: 'brands->update',
4491
4182
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$brand = $client->brands->update(\n 'id',\n description: 'description',\n imageID: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n name: 'name',\n statementDescriptor: 'statement_descriptor',\n supportEmail: 'support_email',\n url: 'url',\n);\n\nvar_dump($brand);",
@@ -4494,9 +4185,6 @@ const EMBEDDED_METHODS = [
4494
4185
  method: 'Brands.Update',
4495
4186
  example: 'BrandUpdateParams parameters = new() { ID = "id" };\n\nvar brand = await client.Brands.Update(parameters);\n\nConsole.WriteLine(brand);',
4496
4187
  },
4497
- http: {
4498
- example: "curl https://live.dodopayments.com/brands/$ID \\\n -X PATCH \\\n -H 'Content-Type: application/json' \\\n -H \"Authorization: Bearer $DODO_PAYMENTS_API_KEY\" \\\n -d '{}'",
4499
- },
4500
4188
  },
4501
4189
  },
4502
4190
  {
@@ -4515,6 +4203,9 @@ const EMBEDDED_METHODS = [
4515
4203
  method: 'client.brands.updateImages',
4516
4204
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.brands.updateImages('id');\n\nconsole.log(response.image_id);",
4517
4205
  },
4206
+ http: {
4207
+ example: 'curl https://live.dodopayments.com/brands/$ID/images \\\n -X PUT \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
4208
+ },
4518
4209
  python: {
4519
4210
  method: 'brands.update_images',
4520
4211
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.brands.update_images(\n "id",\n)\nprint(response.image_id)',
@@ -4535,10 +4226,6 @@ const EMBEDDED_METHODS = [
4535
4226
  method: 'brands.update_images',
4536
4227
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nresponse = dodo_payments.brands.update_images("id")\n\nputs(response)',
4537
4228
  },
4538
- cli: {
4539
- method: 'brands update_images',
4540
- example: "dodo-payments-cli brands update-images \\\n --bearer-token 'My Bearer Token' \\\n --id id",
4541
- },
4542
4229
  php: {
4543
4230
  method: 'brands->updateImages',
4544
4231
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$response = $client->brands->updateImages('id');\n\nvar_dump($response);",
@@ -4547,9 +4234,6 @@ const EMBEDDED_METHODS = [
4547
4234
  method: 'Brands.UpdateImages',
4548
4235
  example: 'BrandUpdateImagesParams parameters = new() { ID = "id" };\n\nvar response = await client.Brands.UpdateImages(parameters);\n\nConsole.WriteLine(response);',
4549
4236
  },
4550
- http: {
4551
- example: 'curl https://live.dodopayments.com/brands/$ID/images \\\n -X PUT \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
4552
- },
4553
4237
  },
4554
4238
  },
4555
4239
  {
@@ -4568,6 +4252,9 @@ const EMBEDDED_METHODS = [
4568
4252
  method: 'client.webhooks.list',
4569
4253
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const webhookDetails of client.webhooks.list()) {\n console.log(webhookDetails.id);\n}",
4570
4254
  },
4255
+ http: {
4256
+ example: 'curl https://live.dodopayments.com/webhooks \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
4257
+ },
4571
4258
  python: {
4572
4259
  method: 'webhooks.list',
4573
4260
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\npage = client.webhooks.list()\npage = page.data[0]\nprint(page.id)',
@@ -4588,10 +4275,6 @@ const EMBEDDED_METHODS = [
4588
4275
  method: 'webhooks.list',
4589
4276
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\npage = dodo_payments.webhooks.list\n\nputs(page)',
4590
4277
  },
4591
- cli: {
4592
- method: 'webhooks list',
4593
- example: "dodo-payments-cli webhooks list \\\n --bearer-token 'My Bearer Token'",
4594
- },
4595
4278
  php: {
4596
4279
  method: 'webhooks->list',
4597
4280
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$page = $client->webhooks->list(iterator: 'iterator', limit: 0);\n\nvar_dump($page);",
@@ -4600,9 +4283,6 @@ const EMBEDDED_METHODS = [
4600
4283
  method: 'Webhooks.List',
4601
4284
  example: 'WebhookListParams parameters = new();\n\nvar page = await client.Webhooks.List(parameters);\nawait foreach (var item in page.Paginate())\n{\n Console.WriteLine(item);\n}',
4602
4285
  },
4603
- http: {
4604
- example: 'curl https://live.dodopayments.com/webhooks \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
4605
- },
4606
4286
  },
4607
4287
  },
4608
4288
  {
@@ -4630,6 +4310,9 @@ const EMBEDDED_METHODS = [
4630
4310
  method: 'client.webhooks.create',
4631
4311
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst webhookDetails = await client.webhooks.create({ url: 'url' });\n\nconsole.log(webhookDetails.id);",
4632
4312
  },
4313
+ http: {
4314
+ example: 'curl https://live.dodopayments.com/webhooks \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY" \\\n -d \'{\n "url": "url"\n }\'',
4315
+ },
4633
4316
  python: {
4634
4317
  method: 'webhooks.create',
4635
4318
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nwebhook_details = client.webhooks.create(\n url="url",\n)\nprint(webhook_details.id)',
@@ -4650,10 +4333,6 @@ const EMBEDDED_METHODS = [
4650
4333
  method: 'webhooks.create',
4651
4334
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nwebhook_details = dodo_payments.webhooks.create(url: "url")\n\nputs(webhook_details)',
4652
4335
  },
4653
- cli: {
4654
- method: 'webhooks create',
4655
- example: "dodo-payments-cli webhooks create \\\n --bearer-token 'My Bearer Token' \\\n --url url",
4656
- },
4657
4336
  php: {
4658
4337
  method: 'webhooks->create',
4659
4338
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$webhookDetails = $client->webhooks->create(\n url: 'url',\n description: 'description',\n disabled: true,\n filterTypes: [WebhookEventType::PAYMENT_SUCCEEDED],\n headers: ['foo' => 'string'],\n idempotencyKey: 'idempotency_key',\n metadata: ['foo' => 'string'],\n rateLimit: 0,\n);\n\nvar_dump($webhookDetails);",
@@ -4662,9 +4341,6 @@ const EMBEDDED_METHODS = [
4662
4341
  method: 'Webhooks.Create',
4663
4342
  example: 'WebhookCreateParams parameters = new() { Url = "url" };\n\nvar webhookDetails = await client.Webhooks.Create(parameters);\n\nConsole.WriteLine(webhookDetails);',
4664
4343
  },
4665
- http: {
4666
- example: 'curl https://live.dodopayments.com/webhooks \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY" \\\n -d \'{\n "url": "url"\n }\'',
4667
- },
4668
4344
  },
4669
4345
  },
4670
4346
  {
@@ -4683,6 +4359,9 @@ const EMBEDDED_METHODS = [
4683
4359
  method: 'client.webhooks.retrieve',
4684
4360
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst webhookDetails = await client.webhooks.retrieve('webhook_id');\n\nconsole.log(webhookDetails.id);",
4685
4361
  },
4362
+ http: {
4363
+ example: 'curl https://live.dodopayments.com/webhooks/$WEBHOOK_ID \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
4364
+ },
4686
4365
  python: {
4687
4366
  method: 'webhooks.retrieve',
4688
4367
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nwebhook_details = client.webhooks.retrieve(\n "webhook_id",\n)\nprint(webhook_details.id)',
@@ -4703,10 +4382,6 @@ const EMBEDDED_METHODS = [
4703
4382
  method: 'webhooks.retrieve',
4704
4383
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nwebhook_details = dodo_payments.webhooks.retrieve("webhook_id")\n\nputs(webhook_details)',
4705
4384
  },
4706
- cli: {
4707
- method: 'webhooks retrieve',
4708
- example: "dodo-payments-cli webhooks retrieve \\\n --bearer-token 'My Bearer Token' \\\n --webhook-id webhook_id",
4709
- },
4710
4385
  php: {
4711
4386
  method: 'webhooks->retrieve',
4712
4387
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$webhookDetails = $client->webhooks->retrieve('webhook_id');\n\nvar_dump($webhookDetails);",
@@ -4715,9 +4390,6 @@ const EMBEDDED_METHODS = [
4715
4390
  method: 'Webhooks.Retrieve',
4716
4391
  example: 'WebhookRetrieveParams parameters = new() { WebhookID = "webhook_id" };\n\nvar webhookDetails = await client.Webhooks.Retrieve(parameters);\n\nConsole.WriteLine(webhookDetails);',
4717
4392
  },
4718
- http: {
4719
- example: 'curl https://live.dodopayments.com/webhooks/$WEBHOOK_ID \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
4720
- },
4721
4393
  },
4722
4394
  },
4723
4395
  {
@@ -4735,6 +4407,9 @@ const EMBEDDED_METHODS = [
4735
4407
  method: 'client.webhooks.delete',
4736
4408
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.webhooks.delete('webhook_id');",
4737
4409
  },
4410
+ http: {
4411
+ example: 'curl https://live.dodopayments.com/webhooks/$WEBHOOK_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
4412
+ },
4738
4413
  python: {
4739
4414
  method: 'webhooks.delete',
4740
4415
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nclient.webhooks.delete(\n "webhook_id",\n)',
@@ -4755,10 +4430,6 @@ const EMBEDDED_METHODS = [
4755
4430
  method: 'webhooks.delete',
4756
4431
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nresult = dodo_payments.webhooks.delete("webhook_id")\n\nputs(result)',
4757
4432
  },
4758
- cli: {
4759
- method: 'webhooks delete',
4760
- example: "dodo-payments-cli webhooks delete \\\n --bearer-token 'My Bearer Token' \\\n --webhook-id webhook_id",
4761
- },
4762
4433
  php: {
4763
4434
  method: 'webhooks->delete',
4764
4435
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$result = $client->webhooks->delete('webhook_id');\n\nvar_dump($result);",
@@ -4767,9 +4438,6 @@ const EMBEDDED_METHODS = [
4767
4438
  method: 'Webhooks.Delete',
4768
4439
  example: 'WebhookDeleteParams parameters = new() { WebhookID = "webhook_id" };\n\nawait client.Webhooks.Delete(parameters);',
4769
4440
  },
4770
- http: {
4771
- example: 'curl https://live.dodopayments.com/webhooks/$WEBHOOK_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
4772
- },
4773
4441
  },
4774
4442
  },
4775
4443
  {
@@ -4796,6 +4464,9 @@ const EMBEDDED_METHODS = [
4796
4464
  method: 'client.webhooks.update',
4797
4465
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst webhookDetails = await client.webhooks.update('webhook_id');\n\nconsole.log(webhookDetails.id);",
4798
4466
  },
4467
+ http: {
4468
+ example: "curl https://live.dodopayments.com/webhooks/$WEBHOOK_ID \\\n -X PATCH \\\n -H 'Content-Type: application/json' \\\n -H \"Authorization: Bearer $DODO_PAYMENTS_API_KEY\" \\\n -d '{}'",
4469
+ },
4799
4470
  python: {
4800
4471
  method: 'webhooks.update',
4801
4472
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nwebhook_details = client.webhooks.update(\n webhook_id="webhook_id",\n)\nprint(webhook_details.id)',
@@ -4816,10 +4487,6 @@ const EMBEDDED_METHODS = [
4816
4487
  method: 'webhooks.update',
4817
4488
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nwebhook_details = dodo_payments.webhooks.update("webhook_id")\n\nputs(webhook_details)',
4818
4489
  },
4819
- cli: {
4820
- method: 'webhooks update',
4821
- example: "dodo-payments-cli webhooks update \\\n --bearer-token 'My Bearer Token' \\\n --webhook-id webhook_id",
4822
- },
4823
4490
  php: {
4824
4491
  method: 'webhooks->update',
4825
4492
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$webhookDetails = $client->webhooks->update(\n 'webhook_id',\n description: 'description',\n disabled: true,\n filterTypes: [WebhookEventType::PAYMENT_SUCCEEDED],\n metadata: ['foo' => 'string'],\n rateLimit: 0,\n url: 'url',\n);\n\nvar_dump($webhookDetails);",
@@ -4828,9 +4495,6 @@ const EMBEDDED_METHODS = [
4828
4495
  method: 'Webhooks.Update',
4829
4496
  example: 'WebhookUpdateParams parameters = new() { WebhookID = "webhook_id" };\n\nvar webhookDetails = await client.Webhooks.Update(parameters);\n\nConsole.WriteLine(webhookDetails);',
4830
4497
  },
4831
- http: {
4832
- example: "curl https://live.dodopayments.com/webhooks/$WEBHOOK_ID \\\n -X PATCH \\\n -H 'Content-Type: application/json' \\\n -H \"Authorization: Bearer $DODO_PAYMENTS_API_KEY\" \\\n -d '{}'",
4833
- },
4834
4498
  },
4835
4499
  },
4836
4500
  {
@@ -4849,6 +4513,9 @@ const EMBEDDED_METHODS = [
4849
4513
  method: 'client.webhooks.retrieveSecret',
4850
4514
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.webhooks.retrieveSecret('webhook_id');\n\nconsole.log(response.secret);",
4851
4515
  },
4516
+ http: {
4517
+ example: 'curl https://live.dodopayments.com/webhooks/$WEBHOOK_ID/secret \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
4518
+ },
4852
4519
  python: {
4853
4520
  method: 'webhooks.retrieve_secret',
4854
4521
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.webhooks.retrieve_secret(\n "webhook_id",\n)\nprint(response.secret)',
@@ -4869,10 +4536,6 @@ const EMBEDDED_METHODS = [
4869
4536
  method: 'webhooks.retrieve_secret',
4870
4537
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nresponse = dodo_payments.webhooks.retrieve_secret("webhook_id")\n\nputs(response)',
4871
4538
  },
4872
- cli: {
4873
- method: 'webhooks retrieve_secret',
4874
- example: "dodo-payments-cli webhooks retrieve-secret \\\n --bearer-token 'My Bearer Token' \\\n --webhook-id webhook_id",
4875
- },
4876
4539
  php: {
4877
4540
  method: 'webhooks->retrieveSecret',
4878
4541
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$response = $client->webhooks->retrieveSecret('webhook_id');\n\nvar_dump($response);",
@@ -4881,9 +4544,6 @@ const EMBEDDED_METHODS = [
4881
4544
  method: 'Webhooks.RetrieveSecret',
4882
4545
  example: 'WebhookRetrieveSecretParams parameters = new() { WebhookID = "webhook_id" };\n\nvar response = await client.Webhooks.RetrieveSecret(parameters);\n\nConsole.WriteLine(response);',
4883
4546
  },
4884
- http: {
4885
- example: 'curl https://live.dodopayments.com/webhooks/$WEBHOOK_ID/secret \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
4886
- },
4887
4547
  },
4888
4548
  },
4889
4549
  {
@@ -4917,9 +4577,6 @@ const EMBEDDED_METHODS = [
4917
4577
  method: 'webhooks.unwrap',
4918
4578
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nresult = dodo_payments.webhooks.unwrap\n\nputs(result)',
4919
4579
  },
4920
- cli: {
4921
- example: "dodo-payments-cli webhooks unwrap \\\n --bearer-token 'My Bearer Token'",
4922
- },
4923
4580
  php: {
4924
4581
  method: 'webhooks->unwrap',
4925
4582
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$result = $client->webhooks->unwrap();\n\nvar_dump($result);",
@@ -4960,9 +4617,6 @@ const EMBEDDED_METHODS = [
4960
4617
  method: 'webhooks.unsafe_unwrap',
4961
4618
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nresult = dodo_payments.webhooks.unsafe_unwrap\n\nputs(result)',
4962
4619
  },
4963
- cli: {
4964
- example: "dodo-payments-cli webhooks unsafe-unwrap \\\n --bearer-token 'My Bearer Token'",
4965
- },
4966
4620
  php: {
4967
4621
  method: 'webhooks->unsafeUnwrap',
4968
4622
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$result = $client->webhooks->unsafeUnwrap();\n\nvar_dump($result);",
@@ -4988,6 +4642,9 @@ const EMBEDDED_METHODS = [
4988
4642
  method: 'client.webhooks.headers.retrieve',
4989
4643
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst header = await client.webhooks.headers.retrieve('webhook_id');\n\nconsole.log(header.headers);",
4990
4644
  },
4645
+ http: {
4646
+ example: 'curl https://live.dodopayments.com/webhooks/$WEBHOOK_ID/headers \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
4647
+ },
4991
4648
  python: {
4992
4649
  method: 'webhooks.headers.retrieve',
4993
4650
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nheader = client.webhooks.headers.retrieve(\n "webhook_id",\n)\nprint(header.headers)',
@@ -5008,10 +4665,6 @@ const EMBEDDED_METHODS = [
5008
4665
  method: 'webhooks.headers.retrieve',
5009
4666
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nheader = dodo_payments.webhooks.headers.retrieve("webhook_id")\n\nputs(header)',
5010
4667
  },
5011
- cli: {
5012
- method: 'headers retrieve',
5013
- example: "dodo-payments-cli webhooks:headers retrieve \\\n --bearer-token 'My Bearer Token' \\\n --webhook-id webhook_id",
5014
- },
5015
4668
  php: {
5016
4669
  method: 'webhooks->headers->retrieve',
5017
4670
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$header = $client->webhooks->headers->retrieve('webhook_id');\n\nvar_dump($header);",
@@ -5020,9 +4673,6 @@ const EMBEDDED_METHODS = [
5020
4673
  method: 'Webhooks.Headers.Retrieve',
5021
4674
  example: 'HeaderRetrieveParams parameters = new() { WebhookID = "webhook_id" };\n\nvar header = await client.Webhooks.Headers.Retrieve(parameters);\n\nConsole.WriteLine(header);',
5022
4675
  },
5023
- http: {
5024
- example: 'curl https://live.dodopayments.com/webhooks/$WEBHOOK_ID/headers \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
5025
- },
5026
4676
  },
5027
4677
  },
5028
4678
  {
@@ -5040,6 +4690,9 @@ const EMBEDDED_METHODS = [
5040
4690
  method: 'client.webhooks.headers.update',
5041
4691
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.webhooks.headers.update('webhook_id', { headers: { foo: 'string' } });",
5042
4692
  },
4693
+ http: {
4694
+ example: 'curl https://live.dodopayments.com/webhooks/$WEBHOOK_ID/headers \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY" \\\n -d \'{\n "headers": {\n "foo": "string"\n }\n }\'',
4695
+ },
5043
4696
  python: {
5044
4697
  method: 'webhooks.headers.update',
5045
4698
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nclient.webhooks.headers.update(\n webhook_id="webhook_id",\n headers={\n "foo": "string"\n },\n)',
@@ -5060,10 +4713,6 @@ const EMBEDDED_METHODS = [
5060
4713
  method: 'webhooks.headers.update',
5061
4714
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nresult = dodo_payments.webhooks.headers.update("webhook_id", headers: {foo: "string"})\n\nputs(result)',
5062
4715
  },
5063
- cli: {
5064
- method: 'headers update',
5065
- example: "dodo-payments-cli webhooks:headers update \\\n --bearer-token 'My Bearer Token' \\\n --webhook-id webhook_id \\\n --headers '{foo: string}'",
5066
- },
5067
4716
  php: {
5068
4717
  method: 'webhooks->headers->update',
5069
4718
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$result = $client->webhooks->headers->update(\n 'webhook_id', headers: ['foo' => 'string']\n);\n\nvar_dump($result);",
@@ -5072,9 +4721,6 @@ const EMBEDDED_METHODS = [
5072
4721
  method: 'Webhooks.Headers.Update',
5073
4722
  example: 'HeaderUpdateParams parameters = new()\n{\n WebhookID = "webhook_id",\n Headers = new Dictionary<string, string>() { { "foo", "string" } },\n};\n\nawait client.Webhooks.Headers.Update(parameters);',
5074
4723
  },
5075
- http: {
5076
- example: 'curl https://live.dodopayments.com/webhooks/$WEBHOOK_ID/headers \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY" \\\n -d \'{\n "headers": {\n "foo": "string"\n }\n }\'',
5077
- },
5078
4724
  },
5079
4725
  },
5080
4726
  {
@@ -5095,6 +4741,9 @@ const EMBEDDED_METHODS = [
5095
4741
  method: 'client.usageEvents.ingest',
5096
4742
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.usageEvents.ingest({\n events: [\n {\n customer_id: 'customer_id',\n event_id: 'event_id',\n event_name: 'event_name',\n },\n ],\n});\n\nconsole.log(response.ingested_count);",
5097
4743
  },
4744
+ http: {
4745
+ example: 'curl https://live.dodopayments.com/events/ingest \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY" \\\n -d \'{\n "events": [\n {\n "customer_id": "customer_id",\n "event_id": "event_id",\n "event_name": "event_name"\n }\n ]\n }\'',
4746
+ },
5098
4747
  python: {
5099
4748
  method: 'usage_events.ingest',
5100
4749
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.usage_events.ingest(\n events=[{\n "customer_id": "customer_id",\n "event_id": "event_id",\n "event_name": "event_name",\n }],\n)\nprint(response.ingested_count)',
@@ -5115,10 +4764,6 @@ const EMBEDDED_METHODS = [
5115
4764
  method: 'usage_events.ingest',
5116
4765
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nresponse = dodo_payments.usage_events.ingest(\n events: [{customer_id: "customer_id", event_id: "event_id", event_name: "event_name"}]\n)\n\nputs(response)',
5117
4766
  },
5118
- cli: {
5119
- method: 'usage_events ingest',
5120
- example: "dodo-payments-cli usage-events ingest \\\n --bearer-token 'My Bearer Token' \\\n --event '{customer_id: customer_id, event_id: event_id, event_name: event_name}'",
5121
- },
5122
4767
  php: {
5123
4768
  method: 'usageEvents->ingest',
5124
4769
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$response = $client->usageEvents->ingest(\n events: [\n [\n 'customerID' => 'customer_id',\n 'eventID' => 'event_id',\n 'eventName' => 'event_name',\n 'metadata' => ['foo' => 'string'],\n 'timestamp' => new \\DateTimeImmutable('2019-12-27T18:11:19.117Z'),\n ],\n ],\n);\n\nvar_dump($response);",
@@ -5127,9 +4772,6 @@ const EMBEDDED_METHODS = [
5127
4772
  method: 'UsageEvents.Ingest',
5128
4773
  example: 'UsageEventIngestParams parameters = new()\n{\n Events =\n [\n new()\n {\n CustomerID = "customer_id",\n EventID = "event_id",\n EventName = "event_name",\n Metadata = new Dictionary<string, Metadata>()\n {\n { "foo", "string" }\n },\n Timestamp = DateTimeOffset.Parse("2019-12-27T18:11:19.117Z"),\n },\n ],\n};\n\nvar response = await client.UsageEvents.Ingest(parameters);\n\nConsole.WriteLine(response);',
5129
4774
  },
5130
- http: {
5131
- example: 'curl https://live.dodopayments.com/events/ingest \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY" \\\n -d \'{\n "events": [\n {\n "customer_id": "customer_id",\n "event_id": "event_id",\n "event_name": "event_name"\n }\n ]\n }\'',
5132
- },
5133
4775
  },
5134
4776
  },
5135
4777
  {
@@ -5156,6 +4798,9 @@ const EMBEDDED_METHODS = [
5156
4798
  method: 'client.usageEvents.list',
5157
4799
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const event of client.usageEvents.list()) {\n console.log(event.business_id);\n}",
5158
4800
  },
4801
+ http: {
4802
+ example: 'curl https://live.dodopayments.com/events \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
4803
+ },
5159
4804
  python: {
5160
4805
  method: 'usage_events.list',
5161
4806
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\npage = client.usage_events.list()\npage = page.items[0]\nprint(page.business_id)',
@@ -5176,10 +4821,6 @@ const EMBEDDED_METHODS = [
5176
4821
  method: 'usage_events.list',
5177
4822
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\npage = dodo_payments.usage_events.list\n\nputs(page)',
5178
4823
  },
5179
- cli: {
5180
- method: 'usage_events list',
5181
- example: "dodo-payments-cli usage-events list \\\n --bearer-token 'My Bearer Token'",
5182
- },
5183
4824
  php: {
5184
4825
  method: 'usageEvents->list',
5185
4826
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$page = $client->usageEvents->list(\n customerID: 'customer_id',\n end: new \\DateTimeImmutable('2019-12-27T18:11:19.117Z'),\n eventName: 'event_name',\n meterID: 'meter_id',\n pageNumber: 0,\n pageSize: 0,\n start: new \\DateTimeImmutable('2019-12-27T18:11:19.117Z'),\n);\n\nvar_dump($page);",
@@ -5188,9 +4829,6 @@ const EMBEDDED_METHODS = [
5188
4829
  method: 'UsageEvents.List',
5189
4830
  example: 'UsageEventListParams parameters = new();\n\nvar page = await client.UsageEvents.List(parameters);\nawait foreach (var item in page.Paginate())\n{\n Console.WriteLine(item);\n}',
5190
4831
  },
5191
- http: {
5192
- example: 'curl https://live.dodopayments.com/events \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
5193
- },
5194
4832
  },
5195
4833
  },
5196
4834
  {
@@ -5209,6 +4847,9 @@ const EMBEDDED_METHODS = [
5209
4847
  method: 'client.usageEvents.retrieve',
5210
4848
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst event = await client.usageEvents.retrieve('event_id');\n\nconsole.log(event.business_id);",
5211
4849
  },
4850
+ http: {
4851
+ example: 'curl https://live.dodopayments.com/events/$EVENT_ID \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
4852
+ },
5212
4853
  python: {
5213
4854
  method: 'usage_events.retrieve',
5214
4855
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nevent = client.usage_events.retrieve(\n "event_id",\n)\nprint(event.business_id)',
@@ -5229,10 +4870,6 @@ const EMBEDDED_METHODS = [
5229
4870
  method: 'usage_events.retrieve',
5230
4871
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nevent = dodo_payments.usage_events.retrieve("event_id")\n\nputs(event)',
5231
4872
  },
5232
- cli: {
5233
- method: 'usage_events retrieve',
5234
- example: "dodo-payments-cli usage-events retrieve \\\n --bearer-token 'My Bearer Token' \\\n --event-id event_id",
5235
- },
5236
4873
  php: {
5237
4874
  method: 'usageEvents->retrieve',
5238
4875
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$event = $client->usageEvents->retrieve('event_id');\n\nvar_dump($event);",
@@ -5241,9 +4878,6 @@ const EMBEDDED_METHODS = [
5241
4878
  method: 'UsageEvents.Retrieve',
5242
4879
  example: 'UsageEventRetrieveParams parameters = new() { EventID = "event_id" };\n\nvar event_ = await client.UsageEvents.Retrieve(parameters);\n\nConsole.WriteLine(event_);',
5243
4880
  },
5244
- http: {
5245
- example: 'curl https://live.dodopayments.com/events/$EVENT_ID \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
5246
- },
5247
4881
  },
5248
4882
  },
5249
4883
  {
@@ -5262,6 +4896,9 @@ const EMBEDDED_METHODS = [
5262
4896
  method: 'client.meters.list',
5263
4897
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const meter of client.meters.list()) {\n console.log(meter.id);\n}",
5264
4898
  },
4899
+ http: {
4900
+ example: 'curl https://live.dodopayments.com/meters \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
4901
+ },
5265
4902
  python: {
5266
4903
  method: 'meters.list',
5267
4904
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\npage = client.meters.list()\npage = page.items[0]\nprint(page.id)',
@@ -5282,10 +4919,6 @@ const EMBEDDED_METHODS = [
5282
4919
  method: 'meters.list',
5283
4920
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\npage = dodo_payments.meters.list\n\nputs(page)',
5284
4921
  },
5285
- cli: {
5286
- method: 'meters list',
5287
- example: "dodo-payments-cli meters list \\\n --bearer-token 'My Bearer Token'",
5288
- },
5289
4922
  php: {
5290
4923
  method: 'meters->list',
5291
4924
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$page = $client->meters->list(archived: true, pageNumber: 0, pageSize: 0);\n\nvar_dump($page);",
@@ -5294,9 +4927,6 @@ const EMBEDDED_METHODS = [
5294
4927
  method: 'Meters.List',
5295
4928
  example: 'MeterListParams parameters = new();\n\nvar page = await client.Meters.List(parameters);\nawait foreach (var item in page.Paginate())\n{\n Console.WriteLine(item);\n}',
5296
4929
  },
5297
- http: {
5298
- example: 'curl https://live.dodopayments.com/meters \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
5299
- },
5300
4930
  },
5301
4931
  },
5302
4932
  {
@@ -5322,6 +4952,9 @@ const EMBEDDED_METHODS = [
5322
4952
  method: 'client.meters.create',
5323
4953
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst meter = await client.meters.create({\n aggregation: { type: 'count' },\n event_name: 'event_name',\n measurement_unit: 'measurement_unit',\n name: 'name',\n});\n\nconsole.log(meter.id);",
5324
4954
  },
4955
+ http: {
4956
+ example: 'curl https://live.dodopayments.com/meters \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY" \\\n -d \'{\n "aggregation": {\n "type": "count"\n },\n "event_name": "event_name",\n "measurement_unit": "measurement_unit",\n "name": "name"\n }\'',
4957
+ },
5325
4958
  python: {
5326
4959
  method: 'meters.create',
5327
4960
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nmeter = client.meters.create(\n aggregation={\n "type": "count"\n },\n event_name="event_name",\n measurement_unit="measurement_unit",\n name="name",\n)\nprint(meter.id)',
@@ -5342,10 +4975,6 @@ const EMBEDDED_METHODS = [
5342
4975
  method: 'meters.create',
5343
4976
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nmeter = dodo_payments.meters.create(\n aggregation: {type: :count},\n event_name: "event_name",\n measurement_unit: "measurement_unit",\n name: "name"\n)\n\nputs(meter)',
5344
4977
  },
5345
- cli: {
5346
- method: 'meters create',
5347
- example: "dodo-payments-cli meters create \\\n --bearer-token 'My Bearer Token' \\\n --aggregation '{type: count}' \\\n --event-name event_name \\\n --measurement-unit measurement_unit \\\n --name name",
5348
- },
5349
4978
  php: {
5350
4979
  method: 'meters->create',
5351
4980
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$meter = $client->meters->create(\n aggregation: ['type' => 'count', 'key' => 'key'],\n eventName: 'event_name',\n measurementUnit: 'measurement_unit',\n name: 'name',\n description: 'description',\n filter: [\n 'clauses' => [\n [\n 'key' => 'user_id',\n 'operator' => FilterOperator::EQUALS,\n 'value' => 'user123',\n ],\n [\n 'key' => 'amount',\n 'operator' => FilterOperator::GREATER_THAN,\n 'value' => 100,\n ],\n ],\n 'conjunction' => Conjunction::AND,\n ],\n);\n\nvar_dump($meter);",
@@ -5354,9 +4983,6 @@ const EMBEDDED_METHODS = [
5354
4983
  method: 'Meters.Create',
5355
4984
  example: 'MeterCreateParams parameters = new()\n{\n Aggregation = new()\n {\n Type = Type.Count,\n Key = "key",\n },\n EventName = "event_name",\n MeasurementUnit = "measurement_unit",\n Name = "name",\n};\n\nvar meter = await client.Meters.Create(parameters);\n\nConsole.WriteLine(meter);',
5356
4985
  },
5357
- http: {
5358
- example: 'curl https://live.dodopayments.com/meters \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY" \\\n -d \'{\n "aggregation": {\n "type": "count"\n },\n "event_name": "event_name",\n "measurement_unit": "measurement_unit",\n "name": "name"\n }\'',
5359
- },
5360
4986
  },
5361
4987
  },
5362
4988
  {
@@ -5375,6 +5001,9 @@ const EMBEDDED_METHODS = [
5375
5001
  method: 'client.meters.retrieve',
5376
5002
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst meter = await client.meters.retrieve('id');\n\nconsole.log(meter.id);",
5377
5003
  },
5004
+ http: {
5005
+ example: 'curl https://live.dodopayments.com/meters/$ID \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
5006
+ },
5378
5007
  python: {
5379
5008
  method: 'meters.retrieve',
5380
5009
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nmeter = client.meters.retrieve(\n "id",\n)\nprint(meter.id)',
@@ -5395,10 +5024,6 @@ const EMBEDDED_METHODS = [
5395
5024
  method: 'meters.retrieve',
5396
5025
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nmeter = dodo_payments.meters.retrieve("id")\n\nputs(meter)',
5397
5026
  },
5398
- cli: {
5399
- method: 'meters retrieve',
5400
- example: "dodo-payments-cli meters retrieve \\\n --bearer-token 'My Bearer Token' \\\n --id id",
5401
- },
5402
5027
  php: {
5403
5028
  method: 'meters->retrieve',
5404
5029
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$meter = $client->meters->retrieve('id');\n\nvar_dump($meter);",
@@ -5407,9 +5032,6 @@ const EMBEDDED_METHODS = [
5407
5032
  method: 'Meters.Retrieve',
5408
5033
  example: 'MeterRetrieveParams parameters = new() { ID = "id" };\n\nvar meter = await client.Meters.Retrieve(parameters);\n\nConsole.WriteLine(meter);',
5409
5034
  },
5410
- http: {
5411
- example: 'curl https://live.dodopayments.com/meters/$ID \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
5412
- },
5413
5035
  },
5414
5036
  },
5415
5037
  {
@@ -5427,6 +5049,9 @@ const EMBEDDED_METHODS = [
5427
5049
  method: 'client.meters.archive',
5428
5050
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.meters.archive('id');",
5429
5051
  },
5052
+ http: {
5053
+ example: 'curl https://live.dodopayments.com/meters/$ID \\\n -X DELETE \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
5054
+ },
5430
5055
  python: {
5431
5056
  method: 'meters.archive',
5432
5057
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nclient.meters.archive(\n "id",\n)',
@@ -5447,10 +5072,6 @@ const EMBEDDED_METHODS = [
5447
5072
  method: 'meters.archive',
5448
5073
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nresult = dodo_payments.meters.archive("id")\n\nputs(result)',
5449
5074
  },
5450
- cli: {
5451
- method: 'meters archive',
5452
- example: "dodo-payments-cli meters archive \\\n --bearer-token 'My Bearer Token' \\\n --id id",
5453
- },
5454
5075
  php: {
5455
5076
  method: 'meters->archive',
5456
5077
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$result = $client->meters->archive('id');\n\nvar_dump($result);",
@@ -5459,9 +5080,6 @@ const EMBEDDED_METHODS = [
5459
5080
  method: 'Meters.Archive',
5460
5081
  example: 'MeterArchiveParams parameters = new() { ID = "id" };\n\nawait client.Meters.Archive(parameters);',
5461
5082
  },
5462
- http: {
5463
- example: 'curl https://live.dodopayments.com/meters/$ID \\\n -X DELETE \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
5464
- },
5465
5083
  },
5466
5084
  },
5467
5085
  {
@@ -5479,6 +5097,9 @@ const EMBEDDED_METHODS = [
5479
5097
  method: 'client.meters.unarchive',
5480
5098
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.meters.unarchive('id');",
5481
5099
  },
5100
+ http: {
5101
+ example: 'curl https://live.dodopayments.com/meters/$ID/unarchive \\\n -X POST \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
5102
+ },
5482
5103
  python: {
5483
5104
  method: 'meters.unarchive',
5484
5105
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nclient.meters.unarchive(\n "id",\n)',
@@ -5499,10 +5120,6 @@ const EMBEDDED_METHODS = [
5499
5120
  method: 'meters.unarchive',
5500
5121
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nresult = dodo_payments.meters.unarchive("id")\n\nputs(result)',
5501
5122
  },
5502
- cli: {
5503
- method: 'meters unarchive',
5504
- example: "dodo-payments-cli meters unarchive \\\n --bearer-token 'My Bearer Token' \\\n --id id",
5505
- },
5506
5123
  php: {
5507
5124
  method: 'meters->unarchive',
5508
5125
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$result = $client->meters->unarchive('id');\n\nvar_dump($result);",
@@ -5511,9 +5128,6 @@ const EMBEDDED_METHODS = [
5511
5128
  method: 'Meters.Unarchive',
5512
5129
  example: 'MeterUnarchiveParams parameters = new() { ID = "id" };\n\nawait client.Meters.Unarchive(parameters);',
5513
5130
  },
5514
- http: {
5515
- example: 'curl https://live.dodopayments.com/meters/$ID/unarchive \\\n -X POST \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
5516
- },
5517
5131
  },
5518
5132
  },
5519
5133
  {
@@ -5541,6 +5155,9 @@ const EMBEDDED_METHODS = [
5541
5155
  method: 'client.balances.retrieveLedger',
5542
5156
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const balanceLedgerEntry of client.balances.retrieveLedger()) {\n console.log(balanceLedgerEntry.id);\n}",
5543
5157
  },
5158
+ http: {
5159
+ example: 'curl https://live.dodopayments.com/balances/ledger \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
5160
+ },
5544
5161
  python: {
5545
5162
  method: 'balances.retrieve_ledger',
5546
5163
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\npage = client.balances.retrieve_ledger()\npage = page.items[0]\nprint(page.id)',
@@ -5561,10 +5178,6 @@ const EMBEDDED_METHODS = [
5561
5178
  method: 'balances.retrieve_ledger',
5562
5179
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\npage = dodo_payments.balances.retrieve_ledger\n\nputs(page)',
5563
5180
  },
5564
- cli: {
5565
- method: 'balances retrieve_ledger',
5566
- example: "dodo-payments-cli balances retrieve-ledger \\\n --bearer-token 'My Bearer Token'",
5567
- },
5568
5181
  php: {
5569
5182
  method: 'balances->retrieveLedger',
5570
5183
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$page = $client->balances->retrieveLedger(\n createdAtGte: new \\DateTimeImmutable('2019-12-27T18:11:19.117Z'),\n createdAtLte: new \\DateTimeImmutable('2019-12-27T18:11:19.117Z'),\n currency: 'AED',\n eventType: 'payment',\n limit: 0,\n pageNumber: 0,\n pageSize: 0,\n referenceObjectID: 'reference_object_id',\n);\n\nvar_dump($page);",
@@ -5573,9 +5186,6 @@ const EMBEDDED_METHODS = [
5573
5186
  method: 'Balances.RetrieveLedger',
5574
5187
  example: 'BalanceRetrieveLedgerParams parameters = new();\n\nvar page = await client.Balances.RetrieveLedger(parameters);\nawait foreach (var item in page.Paginate())\n{\n Console.WriteLine(item);\n}',
5575
5188
  },
5576
- http: {
5577
- example: 'curl https://live.dodopayments.com/balances/ledger \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
5578
- },
5579
5189
  },
5580
5190
  },
5581
5191
  {
@@ -5594,6 +5204,9 @@ const EMBEDDED_METHODS = [
5594
5204
  method: 'client.creditEntitlements.list',
5595
5205
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const creditEntitlement of client.creditEntitlements.list()) {\n console.log(creditEntitlement.id);\n}",
5596
5206
  },
5207
+ http: {
5208
+ example: 'curl https://live.dodopayments.com/credit-entitlements \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
5209
+ },
5597
5210
  python: {
5598
5211
  method: 'credit_entitlements.list',
5599
5212
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\npage = client.credit_entitlements.list()\npage = page.items[0]\nprint(page.id)',
@@ -5614,10 +5227,6 @@ const EMBEDDED_METHODS = [
5614
5227
  method: 'credit_entitlements.list',
5615
5228
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\npage = dodo_payments.credit_entitlements.list\n\nputs(page)',
5616
5229
  },
5617
- cli: {
5618
- method: 'credit_entitlements list',
5619
- example: "dodo-payments-cli credit-entitlements list \\\n --bearer-token 'My Bearer Token'",
5620
- },
5621
5230
  php: {
5622
5231
  method: 'creditEntitlements->list',
5623
5232
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$page = $client->creditEntitlements->list(\n deleted: true, pageNumber: 0, pageSize: 0\n);\n\nvar_dump($page);",
@@ -5626,9 +5235,6 @@ const EMBEDDED_METHODS = [
5626
5235
  method: 'CreditEntitlements.List',
5627
5236
  example: 'CreditEntitlementListParams parameters = new();\n\nvar page = await client.CreditEntitlements.List(parameters);\nawait foreach (var item in page.Paginate())\n{\n Console.WriteLine(item);\n}',
5628
5237
  },
5629
- http: {
5630
- example: 'curl https://live.dodopayments.com/credit-entitlements \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
5631
- },
5632
5238
  },
5633
5239
  },
5634
5240
  {
@@ -5663,6 +5269,9 @@ const EMBEDDED_METHODS = [
5663
5269
  method: 'client.creditEntitlements.create',
5664
5270
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst creditEntitlement = await client.creditEntitlements.create({\n name: 'name',\n overage_enabled: true,\n precision: 0,\n rollover_enabled: true,\n unit: 'unit',\n});\n\nconsole.log(creditEntitlement.id);",
5665
5271
  },
5272
+ http: {
5273
+ example: 'curl https://live.dodopayments.com/credit-entitlements \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY" \\\n -d \'{\n "name": "name",\n "overage_enabled": true,\n "precision": 0,\n "rollover_enabled": true,\n "unit": "unit"\n }\'',
5274
+ },
5666
5275
  python: {
5667
5276
  method: 'credit_entitlements.create',
5668
5277
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\ncredit_entitlement = client.credit_entitlements.create(\n name="name",\n overage_enabled=True,\n precision=0,\n rollover_enabled=True,\n unit="unit",\n)\nprint(credit_entitlement.id)',
@@ -5683,10 +5292,6 @@ const EMBEDDED_METHODS = [
5683
5292
  method: 'credit_entitlements.create',
5684
5293
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\ncredit_entitlement = dodo_payments.credit_entitlements.create(\n name: "name",\n overage_enabled: true,\n precision: 0,\n rollover_enabled: true,\n unit: "unit"\n)\n\nputs(credit_entitlement)',
5685
5294
  },
5686
- cli: {
5687
- method: 'credit_entitlements create',
5688
- example: "dodo-payments-cli credit-entitlements create \\\n --bearer-token 'My Bearer Token' \\\n --name name \\\n --overage-enabled \\\n --precision 0 \\\n --rollover-enabled \\\n --unit unit",
5689
- },
5690
5295
  php: {
5691
5296
  method: 'creditEntitlements->create',
5692
5297
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$creditEntitlement = $client->creditEntitlements->create(\n name: 'name',\n overageEnabled: true,\n precision: 0,\n rolloverEnabled: true,\n unit: 'unit',\n currency: Currency::AED,\n description: 'description',\n expiresAfterDays: 0,\n maxRolloverCount: 0,\n overageBehavior: CbbOverageBehavior::FORGIVE_AT_RESET,\n overageLimit: 0,\n pricePerUnit: 'price_per_unit',\n rolloverPercentage: 0,\n rolloverTimeframeCount: 0,\n rolloverTimeframeInterval: TimeInterval::DAY,\n);\n\nvar_dump($creditEntitlement);",
@@ -5695,9 +5300,6 @@ const EMBEDDED_METHODS = [
5695
5300
  method: 'CreditEntitlements.Create',
5696
5301
  example: 'CreditEntitlementCreateParams parameters = new()\n{\n Name = "name",\n OverageEnabled = true,\n Precision = 0,\n RolloverEnabled = true,\n Unit = "unit",\n};\n\nvar creditEntitlement = await client.CreditEntitlements.Create(parameters);\n\nConsole.WriteLine(creditEntitlement);',
5697
5302
  },
5698
- http: {
5699
- example: 'curl https://live.dodopayments.com/credit-entitlements \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY" \\\n -d \'{\n "name": "name",\n "overage_enabled": true,\n "precision": 0,\n "rollover_enabled": true,\n "unit": "unit"\n }\'',
5700
- },
5701
5303
  },
5702
5304
  },
5703
5305
  {
@@ -5716,6 +5318,9 @@ const EMBEDDED_METHODS = [
5716
5318
  method: 'client.creditEntitlements.retrieve',
5717
5319
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst creditEntitlement = await client.creditEntitlements.retrieve('id');\n\nconsole.log(creditEntitlement.id);",
5718
5320
  },
5321
+ http: {
5322
+ example: 'curl https://live.dodopayments.com/credit-entitlements/$ID \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
5323
+ },
5719
5324
  python: {
5720
5325
  method: 'credit_entitlements.retrieve',
5721
5326
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\ncredit_entitlement = client.credit_entitlements.retrieve(\n "id",\n)\nprint(credit_entitlement.id)',
@@ -5736,10 +5341,6 @@ const EMBEDDED_METHODS = [
5736
5341
  method: 'credit_entitlements.retrieve',
5737
5342
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\ncredit_entitlement = dodo_payments.credit_entitlements.retrieve("id")\n\nputs(credit_entitlement)',
5738
5343
  },
5739
- cli: {
5740
- method: 'credit_entitlements retrieve',
5741
- example: "dodo-payments-cli credit-entitlements retrieve \\\n --bearer-token 'My Bearer Token' \\\n --id id",
5742
- },
5743
5344
  php: {
5744
5345
  method: 'creditEntitlements->retrieve',
5745
5346
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$creditEntitlement = $client->creditEntitlements->retrieve('id');\n\nvar_dump($creditEntitlement);",
@@ -5748,9 +5349,6 @@ const EMBEDDED_METHODS = [
5748
5349
  method: 'CreditEntitlements.Retrieve',
5749
5350
  example: 'CreditEntitlementRetrieveParams parameters = new() { ID = "id" };\n\nvar creditEntitlement = await client.CreditEntitlements.Retrieve(parameters);\n\nConsole.WriteLine(creditEntitlement);',
5750
5351
  },
5751
- http: {
5752
- example: 'curl https://live.dodopayments.com/credit-entitlements/$ID \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
5753
- },
5754
5352
  },
5755
5353
  },
5756
5354
  {
@@ -5768,6 +5366,9 @@ const EMBEDDED_METHODS = [
5768
5366
  method: 'client.creditEntitlements.delete',
5769
5367
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.creditEntitlements.delete('id');",
5770
5368
  },
5369
+ http: {
5370
+ example: 'curl https://live.dodopayments.com/credit-entitlements/$ID \\\n -X DELETE \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
5371
+ },
5771
5372
  python: {
5772
5373
  method: 'credit_entitlements.delete',
5773
5374
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nclient.credit_entitlements.delete(\n "id",\n)',
@@ -5788,10 +5389,6 @@ const EMBEDDED_METHODS = [
5788
5389
  method: 'credit_entitlements.delete',
5789
5390
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nresult = dodo_payments.credit_entitlements.delete("id")\n\nputs(result)',
5790
5391
  },
5791
- cli: {
5792
- method: 'credit_entitlements delete',
5793
- example: "dodo-payments-cli credit-entitlements delete \\\n --bearer-token 'My Bearer Token' \\\n --id id",
5794
- },
5795
5392
  php: {
5796
5393
  method: 'creditEntitlements->delete',
5797
5394
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$result = $client->creditEntitlements->delete('id');\n\nvar_dump($result);",
@@ -5800,9 +5397,6 @@ const EMBEDDED_METHODS = [
5800
5397
  method: 'CreditEntitlements.Delete',
5801
5398
  example: 'CreditEntitlementDeleteParams parameters = new() { ID = "id" };\n\nawait client.CreditEntitlements.Delete(parameters);',
5802
5399
  },
5803
- http: {
5804
- example: 'curl https://live.dodopayments.com/credit-entitlements/$ID \\\n -X DELETE \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
5805
- },
5806
5400
  },
5807
5401
  },
5808
5402
  {
@@ -5836,6 +5430,9 @@ const EMBEDDED_METHODS = [
5836
5430
  method: 'client.creditEntitlements.update',
5837
5431
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.creditEntitlements.update('id');",
5838
5432
  },
5433
+ http: {
5434
+ example: "curl https://live.dodopayments.com/credit-entitlements/$ID \\\n -X PATCH \\\n -H 'Content-Type: application/json' \\\n -H \"Authorization: Bearer $DODO_PAYMENTS_API_KEY\" \\\n -d '{}'",
5435
+ },
5839
5436
  python: {
5840
5437
  method: 'credit_entitlements.update',
5841
5438
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nclient.credit_entitlements.update(\n id="id",\n)',
@@ -5856,10 +5453,6 @@ const EMBEDDED_METHODS = [
5856
5453
  method: 'credit_entitlements.update',
5857
5454
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nresult = dodo_payments.credit_entitlements.update("id")\n\nputs(result)',
5858
5455
  },
5859
- cli: {
5860
- method: 'credit_entitlements update',
5861
- example: "dodo-payments-cli credit-entitlements update \\\n --bearer-token 'My Bearer Token' \\\n --id id",
5862
- },
5863
5456
  php: {
5864
5457
  method: 'creditEntitlements->update',
5865
5458
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$result = $client->creditEntitlements->update(\n 'id',\n currency: Currency::AED,\n description: 'description',\n expiresAfterDays: 0,\n maxRolloverCount: 0,\n name: 'name',\n overageBehavior: CbbOverageBehavior::FORGIVE_AT_RESET,\n overageEnabled: true,\n overageLimit: 0,\n pricePerUnit: 'price_per_unit',\n rolloverEnabled: true,\n rolloverPercentage: 0,\n rolloverTimeframeCount: 0,\n rolloverTimeframeInterval: TimeInterval::DAY,\n unit: 'unit',\n);\n\nvar_dump($result);",
@@ -5868,9 +5461,6 @@ const EMBEDDED_METHODS = [
5868
5461
  method: 'CreditEntitlements.Update',
5869
5462
  example: 'CreditEntitlementUpdateParams parameters = new() { ID = "id" };\n\nawait client.CreditEntitlements.Update(parameters);',
5870
5463
  },
5871
- http: {
5872
- example: "curl https://live.dodopayments.com/credit-entitlements/$ID \\\n -X PATCH \\\n -H 'Content-Type: application/json' \\\n -H \"Authorization: Bearer $DODO_PAYMENTS_API_KEY\" \\\n -d '{}'",
5873
- },
5874
5464
  },
5875
5465
  },
5876
5466
  {
@@ -5888,6 +5478,9 @@ const EMBEDDED_METHODS = [
5888
5478
  method: 'client.creditEntitlements.undelete',
5889
5479
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.creditEntitlements.undelete('id');",
5890
5480
  },
5481
+ http: {
5482
+ example: 'curl https://live.dodopayments.com/credit-entitlements/$ID/undelete \\\n -X POST \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
5483
+ },
5891
5484
  python: {
5892
5485
  method: 'credit_entitlements.undelete',
5893
5486
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nclient.credit_entitlements.undelete(\n "id",\n)',
@@ -5908,10 +5501,6 @@ const EMBEDDED_METHODS = [
5908
5501
  method: 'credit_entitlements.undelete',
5909
5502
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nresult = dodo_payments.credit_entitlements.undelete("id")\n\nputs(result)',
5910
5503
  },
5911
- cli: {
5912
- method: 'credit_entitlements undelete',
5913
- example: "dodo-payments-cli credit-entitlements undelete \\\n --bearer-token 'My Bearer Token' \\\n --id id",
5914
- },
5915
5504
  php: {
5916
5505
  method: 'creditEntitlements->undelete',
5917
5506
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$result = $client->creditEntitlements->undelete('id');\n\nvar_dump($result);",
@@ -5920,9 +5509,6 @@ const EMBEDDED_METHODS = [
5920
5509
  method: 'CreditEntitlements.Undelete',
5921
5510
  example: 'CreditEntitlementUndeleteParams parameters = new() { ID = "id" };\n\nawait client.CreditEntitlements.Undelete(parameters);',
5922
5511
  },
5923
- http: {
5924
- example: 'curl https://live.dodopayments.com/credit-entitlements/$ID/undelete \\\n -X POST \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
5925
- },
5926
5512
  },
5927
5513
  },
5928
5514
  {
@@ -5946,6 +5532,9 @@ const EMBEDDED_METHODS = [
5946
5532
  method: 'client.creditEntitlements.balances.list',
5947
5533
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const customerCreditBalance of client.creditEntitlements.balances.list(\n 'credit_entitlement_id',\n)) {\n console.log(customerCreditBalance.id);\n}",
5948
5534
  },
5535
+ http: {
5536
+ example: 'curl https://live.dodopayments.com/credit-entitlements/$CREDIT_ENTITLEMENT_ID/balances \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
5537
+ },
5949
5538
  python: {
5950
5539
  method: 'credit_entitlements.balances.list',
5951
5540
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\npage = client.credit_entitlements.balances.list(\n credit_entitlement_id="credit_entitlement_id",\n)\npage = page.items[0]\nprint(page.id)',
@@ -5966,10 +5555,6 @@ const EMBEDDED_METHODS = [
5966
5555
  method: 'credit_entitlements.balances.list',
5967
5556
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\npage = dodo_payments.credit_entitlements.balances.list("credit_entitlement_id")\n\nputs(page)',
5968
5557
  },
5969
- cli: {
5970
- method: 'balances list',
5971
- example: "dodo-payments-cli credit-entitlements:balances list \\\n --bearer-token 'My Bearer Token' \\\n --credit-entitlement-id credit_entitlement_id",
5972
- },
5973
5558
  php: {
5974
5559
  method: 'creditEntitlements->balances->list',
5975
5560
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$page = $client->creditEntitlements->balances->list(\n 'credit_entitlement_id', customerID: 'customer_id', pageNumber: 0, pageSize: 0\n);\n\nvar_dump($page);",
@@ -5978,9 +5563,6 @@ const EMBEDDED_METHODS = [
5978
5563
  method: 'CreditEntitlements.Balances.List',
5979
5564
  example: 'BalanceListParams parameters = new()\n{\n CreditEntitlementID = "credit_entitlement_id"\n};\n\nvar page = await client.CreditEntitlements.Balances.List(parameters);\nawait foreach (var item in page.Paginate())\n{\n Console.WriteLine(item);\n}',
5980
5565
  },
5981
- http: {
5982
- example: 'curl https://live.dodopayments.com/credit-entitlements/$CREDIT_ENTITLEMENT_ID/balances \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
5983
- },
5984
5566
  },
5985
5567
  },
5986
5568
  {
@@ -5999,6 +5581,9 @@ const EMBEDDED_METHODS = [
5999
5581
  method: 'client.creditEntitlements.balances.retrieve',
6000
5582
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst customerCreditBalance = await client.creditEntitlements.balances.retrieve('customer_id', {\n credit_entitlement_id: 'credit_entitlement_id',\n});\n\nconsole.log(customerCreditBalance.id);",
6001
5583
  },
5584
+ http: {
5585
+ example: 'curl https://live.dodopayments.com/credit-entitlements/$CREDIT_ENTITLEMENT_ID/balances/$CUSTOMER_ID \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
5586
+ },
6002
5587
  python: {
6003
5588
  method: 'credit_entitlements.balances.retrieve',
6004
5589
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\ncustomer_credit_balance = client.credit_entitlements.balances.retrieve(\n customer_id="customer_id",\n credit_entitlement_id="credit_entitlement_id",\n)\nprint(customer_credit_balance.id)',
@@ -6019,10 +5604,6 @@ const EMBEDDED_METHODS = [
6019
5604
  method: 'credit_entitlements.balances.retrieve',
6020
5605
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\ncustomer_credit_balance = dodo_payments.credit_entitlements.balances.retrieve(\n "customer_id",\n credit_entitlement_id: "credit_entitlement_id"\n)\n\nputs(customer_credit_balance)',
6021
5606
  },
6022
- cli: {
6023
- method: 'balances retrieve',
6024
- example: "dodo-payments-cli credit-entitlements:balances retrieve \\\n --bearer-token 'My Bearer Token' \\\n --credit-entitlement-id credit_entitlement_id \\\n --customer-id customer_id",
6025
- },
6026
5607
  php: {
6027
5608
  method: 'creditEntitlements->balances->retrieve',
6028
5609
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$customerCreditBalance = $client->creditEntitlements->balances->retrieve(\n 'customer_id', creditEntitlementID: 'credit_entitlement_id'\n);\n\nvar_dump($customerCreditBalance);",
@@ -6031,9 +5612,6 @@ const EMBEDDED_METHODS = [
6031
5612
  method: 'CreditEntitlements.Balances.Retrieve',
6032
5613
  example: 'BalanceRetrieveParams parameters = new()\n{\n CreditEntitlementID = "credit_entitlement_id",\n CustomerID = "customer_id",\n};\n\nvar customerCreditBalance = await client.CreditEntitlements.Balances.Retrieve(parameters);\n\nConsole.WriteLine(customerCreditBalance);',
6033
5614
  },
6034
- http: {
6035
- example: 'curl https://live.dodopayments.com/credit-entitlements/$CREDIT_ENTITLEMENT_ID/balances/$CUSTOMER_ID \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
6036
- },
6037
5615
  },
6038
5616
  },
6039
5617
  {
@@ -6058,6 +5636,9 @@ const EMBEDDED_METHODS = [
6058
5636
  method: 'client.creditEntitlements.balances.listGrants',
6059
5637
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const balanceListGrantsResponse of client.creditEntitlements.balances.listGrants(\n 'customer_id',\n { credit_entitlement_id: 'credit_entitlement_id' },\n)) {\n console.log(balanceListGrantsResponse.id);\n}",
6060
5638
  },
5639
+ http: {
5640
+ example: 'curl https://live.dodopayments.com/credit-entitlements/$CREDIT_ENTITLEMENT_ID/balances/$CUSTOMER_ID/grants \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
5641
+ },
6061
5642
  python: {
6062
5643
  method: 'credit_entitlements.balances.list_grants',
6063
5644
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\npage = client.credit_entitlements.balances.list_grants(\n customer_id="customer_id",\n credit_entitlement_id="credit_entitlement_id",\n)\npage = page.items[0]\nprint(page.id)',
@@ -6078,10 +5659,6 @@ const EMBEDDED_METHODS = [
6078
5659
  method: 'credit_entitlements.balances.list_grants',
6079
5660
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\npage = dodo_payments.credit_entitlements.balances.list_grants(\n "customer_id",\n credit_entitlement_id: "credit_entitlement_id"\n)\n\nputs(page)',
6080
5661
  },
6081
- cli: {
6082
- method: 'balances list_grants',
6083
- example: "dodo-payments-cli credit-entitlements:balances list-grants \\\n --bearer-token 'My Bearer Token' \\\n --credit-entitlement-id credit_entitlement_id \\\n --customer-id customer_id",
6084
- },
6085
5662
  php: {
6086
5663
  method: 'creditEntitlements->balances->listGrants',
6087
5664
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$page = $client->creditEntitlements->balances->listGrants(\n 'customer_id',\n creditEntitlementID: 'credit_entitlement_id',\n pageNumber: 0,\n pageSize: 0,\n status: 'active',\n);\n\nvar_dump($page);",
@@ -6090,9 +5667,6 @@ const EMBEDDED_METHODS = [
6090
5667
  method: 'CreditEntitlements.Balances.ListGrants',
6091
5668
  example: 'BalanceListGrantsParams parameters = new()\n{\n CreditEntitlementID = "credit_entitlement_id",\n CustomerID = "customer_id",\n};\n\nvar page = await client.CreditEntitlements.Balances.ListGrants(parameters);\nawait foreach (var item in page.Paginate())\n{\n Console.WriteLine(item);\n}',
6092
5669
  },
6093
- http: {
6094
- example: 'curl https://live.dodopayments.com/credit-entitlements/$CREDIT_ENTITLEMENT_ID/balances/$CUSTOMER_ID/grants \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
6095
- },
6096
5670
  },
6097
5671
  },
6098
5672
  {
@@ -6119,6 +5693,9 @@ const EMBEDDED_METHODS = [
6119
5693
  method: 'client.creditEntitlements.balances.listLedger',
6120
5694
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const creditLedgerEntry of client.creditEntitlements.balances.listLedger('customer_id', {\n credit_entitlement_id: 'credit_entitlement_id',\n})) {\n console.log(creditLedgerEntry.id);\n}",
6121
5695
  },
5696
+ http: {
5697
+ example: 'curl https://live.dodopayments.com/credit-entitlements/$CREDIT_ENTITLEMENT_ID/balances/$CUSTOMER_ID/ledger \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
5698
+ },
6122
5699
  python: {
6123
5700
  method: 'credit_entitlements.balances.list_ledger',
6124
5701
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\npage = client.credit_entitlements.balances.list_ledger(\n customer_id="customer_id",\n credit_entitlement_id="credit_entitlement_id",\n)\npage = page.items[0]\nprint(page.id)',
@@ -6139,10 +5716,6 @@ const EMBEDDED_METHODS = [
6139
5716
  method: 'credit_entitlements.balances.list_ledger',
6140
5717
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\npage = dodo_payments.credit_entitlements.balances.list_ledger(\n "customer_id",\n credit_entitlement_id: "credit_entitlement_id"\n)\n\nputs(page)',
6141
5718
  },
6142
- cli: {
6143
- method: 'balances list_ledger',
6144
- example: "dodo-payments-cli credit-entitlements:balances list-ledger \\\n --bearer-token 'My Bearer Token' \\\n --credit-entitlement-id credit_entitlement_id \\\n --customer-id customer_id",
6145
- },
6146
5719
  php: {
6147
5720
  method: 'creditEntitlements->balances->listLedger',
6148
5721
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$page = $client->creditEntitlements->balances->listLedger(\n 'customer_id',\n creditEntitlementID: 'credit_entitlement_id',\n endDate: new \\DateTimeImmutable('2019-12-27T18:11:19.117Z'),\n pageNumber: 0,\n pageSize: 0,\n startDate: new \\DateTimeImmutable('2019-12-27T18:11:19.117Z'),\n transactionType: 'transaction_type',\n);\n\nvar_dump($page);",
@@ -6151,9 +5724,6 @@ const EMBEDDED_METHODS = [
6151
5724
  method: 'CreditEntitlements.Balances.ListLedger',
6152
5725
  example: 'BalanceListLedgerParams parameters = new()\n{\n CreditEntitlementID = "credit_entitlement_id",\n CustomerID = "customer_id",\n};\n\nvar page = await client.CreditEntitlements.Balances.ListLedger(parameters);\nawait foreach (var item in page.Paginate())\n{\n Console.WriteLine(item);\n}',
6153
5726
  },
6154
- http: {
6155
- example: 'curl https://live.dodopayments.com/credit-entitlements/$CREDIT_ENTITLEMENT_ID/balances/$CUSTOMER_ID/ledger \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
6156
- },
6157
5727
  },
6158
5728
  },
6159
5729
  {
@@ -6181,6 +5751,9 @@ const EMBEDDED_METHODS = [
6181
5751
  method: 'client.creditEntitlements.balances.createLedgerEntry',
6182
5752
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.creditEntitlements.balances.createLedgerEntry('customer_id', {\n credit_entitlement_id: 'credit_entitlement_id',\n amount: 'amount',\n entry_type: 'credit',\n});\n\nconsole.log(response.id);",
6183
5753
  },
5754
+ http: {
5755
+ example: 'curl https://live.dodopayments.com/credit-entitlements/$CREDIT_ENTITLEMENT_ID/balances/$CUSTOMER_ID/ledger-entries \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY" \\\n -d \'{\n "amount": "amount",\n "entry_type": "credit"\n }\'',
5756
+ },
6184
5757
  python: {
6185
5758
  method: 'credit_entitlements.balances.create_ledger_entry',
6186
5759
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.credit_entitlements.balances.create_ledger_entry(\n customer_id="customer_id",\n credit_entitlement_id="credit_entitlement_id",\n amount="amount",\n entry_type="credit",\n)\nprint(response.id)',
@@ -6201,10 +5774,6 @@ const EMBEDDED_METHODS = [
6201
5774
  method: 'credit_entitlements.balances.create_ledger_entry',
6202
5775
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nresponse = dodo_payments.credit_entitlements.balances.create_ledger_entry(\n "customer_id",\n credit_entitlement_id: "credit_entitlement_id",\n amount: "amount",\n entry_type: :credit\n)\n\nputs(response)',
6203
5776
  },
6204
- cli: {
6205
- method: 'balances create_ledger_entry',
6206
- example: "dodo-payments-cli credit-entitlements:balances create-ledger-entry \\\n --bearer-token 'My Bearer Token' \\\n --credit-entitlement-id credit_entitlement_id \\\n --customer-id customer_id \\\n --amount amount \\\n --entry-type credit",
6207
- },
6208
5777
  php: {
6209
5778
  method: 'creditEntitlements->balances->createLedgerEntry',
6210
5779
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$response = $client->creditEntitlements->balances->createLedgerEntry(\n 'customer_id',\n creditEntitlementID: 'credit_entitlement_id',\n amount: 'amount',\n entryType: LedgerEntryType::CREDIT,\n expiresAt: new \\DateTimeImmutable('2019-12-27T18:11:19.117Z'),\n idempotencyKey: 'idempotency_key',\n metadata: ['foo' => 'string'],\n reason: 'reason',\n);\n\nvar_dump($response);",
@@ -6213,9 +5782,6 @@ const EMBEDDED_METHODS = [
6213
5782
  method: 'CreditEntitlements.Balances.CreateLedgerEntry',
6214
5783
  example: 'BalanceCreateLedgerEntryParams parameters = new()\n{\n CreditEntitlementID = "credit_entitlement_id",\n CustomerID = "customer_id",\n Amount = "amount",\n EntryType = LedgerEntryType.Credit,\n};\n\nvar response = await client.CreditEntitlements.Balances.CreateLedgerEntry(parameters);\n\nConsole.WriteLine(response);',
6215
5784
  },
6216
- http: {
6217
- example: 'curl https://live.dodopayments.com/credit-entitlements/$CREDIT_ENTITLEMENT_ID/balances/$CUSTOMER_ID/ledger-entries \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY" \\\n -d \'{\n "amount": "amount",\n "entry_type": "credit"\n }\'',
6218
- },
6219
5785
  },
6220
5786
  },
6221
5787
  {
@@ -6238,6 +5804,9 @@ const EMBEDDED_METHODS = [
6238
5804
  method: 'client.entitlements.list',
6239
5805
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const entitlement of client.entitlements.list()) {\n console.log(entitlement.id);\n}",
6240
5806
  },
5807
+ http: {
5808
+ example: 'curl https://live.dodopayments.com/entitlements \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
5809
+ },
6241
5810
  python: {
6242
5811
  method: 'entitlements.list',
6243
5812
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\npage = client.entitlements.list()\npage = page.items[0]\nprint(page.id)',
@@ -6258,10 +5827,6 @@ const EMBEDDED_METHODS = [
6258
5827
  method: 'entitlements.list',
6259
5828
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\npage = dodo_payments.entitlements.list\n\nputs(page)',
6260
5829
  },
6261
- cli: {
6262
- method: 'entitlements list',
6263
- example: "dodo-payments-cli entitlements list \\\n --bearer-token 'My Bearer Token'",
6264
- },
6265
5830
  php: {
6266
5831
  method: 'entitlements->list',
6267
5832
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$page = $client->entitlements->list(\n integrationType: 'discord', pageNumber: 0, pageSize: 0\n);\n\nvar_dump($page);",
@@ -6270,9 +5835,6 @@ const EMBEDDED_METHODS = [
6270
5835
  method: 'Entitlements.List',
6271
5836
  example: 'EntitlementListParams parameters = new();\n\nvar page = await client.Entitlements.List(parameters);\nawait foreach (var item in page.Paginate())\n{\n Console.WriteLine(item);\n}',
6272
5837
  },
6273
- http: {
6274
- example: 'curl https://live.dodopayments.com/entitlements \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
6275
- },
6276
5838
  },
6277
5839
  },
6278
5840
  {
@@ -6297,6 +5859,9 @@ const EMBEDDED_METHODS = [
6297
5859
  method: 'client.entitlements.create',
6298
5860
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst entitlement = await client.entitlements.create({\n integration_config: { permission: 'pull', target_id: 'target_id' },\n integration_type: 'discord',\n name: 'name',\n});\n\nconsole.log(entitlement.id);",
6299
5861
  },
5862
+ http: {
5863
+ example: 'curl https://live.dodopayments.com/entitlements \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY" \\\n -d \'{\n "integration_config": {\n "permission": "pull",\n "target_id": "target_id"\n },\n "integration_type": "discord",\n "name": "name"\n }\'',
5864
+ },
6300
5865
  python: {
6301
5866
  method: 'entitlements.create',
6302
5867
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nentitlement = client.entitlements.create(\n integration_config={\n "permission": "pull",\n "target_id": "target_id",\n },\n integration_type="discord",\n name="name",\n)\nprint(entitlement.id)',
@@ -6317,10 +5882,6 @@ const EMBEDDED_METHODS = [
6317
5882
  method: 'entitlements.create',
6318
5883
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nentitlement = dodo_payments.entitlements.create(\n integration_config: {permission: :pull, target_id: "target_id"},\n integration_type: :discord,\n name: "name"\n)\n\nputs(entitlement)',
6319
5884
  },
6320
- cli: {
6321
- method: 'entitlements create',
6322
- example: "dodo-payments-cli entitlements create \\\n --bearer-token 'My Bearer Token' \\\n --integration-config '{permission: pull, target_id: target_id}' \\\n --integration-type discord \\\n --name name",
6323
- },
6324
5885
  php: {
6325
5886
  method: 'entitlements->create',
6326
5887
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$entitlement = $client->entitlements->create(\n integrationConfig: [\n 'permission' => GitHubPermission::PULL, 'targetID' => 'target_id'\n ],\n integrationType: EntitlementIntegrationType::DISCORD,\n name: 'name',\n description: 'description',\n metadata: ['foo' => 'string'],\n);\n\nvar_dump($entitlement);",
@@ -6329,9 +5890,6 @@ const EMBEDDED_METHODS = [
6329
5890
  method: 'Entitlements.Create',
6330
5891
  example: 'EntitlementCreateParams parameters = new()\n{\n IntegrationConfig = new GitHubConfig()\n {\n Permission = GitHubPermission.Pull,\n TargetID = "target_id",\n },\n IntegrationType = EntitlementIntegrationType.Discord,\n Name = "name",\n};\n\nvar entitlement = await client.Entitlements.Create(parameters);\n\nConsole.WriteLine(entitlement);',
6331
5892
  },
6332
- http: {
6333
- example: 'curl https://live.dodopayments.com/entitlements \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY" \\\n -d \'{\n "integration_config": {\n "permission": "pull",\n "target_id": "target_id"\n },\n "integration_type": "discord",\n "name": "name"\n }\'',
6334
- },
6335
5893
  },
6336
5894
  },
6337
5895
  {
@@ -6350,6 +5908,9 @@ const EMBEDDED_METHODS = [
6350
5908
  method: 'client.entitlements.retrieve',
6351
5909
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst entitlement = await client.entitlements.retrieve('id');\n\nconsole.log(entitlement.id);",
6352
5910
  },
5911
+ http: {
5912
+ example: 'curl https://live.dodopayments.com/entitlements/$ID \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
5913
+ },
6353
5914
  python: {
6354
5915
  method: 'entitlements.retrieve',
6355
5916
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nentitlement = client.entitlements.retrieve(\n "id",\n)\nprint(entitlement.id)',
@@ -6370,10 +5931,6 @@ const EMBEDDED_METHODS = [
6370
5931
  method: 'entitlements.retrieve',
6371
5932
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nentitlement = dodo_payments.entitlements.retrieve("id")\n\nputs(entitlement)',
6372
5933
  },
6373
- cli: {
6374
- method: 'entitlements retrieve',
6375
- example: "dodo-payments-cli entitlements retrieve \\\n --bearer-token 'My Bearer Token' \\\n --id id",
6376
- },
6377
5934
  php: {
6378
5935
  method: 'entitlements->retrieve',
6379
5936
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$entitlement = $client->entitlements->retrieve('id');\n\nvar_dump($entitlement);",
@@ -6382,9 +5939,6 @@ const EMBEDDED_METHODS = [
6382
5939
  method: 'Entitlements.Retrieve',
6383
5940
  example: 'EntitlementRetrieveParams parameters = new() { ID = "id" };\n\nvar entitlement = await client.Entitlements.Retrieve(parameters);\n\nConsole.WriteLine(entitlement);',
6384
5941
  },
6385
- http: {
6386
- example: 'curl https://live.dodopayments.com/entitlements/$ID \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
6387
- },
6388
5942
  },
6389
5943
  },
6390
5944
  {
@@ -6402,6 +5956,9 @@ const EMBEDDED_METHODS = [
6402
5956
  method: 'client.entitlements.delete',
6403
5957
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.entitlements.delete('id');",
6404
5958
  },
5959
+ http: {
5960
+ example: 'curl https://live.dodopayments.com/entitlements/$ID \\\n -X DELETE \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
5961
+ },
6405
5962
  python: {
6406
5963
  method: 'entitlements.delete',
6407
5964
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nclient.entitlements.delete(\n "id",\n)',
@@ -6422,10 +5979,6 @@ const EMBEDDED_METHODS = [
6422
5979
  method: 'entitlements.delete',
6423
5980
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nresult = dodo_payments.entitlements.delete("id")\n\nputs(result)',
6424
5981
  },
6425
- cli: {
6426
- method: 'entitlements delete',
6427
- example: "dodo-payments-cli entitlements delete \\\n --bearer-token 'My Bearer Token' \\\n --id id",
6428
- },
6429
5982
  php: {
6430
5983
  method: 'entitlements->delete',
6431
5984
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$result = $client->entitlements->delete('id');\n\nvar_dump($result);",
@@ -6434,9 +5987,6 @@ const EMBEDDED_METHODS = [
6434
5987
  method: 'Entitlements.Delete',
6435
5988
  example: 'EntitlementDeleteParams parameters = new() { ID = "id" };\n\nawait client.Entitlements.Delete(parameters);',
6436
5989
  },
6437
- http: {
6438
- example: 'curl https://live.dodopayments.com/entitlements/$ID \\\n -X DELETE \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
6439
- },
6440
5990
  },
6441
5991
  },
6442
5992
  {
@@ -6461,6 +6011,9 @@ const EMBEDDED_METHODS = [
6461
6011
  method: 'client.entitlements.update',
6462
6012
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst entitlement = await client.entitlements.update('id');\n\nconsole.log(entitlement.id);",
6463
6013
  },
6014
+ http: {
6015
+ example: "curl https://live.dodopayments.com/entitlements/$ID \\\n -X PATCH \\\n -H 'Content-Type: application/json' \\\n -H \"Authorization: Bearer $DODO_PAYMENTS_API_KEY\" \\\n -d '{}'",
6016
+ },
6464
6017
  python: {
6465
6018
  method: 'entitlements.update',
6466
6019
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nentitlement = client.entitlements.update(\n id="id",\n)\nprint(entitlement.id)',
@@ -6481,10 +6034,6 @@ const EMBEDDED_METHODS = [
6481
6034
  method: 'entitlements.update',
6482
6035
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nentitlement = dodo_payments.entitlements.update("id")\n\nputs(entitlement)',
6483
6036
  },
6484
- cli: {
6485
- method: 'entitlements update',
6486
- example: "dodo-payments-cli entitlements update \\\n --bearer-token 'My Bearer Token' \\\n --id id",
6487
- },
6488
6037
  php: {
6489
6038
  method: 'entitlements->update',
6490
6039
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$entitlement = $client->entitlements->update(\n 'id',\n description: 'description',\n integrationConfig: [\n 'permission' => GitHubPermission::PULL, 'targetID' => 'target_id'\n ],\n metadata: ['foo' => 'string'],\n name: 'name',\n);\n\nvar_dump($entitlement);",
@@ -6493,9 +6042,6 @@ const EMBEDDED_METHODS = [
6493
6042
  method: 'Entitlements.Update',
6494
6043
  example: 'EntitlementUpdateParams parameters = new() { ID = "id" };\n\nvar entitlement = await client.Entitlements.Update(parameters);\n\nConsole.WriteLine(entitlement);',
6495
6044
  },
6496
- http: {
6497
- example: "curl https://live.dodopayments.com/entitlements/$ID \\\n -X PATCH \\\n -H 'Content-Type: application/json' \\\n -H \"Authorization: Bearer $DODO_PAYMENTS_API_KEY\" \\\n -d '{}'",
6498
- },
6499
6045
  },
6500
6046
  },
6501
6047
  {
@@ -6514,6 +6060,9 @@ const EMBEDDED_METHODS = [
6514
6060
  method: 'client.entitlements.files.upload',
6515
6061
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.entitlements.files.upload('id');\n\nconsole.log(response.file_id);",
6516
6062
  },
6063
+ http: {
6064
+ example: 'curl https://live.dodopayments.com/entitlements/$ID/files \\\n -X POST \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
6065
+ },
6517
6066
  python: {
6518
6067
  method: 'entitlements.files.upload',
6519
6068
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.entitlements.files.upload(\n "id",\n)\nprint(response.file_id)',
@@ -6534,10 +6083,6 @@ const EMBEDDED_METHODS = [
6534
6083
  method: 'entitlements.files.upload',
6535
6084
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nresponse = dodo_payments.entitlements.files.upload("id")\n\nputs(response)',
6536
6085
  },
6537
- cli: {
6538
- method: 'files upload',
6539
- example: "dodo-payments-cli entitlements:files upload \\\n --bearer-token 'My Bearer Token' \\\n --id id",
6540
- },
6541
6086
  php: {
6542
6087
  method: 'entitlements->files->upload',
6543
6088
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$response = $client->entitlements->files->upload('id');\n\nvar_dump($response);",
@@ -6546,9 +6091,6 @@ const EMBEDDED_METHODS = [
6546
6091
  method: 'Entitlements.Files.Upload',
6547
6092
  example: 'FileUploadParams parameters = new() { ID = "id" };\n\nvar response = await client.Entitlements.Files.Upload(parameters);\n\nConsole.WriteLine(response);',
6548
6093
  },
6549
- http: {
6550
- example: 'curl https://live.dodopayments.com/entitlements/$ID/files \\\n -X POST \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
6551
- },
6552
6094
  },
6553
6095
  },
6554
6096
  {
@@ -6566,6 +6108,9 @@ const EMBEDDED_METHODS = [
6566
6108
  method: 'client.entitlements.files.delete',
6567
6109
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.entitlements.files.delete('file_id', { id: 'id' });",
6568
6110
  },
6111
+ http: {
6112
+ example: 'curl https://live.dodopayments.com/entitlements/$ID/files/$FILE_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
6113
+ },
6569
6114
  python: {
6570
6115
  method: 'entitlements.files.delete',
6571
6116
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nclient.entitlements.files.delete(\n file_id="file_id",\n id="id",\n)',
@@ -6586,10 +6131,6 @@ const EMBEDDED_METHODS = [
6586
6131
  method: 'entitlements.files.delete',
6587
6132
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nresult = dodo_payments.entitlements.files.delete("file_id", id: "id")\n\nputs(result)',
6588
6133
  },
6589
- cli: {
6590
- method: 'files delete',
6591
- example: "dodo-payments-cli entitlements:files delete \\\n --bearer-token 'My Bearer Token' \\\n --id id \\\n --file-id file_id",
6592
- },
6593
6134
  php: {
6594
6135
  method: 'entitlements->files->delete',
6595
6136
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$result = $client->entitlements->files->delete('file_id', id: 'id');\n\nvar_dump($result);",
@@ -6598,9 +6139,6 @@ const EMBEDDED_METHODS = [
6598
6139
  method: 'Entitlements.Files.Delete',
6599
6140
  example: 'FileDeleteParams parameters = new()\n{\n ID = "id",\n FileID = "file_id",\n};\n\nawait client.Entitlements.Files.Delete(parameters);',
6600
6141
  },
6601
- http: {
6602
- example: 'curl https://live.dodopayments.com/entitlements/$ID/files/$FILE_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
6603
- },
6604
6142
  },
6605
6143
  },
6606
6144
  {
@@ -6625,6 +6163,9 @@ const EMBEDDED_METHODS = [
6625
6163
  method: 'client.entitlements.grants.list',
6626
6164
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const entitlementGrant of client.entitlements.grants.list('id')) {\n console.log(entitlementGrant.id);\n}",
6627
6165
  },
6166
+ http: {
6167
+ example: 'curl https://live.dodopayments.com/entitlements/$ID/grants \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
6168
+ },
6628
6169
  python: {
6629
6170
  method: 'entitlements.grants.list',
6630
6171
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\npage = client.entitlements.grants.list(\n id="id",\n)\npage = page.items[0]\nprint(page.id)',
@@ -6645,10 +6186,6 @@ const EMBEDDED_METHODS = [
6645
6186
  method: 'entitlements.grants.list',
6646
6187
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\npage = dodo_payments.entitlements.grants.list("id")\n\nputs(page)',
6647
6188
  },
6648
- cli: {
6649
- method: 'grants list',
6650
- example: "dodo-payments-cli entitlements:grants list \\\n --bearer-token 'My Bearer Token' \\\n --id id",
6651
- },
6652
6189
  php: {
6653
6190
  method: 'entitlements->grants->list',
6654
6191
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$page = $client->entitlements->grants->list(\n 'id', customerID: 'customer_id', pageNumber: 0, pageSize: 0, status: 'Pending'\n);\n\nvar_dump($page);",
@@ -6657,9 +6194,6 @@ const EMBEDDED_METHODS = [
6657
6194
  method: 'Entitlements.Grants.List',
6658
6195
  example: 'GrantListParams parameters = new() { ID = "id" };\n\nvar page = await client.Entitlements.Grants.List(parameters);\nawait foreach (var item in page.Paginate())\n{\n Console.WriteLine(item);\n}',
6659
6196
  },
6660
- http: {
6661
- example: 'curl https://live.dodopayments.com/entitlements/$ID/grants \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
6662
- },
6663
6197
  },
6664
6198
  },
6665
6199
  {
@@ -6678,6 +6212,9 @@ const EMBEDDED_METHODS = [
6678
6212
  method: 'client.entitlements.grants.revoke',
6679
6213
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst entitlementGrant = await client.entitlements.grants.revoke('grant_id', { id: 'id' });\n\nconsole.log(entitlementGrant.id);",
6680
6214
  },
6215
+ http: {
6216
+ example: 'curl https://live.dodopayments.com/entitlements/$ID/grants/$GRANT_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
6217
+ },
6681
6218
  python: {
6682
6219
  method: 'entitlements.grants.revoke',
6683
6220
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nentitlement_grant = client.entitlements.grants.revoke(\n grant_id="grant_id",\n id="id",\n)\nprint(entitlement_grant.id)',
@@ -6698,10 +6235,6 @@ const EMBEDDED_METHODS = [
6698
6235
  method: 'entitlements.grants.revoke',
6699
6236
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nentitlement_grant = dodo_payments.entitlements.grants.revoke("grant_id", id: "id")\n\nputs(entitlement_grant)',
6700
6237
  },
6701
- cli: {
6702
- method: 'grants revoke',
6703
- example: "dodo-payments-cli entitlements:grants revoke \\\n --bearer-token 'My Bearer Token' \\\n --id id \\\n --grant-id grant_id",
6704
- },
6705
6238
  php: {
6706
6239
  method: 'entitlements->grants->revoke',
6707
6240
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$entitlementGrant = $client->entitlements->grants->revoke('grant_id', id: 'id');\n\nvar_dump($entitlementGrant);",
@@ -6710,9 +6243,6 @@ const EMBEDDED_METHODS = [
6710
6243
  method: 'Entitlements.Grants.Revoke',
6711
6244
  example: 'GrantRevokeParams parameters = new()\n{\n ID = "id",\n GrantID = "grant_id",\n};\n\nvar entitlementGrant = await client.Entitlements.Grants.Revoke(parameters);\n\nConsole.WriteLine(entitlementGrant);',
6712
6245
  },
6713
- http: {
6714
- example: 'curl https://live.dodopayments.com/entitlements/$ID/grants/$GRANT_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
6715
- },
6716
6246
  },
6717
6247
  },
6718
6248
  {
@@ -6731,6 +6261,9 @@ const EMBEDDED_METHODS = [
6731
6261
  method: 'client.productCollections.list',
6732
6262
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const productCollectionListResponse of client.productCollections.list()) {\n console.log(productCollectionListResponse.id);\n}",
6733
6263
  },
6264
+ http: {
6265
+ example: 'curl https://live.dodopayments.com/product-collections \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
6266
+ },
6734
6267
  python: {
6735
6268
  method: 'product_collections.list',
6736
6269
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\npage = client.product_collections.list()\npage = page.items[0]\nprint(page.id)',
@@ -6751,10 +6284,6 @@ const EMBEDDED_METHODS = [
6751
6284
  method: 'product_collections.list',
6752
6285
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\npage = dodo_payments.product_collections.list\n\nputs(page)',
6753
6286
  },
6754
- cli: {
6755
- method: 'product_collections list',
6756
- example: "dodo-payments-cli product-collections list \\\n --bearer-token 'My Bearer Token'",
6757
- },
6758
6287
  php: {
6759
6288
  method: 'productCollections->list',
6760
6289
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$page = $client->productCollections->list(\n archived: true, brandID: 'brand_id', pageNumber: 0, pageSize: 0\n);\n\nvar_dump($page);",
@@ -6763,9 +6292,6 @@ const EMBEDDED_METHODS = [
6763
6292
  method: 'ProductCollections.List',
6764
6293
  example: 'ProductCollectionListParams parameters = new();\n\nvar page = await client.ProductCollections.List(parameters);\nawait foreach (var item in page.Paginate())\n{\n Console.WriteLine(item);\n}',
6765
6294
  },
6766
- http: {
6767
- example: 'curl https://live.dodopayments.com/product-collections \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
6768
- },
6769
6295
  },
6770
6296
  },
6771
6297
  {
@@ -6789,6 +6315,9 @@ const EMBEDDED_METHODS = [
6789
6315
  method: 'client.productCollections.create',
6790
6316
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst productCollection = await client.productCollections.create({\n groups: [{ products: [{ product_id: 'product_id' }] }],\n name: 'name',\n});\n\nconsole.log(productCollection.id);",
6791
6317
  },
6318
+ http: {
6319
+ example: 'curl https://live.dodopayments.com/product-collections \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY" \\\n -d \'{\n "groups": [\n {\n "products": [\n {\n "product_id": "product_id"\n }\n ]\n }\n ],\n "name": "name"\n }\'',
6320
+ },
6792
6321
  python: {
6793
6322
  method: 'product_collections.create',
6794
6323
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nproduct_collection = client.product_collections.create(\n groups=[{\n "products": [{\n "product_id": "product_id"\n }]\n }],\n name="name",\n)\nprint(product_collection.id)',
@@ -6809,10 +6338,6 @@ const EMBEDDED_METHODS = [
6809
6338
  method: 'product_collections.create',
6810
6339
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nproduct_collection = dodo_payments.product_collections.create(groups: [{products: [{product_id: "product_id"}]}], name: "name")\n\nputs(product_collection)',
6811
6340
  },
6812
- cli: {
6813
- method: 'product_collections create',
6814
- example: "dodo-payments-cli product-collections create \\\n --bearer-token 'My Bearer Token' \\\n --group '{products: [{product_id: product_id}]}' \\\n --name name",
6815
- },
6816
6341
  php: {
6817
6342
  method: 'productCollections->create',
6818
6343
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$productCollection = $client->productCollections->create(\n groups: [\n [\n 'products' => [['productID' => 'product_id', 'status' => true]],\n 'groupName' => 'group_name',\n 'status' => true,\n ],\n ],\n name: 'name',\n brandID: 'brand_id',\n description: 'description',\n);\n\nvar_dump($productCollection);",
@@ -6821,9 +6346,6 @@ const EMBEDDED_METHODS = [
6821
6346
  method: 'ProductCollections.Create',
6822
6347
  example: 'ProductCollectionCreateParams parameters = new()\n{\n Groups =\n [\n new()\n {\n Products =\n [\n new()\n {\n ProductID = "product_id",\n Status = true,\n },\n ],\n GroupName = "group_name",\n Status = true,\n },\n ],\n Name = "name",\n};\n\nvar productCollection = await client.ProductCollections.Create(parameters);\n\nConsole.WriteLine(productCollection);',
6823
6348
  },
6824
- http: {
6825
- example: 'curl https://live.dodopayments.com/product-collections \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY" \\\n -d \'{\n "groups": [\n {\n "products": [\n {\n "product_id": "product_id"\n }\n ]\n }\n ],\n "name": "name"\n }\'',
6826
- },
6827
6349
  },
6828
6350
  },
6829
6351
  {
@@ -6842,6 +6364,9 @@ const EMBEDDED_METHODS = [
6842
6364
  method: 'client.productCollections.retrieve',
6843
6365
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst productCollection = await client.productCollections.retrieve('id');\n\nconsole.log(productCollection.id);",
6844
6366
  },
6367
+ http: {
6368
+ example: 'curl https://live.dodopayments.com/product-collections/$ID \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
6369
+ },
6845
6370
  python: {
6846
6371
  method: 'product_collections.retrieve',
6847
6372
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nproduct_collection = client.product_collections.retrieve(\n "id",\n)\nprint(product_collection.id)',
@@ -6862,10 +6387,6 @@ const EMBEDDED_METHODS = [
6862
6387
  method: 'product_collections.retrieve',
6863
6388
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nproduct_collection = dodo_payments.product_collections.retrieve("id")\n\nputs(product_collection)',
6864
6389
  },
6865
- cli: {
6866
- method: 'product_collections retrieve',
6867
- example: "dodo-payments-cli product-collections retrieve \\\n --bearer-token 'My Bearer Token' \\\n --id id",
6868
- },
6869
6390
  php: {
6870
6391
  method: 'productCollections->retrieve',
6871
6392
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$productCollection = $client->productCollections->retrieve('id');\n\nvar_dump($productCollection);",
@@ -6874,9 +6395,6 @@ const EMBEDDED_METHODS = [
6874
6395
  method: 'ProductCollections.Retrieve',
6875
6396
  example: 'ProductCollectionRetrieveParams parameters = new() { ID = "id" };\n\nvar productCollection = await client.ProductCollections.Retrieve(parameters);\n\nConsole.WriteLine(productCollection);',
6876
6397
  },
6877
- http: {
6878
- example: 'curl https://live.dodopayments.com/product-collections/$ID \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
6879
- },
6880
6398
  },
6881
6399
  },
6882
6400
  {
@@ -6894,6 +6412,9 @@ const EMBEDDED_METHODS = [
6894
6412
  method: 'client.productCollections.delete',
6895
6413
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.productCollections.delete('id');",
6896
6414
  },
6415
+ http: {
6416
+ example: 'curl https://live.dodopayments.com/product-collections/$ID \\\n -X DELETE \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
6417
+ },
6897
6418
  python: {
6898
6419
  method: 'product_collections.delete',
6899
6420
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nclient.product_collections.delete(\n "id",\n)',
@@ -6914,10 +6435,6 @@ const EMBEDDED_METHODS = [
6914
6435
  method: 'product_collections.delete',
6915
6436
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nresult = dodo_payments.product_collections.delete("id")\n\nputs(result)',
6916
6437
  },
6917
- cli: {
6918
- method: 'product_collections delete',
6919
- example: "dodo-payments-cli product-collections delete \\\n --bearer-token 'My Bearer Token' \\\n --id id",
6920
- },
6921
6438
  php: {
6922
6439
  method: 'productCollections->delete',
6923
6440
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$result = $client->productCollections->delete('id');\n\nvar_dump($result);",
@@ -6926,9 +6443,6 @@ const EMBEDDED_METHODS = [
6926
6443
  method: 'ProductCollections.Delete',
6927
6444
  example: 'ProductCollectionDeleteParams parameters = new() { ID = "id" };\n\nawait client.ProductCollections.Delete(parameters);',
6928
6445
  },
6929
- http: {
6930
- example: 'curl https://live.dodopayments.com/product-collections/$ID \\\n -X DELETE \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
6931
- },
6932
6446
  },
6933
6447
  },
6934
6448
  {
@@ -6953,6 +6467,9 @@ const EMBEDDED_METHODS = [
6953
6467
  method: 'client.productCollections.update',
6954
6468
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.productCollections.update('id');",
6955
6469
  },
6470
+ http: {
6471
+ example: "curl https://live.dodopayments.com/product-collections/$ID \\\n -X PATCH \\\n -H 'Content-Type: application/json' \\\n -H \"Authorization: Bearer $DODO_PAYMENTS_API_KEY\" \\\n -d '{}'",
6472
+ },
6956
6473
  python: {
6957
6474
  method: 'product_collections.update',
6958
6475
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nclient.product_collections.update(\n id="id",\n)',
@@ -6973,10 +6490,6 @@ const EMBEDDED_METHODS = [
6973
6490
  method: 'product_collections.update',
6974
6491
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nresult = dodo_payments.product_collections.update("id")\n\nputs(result)',
6975
6492
  },
6976
- cli: {
6977
- method: 'product_collections update',
6978
- example: "dodo-payments-cli product-collections update \\\n --bearer-token 'My Bearer Token' \\\n --id id",
6979
- },
6980
6493
  php: {
6981
6494
  method: 'productCollections->update',
6982
6495
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$result = $client->productCollections->update(\n 'id',\n brandID: 'brand_id',\n description: 'description',\n groupOrder: ['182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'],\n imageID: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n name: 'name',\n);\n\nvar_dump($result);",
@@ -6985,9 +6498,6 @@ const EMBEDDED_METHODS = [
6985
6498
  method: 'ProductCollections.Update',
6986
6499
  example: 'ProductCollectionUpdateParams parameters = new() { ID = "id" };\n\nawait client.ProductCollections.Update(parameters);',
6987
6500
  },
6988
- http: {
6989
- example: "curl https://live.dodopayments.com/product-collections/$ID \\\n -X PATCH \\\n -H 'Content-Type: application/json' \\\n -H \"Authorization: Bearer $DODO_PAYMENTS_API_KEY\" \\\n -d '{}'",
6990
- },
6991
6501
  },
6992
6502
  },
6993
6503
  {
@@ -7006,6 +6516,9 @@ const EMBEDDED_METHODS = [
7006
6516
  method: 'client.productCollections.updateImages',
7007
6517
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.productCollections.updateImages('id');\n\nconsole.log(response.image_id);",
7008
6518
  },
6519
+ http: {
6520
+ example: 'curl https://live.dodopayments.com/product-collections/$ID/images \\\n -X PUT \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
6521
+ },
7009
6522
  python: {
7010
6523
  method: 'product_collections.update_images',
7011
6524
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.product_collections.update_images(\n id="id",\n)\nprint(response.image_id)',
@@ -7026,10 +6539,6 @@ const EMBEDDED_METHODS = [
7026
6539
  method: 'product_collections.update_images',
7027
6540
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nresponse = dodo_payments.product_collections.update_images("id")\n\nputs(response)',
7028
6541
  },
7029
- cli: {
7030
- method: 'product_collections update_images',
7031
- example: "dodo-payments-cli product-collections update-images \\\n --bearer-token 'My Bearer Token' \\\n --id id",
7032
- },
7033
6542
  php: {
7034
6543
  method: 'productCollections->updateImages',
7035
6544
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$response = $client->productCollections->updateImages('id', forceUpdate: true);\n\nvar_dump($response);",
@@ -7038,9 +6547,6 @@ const EMBEDDED_METHODS = [
7038
6547
  method: 'ProductCollections.UpdateImages',
7039
6548
  example: 'ProductCollectionUpdateImagesParams parameters = new() { ID = "id" };\n\nvar response = await client.ProductCollections.UpdateImages(parameters);\n\nConsole.WriteLine(response);',
7040
6549
  },
7041
- http: {
7042
- example: 'curl https://live.dodopayments.com/product-collections/$ID/images \\\n -X PUT \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
7043
- },
7044
6550
  },
7045
6551
  },
7046
6552
  {
@@ -7059,6 +6565,9 @@ const EMBEDDED_METHODS = [
7059
6565
  method: 'client.productCollections.unarchive',
7060
6566
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.productCollections.unarchive('id');\n\nconsole.log(response.collection_id);",
7061
6567
  },
6568
+ http: {
6569
+ example: 'curl https://live.dodopayments.com/product-collections/$ID/unarchive \\\n -X POST \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
6570
+ },
7062
6571
  python: {
7063
6572
  method: 'product_collections.unarchive',
7064
6573
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.product_collections.unarchive(\n "id",\n)\nprint(response.collection_id)',
@@ -7079,10 +6588,6 @@ const EMBEDDED_METHODS = [
7079
6588
  method: 'product_collections.unarchive',
7080
6589
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nresponse = dodo_payments.product_collections.unarchive("id")\n\nputs(response)',
7081
6590
  },
7082
- cli: {
7083
- method: 'product_collections unarchive',
7084
- example: "dodo-payments-cli product-collections unarchive \\\n --bearer-token 'My Bearer Token' \\\n --id id",
7085
- },
7086
6591
  php: {
7087
6592
  method: 'productCollections->unarchive',
7088
6593
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$response = $client->productCollections->unarchive('id');\n\nvar_dump($response);",
@@ -7091,9 +6596,6 @@ const EMBEDDED_METHODS = [
7091
6596
  method: 'ProductCollections.Unarchive',
7092
6597
  example: 'ProductCollectionUnarchiveParams parameters = new() { ID = "id" };\n\nvar response = await client.ProductCollections.Unarchive(parameters);\n\nConsole.WriteLine(response);',
7093
6598
  },
7094
- http: {
7095
- example: 'curl https://live.dodopayments.com/product-collections/$ID/unarchive \\\n -X POST \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
7096
- },
7097
6599
  },
7098
6600
  },
7099
6601
  {
@@ -7117,6 +6619,9 @@ const EMBEDDED_METHODS = [
7117
6619
  method: 'client.productCollections.groups.create',
7118
6620
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst productCollectionGroupResponse = await client.productCollections.groups.create('id', {\n products: [{ product_id: 'product_id' }],\n});\n\nconsole.log(productCollectionGroupResponse.group_id);",
7119
6621
  },
6622
+ http: {
6623
+ example: 'curl https://live.dodopayments.com/product-collections/$ID/groups \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY" \\\n -d \'{\n "products": [\n {\n "product_id": "product_id"\n }\n ]\n }\'',
6624
+ },
7120
6625
  python: {
7121
6626
  method: 'product_collections.groups.create',
7122
6627
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nproduct_collection_group_response = client.product_collections.groups.create(\n id="id",\n products=[{\n "product_id": "product_id"\n }],\n)\nprint(product_collection_group_response.group_id)',
@@ -7137,10 +6642,6 @@ const EMBEDDED_METHODS = [
7137
6642
  method: 'product_collections.groups.create',
7138
6643
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nproduct_collection_group_response = dodo_payments.product_collections.groups.create("id", products: [{product_id: "product_id"}])\n\nputs(product_collection_group_response)',
7139
6644
  },
7140
- cli: {
7141
- method: 'groups create',
7142
- example: "dodo-payments-cli product-collections:groups create \\\n --bearer-token 'My Bearer Token' \\\n --id id \\\n --product '{product_id: product_id}'",
7143
- },
7144
6645
  php: {
7145
6646
  method: 'productCollections->groups->create',
7146
6647
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$productCollectionGroupResponse = $client->productCollections->groups->create(\n 'id',\n products: [['productID' => 'product_id', 'status' => true]],\n groupName: 'group_name',\n status: true,\n);\n\nvar_dump($productCollectionGroupResponse);",
@@ -7149,9 +6650,6 @@ const EMBEDDED_METHODS = [
7149
6650
  method: 'ProductCollections.Groups.Create',
7150
6651
  example: 'GroupCreateParams parameters = new()\n{\n ID = "id",\n Products =\n [\n new()\n {\n ProductID = "product_id",\n Status = true,\n },\n ],\n};\n\nvar productCollectionGroupResponse = await client.ProductCollections.Groups.Create(parameters);\n\nConsole.WriteLine(productCollectionGroupResponse);',
7151
6652
  },
7152
- http: {
7153
- example: 'curl https://live.dodopayments.com/product-collections/$ID/groups \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY" \\\n -d \'{\n "products": [\n {\n "product_id": "product_id"\n }\n ]\n }\'',
7154
- },
7155
6653
  },
7156
6654
  },
7157
6655
  {
@@ -7169,6 +6667,9 @@ const EMBEDDED_METHODS = [
7169
6667
  method: 'client.productCollections.groups.delete',
7170
6668
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.productCollections.groups.delete('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { id: 'id' });",
7171
6669
  },
6670
+ http: {
6671
+ example: 'curl https://live.dodopayments.com/product-collections/$ID/groups/$GROUP_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
6672
+ },
7172
6673
  python: {
7173
6674
  method: 'product_collections.groups.delete',
7174
6675
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nclient.product_collections.groups.delete(\n group_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n id="id",\n)',
@@ -7189,10 +6690,6 @@ const EMBEDDED_METHODS = [
7189
6690
  method: 'product_collections.groups.delete',
7190
6691
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nresult = dodo_payments.product_collections.groups.delete("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", id: "id")\n\nputs(result)',
7191
6692
  },
7192
- cli: {
7193
- method: 'groups delete',
7194
- example: "dodo-payments-cli product-collections:groups delete \\\n --bearer-token 'My Bearer Token' \\\n --id id \\\n --group-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
7195
- },
7196
6693
  php: {
7197
6694
  method: 'productCollections->groups->delete',
7198
6695
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$result = $client->productCollections->groups->delete(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', id: 'id'\n);\n\nvar_dump($result);",
@@ -7201,9 +6698,6 @@ const EMBEDDED_METHODS = [
7201
6698
  method: 'ProductCollections.Groups.Delete',
7202
6699
  example: 'GroupDeleteParams parameters = new()\n{\n ID = "id",\n GroupID = "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n};\n\nawait client.ProductCollections.Groups.Delete(parameters);',
7203
6700
  },
7204
- http: {
7205
- example: 'curl https://live.dodopayments.com/product-collections/$ID/groups/$GROUP_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
7206
- },
7207
6701
  },
7208
6702
  },
7209
6703
  {
@@ -7227,6 +6721,9 @@ const EMBEDDED_METHODS = [
7227
6721
  method: 'client.productCollections.groups.update',
7228
6722
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.productCollections.groups.update('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { id: 'id' });",
7229
6723
  },
6724
+ http: {
6725
+ example: "curl https://live.dodopayments.com/product-collections/$ID/groups/$GROUP_ID \\\n -X PATCH \\\n -H 'Content-Type: application/json' \\\n -H \"Authorization: Bearer $DODO_PAYMENTS_API_KEY\" \\\n -d '{}'",
6726
+ },
7230
6727
  python: {
7231
6728
  method: 'product_collections.groups.update',
7232
6729
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nclient.product_collections.groups.update(\n group_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n id="id",\n)',
@@ -7247,10 +6744,6 @@ const EMBEDDED_METHODS = [
7247
6744
  method: 'product_collections.groups.update',
7248
6745
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nresult = dodo_payments.product_collections.groups.update("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", id: "id")\n\nputs(result)',
7249
6746
  },
7250
- cli: {
7251
- method: 'groups update',
7252
- example: "dodo-payments-cli product-collections:groups update \\\n --bearer-token 'My Bearer Token' \\\n --id id \\\n --group-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
7253
- },
7254
6747
  php: {
7255
6748
  method: 'productCollections->groups->update',
7256
6749
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$result = $client->productCollections->groups->update(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n id: 'id',\n groupName: 'group_name',\n productOrder: ['182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'],\n status: true,\n);\n\nvar_dump($result);",
@@ -7259,9 +6752,6 @@ const EMBEDDED_METHODS = [
7259
6752
  method: 'ProductCollections.Groups.Update',
7260
6753
  example: 'GroupUpdateParams parameters = new()\n{\n ID = "id",\n GroupID = "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n};\n\nawait client.ProductCollections.Groups.Update(parameters);',
7261
6754
  },
7262
- http: {
7263
- example: "curl https://live.dodopayments.com/product-collections/$ID/groups/$GROUP_ID \\\n -X PATCH \\\n -H 'Content-Type: application/json' \\\n -H \"Authorization: Bearer $DODO_PAYMENTS_API_KEY\" \\\n -d '{}'",
7264
- },
7265
6755
  },
7266
6756
  },
7267
6757
  {
@@ -7280,6 +6770,9 @@ const EMBEDDED_METHODS = [
7280
6770
  method: 'client.productCollections.groups.items.create',
7281
6771
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nconst productCollectionProducts = await client.productCollections.groups.items.create(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n { id: 'id', products: [{ product_id: 'product_id' }] },\n);\n\nconsole.log(productCollectionProducts);",
7282
6772
  },
6773
+ http: {
6774
+ example: 'curl https://live.dodopayments.com/product-collections/$ID/groups/$GROUP_ID/items \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY" \\\n -d \'{\n "products": [\n {\n "product_id": "product_id"\n }\n ]\n }\'',
6775
+ },
7283
6776
  python: {
7284
6777
  method: 'product_collections.groups.items.create',
7285
6778
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nproduct_collection_products = client.product_collections.groups.items.create(\n group_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n id="id",\n products=[{\n "product_id": "product_id"\n }],\n)\nprint(product_collection_products)',
@@ -7300,10 +6793,6 @@ const EMBEDDED_METHODS = [
7300
6793
  method: 'product_collections.groups.items.create',
7301
6794
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nproduct_collection_products = dodo_payments.product_collections.groups.items.create(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n id: "id",\n products: [{product_id: "product_id"}]\n)\n\nputs(product_collection_products)',
7302
6795
  },
7303
- cli: {
7304
- method: 'items create',
7305
- example: "dodo-payments-cli product-collections:groups:items create \\\n --bearer-token 'My Bearer Token' \\\n --id id \\\n --group-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e \\\n --product '{product_id: product_id}'",
7306
- },
7307
6796
  php: {
7308
6797
  method: 'productCollections->groups->items->create',
7309
6798
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$productCollectionProducts = $client->productCollections->groups->items->create(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n id: 'id',\n products: [['productID' => 'product_id', 'status' => true]],\n);\n\nvar_dump($productCollectionProducts);",
@@ -7312,9 +6801,6 @@ const EMBEDDED_METHODS = [
7312
6801
  method: 'ProductCollections.Groups.Items.Create',
7313
6802
  example: 'ItemCreateParams parameters = new()\n{\n ID = "id",\n GroupID = "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n Products =\n [\n new()\n {\n ProductID = "product_id",\n Status = true,\n },\n ],\n};\n\nvar productCollectionProducts = await client.ProductCollections.Groups.Items.Create(parameters);\n\nConsole.WriteLine(productCollectionProducts);',
7314
6803
  },
7315
- http: {
7316
- example: 'curl https://live.dodopayments.com/product-collections/$ID/groups/$GROUP_ID/items \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY" \\\n -d \'{\n "products": [\n {\n "product_id": "product_id"\n }\n ]\n }\'',
7317
- },
7318
6804
  },
7319
6805
  },
7320
6806
  {
@@ -7332,6 +6818,9 @@ const EMBEDDED_METHODS = [
7332
6818
  method: 'client.productCollections.groups.items.delete',
7333
6819
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.productCollections.groups.items.delete('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {\n id: 'id',\n group_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n});",
7334
6820
  },
6821
+ http: {
6822
+ example: 'curl https://live.dodopayments.com/product-collections/$ID/groups/$GROUP_ID/items/$ITEM_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
6823
+ },
7335
6824
  python: {
7336
6825
  method: 'product_collections.groups.items.delete',
7337
6826
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nclient.product_collections.groups.items.delete(\n item_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n id="id",\n group_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)',
@@ -7352,10 +6841,6 @@ const EMBEDDED_METHODS = [
7352
6841
  method: 'product_collections.groups.items.delete',
7353
6842
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nresult = dodo_payments.product_collections.groups.items.delete(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n id: "id",\n group_id: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"\n)\n\nputs(result)',
7354
6843
  },
7355
- cli: {
7356
- method: 'items delete',
7357
- example: "dodo-payments-cli product-collections:groups:items delete \\\n --bearer-token 'My Bearer Token' \\\n --id id \\\n --group-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e \\\n --item-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
7358
- },
7359
6844
  php: {
7360
6845
  method: 'productCollections->groups->items->delete',
7361
6846
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$result = $client->productCollections->groups->items->delete(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n id: 'id',\n groupID: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n);\n\nvar_dump($result);",
@@ -7364,9 +6849,6 @@ const EMBEDDED_METHODS = [
7364
6849
  method: 'ProductCollections.Groups.Items.Delete',
7365
6850
  example: 'ItemDeleteParams parameters = new()\n{\n ID = "id",\n GroupID = "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n ItemID = "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n};\n\nawait client.ProductCollections.Groups.Items.Delete(parameters);',
7366
6851
  },
7367
- http: {
7368
- example: 'curl https://live.dodopayments.com/product-collections/$ID/groups/$GROUP_ID/items/$ITEM_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY"',
7369
- },
7370
6852
  },
7371
6853
  },
7372
6854
  {
@@ -7384,6 +6866,9 @@ const EMBEDDED_METHODS = [
7384
6866
  method: 'client.productCollections.groups.items.update',
7385
6867
  example: "import DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.productCollections.groups.items.update('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {\n id: 'id',\n group_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n status: true,\n});",
7386
6868
  },
6869
+ http: {
6870
+ example: 'curl https://live.dodopayments.com/product-collections/$ID/groups/$GROUP_ID/items/$ITEM_ID \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY" \\\n -d \'{\n "status": true\n }\'',
6871
+ },
7387
6872
  python: {
7388
6873
  method: 'product_collections.groups.items.update',
7389
6874
  example: 'import os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n)\nclient.product_collections.groups.items.update(\n item_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n id="id",\n group_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n status=True,\n)',
@@ -7404,10 +6889,6 @@ const EMBEDDED_METHODS = [
7404
6889
  method: 'product_collections.groups.items.update',
7405
6890
  example: 'require "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: "My Bearer Token",\n environment: "test_mode" # defaults to "live_mode"\n)\n\nresult = dodo_payments.product_collections.groups.items.update(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n id: "id",\n group_id: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n status: true\n)\n\nputs(result)',
7406
6891
  },
7407
- cli: {
7408
- method: 'items update',
7409
- example: "dodo-payments-cli product-collections:groups:items update \\\n --bearer-token 'My Bearer Token' \\\n --id id \\\n --group-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e \\\n --item-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e \\\n --status",
7410
- },
7411
6892
  php: {
7412
6893
  method: 'productCollections->groups->items->update',
7413
6894
  example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$result = $client->productCollections->groups->items->update(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n id: 'id',\n groupID: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n status: true,\n);\n\nvar_dump($result);",
@@ -7416,24 +6897,17 @@ const EMBEDDED_METHODS = [
7416
6897
  method: 'ProductCollections.Groups.Items.Update',
7417
6898
  example: 'ItemUpdateParams parameters = new()\n{\n ID = "id",\n GroupID = "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n ItemID = "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n Status = true,\n};\n\nawait client.ProductCollections.Groups.Items.Update(parameters);',
7418
6899
  },
7419
- http: {
7420
- example: 'curl https://live.dodopayments.com/product-collections/$ID/groups/$GROUP_ID/items/$ITEM_ID \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $DODO_PAYMENTS_API_KEY" \\\n -d \'{\n "status": true\n }\'',
7421
- },
7422
6900
  },
7423
6901
  },
7424
6902
  ];
7425
6903
  const EMBEDDED_READMES = [
7426
6904
  {
7427
- language: 'cli',
7428
- content: "# Dodo Payments CLI\n\nThe official CLI for the [Dodo Payments REST API](https://docs.dodopayments.com/api-reference/introduction).\n\nIt is generated with [Stainless](https://www.stainless.com/).\n\n## Installation\n\n### Installing with Go\n\nTo test or install the CLI locally, you need [Go](https://go.dev/doc/install) version 1.22 or later installed.\n\n~~~sh\ngo install 'github.com/stainless-sdks/dodo-payments-cli/cmd/dodo-payments-cli@latest'\n~~~\n\nOnce you have run `go install`, the binary is placed in your Go bin directory:\n\n- **Default location**: `$HOME/go/bin` (or `$GOPATH/bin` if GOPATH is set)\n- **Check your path**: Run `go env GOPATH` to see the base directory\n\nIf commands aren't found after installation, add the Go bin directory to your PATH:\n\n~~~sh\n# Add to your shell profile (.zshrc, .bashrc, etc.)\nexport PATH=\"$PATH:$(go env GOPATH)/bin\"\n~~~\n\n### Running Locally\n\nAfter cloning the git repository for this project, you can use the\n`scripts/run` script to run the tool locally:\n\n~~~sh\n./scripts/run args...\n~~~\n\n## Usage\n\nThe CLI follows a resource-based command structure:\n\n~~~sh\ndodo-payments-cli [resource] <command> [flags...]\n~~~\n\n~~~sh\ndodo-payments-cli checkout-sessions create \\\n --bearer-token 'My Bearer Token' \\\n --product-cart '{product_id: pdt_example, quantity: 1}'\n~~~\n\nFor details about specific commands, use the `--help` flag.\n\n### Environment variables\n\n| Environment variable | Description | Required | Default value |\n| --------------------------- | ----------------------------------- | -------- | ------------- |\n| `DODO_PAYMENTS_API_KEY` | Bearer Token for API authentication | yes | |\n| `DODO_PAYMENTS_WEBHOOK_KEY` | | no | `null` |\n\n### Global flags\n\n- `--bearer-token` - Bearer Token for API authentication (can also be set with `DODO_PAYMENTS_API_KEY` env var)\n- `--webhook-key` (can also be set with `DODO_PAYMENTS_WEBHOOK_KEY` env var)\n- `--help` - Show command line usage\n- `--debug` - Enable debug logging (includes HTTP request/response details)\n- `--version`, `-v` - Show the CLI version\n- `--base-url` - Use a custom API backend URL\n- `--format` - Change the output format (`auto`, `explore`, `json`, `jsonl`, `pretty`, `raw`, `yaml`)\n- `--format-error` - Change the output format for errors (`auto`, `explore`, `json`, `jsonl`, `pretty`, `raw`, `yaml`)\n- `--transform` - Transform the data output using [GJSON syntax](https://github.com/tidwall/gjson/blob/master/SYNTAX.md)\n- `--transform-error` - Transform the error output using [GJSON syntax](https://github.com/tidwall/gjson/blob/master/SYNTAX.md)\n\n### Passing files as arguments\n\nTo pass files to your API, you can use the `@myfile.ext` syntax:\n\n~~~bash\ndodo-payments-cli <command> --arg @abe.jpg\n~~~\n\nFiles can also be passed inside JSON or YAML blobs:\n\n~~~bash\ndodo-payments-cli <command> --arg '{image: \"@abe.jpg\"}'\n# Equivalent:\ndodo-payments-cli <command> <<YAML\narg:\n image: \"@abe.jpg\"\nYAML\n~~~\n\nIf you need to pass a string literal that begins with an `@` sign, you can\nescape the `@` sign to avoid accidentally passing a file.\n\n~~~bash\ndodo-payments-cli <command> --username '\\@abe'\n~~~\n\n#### Explicit encoding\n\nFor JSON endpoints, the CLI tool does filetype sniffing to determine whether the\nfile contents should be sent as a string literal (for plain text files) or as a\nbase64-encoded string literal (for binary files). If you need to explicitly send\nthe file as either plain text or base64-encoded data, you can use\n`@file://myfile.txt` (for string encoding) or `@data://myfile.dat` (for\nbase64-encoding). Note that absolute paths will begin with `@file://` or\n`@data://`, followed by a third `/` (for example, `@file:///tmp/file.txt`).\n\n~~~bash\ndodo-payments-cli <command> --arg @data://file.txt\n~~~\n\n## Linking different Go SDK versions\n\nYou can link the CLI against a different version of the Dodo Payments Go SDK\nfor development purposes using the `./scripts/link` script.\n\nTo link to a specific version from a repository (version can be a branch,\ngit tag, or commit hash):\n\n~~~bash\n./scripts/link github.com/org/repo@version\n~~~\n\nTo link to a local copy of the SDK:\n\n~~~bash\n./scripts/link ../path/to/dodopayments-go\n~~~\n\nIf you run the link script without any arguments, it will default to `../dodopayments-go`.\n",
7429
- },
7430
- {
7431
- language: 'csharp',
7432
- content: '# Dodo Payments C# API Library\n\nThe Dodo Payments C# SDK provides convenient access to the [Dodo Payments REST API](https://docs.dodopayments.com/api-reference/introduction) from applications written in C#.\n\n## Installation\n\nInstall the package from [NuGet](https://www.nuget.org/packages/DodoPayments.Client):\n\n```bash\ndotnet add package DodoPayments.Client\n```\n\n## Requirements\n\nThis library requires .NET Standard 2.0 or later.\n\n## Usage\n\nSee the [`examples`](examples) directory for complete and runnable examples.\n\n```csharp\nDodoPaymentsClient client = new();\n\nCheckoutSessionCreateParams parameters = new()\n{\n ProductCart =\n [\n new()\n {\n ProductID = "pdt_example",\n Quantity = 1,\n },\n ],\n};\n\nvar checkoutSessionResponse = await client.CheckoutSessions.Create(parameters);\n\nConsole.WriteLine(checkoutSessionResponse);\n```',
6905
+ language: 'typescript',
6906
+ content: "# Dodo Payments TypeScript API Library\n\n[![NPM version](https://img.shields.io/npm/v/dodopayments.svg?label=npm%20(stable))](https://npmjs.org/package/dodopayments) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/dodopayments)\n\nThis library provides convenient access to the Dodo Payments REST API from server-side TypeScript or JavaScript.\n\n\n\nThe REST API documentation can be found on [docs.dodopayments.com](https://docs.dodopayments.com/api-reference/introduction). The full API of this library can be found in [api.md](api.md).\n\nIt is generated with [Stainless](https://www.stainless.com/).\n\n## MCP Server\n\nUse the Dodo Payments MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=dodopayments-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsImRvZG9wYXltZW50cy1tY3AiXSwiZW52Ijp7IkRPRE9fUEFZTUVOVFNfQVBJX0tFWSI6Ik15IEJlYXJlciBUb2tlbiIsIkRPRE9fUEFZTUVOVFNfV0VCSE9PS19LRVkiOiJNeSBXZWJob29rIEtleSJ9fQ)\n[![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22dodopayments-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22dodopayments-mcp%22%5D%2C%22env%22%3A%7B%22DODO_PAYMENTS_API_KEY%22%3A%22My%20Bearer%20Token%22%2C%22DODO_PAYMENTS_WEBHOOK_KEY%22%3A%22My%20Webhook%20Key%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n## Installation\n\n```sh\nnpm install dodopayments\n```\n\n\n\n## Usage\n\nThe full API of this library can be found in [api.md](api.md).\n\n<!-- prettier-ignore -->\n```js\nimport DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n environment: 'test_mode', // defaults to 'live_mode'\n});\n\nconst checkoutSessionResponse = await client.checkoutSessions.create({\n product_cart: [{ product_id: 'pdt_example', quantity: 1 }],\n});\n\nconsole.log(checkoutSessionResponse.session_id);\n```\n\n\n\n### Request & Response types\n\nThis library includes TypeScript definitions for all request params and response fields. You may import and use them like so:\n\n<!-- prettier-ignore -->\n```ts\nimport DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n environment: 'test_mode', // defaults to 'live_mode'\n});\n\nconst params: DodoPayments.CheckoutSessionCreateParams = {\n product_cart: [{ product_id: 'pdt_example', quantity: 1 }],\n};\nconst checkoutSessionResponse: DodoPayments.CheckoutSessionResponse =\n await client.checkoutSessions.create(params);\n```\n\nDocumentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors.\n\n\n\n\n\n## Handling errors\n\nWhen the library is unable to connect to the API,\nor if the API returns a non-success status code (i.e., 4xx or 5xx response),\na subclass of `APIError` will be thrown:\n\n<!-- prettier-ignore -->\n```ts\nconst checkoutSessionResponse = await client.checkoutSessions\n .create({ product_cart: [{ product_id: 'pdt_example', quantity: 1 }] })\n .catch(async (err) => {\n if (err instanceof DodoPayments.APIError) {\n console.log(err.status); // 400\n console.log(err.name); // BadRequestError\n console.log(err.headers); // {server: 'nginx', ...}\n } else {\n throw err;\n }\n });\n```\n\nError codes are as follows:\n\n| Status Code | Error Type |\n| ----------- | -------------------------- |\n| 400 | `BadRequestError` |\n| 401 | `AuthenticationError` |\n| 403 | `PermissionDeniedError` |\n| 404 | `NotFoundError` |\n| 422 | `UnprocessableEntityError` |\n| 429 | `RateLimitError` |\n| >=500 | `InternalServerError` |\n| N/A | `APIConnectionError` |\n\n### Retries\n\nCertain errors will be automatically retried 2 times by default, with a short exponential backoff.\nConnection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict,\n429 Rate Limit, and >=500 Internal errors will all be retried by default.\n\nYou can use the `maxRetries` option to configure or disable this:\n\n<!-- prettier-ignore -->\n```js\n// Configure the default for all requests:\nconst client = new DodoPayments({\n maxRetries: 0, // default is 2\n});\n\n// Or, configure per-request:\nawait client.checkoutSessions.create({ product_cart: [{ product_id: 'pdt_example', quantity: 1 }] }, {\n maxRetries: 5,\n});\n```\n\n### Timeouts\n\nRequests time out after 1 minute by default. You can configure this with a `timeout` option:\n\n<!-- prettier-ignore -->\n```ts\n// Configure the default for all requests:\nconst client = new DodoPayments({\n timeout: 20 * 1000, // 20 seconds (default is 1 minute)\n});\n\n// Override per-request:\nawait client.checkoutSessions.create({ product_cart: [{ product_id: 'pdt_example', quantity: 1 }] }, {\n timeout: 5 * 1000,\n});\n```\n\nOn timeout, an `APIConnectionTimeoutError` is thrown.\n\nNote that requests which time out will be [retried twice by default](#retries).\n\n## Auto-pagination\n\nList methods in the DodoPayments API are paginated.\nYou can use the `for await … of` syntax to iterate through items across all pages:\n\n```ts\nasync function fetchAllPaymentListResponses(params) {\n const allPaymentListResponses = [];\n // Automatically fetches more pages as needed.\n for await (const paymentListResponse of client.payments.list()) {\n allPaymentListResponses.push(paymentListResponse);\n }\n return allPaymentListResponses;\n}\n```\n\nAlternatively, you can request a single page at a time:\n\n```ts\nlet page = await client.payments.list();\nfor (const paymentListResponse of page.items) {\n console.log(paymentListResponse);\n}\n\n// Convenience methods are provided for manually paginating:\nwhile (page.hasNextPage()) {\n page = await page.getNextPage();\n // ...\n}\n```\n\n\n\n## Advanced Usage\n\n### Accessing raw Response data (e.g., headers)\n\nThe \"raw\" `Response` returned by `fetch()` can be accessed through the `.asResponse()` method on the `APIPromise` type that all methods return.\nThis method returns as soon as the headers for a successful response are received and does not consume the response body, so you are free to write custom parsing or streaming logic.\n\nYou can also use the `.withResponse()` method to get the raw `Response` along with the parsed data.\nUnlike `.asResponse()` this method consumes the body, returning once it is parsed.\n\n<!-- prettier-ignore -->\n```ts\nconst client = new DodoPayments();\n\nconst response = await client.checkoutSessions\n .create({ product_cart: [{ product_id: 'pdt_example', quantity: 1 }] })\n .asResponse();\nconsole.log(response.headers.get('X-My-Header'));\nconsole.log(response.statusText); // access the underlying Response object\n\nconst { data: checkoutSessionResponse, response: raw } = await client.checkoutSessions\n .create({ product_cart: [{ product_id: 'pdt_example', quantity: 1 }] })\n .withResponse();\nconsole.log(raw.headers.get('X-My-Header'));\nconsole.log(checkoutSessionResponse.session_id);\n```\n\n### Logging\n\n> [!IMPORTANT]\n> All log messages are intended for debugging only. The format and content of log messages\n> may change between releases.\n\n#### Log levels\n\nThe log level can be configured in two ways:\n\n1. Via the `DODO_PAYMENTS_LOG` environment variable\n2. Using the `logLevel` client option (overrides the environment variable if set)\n\n```ts\nimport DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n logLevel: 'debug', // Show all log messages\n});\n```\n\nAvailable log levels, from most to least verbose:\n\n- `'debug'` - Show debug messages, info, warnings, and errors\n- `'info'` - Show info messages, warnings, and errors\n- `'warn'` - Show warnings and errors (default)\n- `'error'` - Show only errors\n- `'off'` - Disable all logging\n\nAt the `'debug'` level, all HTTP requests and responses are logged, including headers and bodies.\nSome authentication-related headers are redacted, but sensitive data in request and response bodies\nmay still be visible.\n\n#### Custom logger\n\nBy default, this library logs to `globalThis.console`. You can also provide a custom logger.\nMost logging libraries are supported, including [pino](https://www.npmjs.com/package/pino), [winston](https://www.npmjs.com/package/winston), [bunyan](https://www.npmjs.com/package/bunyan), [consola](https://www.npmjs.com/package/consola), [signale](https://www.npmjs.com/package/signale), and [@std/log](https://jsr.io/@std/log). If your logger doesn't work, please open an issue.\n\nWhen providing a custom logger, the `logLevel` option still controls which messages are emitted, messages\nbelow the configured level will not be sent to your logger.\n\n```ts\nimport DodoPayments from 'dodopayments';\nimport pino from 'pino';\n\nconst logger = pino();\n\nconst client = new DodoPayments({\n logger: logger.child({ name: 'DodoPayments' }),\n logLevel: 'debug', // Send all messages to pino, allowing it to filter\n});\n```\n\n### Making custom/undocumented requests\n\nThis library is typed for convenient access to the documented API. If you need to access undocumented\nendpoints, params, or response properties, the library can still be used.\n\n#### Undocumented endpoints\n\nTo make requests to undocumented endpoints, you can use `client.get`, `client.post`, and other HTTP verbs.\nOptions on the client, such as retries, will be respected when making these requests.\n\n```ts\nawait client.post('/some/path', {\n body: { some_prop: 'foo' },\n query: { some_query_arg: 'bar' },\n});\n```\n\n#### Undocumented request params\n\nTo make requests using undocumented parameters, you may use `// @ts-expect-error` on the undocumented\nparameter. This library doesn't validate at runtime that the request matches the type, so any extra values you\nsend will be sent as-is.\n\n```ts\nclient.checkoutSessions.create({\n // ...\n // @ts-expect-error baz is not yet public\n baz: 'undocumented option',\n});\n```\n\nFor requests with the `GET` verb, any extra params will be in the query, all other requests will send the\nextra param in the body.\n\nIf you want to explicitly send an extra argument, you can do so with the `query`, `body`, and `headers` request\noptions.\n\n#### Undocumented response properties\n\nTo access undocumented response properties, you may access the response object with `// @ts-expect-error` on\nthe response object, or cast the response object to the requisite type. Like the request params, we do not\nvalidate or strip extra properties from the response from the API.\n\n### Customizing the fetch client\n\nBy default, this library expects a global `fetch` function is defined.\n\nIf you want to use a different `fetch` function, you can either polyfill the global:\n\n```ts\nimport fetch from 'my-fetch';\n\nglobalThis.fetch = fetch;\n```\n\nOr pass it to the client:\n\n```ts\nimport DodoPayments from 'dodopayments';\nimport fetch from 'my-fetch';\n\nconst client = new DodoPayments({ fetch });\n```\n\n### Fetch options\n\nIf you want to set custom `fetch` options without overriding the `fetch` function, you can provide a `fetchOptions` object when instantiating the client or making a request. (Request-specific options override client options.)\n\n```ts\nimport DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n fetchOptions: {\n // `RequestInit` options\n },\n});\n```\n\n#### Configuring proxies\n\nTo modify proxy behavior, you can provide custom `fetchOptions` that add runtime-specific proxy\noptions to requests:\n\n<img src=\"https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/node.svg\" align=\"top\" width=\"18\" height=\"21\"> **Node** <sup>[[docs](https://github.com/nodejs/undici/blob/main/docs/docs/api/ProxyAgent.md#example---proxyagent-with-fetch)]</sup>\n\n```ts\nimport DodoPayments from 'dodopayments';\nimport * as undici from 'undici';\n\nconst proxyAgent = new undici.ProxyAgent('http://localhost:8888');\nconst client = new DodoPayments({\n fetchOptions: {\n dispatcher: proxyAgent,\n },\n});\n```\n\n<img src=\"https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/bun.svg\" align=\"top\" width=\"18\" height=\"21\"> **Bun** <sup>[[docs](https://bun.sh/guides/http/proxy)]</sup>\n\n```ts\nimport DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n fetchOptions: {\n proxy: 'http://localhost:8888',\n },\n});\n```\n\n<img src=\"https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/deno.svg\" align=\"top\" width=\"18\" height=\"21\"> **Deno** <sup>[[docs](https://docs.deno.com/api/deno/~/Deno.createHttpClient)]</sup>\n\n```ts\nimport DodoPayments from 'npm:dodopayments';\n\nconst httpClient = Deno.createHttpClient({ proxy: { url: 'http://localhost:8888' } });\nconst client = new DodoPayments({\n fetchOptions: {\n client: httpClient,\n },\n});\n```\n\n## Frequently Asked Questions\n\n## Semantic versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes that only affect static types, without breaking runtime behavior.\n2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n3. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/dodopayments/dodopayments-typescript/issues) with questions, bugs, or suggestions.\n\n## Requirements\n\nTypeScript >= 4.9 is supported.\n\nThe following runtimes are supported:\n\n- Web browsers (Up-to-date Chrome, Firefox, Safari, Edge, and more)\n- Node.js 20 LTS or later ([non-EOL](https://endoflife.date/nodejs)) versions.\n- Deno v1.28.0 or higher.\n- Bun 1.0 or later.\n- Cloudflare Workers.\n- Vercel Edge Runtime.\n- Jest 28 or greater with the `\"node\"` environment (`\"jsdom\"` is not supported at this time).\n- Nitro v2.6 or greater.\n\nNote that React Native is not supported at this time.\n\nIf you are interested in other runtime environments, please open or upvote an issue on GitHub.\n\n## Contributing\n\nSee [the contributing documentation](./CONTRIBUTING.md).\n",
7433
6907
  },
7434
6908
  {
7435
- language: 'go',
7436
- content: '# Dodo Payments Go API Library\n\n<a href="https://pkg.go.dev/github.com/dodopayments/dodopayments-go"><img src="https://pkg.go.dev/badge/github.com/dodopayments/dodopayments-go.svg" alt="Go Reference"></a>\n\nThe Dodo Payments Go library provides convenient access to the [Dodo Payments REST API](https://docs.dodopayments.com/api-reference/introduction)\nfrom applications written in Go.\n\nIt is generated with [Stainless](https://www.stainless.com/).\n\n## MCP Server\n\nUse the Dodo Payments MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=dodopayments-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsImRvZG9wYXltZW50cy1tY3AiXSwiZW52Ijp7IkRPRE9fUEFZTUVOVFNfQVBJX0tFWSI6Ik15IEJlYXJlciBUb2tlbiIsIkRPRE9fUEFZTUVOVFNfV0VCSE9PS19LRVkiOiJNeSBXZWJob29rIEtleSJ9fQ)\n[![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22dodopayments-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22dodopayments-mcp%22%5D%2C%22env%22%3A%7B%22DODO_PAYMENTS_API_KEY%22%3A%22My%20Bearer%20Token%22%2C%22DODO_PAYMENTS_WEBHOOK_KEY%22%3A%22My%20Webhook%20Key%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n## Installation\n\n<!-- x-release-please-start-version -->\n\n```go\nimport (\n\t"github.com/dodopayments/dodopayments-go" // imported as SDK_PackageName\n)\n```\n\n<!-- x-release-please-end -->\n\nOr to pin the version:\n\n<!-- x-release-please-start-version -->\n\n```sh\ngo get -u \'github.com/dodopayments/dodopayments-go@v0.0.1\'\n```\n\n<!-- x-release-please-end -->\n\n## Requirements\n\nThis library requires Go 1.22+.\n\n## Usage\n\nThe full API of this library can be found in [api.md](api.md).\n\n```go\npackage main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/dodopayments/dodopayments-go"\n\t"github.com/dodopayments/dodopayments-go/option"\n)\n\nfunc main() {\n\tclient := dodopayments.NewClient(\n\t\toption.WithBearerToken("My Bearer Token"), // defaults to os.LookupEnv("DODO_PAYMENTS_API_KEY")\n\t\toption.WithEnvironmentTestMode(), // defaults to option.WithEnvironmentLiveMode()\n\t)\n\tcheckoutSessionResponse, err := client.CheckoutSessions.New(context.TODO(), dodopayments.CheckoutSessionNewParams{\n\t\tCheckoutSessionRequest: dodopayments.CheckoutSessionRequestParam{\n\t\t\tProductCart: dodopayments.F([]dodopayments.ProductItemReqParam{{\n\t\t\t\tProductID: dodopayments.F("product_id"),\n\t\t\t\tQuantity: dodopayments.F(int64(0)),\n\t\t\t}}),\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", checkoutSessionResponse.SessionID)\n}\n\n```\n\n### Request fields\n\nAll request parameters are wrapped in a generic `Field` type,\nwhich we use to distinguish zero values from null or omitted fields.\n\nThis prevents accidentally sending a zero value if you forget a required parameter,\nand enables explicitly sending `null`, `false`, `\'\'`, or `0` on optional parameters.\nAny field not specified is not sent.\n\nTo construct fields with values, use the helpers `String()`, `Int()`, `Float()`, or most commonly, the generic `F[T]()`.\nTo send a null, use `Null[T]()`, and to send a nonconforming value, use `Raw[T](any)`. For example:\n\n```go\nparams := FooParams{\n\tName: SDK_PackageName.F("hello"),\n\n\t// Explicitly send `"description": null`\n\tDescription: SDK_PackageName.Null[string](),\n\n\tPoint: SDK_PackageName.F(SDK_PackageName.Point{\n\t\tX: SDK_PackageName.Int(0),\n\t\tY: SDK_PackageName.Int(1),\n\n\t\t// In cases where the API specifies a given type,\n\t\t// but you want to send something else, use `Raw`:\n\t\tZ: SDK_PackageName.Raw[int64](0.01), // sends a float\n\t}),\n}\n```\n\n### Response objects\n\nAll fields in response structs are value types (not pointers or wrappers).\n\nIf a given field is `null`, not present, or invalid, the corresponding field\nwill simply be its zero value.\n\nAll response structs also include a special `JSON` field, containing more detailed\ninformation about each property, which you can use like so:\n\n```go\nif res.Name == "" {\n\t// true if `"name"` is either not present or explicitly null\n\tres.JSON.Name.IsNull()\n\n\t// true if the `"name"` key was not present in the response JSON at all\n\tres.JSON.Name.IsMissing()\n\n\t// When the API returns data that cannot be coerced to the expected type:\n\tif res.JSON.Name.IsInvalid() {\n\t\traw := res.JSON.Name.Raw()\n\n\t\tlegacyName := struct{\n\t\t\tFirst string `json:"first"`\n\t\t\tLast string `json:"last"`\n\t\t}{}\n\t\tjson.Unmarshal([]byte(raw), &legacyName)\n\t\tname = legacyName.First + " " + legacyName.Last\n\t}\n}\n```\n\nThese `.JSON` structs also include an `Extras` map containing\nany properties in the json response that were not specified\nin the struct. This can be useful for API features not yet\npresent in the SDK.\n\n```go\nbody := res.JSON.ExtraFields["my_unexpected_field"].Raw()\n```\n\n### RequestOptions\n\nThis library uses the functional options pattern. Functions defined in the\n`SDK_PackageOptionName` package return a `RequestOption`, which is a closure that mutates a\n`RequestConfig`. These options can be supplied to the client or at individual\nrequests. For example:\n\n```go\nclient := SDK_PackageName.SDK_ClientInitializerName(\n\t// Adds a header to every request made by the client\n\tSDK_PackageOptionName.WithHeader("X-Some-Header", "custom_header_info"),\n)\n\nclient.CheckoutSessions.New(context.TODO(), ...,\n\t// Override the header\n\tSDK_PackageOptionName.WithHeader("X-Some-Header", "some_other_custom_header_info"),\n\t// Add an undocumented field to the request body, using sjson syntax\n\tSDK_PackageOptionName.WithJSONSet("some.json.path", map[string]string{"my": "object"}),\n)\n```\n\nSee the [full list of request options](https://pkg.go.dev/github.com/dodopayments/dodopayments-go/SDK_PackageOptionName).\n\n### Pagination\n\nThis library provides some conveniences for working with paginated list endpoints.\n\nYou can use `.ListAutoPaging()` methods to iterate through items across all pages:\n\n```go\niter := client.Payments.ListAutoPaging(context.TODO(), dodopayments.PaymentListParams{})\n// Automatically fetches more pages as needed.\nfor iter.Next() {\n\tpaymentListResponse := iter.Current()\n\tfmt.Printf("%+v\\n", paymentListResponse)\n}\nif err := iter.Err(); err != nil {\n\tpanic(err.Error())\n}\n```\n\nOr you can use simple `.List()` methods to fetch a single page and receive a standard response object\nwith additional helper methods like `.GetNextPage()`, e.g.:\n\n```go\npage, err := client.Payments.List(context.TODO(), dodopayments.PaymentListParams{})\nfor page != nil {\n\tfor _, payment := range page.Items {\n\t\tfmt.Printf("%+v\\n", payment)\n\t}\n\tpage, err = page.GetNextPage()\n}\nif err != nil {\n\tpanic(err.Error())\n}\n```\n\n### Errors\n\nWhen the API returns a non-success status code, we return an error with type\n`*SDK_PackageName.Error`. This contains the `StatusCode`, `*http.Request`, and\n`*http.Response` values of the request, as well as the JSON of the error body\n(much like other response objects in the SDK).\n\nTo handle errors, we recommend that you use the `errors.As` pattern:\n\n```go\n_, err := client.CheckoutSessions.New(context.TODO(), dodopayments.CheckoutSessionNewParams{\n\tCheckoutSessionRequest: dodopayments.CheckoutSessionRequestParam{\n\t\tProductCart: dodopayments.F([]dodopayments.ProductItemReqParam{{\n\t\t\tProductID: dodopayments.F("product_id"),\n\t\t\tQuantity: dodopayments.F(int64(0)),\n\t\t}}),\n\t},\n})\nif err != nil {\n\tvar apierr *dodopayments.Error\n\tif errors.As(err, &apierr) {\n\t\tprintln(string(apierr.DumpRequest(true))) // Prints the serialized HTTP request\n\t\tprintln(string(apierr.DumpResponse(true))) // Prints the serialized HTTP response\n\t}\n\tpanic(err.Error()) // GET "/checkouts": 400 Bad Request { ... }\n}\n```\n\nWhen other errors occur, they are returned unwrapped; for example,\nif HTTP transport fails, you might receive `*url.Error` wrapping `*net.OpError`.\n\n### Timeouts\n\nRequests do not time out by default; use context to configure a timeout for a request lifecycle.\n\nNote that if a request is [retried](#retries), the context timeout does not start over.\nTo set a per-retry timeout, use `SDK_PackageOptionName.WithRequestTimeout()`.\n\n```go\n// This sets the timeout for the request, including all the retries.\nctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)\ndefer cancel()\nclient.CheckoutSessions.New(\n\tctx,\n\tdodopayments.CheckoutSessionNewParams{\n\t\tCheckoutSessionRequest: dodopayments.CheckoutSessionRequestParam{\n\t\t\tProductCart: dodopayments.F([]dodopayments.ProductItemReqParam{{\n\t\t\t\tProductID: dodopayments.F("product_id"),\n\t\t\t\tQuantity: dodopayments.F(int64(0)),\n\t\t\t}}),\n\t\t},\n\t},\n\t// This sets the per-retry timeout\n\toption.WithRequestTimeout(20*time.Second),\n)\n```\n\n### File uploads\n\nRequest parameters that correspond to file uploads in multipart requests are typed as\n`param.Field[io.Reader]`. The contents of the `io.Reader` will by default be sent as a multipart form\npart with the file name of "anonymous_file" and content-type of "application/octet-stream".\n\nThe file name and content-type can be customized by implementing `Name() string` or `ContentType()\nstring` on the run-time type of `io.Reader`. Note that `os.File` implements `Name() string`, so a\nfile returned by `os.Open` will be sent with the file name on disk.\n\nWe also provide a helper `SDK_PackageName.FileParam(reader io.Reader, filename string, contentType string)`\nwhich can be used to wrap any `io.Reader` with the appropriate file name and content type.\n\n\n\n### Retries\n\nCertain errors will be automatically retried 2 times by default, with a short exponential backoff.\nWe retry by default all connection errors, 408 Request Timeout, 409 Conflict, 429 Rate Limit,\nand >=500 Internal errors.\n\nYou can use the `WithMaxRetries` option to configure or disable this:\n\n```go\n// Configure the default for all requests:\nclient := dodopayments.NewClient(\n\toption.WithMaxRetries(0), // default is 2\n)\n\n// Override per-request:\nclient.CheckoutSessions.New(\n\tcontext.TODO(),\n\tdodopayments.CheckoutSessionNewParams{\n\t\tCheckoutSessionRequest: dodopayments.CheckoutSessionRequestParam{\n\t\t\tProductCart: dodopayments.F([]dodopayments.ProductItemReqParam{{\n\t\t\t\tProductID: dodopayments.F("product_id"),\n\t\t\t\tQuantity: dodopayments.F(int64(0)),\n\t\t\t}}),\n\t\t},\n\t},\n\toption.WithMaxRetries(5),\n)\n```\n\n\n### Accessing raw response data (e.g. response headers)\n\nYou can access the raw HTTP response data by using the `option.WithResponseInto()` request option. This is useful when\nyou need to examine response headers, status codes, or other details.\n\n```go\n// Create a variable to store the HTTP response\nvar response *http.Response\ncheckoutSessionResponse, err := client.CheckoutSessions.New(\n\tcontext.TODO(),\n\tdodopayments.CheckoutSessionNewParams{\n\t\tCheckoutSessionRequest: dodopayments.CheckoutSessionRequestParam{\n\t\t\tProductCart: dodopayments.F([]dodopayments.ProductItemReqParam{{\n\t\t\t\tProductID: dodopayments.F("product_id"),\n\t\t\t\tQuantity: dodopayments.F(int64(0)),\n\t\t\t}}),\n\t\t},\n\t},\n\toption.WithResponseInto(&response),\n)\nif err != nil {\n\t// handle error\n}\nfmt.Printf("%+v\\n", checkoutSessionResponse)\n\nfmt.Printf("Status Code: %d\\n", response.StatusCode)\nfmt.Printf("Headers: %+#v\\n", response.Header)\n```\n\n### Making custom/undocumented requests\n\nThis library is typed for convenient access to the documented API. If you need to access undocumented\nendpoints, params, or response properties, the library can still be used.\n\n#### Undocumented endpoints\n\nTo make requests to undocumented endpoints, you can use `client.Get`, `client.Post`, and other HTTP verbs.\n`RequestOptions` on the client, such as retries, will be respected when making these requests.\n\n```go\nvar (\n // params can be an io.Reader, a []byte, an encoding/json serializable object,\n // or a "…Params" struct defined in this library.\n params map[string]interface{}\n\n // result can be an []byte, *http.Response, a encoding/json deserializable object,\n // or a model defined in this library.\n result *http.Response\n)\nerr := client.Post(context.Background(), "/unspecified", params, &result)\nif err != nil {\n …\n}\n```\n\n#### Undocumented request params\n\nTo make requests using undocumented parameters, you may use either the `SDK_PackageOptionName.WithQuerySet()`\nor the `SDK_PackageOptionName.WithJSONSet()` methods.\n\n```go\nparams := FooNewParams{\n ID: SDK_PackageName.F("id_xxxx"),\n Data: SDK_PackageName.F(FooNewParamsData{\n FirstName: SDK_PackageName.F("John"),\n }),\n}\nclient.Foo.New(context.Background(), params, SDK_PackageOptionName.WithJSONSet("data.last_name", "Doe"))\n```\n\n#### Undocumented response properties\n\nTo access undocumented response properties, you may either access the raw JSON of the response as a string\nwith `result.JSON.RawJSON()`, or get the raw JSON of a particular field on the result with\n`result.JSON.Foo.Raw()`.\n\nAny fields that are not present on the response struct will be saved and can be accessed by `result.JSON.ExtraFields()` which returns the extra fields as a `map[string]Field`.\n\n### Middleware\n\nWe provide `SDK_PackageOptionName.WithMiddleware` which applies the given\nmiddleware to requests.\n\n```go\nfunc Logger(req *http.Request, next SDK_PackageOptionName.MiddlewareNext) (res *http.Response, err error) {\n\t// Before the request\n\tstart := time.Now()\n\tLogReq(req)\n\n\t// Forward the request to the next handler\n\tres, err = next(req)\n\n\t// Handle stuff after the request\n\tend := time.Now()\n\tLogRes(res, err, start - end)\n\n return res, err\n}\n\nclient := SDK_PackageName.SDK_ClientInitializerName(\n\tSDK_PackageOptionName.WithMiddleware(Logger),\n)\n```\n\nWhen multiple middlewares are provided as variadic arguments, the middlewares\nare applied left to right. If `SDK_PackageOptionName.WithMiddleware` is given\nmultiple times, for example first in the client then the method, the\nmiddleware in the client will run first and the middleware given in the method\nwill run next.\n\nYou may also replace the default `http.Client` with\n`SDK_PackageOptionName.WithHTTPClient(client)`. Only one http client is\naccepted (this overwrites any previous client) and receives requests after any\nmiddleware has been applied.\n\n## Semantic versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n2. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/dodopayments/dodopayments-go/issues) with questions, bugs, or suggestions.\n\n## Contributing\n\nSee [the contributing documentation](./CONTRIBUTING.md).\n',
6909
+ language: 'python',
6910
+ content: '# Dodo Payments Python API library\n\n<!-- prettier-ignore -->\n[![PyPI version](https://img.shields.io/pypi/v/dodopayments.svg?label=pypi%20(stable))](https://pypi.org/project/dodopayments/)\n\nThe Dodo Payments Python library provides convenient access to the Dodo Payments REST API from any Python 3.9+\napplication. The library includes type definitions for all request params and response fields,\nand offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx).\n\n\n\nIt is generated with [Stainless](https://www.stainless.com/).\n\n## MCP Server\n\nUse the Dodo Payments MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=dodopayments-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsImRvZG9wYXltZW50cy1tY3AiXSwiZW52Ijp7IkRPRE9fUEFZTUVOVFNfQVBJX0tFWSI6Ik15IEJlYXJlciBUb2tlbiIsIkRPRE9fUEFZTUVOVFNfV0VCSE9PS19LRVkiOiJNeSBXZWJob29rIEtleSJ9fQ)\n[![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22dodopayments-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22dodopayments-mcp%22%5D%2C%22env%22%3A%7B%22DODO_PAYMENTS_API_KEY%22%3A%22My%20Bearer%20Token%22%2C%22DODO_PAYMENTS_WEBHOOK_KEY%22%3A%22My%20Webhook%20Key%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n## Documentation\n\nThe REST API documentation can be found on [docs.dodopayments.com](https://docs.dodopayments.com/api-reference/introduction). The full API of this library can be found in [api.md](api.md).\n\n## Installation\n\n```sh\n# install from PyPI\npip install dodopayments\n```\n\n## Usage\n\nThe full API of this library can be found in [api.md](api.md).\n\n```python\nimport os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n # defaults to "live_mode".\n environment="test_mode",\n)\n\ncheckout_session_response = client.checkout_sessions.create(\n product_cart=[{\n "product_id": "pdt_example",\n "quantity": 1,\n }],\n)\nprint(checkout_session_response.session_id)\n```\n\nWhile you can provide a `bearer_token` keyword argument,\nwe recommend using [python-dotenv](https://pypi.org/project/python-dotenv/)\nto add `DODO_PAYMENTS_API_KEY="My Bearer Token"` to your `.env` file\nso that your Bearer Token is not stored in source control.\n\n## Async usage\n\nSimply import `AsyncDodoPayments` instead of `DodoPayments` and use `await` with each API call:\n\n```python\nimport os\nimport asyncio\nfrom dodopayments import AsyncDodoPayments\n\nclient = AsyncDodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n # defaults to "live_mode".\n environment="test_mode",\n)\n\nasync def main() -> None:\n checkout_session_response = await client.checkout_sessions.create(\n product_cart=[{\n "product_id": "pdt_example",\n "quantity": 1,\n }],\n )\n print(checkout_session_response.session_id)\n\nasyncio.run(main())\n```\n\nFunctionality between the synchronous and asynchronous clients is otherwise identical.\n\n### With aiohttp\n\nBy default, the async client uses `httpx` for HTTP requests. However, for improved concurrency performance you may also use `aiohttp` as the HTTP backend.\n\nYou can enable this by installing `aiohttp`:\n\n```sh\n# install from PyPI\npip install dodopayments[aiohttp]\n```\n\nThen you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:\n\n```python\nimport os\nimport asyncio\nfrom dodopayments import DefaultAioHttpClient\nfrom dodopayments import AsyncDodoPayments\n\nasync def main() -> None:\n async with AsyncDodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n http_client=DefaultAioHttpClient(),\n) as client:\n checkout_session_response = await client.checkout_sessions.create(\n product_cart=[{\n "product_id": "pdt_example",\n "quantity": 1,\n }],\n )\n print(checkout_session_response.session_id)\n\nasyncio.run(main())\n```\n\n\n\n## Using types\n\nNested request parameters are [TypedDicts](https://docs.python.org/3/library/typing.html#typing.TypedDict). Responses are [Pydantic models](https://docs.pydantic.dev) which also provide helper methods for things like:\n\n- Serializing back into JSON, `model.to_json()`\n- Converting to a dictionary, `model.to_dict()`\n\nTyped requests and responses provide autocomplete and documentation within your editor. If you would like to see type errors in VS Code to help catch bugs earlier, set `python.analysis.typeCheckingMode` to `basic`.\n\n## Pagination\n\nList methods in the Dodo Payments API are paginated.\n\nThis library provides auto-paginating iterators with each list response, so you do not have to request successive pages manually:\n\n```python\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments()\n\nall_payments = []\n# Automatically fetches more pages as needed.\nfor payment in client.payments.list():\n # Do something with payment here\n all_payments.append(payment)\nprint(all_payments)\n```\n\nOr, asynchronously:\n\n```python\nimport asyncio\nfrom dodopayments import AsyncDodoPayments\n\nclient = AsyncDodoPayments()\n\nasync def main() -> None:\n all_payments = []\n # Iterate through items across all pages, issuing requests as needed.\n async for payment in client.payments.list():\n all_payments.append(payment)\n print(all_payments)\n\nasyncio.run(main())\n```\n\nAlternatively, you can use the `.has_next_page()`, `.next_page_info()`, or `.get_next_page()` methods for more granular control working with pages:\n\n```python\nfirst_page = await client.payments.list()\nif first_page.has_next_page():\n print(f"will fetch next page using these details: {first_page.next_page_info()}")\n next_page = await first_page.get_next_page()\n print(f"number of items we just fetched: {len(next_page.items)}")\n\n# Remove `await` for non-async usage.\n```\n\nOr just work directly with the returned data:\n\n```python\nfirst_page = await client.payments.list()\nfor payment in first_page.items:\n print(payment.brand_id)\n\n# Remove `await` for non-async usage.\n```\n\n## Nested params\n\nNested parameters are dictionaries, typed using `TypedDict`, for example:\n\n```python\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments()\n\ncheckout_session_response = client.checkout_sessions.create(\n product_cart=[{\n "product_id": "product_id",\n "quantity": 0,\n }],\n billing_address={\n "country": "AF"\n },\n)\nprint(checkout_session_response.billing_address)\n```\n\n\n\n## Handling errors\n\nWhen the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `dodopayments.APIConnectionError` is raised.\n\nWhen the API returns a non-success status code (that is, 4xx or 5xx\nresponse), a subclass of `dodopayments.APIStatusError` is raised, containing `status_code` and `response` properties.\n\nAll errors inherit from `dodopayments.APIError`.\n\n```python\nimport dodopayments\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments()\n\ntry:\n client.checkout_sessions.create(\n product_cart=[{\n "product_id": "pdt_example",\n "quantity": 1,\n }],\n )\nexcept dodopayments.APIConnectionError as e:\n print("The server could not be reached")\n print(e.__cause__) # an underlying Exception, likely raised within httpx.\nexcept dodopayments.RateLimitError as e:\n print("A 429 status code was received; we should back off a bit.")\nexcept dodopayments.APIStatusError as e:\n print("Another non-200-range status code was received")\n print(e.status_code)\n print(e.response)\n```\n\nError codes are as follows:\n\n| Status Code | Error Type |\n| ----------- | -------------------------- |\n| 400 | `BadRequestError` |\n| 401 | `AuthenticationError` |\n| 403 | `PermissionDeniedError` |\n| 404 | `NotFoundError` |\n| 422 | `UnprocessableEntityError` |\n| 429 | `RateLimitError` |\n| >=500 | `InternalServerError` |\n| N/A | `APIConnectionError` |\n\n### Retries\n\nCertain errors are automatically retried 2 times by default, with a short exponential backoff.\nConnection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict,\n429 Rate Limit, and >=500 Internal errors are all retried by default.\n\nYou can use the `max_retries` option to configure or disable retry settings:\n\n```python\nfrom dodopayments import DodoPayments\n\n# Configure the default for all requests:\nclient = DodoPayments(\n # default is 2\n max_retries=0,\n)\n\n# Or, configure per-request:\nclient.with_options(max_retries = 5).checkout_sessions.create(\n product_cart=[{\n "product_id": "pdt_example",\n "quantity": 1,\n }],\n)\n```\n\n### Timeouts\n\nBy default requests time out after 1 minute. You can configure this with a `timeout` option,\nwhich accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/timeouts/#fine-tuning-the-configuration) object:\n\n```python\nfrom dodopayments import DodoPayments\n\n# Configure the default for all requests:\nclient = DodoPayments(\n # 20 seconds (default is 1 minute)\n timeout=20.0,\n)\n\n# More granular control:\nclient = DodoPayments(\n timeout=httpx.Timeout(60.0, read=5.0, write=10.0, connect=2.0),\n)\n\n# Override per-request:\nclient.with_options(timeout = 5.0).checkout_sessions.create(\n product_cart=[{\n "product_id": "pdt_example",\n "quantity": 1,\n }],\n)\n```\n\nOn timeout, an `APITimeoutError` is thrown.\n\nNote that requests that time out are [retried twice by default](#retries).\n\n\n\n## Advanced\n\n### Logging\n\nWe use the standard library [`logging`](https://docs.python.org/3/library/logging.html) module.\n\nYou can enable logging by setting the environment variable `DODO_PAYMENTS_LOG` to `info`.\n\n```shell\n$ export DODO_PAYMENTS_LOG=info\n```\n\nOr to `debug` for more verbose logging.\n\n### How to tell whether `None` means `null` or missing\n\nIn an API response, a field may be explicitly `null`, or missing entirely; in either case, its value is `None` in this library. You can differentiate the two cases with `.model_fields_set`:\n\n```py\nif response.my_field is None:\n if \'my_field\' not in response.model_fields_set:\n print(\'Got json like {}, without a "my_field" key present at all.\')\n else:\n print(\'Got json like {"my_field": null}.\')\n```\n\n### Accessing raw response data (e.g. headers)\n\nThe "raw" Response object can be accessed by prefixing `.with_raw_response.` to any HTTP method call, e.g.,\n\n```py\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments()\nresponse = client.checkout_sessions.with_raw_response.create(\n product_cart=[{\n "product_id": "pdt_example",\n "quantity": 1,\n }],\n)\nprint(response.headers.get(\'X-My-Header\'))\n\ncheckout_session = response.parse() # get the object that `checkout_sessions.create()` would have returned\nprint(checkout_session.session_id)\n```\n\nThese methods return an [`APIResponse`](https://github.com/dodopayments/dodopayments-python/tree/main/src/dodopayments/_response.py) object.\n\nThe async client returns an [`AsyncAPIResponse`](https://github.com/dodopayments/dodopayments-python/tree/main/src/dodopayments/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.\n\n#### `.with_streaming_response`\n\nThe above interface eagerly reads the full response body when you make the request, which may not always be what you want.\n\nTo stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods.\n\n```python\nwith client.checkout_sessions.with_streaming_response.create(\n product_cart=[{\n "product_id": "pdt_example",\n "quantity": 1,\n }],\n) as response :\n print(response.headers.get(\'X-My-Header\'))\n\n for line in response.iter_lines():\n print(line)\n```\n\nThe context manager is required so that the response will reliably be closed.\n\n### Making custom/undocumented requests\n\nThis library is typed for convenient access to the documented API.\n\nIf you need to access undocumented endpoints, params, or response properties, the library can still be used.\n\n#### Undocumented endpoints\n\nTo make requests to undocumented endpoints, you can make requests using `client.get`, `client.post`, and other\nhttp verbs. Options on the client will be respected (such as retries) when making this request.\n\n```py\nimport httpx\n\nresponse = client.post(\n "/foo",\n cast_to=httpx.Response,\n body={"my_param": True},\n)\n\nprint(response.headers.get("x-foo"))\n```\n\n#### Undocumented request params\n\nIf you want to explicitly send an extra param, you can do so with the `extra_query`, `extra_body`, and `extra_headers` request\noptions.\n\n#### Undocumented response properties\n\nTo access undocumented response properties, you can access the extra fields like `response.unknown_prop`. You\ncan also get all the extra fields on the Pydantic model as a dict with\n[`response.model_extra`](https://docs.pydantic.dev/latest/api/base_model/#pydantic.BaseModel.model_extra).\n\n### Configuring the HTTP client\n\nYou can directly override the [httpx client](https://www.python-httpx.org/api/#client) to customize it for your use case, including:\n\n- Support for [proxies](https://www.python-httpx.org/advanced/proxies/)\n- Custom [transports](https://www.python-httpx.org/advanced/transports/)\n- Additional [advanced](https://www.python-httpx.org/advanced/clients/) functionality\n\n```python\nimport httpx\nfrom dodopayments import DodoPayments, DefaultHttpxClient\n\nclient = DodoPayments(\n # Or use the `DODO_PAYMENTS_BASE_URL` env var\n base_url="http://my.test.server.example.com:8083",\n http_client=DefaultHttpxClient(proxy="http://my.test.proxy.example.com", transport=httpx.HTTPTransport(local_address="0.0.0.0")),\n)\n```\n\nYou can also customize the client on a per-request basis by using `with_options()`:\n\n```python\nclient.with_options(http_client=DefaultHttpxClient(...))\n```\n\n### Managing HTTP resources\n\nBy default the library closes underlying HTTP connections whenever the client is [garbage collected](https://docs.python.org/3/reference/datamodel.html#object.__del__). You can manually close the client using the `.close()` method if desired, or with a context manager that closes when exiting.\n\n```py\nfrom dodopayments import DodoPayments\n\nwith DodoPayments() as client:\n # make requests here\n ...\n\n# HTTP client is now closed\n```\n\n## Versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes that only affect static types, without breaking runtime behavior.\n2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n3. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/dodopayments/dodopayments-python/issues) with questions, bugs, or suggestions.\n\n### Determining the installed version\n\nIf you\'ve upgraded to the latest version but aren\'t seeing any new features you were expecting then your python environment is likely still using an older version.\n\nYou can determine the version that is being used at runtime with:\n\n```py\nimport dodopayments\nprint(dodopayments.__version__)\n```\n\n## Requirements\n\nPython 3.9 or higher.\n\n## Contributing\n\nSee [the contributing documentation](./CONTRIBUTING.md).\n',
7437
6911
  },
7438
6912
  {
7439
6913
  language: 'java',
@@ -7444,20 +6918,20 @@ const EMBEDDED_READMES = [
7444
6918
  content: '# Dodo Payments Kotlin API Library\n\n<!-- x-release-please-start-version -->\n[![Maven Central](https://img.shields.io/maven-central/v/com.dodopayments.api/dodo-payments-kotlin)](https://central.sonatype.com/artifact/com.dodopayments.api/dodo-payments-kotlin/0.0.1)\n[![javadoc](https://javadoc.io/badge2/com.dodopayments.api/dodo-payments-kotlin/0.0.1/javadoc.svg)](https://javadoc.io/doc/com.dodopayments.api/dodo-payments-kotlin/0.0.1)\n<!-- x-release-please-end -->\n\nThe Dodo Payments Kotlin SDK provides convenient access to the [Dodo Payments REST API](https://docs.dodopayments.com/api-reference/introduction) from applications written in Kotlin.\n\nThe Dodo Payments Kotlin SDK is similar to the Dodo Payments Java SDK but with minor differences that make it more ergonomic for use in Kotlin, such as nullable values instead of `Optional`, `Sequence` instead of `Stream`, and suspend functions instead of `CompletableFuture`.\n\nIt is generated with [Stainless](https://www.stainless.com/).\n\n## MCP Server\n\nUse the Dodo Payments MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=dodopayments-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsImRvZG9wYXltZW50cy1tY3AiXSwiZW52Ijp7IkRPRE9fUEFZTUVOVFNfQVBJX0tFWSI6Ik15IEJlYXJlciBUb2tlbiIsIkRPRE9fUEFZTUVOVFNfV0VCSE9PS19LRVkiOiJNeSBXZWJob29rIEtleSJ9fQ)\n[![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22dodopayments-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22dodopayments-mcp%22%5D%2C%22env%22%3A%7B%22DODO_PAYMENTS_API_KEY%22%3A%22My%20Bearer%20Token%22%2C%22DODO_PAYMENTS_WEBHOOK_KEY%22%3A%22My%20Webhook%20Key%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n<!-- x-release-please-start-version -->\n\nThe REST API documentation can be found on [docs.dodopayments.com](https://docs.dodopayments.com/api-reference/introduction). KDocs are available on [javadoc.io](https://javadoc.io/doc/com.dodopayments.api/dodo-payments-kotlin/0.0.1).\n\n<!-- x-release-please-end -->\n\n## Installation\n\n<!-- x-release-please-start-version -->\n\n### Gradle\n\n~~~kotlin\nimplementation("com.dodopayments.api:dodo-payments-kotlin:0.0.1")\n~~~\n\n### Maven\n\n~~~xml\n<dependency>\n <groupId>com.dodopayments.api</groupId>\n <artifactId>dodo-payments-kotlin</artifactId>\n <version>0.0.1</version>\n</dependency>\n~~~\n\n<!-- x-release-please-end -->\n\n## Requirements\n\nThis library requires Java 8 or later.\n\n## Usage\n\n```kotlin\nimport com.dodopayments.api.client.DodoPaymentsClient\nimport com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient\nimport com.dodopayments.api.models.checkoutsessions.CheckoutSessionRequest\nimport com.dodopayments.api.models.checkoutsessions.CheckoutSessionResponse\nimport com.dodopayments.api.models.checkoutsessions.ProductItemReq\n\n// Configures using the `dodopayments.apiKey`, `dodopayments.webhookKey` and `dodopayments.baseUrl` system properties\n// Or configures using the `DODO_PAYMENTS_API_KEY`, `DODO_PAYMENTS_WEBHOOK_KEY` and `DODO_PAYMENTS_BASE_URL` environment variables\nval client: DodoPaymentsClient = DodoPaymentsOkHttpClient.fromEnv()\n\nval params: CheckoutSessionRequest = CheckoutSessionRequest.builder()\n .addProductCart(ProductItemReq.builder()\n .productId("product_id")\n .quantity(0)\n .build())\n .build()\nval checkoutSessionResponse: CheckoutSessionResponse = client.checkoutSessions().create(params)\n```\n\n## Client configuration\n\nConfigure the client using system properties or environment variables:\n\n```kotlin\nimport com.dodopayments.api.client.DodoPaymentsClient\nimport com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient\n\n// Configures using the `dodopayments.apiKey`, `dodopayments.webhookKey` and `dodopayments.baseUrl` system properties\n// Or configures using the `DODO_PAYMENTS_API_KEY`, `DODO_PAYMENTS_WEBHOOK_KEY` and `DODO_PAYMENTS_BASE_URL` environment variables\nval client: DodoPaymentsClient = DodoPaymentsOkHttpClient.fromEnv()\n```\n\nOr manually:\n\n```kotlin\nimport com.dodopayments.api.client.DodoPaymentsClient\nimport com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient\n\nval client: DodoPaymentsClient = DodoPaymentsOkHttpClient.builder()\n .bearerToken("My Bearer Token")\n .build()\n```\n\nOr using a combination of the two approaches:\n\n```kotlin\nimport com.dodopayments.api.client.DodoPaymentsClient\nimport com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient\n\nval client: DodoPaymentsClient = DodoPaymentsOkHttpClient.builder()\n // Configures using the `dodopayments.apiKey`, `dodopayments.webhookKey` and `dodopayments.baseUrl` system properties\n // Or configures using the `DODO_PAYMENTS_API_KEY`, `DODO_PAYMENTS_WEBHOOK_KEY` and `DODO_PAYMENTS_BASE_URL` environment variables\n .fromEnv()\n .bearerToken("My Bearer Token")\n .build()\n```\n\nSee this table for the available options:\n\n| Setter | System property | Environment variable | Required | Default value |\n| ------------- | ------------------------- | --------------------------- | -------- | --------------------------------- |\n| `bearerToken` | `dodopayments.apiKey` | `DODO_PAYMENTS_API_KEY` | true | - |\n| `webhookKey` | `dodopayments.webhookKey` | `DODO_PAYMENTS_WEBHOOK_KEY` | false | - |\n| `baseUrl` | `dodopayments.baseUrl` | `DODO_PAYMENTS_BASE_URL` | true | `"https://live.dodopayments.com"` |\n\nSystem properties take precedence over environment variables.\n\n> [!TIP]\n> Don\'t create more than one client in the same application. Each client has a connection pool and\n> thread pools, which are more efficient to share between requests.\n\n### Modifying configuration\n\nTo temporarily use a modified client configuration, while reusing the same connection and thread pools, call `withOptions()` on any client or service:\n\n```kotlin\nimport com.dodopayments.api.client.DodoPaymentsClient\n\nval clientWithOptions: DodoPaymentsClient = client.withOptions {\n it.baseUrl("https://example.com")\n it.maxRetries(42)\n}\n```\n\nThe `withOptions()` method does not affect the original client or service.\n\n## Requests and responses\n\nTo send a request to the Dodo Payments API, build an instance of some `Params` class and pass it to the corresponding client method. When the response is received, it will be deserialized into an instance of a Kotlin class.\n\nFor example, `client.checkoutSessions().create(...)` should be called with an instance of `CheckoutSessionCreateParams`, and it will return an instance of `CheckoutSessionResponse`.\n\n## Immutability\n\nEach class in the SDK has an associated [builder](https://blogs.oracle.com/javamagazine/post/exploring-joshua-blochs-builder-design-pattern-in-java) or factory method for constructing it.\n\nEach class is [immutable](https://docs.oracle.com/javase/tutorial/essential/concurrency/immutable.html) once constructed. If the class has an associated builder, then it has a `toBuilder()` method, which can be used to convert it back to a builder for making a modified copy.\n\nBecause each class is immutable, builder modification will _never_ affect already built class instances.\n\n## Asynchronous execution\n\nThe default client is synchronous. To switch to asynchronous execution, call the `async()` method:\n\n```kotlin\nimport com.dodopayments.api.client.DodoPaymentsClient\nimport com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient\nimport com.dodopayments.api.models.checkoutsessions.CheckoutSessionRequest\nimport com.dodopayments.api.models.checkoutsessions.CheckoutSessionResponse\nimport com.dodopayments.api.models.checkoutsessions.ProductItemReq\n\n// Configures using the `dodopayments.apiKey`, `dodopayments.webhookKey` and `dodopayments.baseUrl` system properties\n// Or configures using the `DODO_PAYMENTS_API_KEY`, `DODO_PAYMENTS_WEBHOOK_KEY` and `DODO_PAYMENTS_BASE_URL` environment variables\nval client: DodoPaymentsClient = DodoPaymentsOkHttpClient.fromEnv()\n\nval params: CheckoutSessionRequest = CheckoutSessionRequest.builder()\n .addProductCart(ProductItemReq.builder()\n .productId("product_id")\n .quantity(0)\n .build())\n .build()\nval checkoutSessionResponse: CheckoutSessionResponse = client.async().checkoutSessions().create(params)\n```\n\nOr create an asynchronous client from the beginning:\n\n```kotlin\nimport com.dodopayments.api.client.DodoPaymentsClientAsync\nimport com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClientAsync\nimport com.dodopayments.api.models.checkoutsessions.CheckoutSessionRequest\nimport com.dodopayments.api.models.checkoutsessions.CheckoutSessionResponse\nimport com.dodopayments.api.models.checkoutsessions.ProductItemReq\n\n// Configures using the `dodopayments.apiKey`, `dodopayments.webhookKey` and `dodopayments.baseUrl` system properties\n// Or configures using the `DODO_PAYMENTS_API_KEY`, `DODO_PAYMENTS_WEBHOOK_KEY` and `DODO_PAYMENTS_BASE_URL` environment variables\nval client: DodoPaymentsClientAsync = DodoPaymentsOkHttpClientAsync.fromEnv()\n\nval params: CheckoutSessionRequest = CheckoutSessionRequest.builder()\n .addProductCart(ProductItemReq.builder()\n .productId("product_id")\n .quantity(0)\n .build())\n .build()\nval checkoutSessionResponse: CheckoutSessionResponse = client.checkoutSessions().create(params)\n```\n\nThe asynchronous client supports the same options as the synchronous one, except most methods are [suspending](https://kotlinlang.org/docs/coroutines-guide.html).\n\n\n\n\n\n## Binary responses\n\nThe SDK defines methods that return binary responses, which are used for API responses that shouldn\'t necessarily be parsed, like non-JSON data.\n\nThese methods return [`HttpResponse`](dodo-payments-kotlin-core/src/main/kotlin/com/dodopayments/api/core/http/HttpResponse.kt):\n\n```kotlin\nimport com.dodopayments.api.core.http.HttpResponse\nimport com.dodopayments.api.models.invoices.payments.PaymentRetrieveParams\n\nval payment: HttpResponse = client.invoices().payments().retrieve("payment_id")\n```\n\nTo save the response content to a file, use the [`Files.copy(...)`](https://docs.oracle.com/javase/8/docs/api/java/nio/file/Files.html#copy-java.io.InputStream-java.nio.file.Path-java.nio.file.CopyOption...-) method:\n\n```kotlin\nimport java.nio.file.Files\nimport java.nio.file.Paths\nimport java.nio.file.StandardCopyOption\n\nclient.invoices().payments().retrieve(params).use {\n Files.copy(\n it.body(),\n Paths.get(path),\n StandardCopyOption.REPLACE_EXISTING\n )\n}\n```\n\nOr transfer the response content to any [`OutputStream`](https://docs.oracle.com/javase/8/docs/api/java/io/OutputStream.html):\n\n```kotlin\nimport java.nio.file.Files\nimport java.nio.file.Paths\n\nclient.invoices().payments().retrieve(params).use {\n it.body().transferTo(Files.newOutputStream(Paths.get(path)))\n}\n```\n\n## Raw responses\n\nThe SDK defines methods that deserialize responses into instances of Kotlin classes. However, these methods don\'t provide access to the response headers, status code, or the raw response body.\n\nTo access this data, prefix any HTTP method call on a client or service with `withRawResponse()`:\n\n```kotlin\nimport com.dodopayments.api.core.http.Headers\nimport com.dodopayments.api.core.http.HttpResponseFor\nimport com.dodopayments.api.models.checkoutsessions.CheckoutSessionRequest\nimport com.dodopayments.api.models.checkoutsessions.CheckoutSessionResponse\nimport com.dodopayments.api.models.checkoutsessions.ProductItemReq\n\nval params: CheckoutSessionRequest = CheckoutSessionRequest.builder()\n .addProductCart(ProductItemReq.builder()\n .productId("product_id")\n .quantity(0)\n .build())\n .build()\nval checkoutSessionResponse: HttpResponseFor<CheckoutSessionResponse> = client.checkoutSessions().withRawResponse().create(params)\n\nval statusCode: Int = checkoutSessionResponse.statusCode()\nval headers: Headers = checkoutSessionResponse.headers()\n```\n\nYou can still deserialize the response into an instance of a Kotlin class if needed:\n\n```kotlin\nimport com.dodopayments.api.models.checkoutsessions.CheckoutSessionResponse\n\nval parsedCheckoutSessionResponse: CheckoutSessionResponse = checkoutSessionResponse.parse()\n```\n\n## Error handling\n\nThe SDK throws custom unchecked exception types:\n\n- [`DodoPaymentsServiceException`](dodo-payments-kotlin-core/src/main/kotlin/com/dodopayments/api/errors/DodoPaymentsServiceException.kt): Base class for HTTP errors. See this table for which exception subclass is thrown for each HTTP status code:\n\n | Status | Exception |\n | ------ | -------------------------------------------------- |\n | 400 | [`BadRequestException`](dodo-payments-kotlin-core/src/main/kotlin/com/dodopayments/api/errors/BadRequestException.kt) |\n | 401 | [`UnauthorizedException`](dodo-payments-kotlin-core/src/main/kotlin/com/dodopayments/api/errors/UnauthorizedException.kt) |\n | 403 | [`PermissionDeniedException`](dodo-payments-kotlin-core/src/main/kotlin/com/dodopayments/api/errors/PermissionDeniedException.kt) |\n | 404 | [`NotFoundException`](dodo-payments-kotlin-core/src/main/kotlin/com/dodopayments/api/errors/NotFoundException.kt) |\n | 422 | [`UnprocessableEntityException`](dodo-payments-kotlin-core/src/main/kotlin/com/dodopayments/api/errors/UnprocessableEntityException.kt) |\n | 429 | [`RateLimitException`](dodo-payments-kotlin-core/src/main/kotlin/com/dodopayments/api/errors/RateLimitException.kt) |\n | 5xx | [`InternalServerException`](dodo-payments-kotlin-core/src/main/kotlin/com/dodopayments/api/errors/InternalServerException.kt) |\n | others | [`UnexpectedStatusCodeException`](dodo-payments-kotlin-core/src/main/kotlin/com/dodopayments/api/errors/UnexpectedStatusCodeException.kt) |\n\n- [`DodoPaymentsIoException`](dodo-payments-kotlin-core/src/main/kotlin/com/dodopayments/api/errors/DodoPaymentsIoException.kt): I/O networking errors.\n\n- [`DodoPaymentsRetryableException`](dodo-payments-kotlin-core/src/main/kotlin/com/dodopayments/api/errors/DodoPaymentsRetryableException.kt): Generic error indicating a failure that could be retried by the client.\n\n- [`DodoPaymentsInvalidDataException`](dodo-payments-kotlin-core/src/main/kotlin/com/dodopayments/api/errors/DodoPaymentsInvalidDataException.kt): Failure to interpret successfully parsed data. For example, when accessing a property that\'s supposed to be required, but the API unexpectedly omitted it from the response.\n\n- [`DodoPaymentsException`](dodo-payments-kotlin-core/src/main/kotlin/com/dodopayments/api/errors/DodoPaymentsException.kt): Base class for all exceptions. Most errors will result in one of the previously mentioned ones, but completely generic errors may be thrown using the base class.\n\n## Pagination\n\nThe SDK defines methods that return a paginated lists of results. It provides convenient ways to access the results either one page at a time or item-by-item across all pages.\n\n### Auto-pagination\n\nTo iterate through all results across all pages, use the `autoPager()` method, which automatically fetches more pages as needed.\n\nWhen using the synchronous client, the method returns a [`Sequence`](https://kotlinlang.org/docs/sequences.html)\n\n```kotlin\nimport com.dodopayments.api.models.payments.PaymentListPage\n\nval page: PaymentListPage = client.payments().list()\npage.autoPager()\n .take(50)\n .forEach { payment -> println(payment) }\n```\n\nWhen using the asynchronous client, the method returns a [`Flow`](https://kotlinlang.org/docs/flow.html):\n\n```kotlin\nimport com.dodopayments.api.models.payments.PaymentListPageAsync\n\nval page: PaymentListPageAsync = client.async().payments().list()\npage.autoPager()\n .take(50)\n .forEach { payment -> println(payment) }\n```\n\n### Manual pagination\n\nTo access individual page items and manually request the next page, use the `items()`,\n`hasNextPage()`, and `nextPage()` methods:\n\n```kotlin\nimport com.dodopayments.api.models.payments.PaymentListPage\nimport com.dodopayments.api.models.payments.PaymentListResponse\n\nval page: PaymentListPage = client.payments().list()\nwhile (true) {\n for (payment in page.items()) {\n println(payment)\n }\n\n if (!page.hasNextPage()) {\n break\n }\n\n page = page.nextPage()\n}\n```\n\n## Logging\n\nEnable logging by setting the `DODO_PAYMENTS_LOG` environment variable to `info`:\n\n```sh\nexport DODO_PAYMENTS_LOG=info\n```\n\nOr to `debug` for more verbose logging:\n\n```sh\nexport DODO_PAYMENTS_LOG=debug\n```\n\nOr configure the client manually using the `logLevel` method:\n\n```kotlin\nimport com.dodopayments.api.client.DodoPaymentsClient\nimport com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient\nimport com.dodopayments.api.core.LogLevel\n\nval client: DodoPaymentsClient = DodoPaymentsOkHttpClient.builder()\n .fromEnv()\n .logLevel(LogLevel.INFO)\n .build()\n```\n\n## ProGuard and R8\n\nAlthough the SDK uses reflection, it is still usable with [ProGuard](https://github.com/Guardsquare/proguard) and [R8](https://developer.android.com/topic/performance/app-optimization/enable-app-optimization) because `dodo-payments-kotlin-core` is published with a [configuration file](dodo-payments-kotlin-core/src/main/resources/META-INF/proguard/dodo-payments-kotlin-core.pro) containing [keep rules](https://www.guardsquare.com/manual/configuration/usage).\n\nProGuard and R8 should automatically detect and use the published rules, but you can also manually copy the keep rules if necessary.\n\n\n\n\n\n## Jackson\n\nThe SDK depends on [Jackson](https://github.com/FasterXML/jackson) for JSON serialization/deserialization. It is compatible with version 2.13.4 or higher, but depends on version 2.18.2 by default.\n\nThe SDK throws an exception if it detects an incompatible Jackson version at runtime (e.g. if the default version was overridden in your Maven or Gradle config).\n\nIf the SDK threw an exception, but you\'re _certain_ the version is compatible, then disable the version check using the `checkJacksonVersionCompatibility` on [`DodoPaymentsOkHttpClient`](dodo-payments-kotlin-client-okhttp/src/main/kotlin/com/dodopayments/api/client/okhttp/DodoPaymentsOkHttpClient.kt) or [`DodoPaymentsOkHttpClientAsync`](dodo-payments-kotlin-client-okhttp/src/main/kotlin/com/dodopayments/api/client/okhttp/DodoPaymentsOkHttpClientAsync.kt).\n\n> [!CAUTION]\n> We make no guarantee that the SDK works correctly when the Jackson version check is disabled.\n\nAlso note that there are bugs in older Jackson versions that can affect the SDK. We don\'t work around all Jackson bugs ([example](https://github.com/FasterXML/jackson-databind/issues/3240)) and expect users to upgrade Jackson for those instead.\n\n## Network options\n\n### Retries\n\nThe SDK automatically retries 2 times by default, with a short exponential backoff between requests.\n\nOnly the following error types are retried:\n- Connection errors (for example, due to a network connectivity problem)\n- 408 Request Timeout\n- 409 Conflict\n- 429 Rate Limit\n- 5xx Internal\n\nThe API may also explicitly instruct the SDK to retry or not retry a request.\n\nTo set a custom number of retries, configure the client using the `maxRetries` method:\n\n```kotlin\nimport com.dodopayments.api.client.DodoPaymentsClient\nimport com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient\n\nval client: DodoPaymentsClient = DodoPaymentsOkHttpClient.builder()\n .fromEnv()\n .maxRetries(4)\n .build()\n```\n\n### Timeouts\n\nRequests time out after 1 minute by default.\n\nTo set a custom timeout, configure the method call using the `timeout` method:\n\n```kotlin\nimport com.dodopayments.api.models.checkoutsessions.CheckoutSessionResponse\n\nval checkoutSessionResponse: CheckoutSessionResponse = client.checkoutSessions().create(\n params, RequestOptions.builder().timeout(Duration.ofSeconds(30)).build()\n)\n```\n\nOr configure the default for all method calls at the client level:\n\n```kotlin\nimport com.dodopayments.api.client.DodoPaymentsClient\nimport com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient\nimport java.time.Duration\n\nval client: DodoPaymentsClient = DodoPaymentsOkHttpClient.builder()\n .fromEnv()\n .timeout(Duration.ofSeconds(30))\n .build()\n```\n\n### Proxies\n\nTo route requests through a proxy, configure the client using the `proxy` method:\n\n```kotlin\nimport com.dodopayments.api.client.DodoPaymentsClient\nimport com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient\nimport java.net.InetSocketAddress\nimport java.net.Proxy\n\nval client: DodoPaymentsClient = DodoPaymentsOkHttpClient.builder()\n .fromEnv()\n .proxy(Proxy(\n Proxy.Type.HTTP, InetSocketAddress(\n "https://example.com", 8080\n )\n ))\n .build()\n```\n\nIf the proxy responds with `407 Proxy Authentication Required`, supply credentials by also configuring `proxyAuthenticator`:\n\n```kotlin\nimport com.dodopayments.api.client.DodoPaymentsClient\nimport com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient\nimport com.dodopayments.api.core.http.ProxyAuthenticator\n\nval client: DodoPaymentsClient = DodoPaymentsOkHttpClient.builder()\n .fromEnv()\n .proxy(...)\n // Or a custom implementation of `ProxyAuthenticator`.\n .proxyAuthenticator(ProxyAuthenticator.basic("username", "password"))\n .build()\n```\n\n### Connection pooling\n\nTo customize the underlying OkHttp connection pool, configure the client using the `maxIdleConnections` and `keepAliveDuration` methods:\n\n```kotlin\nimport com.dodopayments.api.client.DodoPaymentsClient\nimport com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient\nimport java.time.Duration\n\nval client: DodoPaymentsClient = DodoPaymentsOkHttpClient.builder()\n .fromEnv()\n // If `maxIdleConnections` is set, then `keepAliveDuration` must be set, and vice versa.\n .maxIdleConnections(10)\n .keepAliveDuration(Duration.ofMinutes(2))\n .build()\n```\n\nIf both options are unset, OkHttp\'s default connection pool settings are used.\n\n### HTTPS\n\n> [!NOTE]\n> Most applications should not call these methods, and instead use the system defaults. The defaults include\n> special optimizations that can be lost if the implementations are modified.\n\nTo configure how HTTPS connections are secured, configure the client using the `sslSocketFactory`, `trustManager`, and `hostnameVerifier` methods:\n\n```kotlin\nimport com.dodopayments.api.client.DodoPaymentsClient\nimport com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient\n\nval client: DodoPaymentsClient = DodoPaymentsOkHttpClient.builder()\n .fromEnv()\n // If `sslSocketFactory` is set, then `trustManager` must be set, and vice versa.\n .sslSocketFactory(yourSSLSocketFactory)\n .trustManager(yourTrustManager)\n .hostnameVerifier(yourHostnameVerifier)\n .build()\n```\n\n### Environments\n\nThe SDK sends requests to the live_mode by default. To send requests to a different environment, configure the client like so:\n\n```kotlin\nimport com.dodopayments.api.client.DodoPaymentsClient\nimport com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient\n\nval client: DodoPaymentsClient = DodoPaymentsOkHttpClient.builder()\n .fromEnv()\n .testMode()\n .build()\n```\n\n### Custom HTTP client\n\nThe SDK consists of three artifacts:\n- `dodo-payments-kotlin-core`\n - Contains core SDK logic\n - Does not depend on [OkHttp](https://square.github.io/okhttp)\n - Exposes [`DodoPaymentsClient`](dodo-payments-kotlin-core/src/main/kotlin/com/dodopayments/api/client/DodoPaymentsClient.kt), [`DodoPaymentsClientAsync`](dodo-payments-kotlin-core/src/main/kotlin/com/dodopayments/api/client/DodoPaymentsClientAsync.kt), [`DodoPaymentsClientImpl`](dodo-payments-kotlin-core/src/main/kotlin/com/dodopayments/api/client/DodoPaymentsClientImpl.kt), and [`DodoPaymentsClientAsyncImpl`](dodo-payments-kotlin-core/src/main/kotlin/com/dodopayments/api/client/DodoPaymentsClientAsyncImpl.kt), all of which can work with any HTTP client\n- `dodo-payments-kotlin-client-okhttp`\n - Depends on [OkHttp](https://square.github.io/okhttp)\n - Exposes [`DodoPaymentsOkHttpClient`](dodo-payments-kotlin-client-okhttp/src/main/kotlin/com/dodopayments/api/client/okhttp/DodoPaymentsOkHttpClient.kt) and [`DodoPaymentsOkHttpClientAsync`](dodo-payments-kotlin-client-okhttp/src/main/kotlin/com/dodopayments/api/client/okhttp/DodoPaymentsOkHttpClientAsync.kt), which provide a way to construct [`DodoPaymentsClientImpl`](dodo-payments-kotlin-core/src/main/kotlin/com/dodopayments/api/client/DodoPaymentsClientImpl.kt) and [`DodoPaymentsClientAsyncImpl`](dodo-payments-kotlin-core/src/main/kotlin/com/dodopayments/api/client/DodoPaymentsClientAsyncImpl.kt), respectively, using OkHttp\n- `dodo-payments-kotlin`\n - Depends on and exposes the APIs of both `dodo-payments-kotlin-core` and `dodo-payments-kotlin-client-okhttp`\n - Does not have its own logic\n\nThis structure allows replacing the SDK\'s default HTTP client without pulling in unnecessary dependencies.\n\n#### Customized [`OkHttpClient`](https://square.github.io/okhttp/3.x/okhttp/okhttp3/OkHttpClient.html)\n\n> [!TIP]\n> Try the available [network options](#network-options) before replacing the default client.\n\nTo use a customized `OkHttpClient`:\n\n1. Replace your [`dodo-payments-kotlin` dependency](#installation) with `dodo-payments-kotlin-core`\n2. Copy `dodo-payments-kotlin-client-okhttp`\'s [`OkHttpClient`](dodo-payments-kotlin-client-okhttp/src/main/kotlin/com/dodopayments/api/client/okhttp/OkHttpClient.kt) class into your code and customize it\n3. Construct [`DodoPaymentsClientImpl`](dodo-payments-kotlin-core/src/main/kotlin/com/dodopayments/api/client/DodoPaymentsClientImpl.kt) or [`DodoPaymentsClientAsyncImpl`](dodo-payments-kotlin-core/src/main/kotlin/com/dodopayments/api/client/DodoPaymentsClientAsyncImpl.kt), similarly to [`DodoPaymentsOkHttpClient`](dodo-payments-kotlin-client-okhttp/src/main/kotlin/com/dodopayments/api/client/okhttp/DodoPaymentsOkHttpClient.kt) or [`DodoPaymentsOkHttpClientAsync`](dodo-payments-kotlin-client-okhttp/src/main/kotlin/com/dodopayments/api/client/okhttp/DodoPaymentsOkHttpClientAsync.kt), using your customized client\n\n### Completely custom HTTP client\n\nTo use a completely custom HTTP client:\n\n1. Replace your [`dodo-payments-kotlin` dependency](#installation) with `dodo-payments-kotlin-core`\n2. Write a class that implements the [`HttpClient`](dodo-payments-kotlin-core/src/main/kotlin/com/dodopayments/api/core/http/HttpClient.kt) interface\n3. Construct [`DodoPaymentsClientImpl`](dodo-payments-kotlin-core/src/main/kotlin/com/dodopayments/api/client/DodoPaymentsClientImpl.kt) or [`DodoPaymentsClientAsyncImpl`](dodo-payments-kotlin-core/src/main/kotlin/com/dodopayments/api/client/DodoPaymentsClientAsyncImpl.kt), similarly to [`DodoPaymentsOkHttpClient`](dodo-payments-kotlin-client-okhttp/src/main/kotlin/com/dodopayments/api/client/okhttp/DodoPaymentsOkHttpClient.kt) or [`DodoPaymentsOkHttpClientAsync`](dodo-payments-kotlin-client-okhttp/src/main/kotlin/com/dodopayments/api/client/okhttp/DodoPaymentsOkHttpClientAsync.kt), using your new client class\n\n## Undocumented API functionality\n\nThe SDK is typed for convenient usage of the documented API. However, it also supports working with undocumented or not yet supported parts of the API.\n\n### Parameters\n\nTo set undocumented parameters, call the `putAdditionalHeader`, `putAdditionalQueryParam`, or `putAdditionalBodyProperty` methods on any `Params` class:\n\n```kotlin\nimport com.dodopayments.api.core.JsonValue\nimport com.dodopayments.api.models.checkoutsessions.CheckoutSessionCreateParams\n\nval params: CheckoutSessionCreateParams = CheckoutSessionCreateParams.builder()\n .putAdditionalHeader("Secret-Header", "42")\n .putAdditionalQueryParam("secret_query_param", "42")\n .putAdditionalBodyProperty("secretProperty", JsonValue.from("42"))\n .build()\n```\n\nThese can be accessed on the built object later using the `_additionalHeaders()`, `_additionalQueryParams()`, and `_additionalBodyProperties()` methods.\n\nTo set a documented parameter or property to an undocumented or not yet supported _value_, pass a [`JsonValue`](dodo-payments-kotlin-core/src/main/kotlin/com/dodopayments/api/core/Values.kt) object to its setter:\n\n```kotlin\nimport com.dodopayments.api.models.checkoutsessions.CheckoutSessionCreateParams\nimport com.dodopayments.api.models.checkoutsessions.CheckoutSessionRequest\nimport com.dodopayments.api.models.checkoutsessions.ProductItemReq\n\nval params: CheckoutSessionCreateParams = CheckoutSessionCreateParams.builder()\n .checkoutSessionRequest(CheckoutSessionRequest.builder()\n .addProductCart(ProductItemReq.builder()\n .productId("product_id")\n .quantity(0)\n .build())\n .build())\n .build()\n```\n\nThe most straightforward way to create a [`JsonValue`](dodo-payments-kotlin-core/src/main/kotlin/com/dodopayments/api/core/Values.kt) is using its `from(...)` method:\n\n```kotlin\nimport com.dodopayments.api.core.JsonValue\n\n// Create primitive JSON values\nval nullValue: JsonValue = JsonValue.from(null)\nval booleanValue: JsonValue = JsonValue.from(true)\nval numberValue: JsonValue = JsonValue.from(42)\nval stringValue: JsonValue = JsonValue.from("Hello World!")\n\n// Create a JSON array value equivalent to `["Hello", "World"]`\nval arrayValue: JsonValue = JsonValue.from(listOf(\n "Hello", "World"\n))\n\n// Create a JSON object value equivalent to `{ "a": 1, "b": 2 }`\nval objectValue: JsonValue = JsonValue.from(mapOf(\n "a" to 1, "b" to 2\n))\n\n// Create an arbitrarily nested JSON equivalent to:\n// {\n// "a": [1, 2],\n// "b": [3, 4]\n// }\nval complexValue: JsonValue = JsonValue.from(mapOf(\n "a" to listOf(\n 1, 2\n ), "b" to listOf(\n 3, 4\n )\n))\n```\n\nNormally a `Builder` class\'s `build` method will throw [`IllegalStateException`](https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalStateException.html) if any required parameter or property is unset.\n\nTo forcibly omit a required parameter or property, pass [`JsonMissing`](dodo-payments-kotlin-core/src/main/kotlin/com/dodopayments/api/core/Values.kt):\n\n```kotlin\nimport com.dodopayments.api.core.JsonMissing\nimport com.dodopayments.api.models.checkoutsessions.CheckoutSessionCreateParams\nimport com.dodopayments.api.models.checkoutsessions.CheckoutSessionRequest\nimport com.dodopayments.api.models.checkoutsessions.ProductItemReq\n\nval params: CheckoutSessionCreateParams = CheckoutSessionCreateParams.builder()\n .checkoutSessionRequest(CheckoutSessionRequest.builder()\n .addProductCart(ProductItemReq.builder()\n .productId("product_id")\n .quantity(0)\n .build())\n .build())\n .productCart(JsonMissing.of())\n .build()\n```\n\n### Response properties\n\nTo access undocumented response properties, call the `_additionalProperties()` method:\n\n```kotlin\nimport com.dodopayments.api.core.JsonBoolean\nimport com.dodopayments.api.core.JsonNull\nimport com.dodopayments.api.core.JsonNumber\nimport com.dodopayments.api.core.JsonValue\n\nval additionalProperties: Map<String, JsonValue> = client.checkoutSessions().create(params)._additionalProperties()\nval secretPropertyValue: JsonValue = additionalProperties.get("secretProperty")\n\nval result = when (secretPropertyValue) {\n is JsonNull -> "It\'s null!"\n is JsonBoolean -> "It\'s a boolean!"\n is JsonNumber -> "It\'s a number!"\n // Other types include `JsonMissing`, `JsonString`, `JsonArray`, and `JsonObject`\n else -> "It\'s something else!"\n}\n```\n\nTo access a property\'s raw JSON value, which may be undocumented, call its `_` prefixed method:\n\n```kotlin\nimport com.dodopayments.api.core.JsonField\n\nval field: JsonField<Any> = client.checkoutSessions().create(params)._field()\n\nif (field.isMissing()) {\n // The property is absent from the JSON response\n} else if (field.isNull()) {\n // The property was set to literal null\n} else {\n // Check if value was provided as a string\n // Other methods include `asNumber()`, `asBoolean()`, etc.\n val jsonString: String? = field.asString();\n\n // Try to deserialize into a custom type\n val myObject: MyClass = field.asUnknown()!!.convert(MyClass::class.java)\n}\n```\n\n### Response validation\n\nIn rare cases, the API may return a response that doesn\'t match the expected type. For example, the SDK may expect a property to contain a `String`, but the API could return something else.\n\nBy default, the SDK will not throw an exception in this case. It will throw [`DodoPaymentsInvalidDataException`](dodo-payments-kotlin-core/src/main/kotlin/com/dodopayments/api/errors/DodoPaymentsInvalidDataException.kt) only if you directly access the property.\n\nValidating the response is _not_ forwards compatible with new types from the API for existing fields.\n\nIf you would still prefer to check that the response is completely well-typed upfront, then either call `validate()`:\n\n```kotlin\nimport com.dodopayments.api.models.checkoutsessions.CheckoutSessionResponse\n\nval checkoutSessionResponse: CheckoutSessionResponse = client.checkoutSessions().create(params).validate()\n```\n\nOr configure the method call to validate the response using the `responseValidation` method:\n\n```kotlin\nimport com.dodopayments.api.models.checkoutsessions.CheckoutSessionResponse\n\nval checkoutSessionResponse: CheckoutSessionResponse = client.checkoutSessions().create(\n params, RequestOptions.builder().responseValidation(true).build()\n)\n```\n\nOr configure the default for all method calls at the client level:\n\n```kotlin\nimport com.dodopayments.api.client.DodoPaymentsClient\nimport com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient\n\nval client: DodoPaymentsClient = DodoPaymentsOkHttpClient.builder()\n .fromEnv()\n .responseValidation(true)\n .build()\n```\n\n## FAQ\n\n### Why don\'t you use plain `enum` classes?\n\nKotlin `enum` classes are not trivially [forwards compatible](https://www.stainless.com/blog/making-java-enums-forwards-compatible). Using them in the SDK could cause runtime exceptions if the API is updated to respond with a new enum value.\n\n### Why do you represent fields using `JsonField<T>` instead of just plain `T`?\n\nUsing `JsonField<T>` enables a few features:\n\n- Allowing usage of [undocumented API functionality](#undocumented-api-functionality)\n- Lazily [validating the API response against the expected shape](#response-validation)\n- Representing absent vs explicitly null values\n\n### Why don\'t you use [`data` classes](https://kotlinlang.org/docs/data-classes.html)?\n\nIt is not [backwards compatible to add new fields to a data class](https://kotlinlang.org/docs/api-guidelines-backward-compatibility.html#avoid-using-data-classes-in-your-api) and we don\'t want to introduce a breaking change every time we add a field to a class.\n\n### Why don\'t you use checked exceptions?\n\nChecked exceptions are widely considered a mistake in the Java programming language. In fact, they were omitted from Kotlin for this reason.\n\nChecked exceptions:\n\n- Are verbose to handle\n- Encourage error handling at the wrong level of abstraction, where nothing can be done about the error\n- Are tedious to propagate due to the [function coloring problem](https://journal.stuffwithstuff.com/2015/02/01/what-color-is-your-function)\n- Don\'t play well with lambdas (also due to the function coloring problem)\n\n## Semantic versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n2. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/dodopayments/dodopayments-kotlin/issues) with questions, bugs, or suggestions.\n',
7445
6919
  },
7446
6920
  {
7447
- language: 'php',
7448
- content: "# Dodo Payments PHP API Library\n\nThe Dodo Payments PHP library provides convenient access to the Dodo Payments REST API from any PHP 8.1.0+ application.\n\n## Installation\n\n<!-- x-release-please-start-version -->\n```\ncomposer require \"dodopayments/client 0.0.1\"\n```\n<!-- x-release-please-end -->\n\n## Usage\n\n```php\n<?php\n\n$client = new Client(\n bearerToken: getenv('DODO_PAYMENTS_API_KEY') ?: 'My Bearer Token',\n environment: 'test_mode',\n);\n\n$checkoutSessionResponse = $client->checkoutSessions->create(\n productCart: [['productID' => 'pdt_example', 'quantity' => 1]]\n);\n\nvar_dump($checkoutSessionResponse->session_id);\n```",
7449
- },
7450
- {
7451
- language: 'python',
7452
- content: '# Dodo Payments Python API library\n\n<!-- prettier-ignore -->\n[![PyPI version](https://img.shields.io/pypi/v/dodopayments.svg?label=pypi%20(stable))](https://pypi.org/project/dodopayments/)\n\nThe Dodo Payments Python library provides convenient access to the Dodo Payments REST API from any Python 3.9+\napplication. The library includes type definitions for all request params and response fields,\nand offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx).\n\n\n\nIt is generated with [Stainless](https://www.stainless.com/).\n\n## MCP Server\n\nUse the Dodo Payments MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=dodopayments-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsImRvZG9wYXltZW50cy1tY3AiXSwiZW52Ijp7IkRPRE9fUEFZTUVOVFNfQVBJX0tFWSI6Ik15IEJlYXJlciBUb2tlbiIsIkRPRE9fUEFZTUVOVFNfV0VCSE9PS19LRVkiOiJNeSBXZWJob29rIEtleSJ9fQ)\n[![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22dodopayments-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22dodopayments-mcp%22%5D%2C%22env%22%3A%7B%22DODO_PAYMENTS_API_KEY%22%3A%22My%20Bearer%20Token%22%2C%22DODO_PAYMENTS_WEBHOOK_KEY%22%3A%22My%20Webhook%20Key%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n## Documentation\n\nThe REST API documentation can be found on [docs.dodopayments.com](https://docs.dodopayments.com/api-reference/introduction). The full API of this library can be found in [api.md](api.md).\n\n## Installation\n\n```sh\n# install from PyPI\npip install dodopayments\n```\n\n## Usage\n\nThe full API of this library can be found in [api.md](api.md).\n\n```python\nimport os\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n # defaults to "live_mode".\n environment="test_mode",\n)\n\ncheckout_session_response = client.checkout_sessions.create(\n product_cart=[{\n "product_id": "pdt_example",\n "quantity": 1,\n }],\n)\nprint(checkout_session_response.session_id)\n```\n\nWhile you can provide a `bearer_token` keyword argument,\nwe recommend using [python-dotenv](https://pypi.org/project/python-dotenv/)\nto add `DODO_PAYMENTS_API_KEY="My Bearer Token"` to your `.env` file\nso that your Bearer Token is not stored in source control.\n\n## Async usage\n\nSimply import `AsyncDodoPayments` instead of `DodoPayments` and use `await` with each API call:\n\n```python\nimport os\nimport asyncio\nfrom dodopayments import AsyncDodoPayments\n\nclient = AsyncDodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n # defaults to "live_mode".\n environment="test_mode",\n)\n\nasync def main() -> None:\n checkout_session_response = await client.checkout_sessions.create(\n product_cart=[{\n "product_id": "pdt_example",\n "quantity": 1,\n }],\n )\n print(checkout_session_response.session_id)\n\nasyncio.run(main())\n```\n\nFunctionality between the synchronous and asynchronous clients is otherwise identical.\n\n### With aiohttp\n\nBy default, the async client uses `httpx` for HTTP requests. However, for improved concurrency performance you may also use `aiohttp` as the HTTP backend.\n\nYou can enable this by installing `aiohttp`:\n\n```sh\n# install from PyPI\npip install dodopayments[aiohttp]\n```\n\nThen you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:\n\n```python\nimport os\nimport asyncio\nfrom dodopayments import DefaultAioHttpClient\nfrom dodopayments import AsyncDodoPayments\n\nasync def main() -> None:\n async with AsyncDodoPayments(\n bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted\n http_client=DefaultAioHttpClient(),\n) as client:\n checkout_session_response = await client.checkout_sessions.create(\n product_cart=[{\n "product_id": "pdt_example",\n "quantity": 1,\n }],\n )\n print(checkout_session_response.session_id)\n\nasyncio.run(main())\n```\n\n\n\n## Using types\n\nNested request parameters are [TypedDicts](https://docs.python.org/3/library/typing.html#typing.TypedDict). Responses are [Pydantic models](https://docs.pydantic.dev) which also provide helper methods for things like:\n\n- Serializing back into JSON, `model.to_json()`\n- Converting to a dictionary, `model.to_dict()`\n\nTyped requests and responses provide autocomplete and documentation within your editor. If you would like to see type errors in VS Code to help catch bugs earlier, set `python.analysis.typeCheckingMode` to `basic`.\n\n## Pagination\n\nList methods in the Dodo Payments API are paginated.\n\nThis library provides auto-paginating iterators with each list response, so you do not have to request successive pages manually:\n\n```python\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments()\n\nall_payments = []\n# Automatically fetches more pages as needed.\nfor payment in client.payments.list():\n # Do something with payment here\n all_payments.append(payment)\nprint(all_payments)\n```\n\nOr, asynchronously:\n\n```python\nimport asyncio\nfrom dodopayments import AsyncDodoPayments\n\nclient = AsyncDodoPayments()\n\nasync def main() -> None:\n all_payments = []\n # Iterate through items across all pages, issuing requests as needed.\n async for payment in client.payments.list():\n all_payments.append(payment)\n print(all_payments)\n\nasyncio.run(main())\n```\n\nAlternatively, you can use the `.has_next_page()`, `.next_page_info()`, or `.get_next_page()` methods for more granular control working with pages:\n\n```python\nfirst_page = await client.payments.list()\nif first_page.has_next_page():\n print(f"will fetch next page using these details: {first_page.next_page_info()}")\n next_page = await first_page.get_next_page()\n print(f"number of items we just fetched: {len(next_page.items)}")\n\n# Remove `await` for non-async usage.\n```\n\nOr just work directly with the returned data:\n\n```python\nfirst_page = await client.payments.list()\nfor payment in first_page.items:\n print(payment.brand_id)\n\n# Remove `await` for non-async usage.\n```\n\n## Nested params\n\nNested parameters are dictionaries, typed using `TypedDict`, for example:\n\n```python\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments()\n\ncheckout_session_response = client.checkout_sessions.create(\n product_cart=[{\n "product_id": "product_id",\n "quantity": 0,\n }],\n billing_address={\n "country": "AF"\n },\n)\nprint(checkout_session_response.billing_address)\n```\n\n\n\n## Handling errors\n\nWhen the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `dodopayments.APIConnectionError` is raised.\n\nWhen the API returns a non-success status code (that is, 4xx or 5xx\nresponse), a subclass of `dodopayments.APIStatusError` is raised, containing `status_code` and `response` properties.\n\nAll errors inherit from `dodopayments.APIError`.\n\n```python\nimport dodopayments\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments()\n\ntry:\n client.checkout_sessions.create(\n product_cart=[{\n "product_id": "pdt_example",\n "quantity": 1,\n }],\n )\nexcept dodopayments.APIConnectionError as e:\n print("The server could not be reached")\n print(e.__cause__) # an underlying Exception, likely raised within httpx.\nexcept dodopayments.RateLimitError as e:\n print("A 429 status code was received; we should back off a bit.")\nexcept dodopayments.APIStatusError as e:\n print("Another non-200-range status code was received")\n print(e.status_code)\n print(e.response)\n```\n\nError codes are as follows:\n\n| Status Code | Error Type |\n| ----------- | -------------------------- |\n| 400 | `BadRequestError` |\n| 401 | `AuthenticationError` |\n| 403 | `PermissionDeniedError` |\n| 404 | `NotFoundError` |\n| 422 | `UnprocessableEntityError` |\n| 429 | `RateLimitError` |\n| >=500 | `InternalServerError` |\n| N/A | `APIConnectionError` |\n\n### Retries\n\nCertain errors are automatically retried 2 times by default, with a short exponential backoff.\nConnection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict,\n429 Rate Limit, and >=500 Internal errors are all retried by default.\n\nYou can use the `max_retries` option to configure or disable retry settings:\n\n```python\nfrom dodopayments import DodoPayments\n\n# Configure the default for all requests:\nclient = DodoPayments(\n # default is 2\n max_retries=0,\n)\n\n# Or, configure per-request:\nclient.with_options(max_retries = 5).checkout_sessions.create(\n product_cart=[{\n "product_id": "pdt_example",\n "quantity": 1,\n }],\n)\n```\n\n### Timeouts\n\nBy default requests time out after 1 minute. You can configure this with a `timeout` option,\nwhich accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/timeouts/#fine-tuning-the-configuration) object:\n\n```python\nfrom dodopayments import DodoPayments\n\n# Configure the default for all requests:\nclient = DodoPayments(\n # 20 seconds (default is 1 minute)\n timeout=20.0,\n)\n\n# More granular control:\nclient = DodoPayments(\n timeout=httpx.Timeout(60.0, read=5.0, write=10.0, connect=2.0),\n)\n\n# Override per-request:\nclient.with_options(timeout = 5.0).checkout_sessions.create(\n product_cart=[{\n "product_id": "pdt_example",\n "quantity": 1,\n }],\n)\n```\n\nOn timeout, an `APITimeoutError` is thrown.\n\nNote that requests that time out are [retried twice by default](#retries).\n\n\n\n## Advanced\n\n### Logging\n\nWe use the standard library [`logging`](https://docs.python.org/3/library/logging.html) module.\n\nYou can enable logging by setting the environment variable `DODO_PAYMENTS_LOG` to `info`.\n\n```shell\n$ export DODO_PAYMENTS_LOG=info\n```\n\nOr to `debug` for more verbose logging.\n\n### How to tell whether `None` means `null` or missing\n\nIn an API response, a field may be explicitly `null`, or missing entirely; in either case, its value is `None` in this library. You can differentiate the two cases with `.model_fields_set`:\n\n```py\nif response.my_field is None:\n if \'my_field\' not in response.model_fields_set:\n print(\'Got json like {}, without a "my_field" key present at all.\')\n else:\n print(\'Got json like {"my_field": null}.\')\n```\n\n### Accessing raw response data (e.g. headers)\n\nThe "raw" Response object can be accessed by prefixing `.with_raw_response.` to any HTTP method call, e.g.,\n\n```py\nfrom dodopayments import DodoPayments\n\nclient = DodoPayments()\nresponse = client.checkout_sessions.with_raw_response.create(\n product_cart=[{\n "product_id": "pdt_example",\n "quantity": 1,\n }],\n)\nprint(response.headers.get(\'X-My-Header\'))\n\ncheckout_session = response.parse() # get the object that `checkout_sessions.create()` would have returned\nprint(checkout_session.session_id)\n```\n\nThese methods return an [`APIResponse`](https://github.com/dodopayments/dodopayments-python/tree/main/src/dodopayments/_response.py) object.\n\nThe async client returns an [`AsyncAPIResponse`](https://github.com/dodopayments/dodopayments-python/tree/main/src/dodopayments/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.\n\n#### `.with_streaming_response`\n\nThe above interface eagerly reads the full response body when you make the request, which may not always be what you want.\n\nTo stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods.\n\n```python\nwith client.checkout_sessions.with_streaming_response.create(\n product_cart=[{\n "product_id": "pdt_example",\n "quantity": 1,\n }],\n) as response :\n print(response.headers.get(\'X-My-Header\'))\n\n for line in response.iter_lines():\n print(line)\n```\n\nThe context manager is required so that the response will reliably be closed.\n\n### Making custom/undocumented requests\n\nThis library is typed for convenient access to the documented API.\n\nIf you need to access undocumented endpoints, params, or response properties, the library can still be used.\n\n#### Undocumented endpoints\n\nTo make requests to undocumented endpoints, you can make requests using `client.get`, `client.post`, and other\nhttp verbs. Options on the client will be respected (such as retries) when making this request.\n\n```py\nimport httpx\n\nresponse = client.post(\n "/foo",\n cast_to=httpx.Response,\n body={"my_param": True},\n)\n\nprint(response.headers.get("x-foo"))\n```\n\n#### Undocumented request params\n\nIf you want to explicitly send an extra param, you can do so with the `extra_query`, `extra_body`, and `extra_headers` request\noptions.\n\n#### Undocumented response properties\n\nTo access undocumented response properties, you can access the extra fields like `response.unknown_prop`. You\ncan also get all the extra fields on the Pydantic model as a dict with\n[`response.model_extra`](https://docs.pydantic.dev/latest/api/base_model/#pydantic.BaseModel.model_extra).\n\n### Configuring the HTTP client\n\nYou can directly override the [httpx client](https://www.python-httpx.org/api/#client) to customize it for your use case, including:\n\n- Support for [proxies](https://www.python-httpx.org/advanced/proxies/)\n- Custom [transports](https://www.python-httpx.org/advanced/transports/)\n- Additional [advanced](https://www.python-httpx.org/advanced/clients/) functionality\n\n```python\nimport httpx\nfrom dodopayments import DodoPayments, DefaultHttpxClient\n\nclient = DodoPayments(\n # Or use the `DODO_PAYMENTS_BASE_URL` env var\n base_url="http://my.test.server.example.com:8083",\n http_client=DefaultHttpxClient(proxy="http://my.test.proxy.example.com", transport=httpx.HTTPTransport(local_address="0.0.0.0")),\n)\n```\n\nYou can also customize the client on a per-request basis by using `with_options()`:\n\n```python\nclient.with_options(http_client=DefaultHttpxClient(...))\n```\n\n### Managing HTTP resources\n\nBy default the library closes underlying HTTP connections whenever the client is [garbage collected](https://docs.python.org/3/reference/datamodel.html#object.__del__). You can manually close the client using the `.close()` method if desired, or with a context manager that closes when exiting.\n\n```py\nfrom dodopayments import DodoPayments\n\nwith DodoPayments() as client:\n # make requests here\n ...\n\n# HTTP client is now closed\n```\n\n## Versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes that only affect static types, without breaking runtime behavior.\n2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n3. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/dodopayments/dodopayments-python/issues) with questions, bugs, or suggestions.\n\n### Determining the installed version\n\nIf you\'ve upgraded to the latest version but aren\'t seeing any new features you were expecting then your python environment is likely still using an older version.\n\nYou can determine the version that is being used at runtime with:\n\n```py\nimport dodopayments\nprint(dodopayments.__version__)\n```\n\n## Requirements\n\nPython 3.9 or higher.\n\n## Contributing\n\nSee [the contributing documentation](./CONTRIBUTING.md).\n',
6921
+ language: 'go',
6922
+ content: '# Dodo Payments Go API Library\n\n<a href="https://pkg.go.dev/github.com/dodopayments/dodopayments-go"><img src="https://pkg.go.dev/badge/github.com/dodopayments/dodopayments-go.svg" alt="Go Reference"></a>\n\nThe Dodo Payments Go library provides convenient access to the [Dodo Payments REST API](https://docs.dodopayments.com/api-reference/introduction)\nfrom applications written in Go.\n\nIt is generated with [Stainless](https://www.stainless.com/).\n\n## MCP Server\n\nUse the Dodo Payments MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=dodopayments-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsImRvZG9wYXltZW50cy1tY3AiXSwiZW52Ijp7IkRPRE9fUEFZTUVOVFNfQVBJX0tFWSI6Ik15IEJlYXJlciBUb2tlbiIsIkRPRE9fUEFZTUVOVFNfV0VCSE9PS19LRVkiOiJNeSBXZWJob29rIEtleSJ9fQ)\n[![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22dodopayments-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22dodopayments-mcp%22%5D%2C%22env%22%3A%7B%22DODO_PAYMENTS_API_KEY%22%3A%22My%20Bearer%20Token%22%2C%22DODO_PAYMENTS_WEBHOOK_KEY%22%3A%22My%20Webhook%20Key%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n## Installation\n\n<!-- x-release-please-start-version -->\n\n```go\nimport (\n\t"github.com/dodopayments/dodopayments-go" // imported as SDK_PackageName\n)\n```\n\n<!-- x-release-please-end -->\n\nOr to pin the version:\n\n<!-- x-release-please-start-version -->\n\n```sh\ngo get -u \'github.com/dodopayments/dodopayments-go@v0.0.1\'\n```\n\n<!-- x-release-please-end -->\n\n## Requirements\n\nThis library requires Go 1.22+.\n\n## Usage\n\nThe full API of this library can be found in [api.md](api.md).\n\n```go\npackage main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/dodopayments/dodopayments-go"\n\t"github.com/dodopayments/dodopayments-go/option"\n)\n\nfunc main() {\n\tclient := dodopayments.NewClient(\n\t\toption.WithBearerToken("My Bearer Token"), // defaults to os.LookupEnv("DODO_PAYMENTS_API_KEY")\n\t\toption.WithEnvironmentTestMode(), // defaults to option.WithEnvironmentLiveMode()\n\t)\n\tcheckoutSessionResponse, err := client.CheckoutSessions.New(context.TODO(), dodopayments.CheckoutSessionNewParams{\n\t\tCheckoutSessionRequest: dodopayments.CheckoutSessionRequestParam{\n\t\t\tProductCart: dodopayments.F([]dodopayments.ProductItemReqParam{{\n\t\t\t\tProductID: dodopayments.F("product_id"),\n\t\t\t\tQuantity: dodopayments.F(int64(0)),\n\t\t\t}}),\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", checkoutSessionResponse.SessionID)\n}\n\n```\n\n### Request fields\n\nAll request parameters are wrapped in a generic `Field` type,\nwhich we use to distinguish zero values from null or omitted fields.\n\nThis prevents accidentally sending a zero value if you forget a required parameter,\nand enables explicitly sending `null`, `false`, `\'\'`, or `0` on optional parameters.\nAny field not specified is not sent.\n\nTo construct fields with values, use the helpers `String()`, `Int()`, `Float()`, or most commonly, the generic `F[T]()`.\nTo send a null, use `Null[T]()`, and to send a nonconforming value, use `Raw[T](any)`. For example:\n\n```go\nparams := FooParams{\n\tName: SDK_PackageName.F("hello"),\n\n\t// Explicitly send `"description": null`\n\tDescription: SDK_PackageName.Null[string](),\n\n\tPoint: SDK_PackageName.F(SDK_PackageName.Point{\n\t\tX: SDK_PackageName.Int(0),\n\t\tY: SDK_PackageName.Int(1),\n\n\t\t// In cases where the API specifies a given type,\n\t\t// but you want to send something else, use `Raw`:\n\t\tZ: SDK_PackageName.Raw[int64](0.01), // sends a float\n\t}),\n}\n```\n\n### Response objects\n\nAll fields in response structs are value types (not pointers or wrappers).\n\nIf a given field is `null`, not present, or invalid, the corresponding field\nwill simply be its zero value.\n\nAll response structs also include a special `JSON` field, containing more detailed\ninformation about each property, which you can use like so:\n\n```go\nif res.Name == "" {\n\t// true if `"name"` is either not present or explicitly null\n\tres.JSON.Name.IsNull()\n\n\t// true if the `"name"` key was not present in the response JSON at all\n\tres.JSON.Name.IsMissing()\n\n\t// When the API returns data that cannot be coerced to the expected type:\n\tif res.JSON.Name.IsInvalid() {\n\t\traw := res.JSON.Name.Raw()\n\n\t\tlegacyName := struct{\n\t\t\tFirst string `json:"first"`\n\t\t\tLast string `json:"last"`\n\t\t}{}\n\t\tjson.Unmarshal([]byte(raw), &legacyName)\n\t\tname = legacyName.First + " " + legacyName.Last\n\t}\n}\n```\n\nThese `.JSON` structs also include an `Extras` map containing\nany properties in the json response that were not specified\nin the struct. This can be useful for API features not yet\npresent in the SDK.\n\n```go\nbody := res.JSON.ExtraFields["my_unexpected_field"].Raw()\n```\n\n### RequestOptions\n\nThis library uses the functional options pattern. Functions defined in the\n`SDK_PackageOptionName` package return a `RequestOption`, which is a closure that mutates a\n`RequestConfig`. These options can be supplied to the client or at individual\nrequests. For example:\n\n```go\nclient := SDK_PackageName.SDK_ClientInitializerName(\n\t// Adds a header to every request made by the client\n\tSDK_PackageOptionName.WithHeader("X-Some-Header", "custom_header_info"),\n)\n\nclient.CheckoutSessions.New(context.TODO(), ...,\n\t// Override the header\n\tSDK_PackageOptionName.WithHeader("X-Some-Header", "some_other_custom_header_info"),\n\t// Add an undocumented field to the request body, using sjson syntax\n\tSDK_PackageOptionName.WithJSONSet("some.json.path", map[string]string{"my": "object"}),\n)\n```\n\nSee the [full list of request options](https://pkg.go.dev/github.com/dodopayments/dodopayments-go/SDK_PackageOptionName).\n\n### Pagination\n\nThis library provides some conveniences for working with paginated list endpoints.\n\nYou can use `.ListAutoPaging()` methods to iterate through items across all pages:\n\n```go\niter := client.Payments.ListAutoPaging(context.TODO(), dodopayments.PaymentListParams{})\n// Automatically fetches more pages as needed.\nfor iter.Next() {\n\tpaymentListResponse := iter.Current()\n\tfmt.Printf("%+v\\n", paymentListResponse)\n}\nif err := iter.Err(); err != nil {\n\tpanic(err.Error())\n}\n```\n\nOr you can use simple `.List()` methods to fetch a single page and receive a standard response object\nwith additional helper methods like `.GetNextPage()`, e.g.:\n\n```go\npage, err := client.Payments.List(context.TODO(), dodopayments.PaymentListParams{})\nfor page != nil {\n\tfor _, payment := range page.Items {\n\t\tfmt.Printf("%+v\\n", payment)\n\t}\n\tpage, err = page.GetNextPage()\n}\nif err != nil {\n\tpanic(err.Error())\n}\n```\n\n### Errors\n\nWhen the API returns a non-success status code, we return an error with type\n`*SDK_PackageName.Error`. This contains the `StatusCode`, `*http.Request`, and\n`*http.Response` values of the request, as well as the JSON of the error body\n(much like other response objects in the SDK).\n\nTo handle errors, we recommend that you use the `errors.As` pattern:\n\n```go\n_, err := client.CheckoutSessions.New(context.TODO(), dodopayments.CheckoutSessionNewParams{\n\tCheckoutSessionRequest: dodopayments.CheckoutSessionRequestParam{\n\t\tProductCart: dodopayments.F([]dodopayments.ProductItemReqParam{{\n\t\t\tProductID: dodopayments.F("product_id"),\n\t\t\tQuantity: dodopayments.F(int64(0)),\n\t\t}}),\n\t},\n})\nif err != nil {\n\tvar apierr *dodopayments.Error\n\tif errors.As(err, &apierr) {\n\t\tprintln(string(apierr.DumpRequest(true))) // Prints the serialized HTTP request\n\t\tprintln(string(apierr.DumpResponse(true))) // Prints the serialized HTTP response\n\t}\n\tpanic(err.Error()) // GET "/checkouts": 400 Bad Request { ... }\n}\n```\n\nWhen other errors occur, they are returned unwrapped; for example,\nif HTTP transport fails, you might receive `*url.Error` wrapping `*net.OpError`.\n\n### Timeouts\n\nRequests do not time out by default; use context to configure a timeout for a request lifecycle.\n\nNote that if a request is [retried](#retries), the context timeout does not start over.\nTo set a per-retry timeout, use `SDK_PackageOptionName.WithRequestTimeout()`.\n\n```go\n// This sets the timeout for the request, including all the retries.\nctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)\ndefer cancel()\nclient.CheckoutSessions.New(\n\tctx,\n\tdodopayments.CheckoutSessionNewParams{\n\t\tCheckoutSessionRequest: dodopayments.CheckoutSessionRequestParam{\n\t\t\tProductCart: dodopayments.F([]dodopayments.ProductItemReqParam{{\n\t\t\t\tProductID: dodopayments.F("product_id"),\n\t\t\t\tQuantity: dodopayments.F(int64(0)),\n\t\t\t}}),\n\t\t},\n\t},\n\t// This sets the per-retry timeout\n\toption.WithRequestTimeout(20*time.Second),\n)\n```\n\n### File uploads\n\nRequest parameters that correspond to file uploads in multipart requests are typed as\n`param.Field[io.Reader]`. The contents of the `io.Reader` will by default be sent as a multipart form\npart with the file name of "anonymous_file" and content-type of "application/octet-stream".\n\nThe file name and content-type can be customized by implementing `Name() string` or `ContentType()\nstring` on the run-time type of `io.Reader`. Note that `os.File` implements `Name() string`, so a\nfile returned by `os.Open` will be sent with the file name on disk.\n\nWe also provide a helper `SDK_PackageName.FileParam(reader io.Reader, filename string, contentType string)`\nwhich can be used to wrap any `io.Reader` with the appropriate file name and content type.\n\n\n\n### Retries\n\nCertain errors will be automatically retried 2 times by default, with a short exponential backoff.\nWe retry by default all connection errors, 408 Request Timeout, 409 Conflict, 429 Rate Limit,\nand >=500 Internal errors.\n\nYou can use the `WithMaxRetries` option to configure or disable this:\n\n```go\n// Configure the default for all requests:\nclient := dodopayments.NewClient(\n\toption.WithMaxRetries(0), // default is 2\n)\n\n// Override per-request:\nclient.CheckoutSessions.New(\n\tcontext.TODO(),\n\tdodopayments.CheckoutSessionNewParams{\n\t\tCheckoutSessionRequest: dodopayments.CheckoutSessionRequestParam{\n\t\t\tProductCart: dodopayments.F([]dodopayments.ProductItemReqParam{{\n\t\t\t\tProductID: dodopayments.F("product_id"),\n\t\t\t\tQuantity: dodopayments.F(int64(0)),\n\t\t\t}}),\n\t\t},\n\t},\n\toption.WithMaxRetries(5),\n)\n```\n\n\n### Accessing raw response data (e.g. response headers)\n\nYou can access the raw HTTP response data by using the `option.WithResponseInto()` request option. This is useful when\nyou need to examine response headers, status codes, or other details.\n\n```go\n// Create a variable to store the HTTP response\nvar response *http.Response\ncheckoutSessionResponse, err := client.CheckoutSessions.New(\n\tcontext.TODO(),\n\tdodopayments.CheckoutSessionNewParams{\n\t\tCheckoutSessionRequest: dodopayments.CheckoutSessionRequestParam{\n\t\t\tProductCart: dodopayments.F([]dodopayments.ProductItemReqParam{{\n\t\t\t\tProductID: dodopayments.F("product_id"),\n\t\t\t\tQuantity: dodopayments.F(int64(0)),\n\t\t\t}}),\n\t\t},\n\t},\n\toption.WithResponseInto(&response),\n)\nif err != nil {\n\t// handle error\n}\nfmt.Printf("%+v\\n", checkoutSessionResponse)\n\nfmt.Printf("Status Code: %d\\n", response.StatusCode)\nfmt.Printf("Headers: %+#v\\n", response.Header)\n```\n\n### Making custom/undocumented requests\n\nThis library is typed for convenient access to the documented API. If you need to access undocumented\nendpoints, params, or response properties, the library can still be used.\n\n#### Undocumented endpoints\n\nTo make requests to undocumented endpoints, you can use `client.Get`, `client.Post`, and other HTTP verbs.\n`RequestOptions` on the client, such as retries, will be respected when making these requests.\n\n```go\nvar (\n // params can be an io.Reader, a []byte, an encoding/json serializable object,\n // or a "…Params" struct defined in this library.\n params map[string]interface{}\n\n // result can be an []byte, *http.Response, a encoding/json deserializable object,\n // or a model defined in this library.\n result *http.Response\n)\nerr := client.Post(context.Background(), "/unspecified", params, &result)\nif err != nil {\n …\n}\n```\n\n#### Undocumented request params\n\nTo make requests using undocumented parameters, you may use either the `SDK_PackageOptionName.WithQuerySet()`\nor the `SDK_PackageOptionName.WithJSONSet()` methods.\n\n```go\nparams := FooNewParams{\n ID: SDK_PackageName.F("id_xxxx"),\n Data: SDK_PackageName.F(FooNewParamsData{\n FirstName: SDK_PackageName.F("John"),\n }),\n}\nclient.Foo.New(context.Background(), params, SDK_PackageOptionName.WithJSONSet("data.last_name", "Doe"))\n```\n\n#### Undocumented response properties\n\nTo access undocumented response properties, you may either access the raw JSON of the response as a string\nwith `result.JSON.RawJSON()`, or get the raw JSON of a particular field on the result with\n`result.JSON.Foo.Raw()`.\n\nAny fields that are not present on the response struct will be saved and can be accessed by `result.JSON.ExtraFields()` which returns the extra fields as a `map[string]Field`.\n\n### Middleware\n\nWe provide `SDK_PackageOptionName.WithMiddleware` which applies the given\nmiddleware to requests.\n\n```go\nfunc Logger(req *http.Request, next SDK_PackageOptionName.MiddlewareNext) (res *http.Response, err error) {\n\t// Before the request\n\tstart := time.Now()\n\tLogReq(req)\n\n\t// Forward the request to the next handler\n\tres, err = next(req)\n\n\t// Handle stuff after the request\n\tend := time.Now()\n\tLogRes(res, err, start - end)\n\n return res, err\n}\n\nclient := SDK_PackageName.SDK_ClientInitializerName(\n\tSDK_PackageOptionName.WithMiddleware(Logger),\n)\n```\n\nWhen multiple middlewares are provided as variadic arguments, the middlewares\nare applied left to right. If `SDK_PackageOptionName.WithMiddleware` is given\nmultiple times, for example first in the client then the method, the\nmiddleware in the client will run first and the middleware given in the method\nwill run next.\n\nYou may also replace the default `http.Client` with\n`SDK_PackageOptionName.WithHTTPClient(client)`. Only one http client is\naccepted (this overwrites any previous client) and receives requests after any\nmiddleware has been applied.\n\n## Semantic versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n2. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/dodopayments/dodopayments-go/issues) with questions, bugs, or suggestions.\n\n## Contributing\n\nSee [the contributing documentation](./CONTRIBUTING.md).\n',
7453
6923
  },
7454
6924
  {
7455
6925
  language: 'ruby',
7456
6926
  content: '# Dodo Payments Ruby API library\n\nThe Dodo Payments Ruby library provides convenient access to the Dodo Payments REST API from any Ruby 3.2.0+ application. It ships with comprehensive types & docstrings in Yard, RBS, and RBI – [see below](https://github.com/dodopayments/dodopayments-ruby#Sorbet) for usage with Sorbet. The standard library\'s `net/http` is used as the HTTP transport, with connection pooling via the `connection_pool` gem.\n\n\n\nIt is generated with [Stainless](https://www.stainless.com/).\n\n## MCP Server\n\nUse the Dodo Payments MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=dodopayments-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsImRvZG9wYXltZW50cy1tY3AiXSwiZW52Ijp7IkRPRE9fUEFZTUVOVFNfQVBJX0tFWSI6Ik15IEJlYXJlciBUb2tlbiIsIkRPRE9fUEFZTUVOVFNfV0VCSE9PS19LRVkiOiJNeSBXZWJob29rIEtleSJ9fQ)\n[![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22dodopayments-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22dodopayments-mcp%22%5D%2C%22env%22%3A%7B%22DODO_PAYMENTS_API_KEY%22%3A%22My%20Bearer%20Token%22%2C%22DODO_PAYMENTS_WEBHOOK_KEY%22%3A%22My%20Webhook%20Key%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n## Documentation\n\nDocumentation for releases of this gem can be found [on RubyDoc](https://gemdocs.org/gems/dodopayments).\n\nThe REST API documentation can be found on [docs.dodopayments.com](https://docs.dodopayments.com/api-reference/introduction).\n\n## Installation\n\nTo use this gem, install via Bundler by adding the following to your application\'s `Gemfile`:\n\n<!-- x-release-please-start-version -->\n\n```ruby\ngem "dodopayments", "~> 0.0.1"\n```\n\n<!-- x-release-please-end -->\n\n## Usage\n\n```ruby\nrequire "bundler/setup"\nrequire "dodopayments"\n\ndodo_payments = Dodopayments::Client.new(\n bearer_token: ENV["DODO_PAYMENTS_API_KEY"], # This is the default and can be omitted\n environment: "test_mode" # defaults to "live_mode"\n)\n\ncheckout_session_response = dodo_payments.checkout_sessions.create(product_cart: [{product_id: "pdt_example", quantity: 1}])\n\nputs(checkout_session_response.session_id)\n```\n\n\n\n### Pagination\n\nList methods in the Dodo Payments API are paginated.\n\nThis library provides auto-paginating iterators with each list response, so you do not have to request successive pages manually:\n\n```ruby\npage = dodo_payments.payments.list\n\n# Fetch single item from page.\npayment = page.items[0]\nputs(payment.brand_id)\n\n# Automatically fetches more pages as needed.\npage.auto_paging_each do |payment|\n puts(payment.brand_id)\nend\n```\n\nAlternatively, you can use the `#next_page?` and `#next_page` methods for more granular control working with pages.\n\n```ruby\nif page.next_page?\n new_page = page.next_page\n puts(new_page.items[0].brand_id)\nend\n```\n\n\n\n### Handling errors\n\nWhen the library is unable to connect to the API, or if the API returns a non-success status code (i.e., 4xx or 5xx response), a subclass of `Dodopayments::Errors::APIError` will be thrown:\n\n```ruby\nbegin\n checkout_session = dodo_payments.checkout_sessions.create(product_cart: [{product_id: "pdt_example", quantity: 1}])\nrescue Dodopayments::Errors::APIConnectionError => e\n puts("The server could not be reached")\n puts(e.cause) # an underlying Exception, likely raised within `net/http`\nrescue Dodopayments::Errors::RateLimitError => e\n puts("A 429 status code was received; we should back off a bit.")\nrescue Dodopayments::Errors::APIStatusError => e\n puts("Another non-200-range status code was received")\n puts(e.status)\nend\n```\n\nError codes are as follows:\n\n| Cause | Error Type |\n| ---------------- | -------------------------- |\n| HTTP 400 | `BadRequestError` |\n| HTTP 401 | `AuthenticationError` |\n| HTTP 403 | `PermissionDeniedError` |\n| HTTP 404 | `NotFoundError` |\n| HTTP 409 | `ConflictError` |\n| HTTP 422 | `UnprocessableEntityError` |\n| HTTP 429 | `RateLimitError` |\n| HTTP >= 500 | `InternalServerError` |\n| Other HTTP error | `APIStatusError` |\n| Timeout | `APITimeoutError` |\n| Network error | `APIConnectionError` |\n\n### Retries\n\nCertain errors will be automatically retried 2 times by default, with a short exponential backoff.\n\nConnection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict, 429 Rate Limit, >=500 Internal errors, and timeouts will all be retried by default.\n\nYou can use the `max_retries` option to configure or disable this:\n\n```ruby\n# Configure the default for all requests:\ndodo_payments = Dodopayments::Client.new(\n max_retries: 0 # default is 2\n)\n\n# Or, configure per-request:\ndodo_payments.checkout_sessions.create(\n product_cart: [{product_id: "pdt_example", quantity: 1}],\n request_options: {max_retries: 5}\n)\n```\n\n### Timeouts\n\nBy default, requests will time out after 60 seconds. You can use the timeout option to configure or disable this:\n\n```ruby\n# Configure the default for all requests:\ndodo_payments = Dodopayments::Client.new(\n timeout: nil # default is 60\n)\n\n# Or, configure per-request:\ndodo_payments.checkout_sessions.create(\n product_cart: [{product_id: "pdt_example", quantity: 1}],\n request_options: {timeout: 5}\n)\n```\n\nOn timeout, `Dodopayments::Errors::APITimeoutError` is raised.\n\nNote that requests that time out are retried by default.\n\n## Advanced concepts\n\n### BaseModel\n\nAll parameter and response objects inherit from `Dodopayments::Internal::Type::BaseModel`, which provides several conveniences, including:\n\n1. All fields, including unknown ones, are accessible with `obj[:prop]` syntax, and can be destructured with `obj => {prop: prop}` or pattern-matching syntax.\n\n2. Structural equivalence for equality; if two API calls return the same values, comparing the responses with == will return true.\n\n3. Both instances and the classes themselves can be pretty-printed.\n\n4. Helpers such as `#to_h`, `#deep_to_h`, `#to_json`, and `#to_yaml`.\n\n### Making custom or undocumented requests\n\n#### Undocumented properties\n\nYou can send undocumented parameters to any endpoint, and read undocumented response properties, like so:\n\nNote: the `extra_` parameters of the same name overrides the documented parameters.\n\n```ruby\ncheckout_session_response =\n dodo_payments.checkout_sessions.create(\n product_cart: [{product_id: "pdt_example", quantity: 1}],\n request_options: {\n extra_query: {my_query_parameter: value},\n extra_body: {my_body_parameter: value},\n extra_headers: {"my-header": value}\n }\n )\n\nputs(checkout_session_response[:my_undocumented_property])\n```\n\n#### Undocumented request params\n\nIf you want to explicitly send an extra param, you can do so with the `extra_query`, `extra_body`, and `extra_headers` under the `request_options:` parameter when making a request, as seen in the examples above.\n\n#### Undocumented endpoints\n\nTo make requests to undocumented endpoints while retaining the benefit of auth, retries, and so on, you can make requests using `client.request`, like so:\n\n```ruby\nresponse = client.request(\n method: :post,\n path: \'/undocumented/endpoint\',\n query: {"dog": "woof"},\n headers: {"useful-header": "interesting-value"},\n body: {"hello": "world"}\n)\n```\n\n### Concurrency & connection pooling\n\nThe `Dodopayments::Client` instances are threadsafe, but are only are fork-safe when there are no in-flight HTTP requests.\n\nEach instance of `Dodopayments::Client` has its own HTTP connection pool with a default size of 99. As such, we recommend instantiating the client once per application in most settings.\n\nWhen all available connections from the pool are checked out, requests wait for a new connection to become available, with queue time counting towards the request timeout.\n\nUnless otherwise specified, other classes in the SDK do not have locks protecting their underlying data structure.\n\n## Sorbet\n\nThis library provides comprehensive [RBI](https://sorbet.org/docs/rbi) definitions, and has no dependency on sorbet-runtime.\n\nYou can provide typesafe request parameters like so:\n\n```ruby\ndodo_payments.checkout_sessions.create(\n product_cart: [Dodopayments::ProductItemReq.new(product_id: "pdt_example", quantity: 1)]\n)\n```\n\nOr, equivalently:\n\n```ruby\n# Hashes work, but are not typesafe:\ndodo_payments.checkout_sessions.create(product_cart: [{product_id: "pdt_example", quantity: 1}])\n\n# You can also splat a full Params class:\nparams = Dodopayments::CheckoutSessionCreateParams.new(\n product_cart: [Dodopayments::ProductItemReq.new(product_id: "pdt_example", quantity: 1)]\n)\ndodo_payments.checkout_sessions.create(**params)\n```\n\n### Enums\n\nSince this library does not depend on `sorbet-runtime`, it cannot provide [`T::Enum`](https://sorbet.org/docs/tenum) instances. Instead, we provide "tagged symbols" instead, which is always a primitive at runtime:\n\n```ruby\n# :AED\nputs(Dodopayments::Currency::AED)\n\n# Revealed type: `T.all(Dodopayments::Currency, Symbol)`\nT.reveal_type(Dodopayments::Currency::AED)\n```\n\nEnum parameters have a "relaxed" type, so you can either pass in enum constants or their literal value:\n\n```ruby\n# Using the enum constants preserves the tagged type information:\ndodo_payments.checkout_sessions.create(\n billing_currency: Dodopayments::Currency::AED,\n # …\n)\n\n# Literal values are also permissible:\ndodo_payments.checkout_sessions.create(\n billing_currency: :AED,\n # …\n)\n```\n\n## Versioning\n\nThis package follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions. As the library is in initial development and has a major version of `0`, APIs may change at any time.\n\nThis package considers improvements to the (non-runtime) `*.rbi` and `*.rbs` type definitions to be non-breaking changes.\n\n## Requirements\n\nRuby 3.2.0 or higher.\n\n## Contributing\n\nSee [the contributing documentation](https://github.com/dodopayments/dodopayments-ruby/tree/main/CONTRIBUTING.md).\n',
7457
6927
  },
7458
6928
  {
7459
- language: 'typescript',
7460
- content: "# Dodo Payments TypeScript API Library\n\n[![NPM version](https://img.shields.io/npm/v/dodopayments.svg?label=npm%20(stable))](https://npmjs.org/package/dodopayments) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/dodopayments)\n\nThis library provides convenient access to the Dodo Payments REST API from server-side TypeScript or JavaScript.\n\n\n\nThe REST API documentation can be found on [docs.dodopayments.com](https://docs.dodopayments.com/api-reference/introduction). The full API of this library can be found in [api.md](api.md).\n\nIt is generated with [Stainless](https://www.stainless.com/).\n\n## MCP Server\n\nUse the Dodo Payments MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=dodopayments-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsImRvZG9wYXltZW50cy1tY3AiXSwiZW52Ijp7IkRPRE9fUEFZTUVOVFNfQVBJX0tFWSI6Ik15IEJlYXJlciBUb2tlbiIsIkRPRE9fUEFZTUVOVFNfV0VCSE9PS19LRVkiOiJNeSBXZWJob29rIEtleSJ9fQ)\n[![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22dodopayments-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22dodopayments-mcp%22%5D%2C%22env%22%3A%7B%22DODO_PAYMENTS_API_KEY%22%3A%22My%20Bearer%20Token%22%2C%22DODO_PAYMENTS_WEBHOOK_KEY%22%3A%22My%20Webhook%20Key%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n## Installation\n\n```sh\nnpm install dodopayments\n```\n\n\n\n## Usage\n\nThe full API of this library can be found in [api.md](api.md).\n\n<!-- prettier-ignore -->\n```js\nimport DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n environment: 'test_mode', // defaults to 'live_mode'\n});\n\nconst checkoutSessionResponse = await client.checkoutSessions.create({\n product_cart: [{ product_id: 'pdt_example', quantity: 1 }],\n});\n\nconsole.log(checkoutSessionResponse.session_id);\n```\n\n\n\n### Request & Response types\n\nThis library includes TypeScript definitions for all request params and response fields. You may import and use them like so:\n\n<!-- prettier-ignore -->\n```ts\nimport DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted\n environment: 'test_mode', // defaults to 'live_mode'\n});\n\nconst params: DodoPayments.CheckoutSessionCreateParams = {\n product_cart: [{ product_id: 'pdt_example', quantity: 1 }],\n};\nconst checkoutSessionResponse: DodoPayments.CheckoutSessionResponse =\n await client.checkoutSessions.create(params);\n```\n\nDocumentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors.\n\n\n\n\n\n## Handling errors\n\nWhen the library is unable to connect to the API,\nor if the API returns a non-success status code (i.e., 4xx or 5xx response),\na subclass of `APIError` will be thrown:\n\n<!-- prettier-ignore -->\n```ts\nconst checkoutSessionResponse = await client.checkoutSessions\n .create({ product_cart: [{ product_id: 'pdt_example', quantity: 1 }] })\n .catch(async (err) => {\n if (err instanceof DodoPayments.APIError) {\n console.log(err.status); // 400\n console.log(err.name); // BadRequestError\n console.log(err.headers); // {server: 'nginx', ...}\n } else {\n throw err;\n }\n });\n```\n\nError codes are as follows:\n\n| Status Code | Error Type |\n| ----------- | -------------------------- |\n| 400 | `BadRequestError` |\n| 401 | `AuthenticationError` |\n| 403 | `PermissionDeniedError` |\n| 404 | `NotFoundError` |\n| 422 | `UnprocessableEntityError` |\n| 429 | `RateLimitError` |\n| >=500 | `InternalServerError` |\n| N/A | `APIConnectionError` |\n\n### Retries\n\nCertain errors will be automatically retried 2 times by default, with a short exponential backoff.\nConnection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict,\n429 Rate Limit, and >=500 Internal errors will all be retried by default.\n\nYou can use the `maxRetries` option to configure or disable this:\n\n<!-- prettier-ignore -->\n```js\n// Configure the default for all requests:\nconst client = new DodoPayments({\n maxRetries: 0, // default is 2\n});\n\n// Or, configure per-request:\nawait client.checkoutSessions.create({ product_cart: [{ product_id: 'pdt_example', quantity: 1 }] }, {\n maxRetries: 5,\n});\n```\n\n### Timeouts\n\nRequests time out after 1 minute by default. You can configure this with a `timeout` option:\n\n<!-- prettier-ignore -->\n```ts\n// Configure the default for all requests:\nconst client = new DodoPayments({\n timeout: 20 * 1000, // 20 seconds (default is 1 minute)\n});\n\n// Override per-request:\nawait client.checkoutSessions.create({ product_cart: [{ product_id: 'pdt_example', quantity: 1 }] }, {\n timeout: 5 * 1000,\n});\n```\n\nOn timeout, an `APIConnectionTimeoutError` is thrown.\n\nNote that requests which time out will be [retried twice by default](#retries).\n\n## Auto-pagination\n\nList methods in the DodoPayments API are paginated.\nYou can use the `for await … of` syntax to iterate through items across all pages:\n\n```ts\nasync function fetchAllPaymentListResponses(params) {\n const allPaymentListResponses = [];\n // Automatically fetches more pages as needed.\n for await (const paymentListResponse of client.payments.list()) {\n allPaymentListResponses.push(paymentListResponse);\n }\n return allPaymentListResponses;\n}\n```\n\nAlternatively, you can request a single page at a time:\n\n```ts\nlet page = await client.payments.list();\nfor (const paymentListResponse of page.items) {\n console.log(paymentListResponse);\n}\n\n// Convenience methods are provided for manually paginating:\nwhile (page.hasNextPage()) {\n page = await page.getNextPage();\n // ...\n}\n```\n\n\n\n## Advanced Usage\n\n### Accessing raw Response data (e.g., headers)\n\nThe \"raw\" `Response` returned by `fetch()` can be accessed through the `.asResponse()` method on the `APIPromise` type that all methods return.\nThis method returns as soon as the headers for a successful response are received and does not consume the response body, so you are free to write custom parsing or streaming logic.\n\nYou can also use the `.withResponse()` method to get the raw `Response` along with the parsed data.\nUnlike `.asResponse()` this method consumes the body, returning once it is parsed.\n\n<!-- prettier-ignore -->\n```ts\nconst client = new DodoPayments();\n\nconst response = await client.checkoutSessions\n .create({ product_cart: [{ product_id: 'pdt_example', quantity: 1 }] })\n .asResponse();\nconsole.log(response.headers.get('X-My-Header'));\nconsole.log(response.statusText); // access the underlying Response object\n\nconst { data: checkoutSessionResponse, response: raw } = await client.checkoutSessions\n .create({ product_cart: [{ product_id: 'pdt_example', quantity: 1 }] })\n .withResponse();\nconsole.log(raw.headers.get('X-My-Header'));\nconsole.log(checkoutSessionResponse.session_id);\n```\n\n### Logging\n\n> [!IMPORTANT]\n> All log messages are intended for debugging only. The format and content of log messages\n> may change between releases.\n\n#### Log levels\n\nThe log level can be configured in two ways:\n\n1. Via the `DODO_PAYMENTS_LOG` environment variable\n2. Using the `logLevel` client option (overrides the environment variable if set)\n\n```ts\nimport DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n logLevel: 'debug', // Show all log messages\n});\n```\n\nAvailable log levels, from most to least verbose:\n\n- `'debug'` - Show debug messages, info, warnings, and errors\n- `'info'` - Show info messages, warnings, and errors\n- `'warn'` - Show warnings and errors (default)\n- `'error'` - Show only errors\n- `'off'` - Disable all logging\n\nAt the `'debug'` level, all HTTP requests and responses are logged, including headers and bodies.\nSome authentication-related headers are redacted, but sensitive data in request and response bodies\nmay still be visible.\n\n#### Custom logger\n\nBy default, this library logs to `globalThis.console`. You can also provide a custom logger.\nMost logging libraries are supported, including [pino](https://www.npmjs.com/package/pino), [winston](https://www.npmjs.com/package/winston), [bunyan](https://www.npmjs.com/package/bunyan), [consola](https://www.npmjs.com/package/consola), [signale](https://www.npmjs.com/package/signale), and [@std/log](https://jsr.io/@std/log). If your logger doesn't work, please open an issue.\n\nWhen providing a custom logger, the `logLevel` option still controls which messages are emitted, messages\nbelow the configured level will not be sent to your logger.\n\n```ts\nimport DodoPayments from 'dodopayments';\nimport pino from 'pino';\n\nconst logger = pino();\n\nconst client = new DodoPayments({\n logger: logger.child({ name: 'DodoPayments' }),\n logLevel: 'debug', // Send all messages to pino, allowing it to filter\n});\n```\n\n### Making custom/undocumented requests\n\nThis library is typed for convenient access to the documented API. If you need to access undocumented\nendpoints, params, or response properties, the library can still be used.\n\n#### Undocumented endpoints\n\nTo make requests to undocumented endpoints, you can use `client.get`, `client.post`, and other HTTP verbs.\nOptions on the client, such as retries, will be respected when making these requests.\n\n```ts\nawait client.post('/some/path', {\n body: { some_prop: 'foo' },\n query: { some_query_arg: 'bar' },\n});\n```\n\n#### Undocumented request params\n\nTo make requests using undocumented parameters, you may use `// @ts-expect-error` on the undocumented\nparameter. This library doesn't validate at runtime that the request matches the type, so any extra values you\nsend will be sent as-is.\n\n```ts\nclient.checkoutSessions.create({\n // ...\n // @ts-expect-error baz is not yet public\n baz: 'undocumented option',\n});\n```\n\nFor requests with the `GET` verb, any extra params will be in the query, all other requests will send the\nextra param in the body.\n\nIf you want to explicitly send an extra argument, you can do so with the `query`, `body`, and `headers` request\noptions.\n\n#### Undocumented response properties\n\nTo access undocumented response properties, you may access the response object with `// @ts-expect-error` on\nthe response object, or cast the response object to the requisite type. Like the request params, we do not\nvalidate or strip extra properties from the response from the API.\n\n### Customizing the fetch client\n\nBy default, this library expects a global `fetch` function is defined.\n\nIf you want to use a different `fetch` function, you can either polyfill the global:\n\n```ts\nimport fetch from 'my-fetch';\n\nglobalThis.fetch = fetch;\n```\n\nOr pass it to the client:\n\n```ts\nimport DodoPayments from 'dodopayments';\nimport fetch from 'my-fetch';\n\nconst client = new DodoPayments({ fetch });\n```\n\n### Fetch options\n\nIf you want to set custom `fetch` options without overriding the `fetch` function, you can provide a `fetchOptions` object when instantiating the client or making a request. (Request-specific options override client options.)\n\n```ts\nimport DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n fetchOptions: {\n // `RequestInit` options\n },\n});\n```\n\n#### Configuring proxies\n\nTo modify proxy behavior, you can provide custom `fetchOptions` that add runtime-specific proxy\noptions to requests:\n\n<img src=\"https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/node.svg\" align=\"top\" width=\"18\" height=\"21\"> **Node** <sup>[[docs](https://github.com/nodejs/undici/blob/main/docs/docs/api/ProxyAgent.md#example---proxyagent-with-fetch)]</sup>\n\n```ts\nimport DodoPayments from 'dodopayments';\nimport * as undici from 'undici';\n\nconst proxyAgent = new undici.ProxyAgent('http://localhost:8888');\nconst client = new DodoPayments({\n fetchOptions: {\n dispatcher: proxyAgent,\n },\n});\n```\n\n<img src=\"https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/bun.svg\" align=\"top\" width=\"18\" height=\"21\"> **Bun** <sup>[[docs](https://bun.sh/guides/http/proxy)]</sup>\n\n```ts\nimport DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments({\n fetchOptions: {\n proxy: 'http://localhost:8888',\n },\n});\n```\n\n<img src=\"https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/deno.svg\" align=\"top\" width=\"18\" height=\"21\"> **Deno** <sup>[[docs](https://docs.deno.com/api/deno/~/Deno.createHttpClient)]</sup>\n\n```ts\nimport DodoPayments from 'npm:dodopayments';\n\nconst httpClient = Deno.createHttpClient({ proxy: { url: 'http://localhost:8888' } });\nconst client = new DodoPayments({\n fetchOptions: {\n client: httpClient,\n },\n});\n```\n\n## Frequently Asked Questions\n\n## Semantic versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes that only affect static types, without breaking runtime behavior.\n2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n3. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/dodopayments/dodopayments-typescript/issues) with questions, bugs, or suggestions.\n\n## Requirements\n\nTypeScript >= 4.9 is supported.\n\nThe following runtimes are supported:\n\n- Web browsers (Up-to-date Chrome, Firefox, Safari, Edge, and more)\n- Node.js 20 LTS or later ([non-EOL](https://endoflife.date/nodejs)) versions.\n- Deno v1.28.0 or higher.\n- Bun 1.0 or later.\n- Cloudflare Workers.\n- Vercel Edge Runtime.\n- Jest 28 or greater with the `\"node\"` environment (`\"jsdom\"` is not supported at this time).\n- Nitro v2.6 or greater.\n\nNote that React Native is not supported at this time.\n\nIf you are interested in other runtime environments, please open or upvote an issue on GitHub.\n\n## Contributing\n\nSee [the contributing documentation](./CONTRIBUTING.md).\n",
6929
+ language: 'php',
6930
+ content: "# Dodo Payments PHP API Library\n\nThe Dodo Payments PHP library provides convenient access to the Dodo Payments REST API from any PHP 8.1.0+ application.\n\n## Installation\n\n<!-- x-release-please-start-version -->\n```\ncomposer require \"dodopayments/client 0.0.1\"\n```\n<!-- x-release-please-end -->\n\n## Usage\n\n```php\n<?php\n\n$client = new Client(\n bearerToken: getenv('DODO_PAYMENTS_API_KEY') ?: 'My Bearer Token',\n environment: 'test_mode',\n);\n\n$checkoutSessionResponse = $client->checkoutSessions->create(\n productCart: [['productID' => 'pdt_example', 'quantity' => 1]]\n);\n\nvar_dump($checkoutSessionResponse->session_id);\n```",
6931
+ },
6932
+ {
6933
+ language: 'csharp',
6934
+ content: '# Dodo Payments C# API Library\n\nThe Dodo Payments C# SDK provides convenient access to the [Dodo Payments REST API](https://docs.dodopayments.com/api-reference/introduction) from applications written in C#.\n\n## Installation\n\nInstall the package from [NuGet](https://www.nuget.org/packages/DodoPayments.Client):\n\n```bash\ndotnet add package DodoPayments.Client\n```\n\n## Requirements\n\nThis library requires .NET Standard 2.0 or later.\n\n## Usage\n\nSee the [`examples`](examples) directory for complete and runnable examples.\n\n```csharp\nDodoPaymentsClient client = new();\n\nCheckoutSessionCreateParams parameters = new()\n{\n ProductCart =\n [\n new()\n {\n ProductID = "pdt_example",\n Quantity = 1,\n },\n ],\n};\n\nvar checkoutSessionResponse = await client.CheckoutSessions.Create(parameters);\n\nConsole.WriteLine(checkoutSessionResponse);\n```',
7461
6935
  },
7462
6936
  ];
7463
6937
  const INDEX_OPTIONS = {