diff --git a/openapi/api.yaml b/openapi/api.yaml index 1a116208..98b181b8 100644 --- a/openapi/api.yaml +++ b/openapi/api.yaml @@ -217,186 +217,155 @@ security: x-tagGroups: - name: Customers tags: - - account - - note - - account_acquisition - - billing_info - - billing_infos - - coupon_redemption - - subscription - - subscription_change - - usage - - shipping_address + - Account + - Account Note + - Account Acquisition Info + - Billing Info + - Billing Infos + - Coupon Redemption + - Subscription + - Subscription Change + - Usage + - Shipping Address - name: Invoices and Payments tags: - - purchase - - invoice - - line_item - - credit_payment - - transaction - - revenue_recovery - - gift_cards + - Purchase + - Invoice + - Line Item + - Credit Payment + - Transaction + - Revenue Recovery + - Gift Cards - name: Products and Promotions tags: - - item - - plan - - add-on - - measured_unit - - coupon - - unique_coupon_code - - price_segment + - Item + - Plan + - Add-on + - Measured Unit + - Coupon + - Unique Coupon Code + - Price Segment - name: Configuration tags: - - site - - custom_field_definition - - shipping_method - - dunning_campaigns - - business_entities - - automated_exports - - general_ledger_account - - performance_obligations - - invoice_templates + - Site + - Custom Field Definition + - Shipping Method + - Dunning Campaigns + - Business Entities + - Automated Exports + - General Ledger Account + - Performance Obligations + - Invoice Templates - name: App Management tags: - - external_subscriptions - - external_invoices - - external_products - - external_accounts - - external_product_references - - external_payment_phases + - External Subscription + - External Invoice + - External Product + - External Account + - External Product Reference + - External Payment Phase tags: -- name: account - x-displayName: Account +- name: Account description: Accounts are core to managing your customers inside of Recurly. The account object stores the entire Recurly history of your customer and acts as the entry point for working with a customer's billing information, subscription data, transactions, invoices and more. -- name: note - x-displayName: Account Note +- name: Account Note description: Account notes allow your team to leave notes on an account to add context, e.g. the reason for a refund, customer requests, and/or complaints. These notes are internal and not exposed to your customers. -- name: account_acquisition - x-displayName: Account Acquisition Info +- name: Account Acquisition Info description: Recurly offers the ability to record marketing data on customer accounts to match this data with revenue and billing data events in Recurly. -- name: billing_info - x-displayName: Billing Info +- name: Billing Info description: Without the premium Wallet feature, an account can only have one stored payment method at a time. Examples include credit cards, PayPal, or bank accounts. Billing info is filled out by the customer upon purchase or when they update their information. -- name: billing_infos - x-displayName: Billing Infos +- name: Billing Infos description: If the premium Wallet feature is enabled, an account can have multiple payment methods stored. Examples include credit cards, PayPal, or bank accounts. Primary or backup billing infos can be designated from these endpoints. -- name: coupon_redemption - x-displayName: Coupon Redemption +- name: Coupon Redemption description: Coupon redemptions are created when a coupon is applied to an account or subscription. This allows you to track your promotions. -- name: subscription - x-displayName: Subscription +- name: Subscription description: Subscriptions are created when your customers subscribe to one of your plans. The customer's subscription tells Recurly when and how much to bill the customer. -- name: subscription_change - x-displayName: Subscription Change +- name: Subscription Change description: Subscription changes alter subscription in a way that might affect the invoiced amount, such as changing the plan, add-ons, quantities, or shipping address. Changes can be made immediately in the current billing cycle or scheduled to take place at the next renewal. -- name: usage - x-displayName: Usage +- name: Usage description: Send Recurly your customer usage and we will automatically bill them in arrears at the end of the billing cycle. For more info on usage-based billing, [click here](https://docs.recurly.com/docs/usage-based-billing). -- name: shipping_address - x-displayName: Shipping Address +- name: Shipping Address description: Shipping addresses are tied to a customer's account. Each account can have up to 20 different shipping addresses, and if you have enabled multiple subscriptions per account, you can associate different shipping addresses to each subscription. -- name: purchase - x-displayName: Purchase +- name: Purchase description: A purchase is a checkout containing at least one or more subscriptions or one-time charges (line items) and supports both coupon and gift card redemptions. All items purchased will be on one invoice and paid for with one transaction. The purchases endpoint can also be used to immediately create a credit invoice on an account, when Credit Invoices is enabled on your site. -- name: invoice - x-displayName: Invoice +- name: Invoice description: An invoice relates charges, credits, and payments together. When a subscription is created or renewed or a charge is created on the account, Recurly will sum the charges, discount or tax as appropriate, and send the invoice out for collection. -- name: line_item - x-displayName: Line Item +- name: Line Item description: Line items are the charges and credits on your customer's invoices. -- name: credit_payment - x-displayName: Credit Payment -- name: transaction - x-displayName: Transaction +- name: Credit Payment +- name: Transaction description: Purchasing information is sent to your payment gateway in an action called a transaction. This includes the customer's billing information and the amount of money to be charged, voided, or refunded. -- name: revenue_recovery - x-displayName: Revenue Recovery +- name: Revenue Recovery description: Revenue recovery -- name: gift_cards - x-displayName: Gift Cards +- name: Gift Cards description: Add gift card purchases to your checkout and allow gift card recipients to redeem the gift card for credit towards any of your products. -- name: item - x-displayName: Item +- name: Item description: |- For merchants who sell the same things to many customers, documenting those offerings in a catalog allows for faster charge creation, easier management of offerings, and analytics about your offerings across all sales channels. Because your offerings can be physical, digital, or service-oriented, Recurly collectively calls these offerings "Items". Recurly's item catalog requires the Credit Invoices feature to be enabled. -- name: plan - x-displayName: Plan +- name: Plan description: A plan tells Recurly how often and how much to charge your customers. Plans can be created with free trials, optional products (called add-ons), setup fees, and more. -- name: add-on - x-displayName: Add-on +- name: Add-on description: An add-on is a charge billed each billing period in addition to a subscription’s base charge. Each plan may have one or more add-ons associated with it. -- name: measured_unit - x-displayName: Measured Unit +- name: Measured Unit description: A measured unit describes a usage-based add-on's usage. If different usage-based add-ons share the same measured unit, you can report on customer usage for those add-ons at the aggregated measured unit level. -- name: coupon - x-displayName: Coupon +- name: Coupon description: Coupons can either be single codes that easily allow mass distribution by many customers or bulk coupons that can generate many unique coupons that can allow for individual delivery and tracking. -- name: unique_coupon_code - x-displayName: Unique Coupon Code +- name: Unique Coupon Code description: Unique coupon codes are generated from bulk coupons. -- name: price_segment - x-displayName: Price Segment -- name: site - x-displayName: Site -- name: custom_field_definition - x-displayName: Custom Field Definition +- name: Price Segment +- name: Site +- name: Custom Field Definition description: Describes the fields that can be used as custom fields on accounts, items, line-items (one time charges), plans, or subscriptions. -- name: shipping_method - x-displayName: Shipping Method +- name: Shipping Method description: Shipping methods offered to send products to customers. -- name: dunning_campaigns - x-displayName: Dunning Campaigns +- name: Dunning Campaigns description: Settings used when attempting to dun customers whose payments are declined. -- name: business_entities - x-displayName: Business Entities +- name: Business Entities description: Describes the business address that will be used for invoices and taxes depending on settings and subscriber location. -- name: automated_exports - x-displayName: Automated Exports +- name: Automated Exports description: Automated exports of customer data. -- name: general_ledger_account - x-displayName: General Ledger Account +- name: General Ledger Account description: | A general ledger account is an account of record used to sort, store and summarize a company's transactions. Recurly supports the balance @@ -428,8 +397,7 @@ tags: If you are interested in Recurly Revenue Recognition features, please contact a Recurly customer service representative. -- name: performance_obligations - x-displayName: Performance Obligations +- name: Performance Obligations description: | A performance obligation is a promise to provide a distinct good or service or a series of distinct goods or services as defined by the revenue standard. @@ -444,34 +412,27 @@ tags: - The customer receives and consumes the benefits of the goods or services as they are provided by the entity (routine, recurring services like a cleaning service are an example of a series of services that are substantially the same and have the same pattern of transfer) -- name: invoice_templates - x-displayName: Invoice Templates -- name: external_subscriptions - x-displayName: External Subscription +- name: Invoice Templates +- name: External Subscription description: A subscription from an external resource that is not managed by the Recurly platform and instead is managed by third-party platforms like Apple App Store and Google Play Store. -- name: external_invoices - x-displayName: External Invoice +- name: External Invoice description: An invoice from an external resource that is not managed by the Recurly platform and instead is managed by third-party platforms like Apple App Store and Google Play Store. -- name: external_products - x-displayName: External Product +- name: External Product description: A product from an external resource that is not managed by the Recurly platform and instead is managed by third-party platforms like Apple App Store and Google Play Store. -- name: external_accounts - x-displayName: External Account +- name: External Account description: An account from an external resource that is not managed by the Recurly platform and instead is managed by third-party platforms like Apple App Store and Google Play Store. -- name: external_product_references - x-displayName: External Product Reference +- name: External Product Reference description: Associates an external product to a corresponding resource on an external platform like the Apple App Store or Google Play Store. -- name: external_payment_phases - x-displayName: External Payment Phase +- name: External Payment Phase description: Details of payments in the lifecycle of a subscription from an external resource that is not managed by the Recurly platform, e.g. App Store or Google Play Store. @@ -485,7 +446,7 @@ paths: See the [Pagination Guide](/developers/guides/pagination.html) to learn how to use pagination in the API and Client Libraries. tags: - - site + - Site parameters: - "$ref": "#/components/parameters/ids" - "$ref": "#/components/parameters/limit" @@ -650,7 +611,7 @@ paths: operationId: get_site summary: Fetch a site tags: - - site + - Site parameters: - "$ref": "#/components/parameters/site_id" responses: @@ -861,7 +822,7 @@ paths: "/accounts": get: tags: - - account + - Account operationId: list_accounts summary: List a site's accounts description: See the [Pagination Guide](/developers/guides/pagination.html) @@ -1037,7 +998,7 @@ paths: name: Go post: tags: - - account + - Account operationId: create_account summary: Create an account requestBody: @@ -1517,7 +1478,7 @@ paths: - "$ref": "#/components/parameters/account_id" get: tags: - - account + - Account operationId: get_account summary: Fetch an account responses: @@ -1721,7 +1682,7 @@ paths: name: Go put: tags: - - account + - Account operationId: update_account summary: Update an account requestBody: @@ -2010,7 +1971,7 @@ paths: name: Go delete: tags: - - account + - Account operationId: deactivate_account summary: Deactivate an account description: Deactivating an account permanently deletes its billing information @@ -2234,7 +2195,7 @@ paths: - "$ref": "#/components/parameters/account_id" put: tags: - - account + - Account operationId: redact_account summary: Redact an account (GDPR Right to Erasure) description: Permanently and irreversibly removes all personally identifiable @@ -2273,7 +2234,7 @@ paths: - "$ref": "#/components/parameters/account_id" get: tags: - - account_acquisition + - Account Acquisition Info operationId: get_account_acquisition summary: Fetch an account's acquisition data responses: @@ -2478,7 +2439,7 @@ paths: name: Go put: tags: - - account_acquisition + - Account Acquisition Info operationId: update_account_acquisition summary: Update an account's acquisition data requestBody: @@ -2784,7 +2745,7 @@ paths: name: Go delete: tags: - - account_acquisition + - Account Acquisition Info operationId: remove_account_acquisition summary: Remove an account's acquisition data responses: @@ -2983,7 +2944,7 @@ paths: - "$ref": "#/components/parameters/account_id" put: tags: - - account + - Account operationId: reactivate_account summary: Reactivate an inactive account description: Reactivating an account will restore its history but the customer @@ -3202,7 +3163,7 @@ paths: - "$ref": "#/components/parameters/account_id" get: tags: - - account + - Account operationId: get_account_balance summary: Fetch an account's balance and past due status responses: @@ -3413,7 +3374,7 @@ paths: "/accounts/{account_id}/billing_info": get: tags: - - billing_info + - Billing Info operationId: get_billing_info summary: Fetch an account's billing information parameters: @@ -3626,7 +3587,7 @@ paths: name: Go put: tags: - - billing_info + - Billing Info operationId: update_billing_info summary: Set an account's billing information description: | @@ -3922,7 +3883,7 @@ paths: name: Go delete: tags: - - billing_info + - Billing Info operationId: remove_billing_info summary: Remove an account's billing information parameters: @@ -4125,7 +4086,7 @@ paths: "/accounts/{account_id}/billing_info/verify": post: tags: - - billing_info + - Billing Info operationId: verify_billing_info summary: Verify an account's credit card billing information parameters: @@ -4354,7 +4315,7 @@ paths: "/accounts/{account_id}/billing_info/verify_cvv": post: tags: - - billing_info + - Billing Info operationId: verify_billing_info_cvv summary: Verify an account's credit card billing cvv parameters: @@ -4395,7 +4356,7 @@ paths: "/accounts/{account_id}/billing_infos": get: tags: - - billing_infos + - Billing Infos operationId: list_billing_infos summary: Get the list of billing information associated with an account description: See the [Pagination Guide](/developers/guides/pagination.html) @@ -4428,7 +4389,7 @@ paths: x-code-samples: [] post: tags: - - billing_infos + - Billing Infos operationId: create_billing_info summary: Add new billing information on an account description: | @@ -4488,7 +4449,7 @@ paths: "/accounts/{account_id}/billing_infos/{billing_info_id}": get: tags: - - billing_infos + - Billing Infos operationId: get_a_billing_info summary: Fetch a billing info parameters: @@ -4510,7 +4471,7 @@ paths: x-code-samples: [] put: tags: - - billing_infos + - Billing Infos operationId: update_a_billing_info summary: Update an account's billing information description: | @@ -4570,7 +4531,7 @@ paths: x-code-samples: [] delete: tags: - - billing_infos + - Billing Infos operationId: remove_a_billing_info summary: Remove an account's billing information parameters: @@ -4600,7 +4561,7 @@ paths: "/accounts/{account_id}/billing_infos/{billing_info_id}/verify": post: tags: - - billing_infos + - Billing Infos operationId: verify_billing_infos summary: Verify a billing information's credit card parameters: @@ -4643,7 +4604,7 @@ paths: "/accounts/{account_id}/billing_infos/{billing_info_id}/verify_cvv": post: tags: - - billing_infos + - Billing Infos operationId: verify_billing_infos_cvv summary: Verify a billing information's credit card cvv parameters: @@ -4691,7 +4652,7 @@ paths: "/accounts/{account_id}/coupon_redemptions": get: tags: - - coupon_redemption + - Coupon Redemption operationId: list_account_coupon_redemptions summary: List the coupon redemptions for an account description: See the [Pagination Guide](/developers/guides/pagination.html) @@ -4857,7 +4818,7 @@ paths: "/accounts/{account_id}/coupon_redemptions/active": get: tags: - - coupon_redemption + - Coupon Redemption operationId: list_active_coupon_redemptions summary: List the coupon redemptions that are active on an account description: See the [Pagination Guide](/developers/guides/pagination.html) @@ -5003,7 +4964,7 @@ paths: name: PHP post: tags: - - coupon_redemption + - Coupon Redemption operationId: create_coupon_redemption summary: Generate an active coupon redemption on an account or subscription parameters: @@ -5233,7 +5194,7 @@ paths: name: Go delete: tags: - - coupon_redemption + - Coupon Redemption operationId: remove_coupon_redemption summary: Delete the active coupon redemption from an account parameters: @@ -5442,7 +5403,7 @@ paths: "/accounts/{account_id}/coupon_redemptions/{coupon_redemption_id}": get: tags: - - coupon_redemption + - Coupon Redemption operationId: get_coupon_redemption summary: Show the coupon redemption parameters: @@ -5470,7 +5431,7 @@ paths: x-code-samples: [] delete: tags: - - coupon_redemption + - Coupon Redemption operationId: remove_coupon_redemption_by_id summary: Delete the coupon redemption description: Deactivate the coupon redemption on an account. @@ -5506,7 +5467,7 @@ paths: "/accounts/{account_id}/credit_payments": get: tags: - - credit_payment + - Credit Payment operationId: list_account_credit_payments summary: List an account's credit payments description: See the [Pagination Guide](/developers/guides/pagination.html) @@ -5690,7 +5651,7 @@ paths: - "$ref": "#/components/parameters/account_id" get: tags: - - external_accounts + - External Account operationId: list_account_external_account summary: List external accounts for an account responses: @@ -5727,7 +5688,7 @@ paths: x-code-samples: [] post: tags: - - external_accounts + - External Account operationId: create_account_external_account summary: Create an external account requestBody: @@ -5773,7 +5734,7 @@ paths: - "$ref": "#/components/parameters/external_account_id" get: tags: - - external_accounts + - External Account operationId: get_account_external_account summary: Get an external account for an account responses: @@ -5810,7 +5771,7 @@ paths: x-code-samples: [] put: tags: - - external_accounts + - External Account operationId: update_account_external_account summary: Update an external account requestBody: @@ -5852,7 +5813,7 @@ paths: x-code-samples: [] delete: tags: - - external_accounts + - External Account operationId: delete_account_external_account summary: Delete an external account for an account responses: @@ -5892,7 +5853,7 @@ paths: - "$ref": "#/components/parameters/account_id" get: tags: - - account + - Account operationId: list_account_external_invoices summary: List the external invoices on an account description: See the [Pagination Guide](/developers/guides/pagination.html) @@ -5924,7 +5885,7 @@ paths: "/accounts/{account_id}/invoices": get: tags: - - invoice + - Invoice operationId: list_account_invoices summary: List an account's invoices description: See the [Pagination Guide](/developers/guides/pagination.html) @@ -6098,7 +6059,7 @@ paths: name: Go post: tags: - - invoice + - Invoice operationId: create_invoice summary: Create an invoice for pending line items parameters: @@ -6400,7 +6361,7 @@ paths: "/accounts/{account_id}/invoices/preview": post: tags: - - invoice + - Invoice operationId: preview_invoice summary: Preview new invoice for pending line items parameters: @@ -6701,7 +6662,7 @@ paths: "/accounts/{account_id}/line_items": get: tags: - - line_item + - Line Item operationId: list_account_line_items summary: List an account's line items description: See the [Pagination Guide](/developers/guides/pagination.html) @@ -6878,7 +6839,7 @@ paths: name: Go post: tags: - - line_item + - Line Item operationId: create_line_item summary: Create a new line item for the account description: When using the Credit Invoices feature, utilize the purchases endpoint @@ -7185,7 +7146,7 @@ paths: "/accounts/{account_id}/notes": get: tags: - - note + - Account Note operationId: list_account_notes summary: List an account's notes description: See the [Pagination Guide](/developers/guides/pagination.html) @@ -7336,7 +7297,7 @@ paths: name: Go post: tags: - - note + - Account Note operationId: create_account_note summary: Create an account note parameters: @@ -7382,7 +7343,7 @@ paths: "/accounts/{account_id}/notes/{account_note_id}": get: tags: - - note + - Account Note operationId: get_account_note summary: Fetch an account note parameters: @@ -7603,7 +7564,7 @@ paths: name: Go delete: tags: - - note + - Account Note operationId: remove_account_note summary: Delete an account note parameters: @@ -7628,7 +7589,7 @@ paths: "/accounts/{account_id}/shipping_addresses": get: tags: - - shipping_address + - Shipping Address operationId: list_shipping_addresses summary: Fetch a list of an account's shipping addresses description: See the [Pagination Guide](/developers/guides/pagination.html) @@ -7795,7 +7756,7 @@ paths: name: Go post: tags: - - shipping_address + - Shipping Address operationId: create_shipping_address summary: Create a new shipping address for the account parameters: @@ -8142,7 +8103,7 @@ paths: "/accounts/{account_id}/shipping_addresses/{shipping_address_id}": get: tags: - - shipping_address + - Shipping Address operationId: get_shipping_address summary: Fetch an account's shipping address parameters: @@ -8361,7 +8322,7 @@ paths: name: Go put: tags: - - shipping_address + - Shipping Address operationId: update_shipping_address summary: Update an account's shipping address parameters: @@ -8664,7 +8625,7 @@ paths: name: Go delete: tags: - - shipping_address + - Shipping Address operationId: remove_shipping_address summary: Remove an account's shipping address parameters: @@ -8870,7 +8831,7 @@ paths: "/accounts/{account_id}/subscriptions": get: tags: - - subscription + - Subscription operationId: list_account_subscriptions summary: List an account's subscriptions description: See the [Pagination Guide](/developers/guides/pagination.html) @@ -9044,7 +9005,7 @@ paths: "/accounts/{account_id}/transactions": get: tags: - - transaction + - Transaction operationId: list_account_transactions summary: List an account's transactions description: See the [Pagination Guide](/developers/guides/pagination.html) @@ -9221,7 +9182,7 @@ paths: "/accounts/{account_id}/accounts": get: tags: - - account + - Account operationId: list_child_accounts summary: List an account's child accounts description: See the [Pagination Guide](/developers/guides/pagination.html) @@ -9348,7 +9309,7 @@ paths: "/acquisitions": get: tags: - - account_acquisition + - Account Acquisition Info operationId: list_account_acquisition summary: List a site's account acquisition data description: See the [Pagination Guide](/developers/guides/pagination.html) @@ -9515,7 +9476,7 @@ paths: "/coupons": get: tags: - - coupon + - Coupon operationId: list_coupons summary: List a site's coupons description: See the [Pagination Guide](/developers/guides/pagination.html) @@ -9688,7 +9649,7 @@ paths: name: Go post: tags: - - coupon + - Coupon operationId: create_coupon summary: Create a new coupon requestBody: @@ -10050,7 +10011,7 @@ paths: "/coupons/{coupon_id}": get: tags: - - coupon + - Coupon operationId: get_coupon summary: Fetch a coupon parameters: @@ -10262,7 +10223,7 @@ paths: name: Go put: tags: - - coupon + - Coupon operationId: update_coupon summary: Update an active coupon parameters: @@ -10533,7 +10494,7 @@ paths: name: Go delete: tags: - - coupon + - Coupon operationId: deactivate_coupon summary: Expire a coupon parameters: @@ -10728,7 +10689,7 @@ paths: "/coupons/{coupon_id}/generate": post: tags: - - unique_coupon_code + - Unique Coupon Code operationId: generate_unique_coupon_codes summary: Generate unique coupon codes parameters: @@ -10770,7 +10731,7 @@ paths: "/coupons/{coupon_id}/generate_sync": post: tags: - - unique_coupon_code + - Unique Coupon Code operationId: generate_unique_coupon_codes_sync summary: Generate unique coupon codes synchronously description: Generates up to 200 unique coupon codes for a bulk coupon and returns @@ -10819,7 +10780,7 @@ paths: "/coupons/{coupon_id}/restore": put: tags: - - coupon + - Coupon operationId: restore_coupon summary: Restore an inactive coupon description: Make an expired coupon redeemable again. You can change editable @@ -10867,7 +10828,7 @@ paths: "/coupons/{coupon_id}/unique_coupon_codes": get: tags: - - unique_coupon_code + - Unique Coupon Code operationId: list_unique_coupon_codes summary: List unique coupon codes associated with a bulk coupon description: See the [Pagination Guide](/developers/guides/pagination.html) @@ -10904,7 +10865,7 @@ paths: "/credit_payments": get: tags: - - credit_payment + - Credit Payment operationId: list_credit_payments summary: List a site's credit payments description: See the [Pagination Guide](/developers/guides/pagination.html) @@ -11078,7 +11039,7 @@ paths: "/credit_payments/{credit_payment_id}": get: tags: - - credit_payment + - Credit Payment operationId: get_credit_payment summary: Fetch a credit payment parameters: @@ -11106,7 +11067,7 @@ paths: "/custom_field_definitions": get: tags: - - custom_field_definition + - Custom Field Definition operationId: list_custom_field_definitions summary: List a site's custom field definitions description: See the [Pagination Guide](/developers/guides/pagination.html) @@ -11287,7 +11248,7 @@ paths: "/custom_field_definitions/{custom_field_definition_id}": get: tags: - - custom_field_definition + - Custom Field Definition operationId: get_custom_field_definition summary: Fetch an custom field definition parameters: @@ -11500,7 +11461,7 @@ paths: "/general_ledger_accounts": post: tags: - - general_ledger_account + - General Ledger Account operationId: create_general_ledger_account summary: Create a new general ledger account requestBody: @@ -11525,7 +11486,7 @@ paths: x-code-samples: [] get: tags: - - general_ledger_account + - General Ledger Account operationId: list_general_ledger_accounts summary: List a site's general ledger accounts description: See the [Pagination Guide](/developers/guides/pagination.html) @@ -11553,7 +11514,7 @@ paths: "/general_ledger_accounts/{general_ledger_account_id}": get: tags: - - general_ledger_account + - General Ledger Account operationId: get_general_ledger_account summary: Fetch a general ledger account parameters: @@ -11574,7 +11535,7 @@ paths: x-code-samples: [] put: tags: - - general_ledger_account + - General Ledger Account operationId: update_general_ledger_account summary: Update a general ledger account parameters: @@ -11602,7 +11563,7 @@ paths: "/performance_obligations/{performance_obligation_id}": get: tags: - - performance_obligations + - Performance Obligations operationId: get_performance_obligation summary: Get a single Performance Obligation. parameters: @@ -11624,7 +11585,7 @@ paths: "/performance_obligations": get: tags: - - performance_obligations + - Performance Obligations operationId: get_performance_obligations summary: Get a site's Performance Obligations responses: @@ -11644,7 +11605,7 @@ paths: "/invoice_templates/{invoice_template_id}/accounts": get: tags: - - account + - Account operationId: list_invoice_template_accounts summary: List an invoice template's associated accounts description: See the [Pagination Guide](/developers/guides/pagination.html) @@ -11689,7 +11650,7 @@ paths: "/items": get: tags: - - item + - Item operationId: list_items summary: List a site's items description: See the [Pagination Guide](/developers/guides/pagination.html) @@ -11863,7 +11824,7 @@ paths: name: Go post: tags: - - item + - Item operationId: create_item summary: Create a new item requestBody: @@ -12250,7 +12211,7 @@ paths: "/items/{item_id}": get: tags: - - item + - Item operationId: get_item summary: Fetch an item parameters: @@ -12462,7 +12423,7 @@ paths: name: Go put: tags: - - item + - Item operationId: update_item summary: Update an active item parameters: @@ -12758,7 +12719,7 @@ paths: name: Go delete: tags: - - item + - Item operationId: deactivate_item summary: Deactivate an item parameters: @@ -12973,7 +12934,7 @@ paths: - "$ref": "#/components/parameters/item_id" put: tags: - - item + - Item operationId: reactivate_item summary: Reactivate an inactive item description: Reactivating an item makes it available for new purchases. It will @@ -13190,7 +13151,7 @@ paths: "/measured_units": get: tags: - - measured_unit + - Measured Unit operationId: list_measured_unit summary: List a site's measured units description: See the [Pagination Guide](/developers/guides/pagination.html) @@ -13225,7 +13186,7 @@ paths: x-code-samples: [] post: tags: - - measured_unit + - Measured Unit operationId: create_measured_unit summary: Create a new measured unit requestBody: @@ -13269,7 +13230,7 @@ paths: "/measured_units/{measured_unit_id}": get: tags: - - measured_unit + - Measured Unit operationId: get_measured_unit summary: Fetch a measured unit parameters: @@ -13296,7 +13257,7 @@ paths: x-code-samples: [] put: tags: - - measured_unit + - Measured Unit operationId: update_measured_unit summary: Update a measured unit parameters: @@ -13341,7 +13302,7 @@ paths: x-code-samples: [] delete: tags: - - measured_unit + - Measured Unit operationId: remove_measured_unit summary: Remove a measured unit description: A mesured unit cannot be deleted if it is used by an active plan. @@ -13370,7 +13331,7 @@ paths: "/external_products": get: tags: - - external_products + - External Product operationId: list_external_products summary: List a site's external products description: See the [Pagination Guide](/developers/guides/pagination.html) @@ -13399,7 +13360,7 @@ paths: x-code-samples: [] post: tags: - - external_products + - External Product operationId: create_external_product summary: Create an external product requestBody: @@ -13439,7 +13400,7 @@ paths: - "$ref": "#/components/parameters/external_product_id" get: tags: - - external_products + - External Product operationId: get_external_product summary: Fetch an external product responses: @@ -13464,7 +13425,7 @@ paths: x-code-samples: [] put: tags: - - external_products + - External Product operationId: update_external_product summary: Update an external product requestBody: @@ -13495,7 +13456,7 @@ paths: x-code-samples: [] delete: tags: - - external_products + - External Product operationId: deactivate_external_products summary: Deactivate an external product description: Deactivate an external product. @@ -13524,7 +13485,7 @@ paths: - "$ref": "#/components/parameters/external_product_id" get: tags: - - external_product_references + - External Product Reference operationId: list_external_product_external_product_references summary: List the external product references for an external product description: See the [Pagination Guide](/developers/guides/pagination.html) @@ -13554,7 +13515,7 @@ paths: x-code-samples: [] post: tags: - - external_product_references + - External Product Reference operationId: create_external_product_external_product_reference summary: Create an external product reference on an external product requestBody: @@ -13589,7 +13550,7 @@ paths: - "$ref": "#/components/parameters/external_product_reference_id" get: tags: - - external_product_references + - External Product Reference operationId: get_external_product_external_product_reference summary: Fetch an external product reference responses: @@ -13614,7 +13575,7 @@ paths: x-code-samples: [] delete: tags: - - external_product_references + - External Product Reference operationId: deactivate_external_product_external_product_reference summary: Deactivate an external product reference responses: @@ -13640,7 +13601,7 @@ paths: "/external_subscriptions": post: tags: - - external_subscriptions + - External Subscription operationId: create_external_subscription summary: Create an external subscription requestBody: @@ -13678,7 +13639,7 @@ paths: x-code-samples: [] get: tags: - - external_subscriptions + - External Subscription operationId: list_external_subscriptions summary: List the external subscriptions on a site description: See the [Pagination Guide](/developers/guides/pagination.html) @@ -13710,7 +13671,7 @@ paths: parameters: - "$ref": "#/components/parameters/external_subscription_id_fetch" tags: - - external_subscriptions + - External Subscription operationId: get_external_subscription summary: Fetch an external subscription responses: @@ -13744,7 +13705,7 @@ paths: parameters: - "$ref": "#/components/parameters/external_subscription_id" tags: - - external_subscriptions + - External Subscription operationId: put_external_subscription summary: Update an external subscription requestBody: @@ -13791,7 +13752,7 @@ paths: - "$ref": "#/components/parameters/external_subscription_id" get: tags: - - external_subscriptions + - External Subscription operationId: list_external_subscription_external_invoices summary: List the external invoices on an external subscription description: See the [Pagination Guide](/developers/guides/pagination.html) @@ -13822,7 +13783,7 @@ paths: x-code-samples: [] post: tags: - - external_invoices + - External Invoice operationId: create_external_invoice summary: Create an external invoice requestBody: @@ -13861,7 +13822,7 @@ paths: "/invoices": get: tags: - - invoice + - Invoice operationId: list_invoices summary: List a site's invoices description: See the [Pagination Guide](/developers/guides/pagination.html) @@ -14037,7 +13998,7 @@ paths: "/invoices/{invoice_id}": get: tags: - - invoice + - Invoice operationId: get_invoice summary: Fetch an invoice parameters: @@ -14249,7 +14210,7 @@ paths: name: Go put: tags: - - invoice + - Invoice operationId: update_invoice summary: Update an invoice parameters: @@ -14526,7 +14487,7 @@ paths: "/invoices/{invoice_id}.pdf": get: tags: - - invoice + - Invoice operationId: get_invoice_pdf summary: Fetch an invoice as a PDF parameters: @@ -14780,7 +14741,7 @@ paths: "/invoices/{invoice_id}/apply_credit_balance": put: tags: - - invoice + - Invoice operationId: apply_credit_balance summary: Apply available credit to a pending or past due charge invoice description: Apply credit payment to the outstanding balance on an existing @@ -15003,7 +14964,7 @@ paths: "/invoices/{invoice_id}/collect": put: tags: - - invoice + - Invoice operationId: collect_invoice summary: Collect a pending or past due, automatic invoice description: Force a collection attempt using the stored billing information. @@ -15230,7 +15191,7 @@ paths: "/invoices/{invoice_id}/mark_failed": put: tags: - - invoice + - Invoice operationId: mark_invoice_failed summary: Mark an open invoice as failed description: | @@ -15453,7 +15414,7 @@ paths: "/invoices/{invoice_id}/mark_successful": put: tags: - - invoice + - Invoice operationId: mark_invoice_successful summary: Mark an open invoice as successful description: | @@ -15682,7 +15643,7 @@ paths: "/invoices/{invoice_id}/reopen": put: tags: - - invoice + - Invoice operationId: reopen_invoice summary: Reopen a closed, manual invoice parameters: @@ -15902,7 +15863,7 @@ paths: "/invoices/{invoice_id}/void": put: tags: - - invoice + - Invoice operationId: void_invoice summary: Void a credit invoice. description: Invoice must be a credit invoice (`type=credit`) and cannot be @@ -16086,7 +16047,7 @@ paths: "/invoices/{invoice_id}/transactions": post: tags: - - invoice + - Invoice operationId: record_external_transaction summary: Record an external payment for a manual invoices. description: This endpoint allows you to record an offline payment that was @@ -16174,7 +16135,7 @@ paths: "/invoices/{invoice_id}/line_items": get: tags: - - line_item + - Line Item operationId: list_invoice_line_items summary: List an invoice's line items description: See the [Pagination Guide](/developers/guides/pagination.html) @@ -16359,7 +16320,7 @@ paths: "/invoices/{invoice_id}/coupon_redemptions": get: tags: - - coupon_redemption + - Coupon Redemption operationId: list_invoice_coupon_redemptions summary: List the coupon redemptions applied to an invoice description: See the [Pagination Guide](/developers/guides/pagination.html) @@ -16522,7 +16483,7 @@ paths: "/invoices/{invoice_id}/related_invoices": get: tags: - - invoice + - Invoice operationId: list_related_invoices summary: List an invoice's related credit or charge invoices description: | @@ -16682,7 +16643,7 @@ paths: "/invoices/{invoice_id}/refund": post: tags: - - invoice + - Invoice operationId: refund_invoice summary: Refund an invoice description: | @@ -16978,7 +16939,7 @@ paths: "/invoices/recovery": post: tags: - - revenue_recovery + - Revenue Recovery operationId: create_invoice_retry summary: Create an invoice for revenue recovery requestBody: @@ -17023,7 +16984,7 @@ paths: "/line_items": get: tags: - - line_item + - Line Item operationId: list_line_items summary: List a site's line items description: See the [Pagination Guide](/developers/guides/pagination.html) @@ -17204,7 +17165,7 @@ paths: "/line_items/{line_item_id}": get: tags: - - line_item + - Line Item operationId: get_line_item summary: Fetch a line item parameters: @@ -17416,7 +17377,7 @@ paths: name: Go delete: tags: - - line_item + - Line Item operationId: remove_line_item summary: Delete an uninvoiced line item parameters: @@ -17631,7 +17592,7 @@ paths: "/plans": get: tags: - - plan + - Plan operationId: list_plans summary: List a site's plans description: See the [Pagination Guide](/developers/guides/pagination.html) @@ -17805,7 +17766,7 @@ paths: name: Go post: tags: - - plan + - Plan operationId: create_plan summary: Create a plan requestBody: @@ -18170,7 +18131,7 @@ paths: "/plans/{plan_id}": get: tags: - - plan + - Plan operationId: get_plan summary: Fetch a plan parameters: @@ -18382,7 +18343,7 @@ paths: name: Go put: tags: - - plan + - Plan operationId: update_plan summary: Update a plan parameters: @@ -18644,7 +18605,7 @@ paths: name: Go delete: tags: - - plan + - Plan operationId: remove_plan summary: Remove a plan parameters: @@ -18847,7 +18808,7 @@ paths: "/plans/{plan_id}/add_ons": get: tags: - - add-on + - Add-on operationId: list_plan_add_ons summary: List a plan's add-ons description: See the [Pagination Guide](/developers/guides/pagination.html) @@ -19020,7 +18981,7 @@ paths: name: Go post: tags: - - add-on + - Add-on operationId: create_plan_add_on summary: Create an add-on parameters: @@ -19383,7 +19344,7 @@ paths: "/plans/{plan_id}/add_ons/{add_on_id}": get: tags: - - add-on + - Add-on operationId: get_plan_add_on summary: Fetch a plan's add-on parameters: @@ -19600,7 +19561,7 @@ paths: name: Go put: tags: - - add-on + - Add-on operationId: update_plan_add_on summary: Update an add-on parameters: @@ -19853,7 +19814,7 @@ paths: name: Go delete: tags: - - add-on + - Add-on operationId: remove_plan_add_on summary: Remove an add-on parameters: @@ -20052,7 +20013,7 @@ paths: "/price_segments": get: tags: - - price_segment + - Price Segment operationId: list_price_segments summary: List a site's price segments description: See the [Pagination Guide](/developers/guides/pagination.html) @@ -20090,7 +20051,7 @@ paths: "/price_segments/{price_segment_id}": get: tags: - - price_segment + - Price Segment operationId: get_price_segment summary: Fetch a price segment parameters: @@ -20118,7 +20079,7 @@ paths: "/add_ons": get: tags: - - add-on + - Add-on operationId: list_add_ons summary: List a site's add-ons description: See the [Pagination Guide](/developers/guides/pagination.html) @@ -20289,7 +20250,7 @@ paths: "/add_ons/{add_on_id}": get: tags: - - add-on + - Add-on operationId: get_add_on summary: Fetch an add-on parameters: @@ -20502,7 +20463,7 @@ paths: "/shipping_methods": get: tags: - - shipping_method + - Shipping Method operationId: list_shipping_methods summary: List a site's shipping methods description: See the [Pagination Guide](/developers/guides/pagination.html) @@ -20671,7 +20632,7 @@ paths: name: Go post: tags: - - shipping_method + - Shipping Method operationId: create_shipping_method summary: Create a new shipping method requestBody: @@ -20715,7 +20676,7 @@ paths: "/shipping_methods/{shipping_method_id}": get: tags: - - shipping_method + - Shipping Method operationId: get_shipping_method summary: Fetch a shipping method parameters: @@ -20742,7 +20703,7 @@ paths: x-code-samples: [] put: tags: - - shipping_method + - Shipping Method operationId: update_shipping_method summary: Update an active Shipping Method parameters: @@ -20787,7 +20748,7 @@ paths: x-code-samples: [] delete: tags: - - shipping_method + - Shipping Method operationId: deactivate_shipping_method summary: Deactivate a shipping method parameters: @@ -20817,7 +20778,7 @@ paths: "/subscriptions": get: tags: - - subscription + - Subscription operationId: list_subscriptions summary: List a site's subscriptions description: See the [Pagination Guide](/developers/guides/pagination.html) @@ -20991,7 +20952,7 @@ paths: name: Go post: tags: - - subscription + - Subscription operationId: create_subscription summary: Create a new subscription requestBody: @@ -21315,7 +21276,7 @@ paths: "/subscriptions/{subscription_id}": get: tags: - - subscription + - Subscription operationId: get_subscription summary: Fetch a subscription parameters: @@ -21531,7 +21492,7 @@ paths: name: Go put: tags: - - subscription + - Subscription operationId: update_subscription summary: Update a subscription description: This only lets you change the subscription settings that have no @@ -21804,7 +21765,7 @@ paths: name: Go delete: tags: - - subscription + - Subscription operationId: terminate_subscription summary: Terminate a subscription description: | @@ -22071,7 +22032,7 @@ paths: "/subscriptions/{subscription_id}/cancel": put: tags: - - subscription + - Subscription operationId: cancel_subscription summary: Cancel a subscription description: A canceled subscription will continue through its current billing @@ -22309,7 +22270,7 @@ paths: "/subscriptions/{subscription_id}/reactivate": put: tags: - - subscription + - Subscription operationId: reactivate_subscription summary: Reactivate a canceled subscription description: | @@ -22539,7 +22500,7 @@ paths: "/subscriptions/{subscription_id}/pause": put: tags: - - subscription + - Subscription operationId: pause_subscription summary: Pause subscription description: | @@ -22809,7 +22770,7 @@ paths: "/subscriptions/{subscription_id}/resume": put: tags: - - subscription + - Subscription operationId: resume_subscription summary: Resume subscription description: | @@ -23040,7 +23001,7 @@ paths: "/subscriptions/{subscription_id}/convert_trial": put: tags: - - subscription + - Subscription operationId: convert_trial summary: Convert trial subscription description: This will immediately convert a trial subscription to a fully active @@ -23080,7 +23041,7 @@ paths: "/subscriptions/{subscription_id}/preview_renewal": get: tags: - - subscription + - Subscription operationId: get_preview_renewal summary: Fetch a preview of a subscription's renewal invoice(s) description: The subscriptions's renewal invoice(s) will be returned if they @@ -23306,7 +23267,7 @@ paths: "/subscriptions/{subscription_id}/change": get: tags: - - subscription_change + - Subscription Change operationId: get_subscription_change summary: Fetch a subscription's pending change parameters: @@ -23535,7 +23496,7 @@ paths: name: Go post: tags: - - subscription_change + - Subscription Change operationId: create_subscription_change summary: Create a new subscription change description: | @@ -23830,7 +23791,7 @@ paths: name: Go delete: tags: - - subscription_change + - Subscription Change operationId: remove_subscription_change summary: Delete the pending subscription change parameters: @@ -24041,7 +24002,7 @@ paths: "/subscriptions/{subscription_id}/change/preview": post: tags: - - subscription_change + - Subscription Change operationId: preview_subscription_change summary: Preview a new subscription change description: Calling this will not save the subscription change or overwrite @@ -24084,7 +24045,7 @@ paths: "/subscriptions/{subscription_id}/invoices": get: tags: - - invoice + - Invoice operationId: list_subscription_invoices summary: List a subscription's invoices description: See the [Pagination Guide](/developers/guides/pagination.html) @@ -24260,7 +24221,7 @@ paths: "/subscriptions/{subscription_id}/line_items": get: tags: - - line_item + - Line Item operationId: list_subscription_line_items summary: List a subscription's line items description: See the [Pagination Guide](/developers/guides/pagination.html) @@ -24438,7 +24399,7 @@ paths: "/subscriptions/{subscription_id}/coupon_redemptions": get: tags: - - coupon_redemption + - Coupon Redemption operationId: list_subscription_coupon_redemptions summary: List the coupon redemptions for a subscription description: See the [Pagination Guide](/developers/guides/pagination.html) @@ -24605,7 +24566,7 @@ paths: "/subscriptions/{subscription_id}/coupon_redemptions/{coupon_redemption_id}": get: tags: - - coupon_redemption + - Coupon Redemption operationId: get_subscription_coupon_redemption summary: Show the coupon redemption for a subscription parameters: @@ -24633,7 +24594,7 @@ paths: x-code-samples: [] delete: tags: - - coupon_redemption + - Coupon Redemption operationId: remove_subscription_coupon_redemption summary: Delete the coupon redemption from a subscription description: Deactivate the coupon redemption on a subscription. @@ -24669,7 +24630,7 @@ paths: "/subscriptions/{subscription_id}/add_ons/{add_on_id}/usage": get: tags: - - usage + - Usage operationId: list_usage summary: List a subscription add-on's usage records parameters: @@ -24710,7 +24671,7 @@ paths: x-code-samples: [] post: tags: - - usage + - Usage operationId: create_usage summary: Log a usage record on this subscription add-on parameters: @@ -24757,7 +24718,7 @@ paths: "/usage/{usage_id}": get: tags: - - usage + - Usage operationId: get_usage summary: Get a usage record parameters: @@ -24790,7 +24751,7 @@ paths: x-code-samples: [] put: tags: - - usage + - Usage operationId: update_usage summary: Update a usage record parameters: @@ -24835,7 +24796,7 @@ paths: x-code-samples: [] delete: tags: - - usage + - Usage operationId: remove_usage summary: Delete a usage record. parameters: @@ -24871,7 +24832,7 @@ paths: "/transactions": get: tags: - - transaction + - Transaction operationId: list_transactions summary: List a site's transactions description: See the [Pagination Guide](/developers/guides/pagination.html) @@ -25047,7 +25008,7 @@ paths: "/transactions/{transaction_id}": get: tags: - - transaction + - Transaction operationId: get_transaction summary: Fetch a transaction parameters: @@ -25262,7 +25223,7 @@ paths: - "$ref": "#/components/parameters/unique_coupon_code_id" get: tags: - - unique_coupon_code + - Unique Coupon Code operationId: get_unique_coupon_code summary: Fetch a unique coupon code responses: @@ -25287,7 +25248,7 @@ paths: x-code-samples: [] delete: tags: - - unique_coupon_code + - Unique Coupon Code operationId: deactivate_unique_coupon_code summary: Deactivate a unique coupon code description: Expire a unique code, making that specific code no longer redeemable. @@ -25323,7 +25284,7 @@ paths: - "$ref": "#/components/parameters/unique_coupon_code_id" put: tags: - - unique_coupon_code + - Unique Coupon Code operationId: reactivate_unique_coupon_code summary: Restore a unique coupon code responses: @@ -25355,7 +25316,7 @@ paths: "/purchases": post: tags: - - purchase + - Purchase operationId: create_purchase summary: Create a new purchase description: A purchase is a checkout containing at least one or more subscriptions @@ -25801,7 +25762,7 @@ paths: "/purchases/preview": post: tags: - - purchase + - Purchase operationId: preview_purchase summary: Preview a new purchase description: A purchase is a checkout containing at least one or more subscriptions @@ -26237,7 +26198,7 @@ paths: "/purchases/pending": post: tags: - - purchase + - Purchase operationId: create_pending_purchase summary: Create a pending purchase description: |- @@ -26742,7 +26703,7 @@ paths: "/purchases/authorize": post: tags: - - purchase + - Purchase operationId: create_authorize_purchase summary: Authorize a purchase description: |- @@ -26786,7 +26747,7 @@ paths: "/purchases/{transaction_id}/capture": post: tags: - - purchase + - Purchase parameters: - "$ref": "#/components/parameters/transaction_id" operationId: create_capture_purchase @@ -26837,7 +26798,7 @@ paths: Cancel an open Authorization request tags: - - purchase + - Purchase operationId: cancelPurchase responses: '200': @@ -26868,7 +26829,7 @@ paths: "/export_dates": get: tags: - - automated_exports + - Automated Exports operationId: get_export_dates summary: List the dates that have an available export to download. description: Returns a list of dates for which export files are available for @@ -27065,7 +27026,7 @@ paths: - "$ref": "#/components/parameters/export_date" get: tags: - - automated_exports + - Automated Exports operationId: get_export_files summary: List of the export files that are available to download. description: Returns a list of presigned URLs to download export files for the @@ -27260,7 +27221,7 @@ paths: "/dunning_campaigns": get: tags: - - dunning_campaigns + - Dunning Campaigns operationId: list_dunning_campaigns summary: List the dunning campaigns for a site description: See the [Pagination Guide](/developers/guides/pagination.html) @@ -27287,12 +27248,68 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: [] + post: + tags: + - Dunning Campaigns + operationId: create_dunning_campaign + summary: Create a new dunning campaign + requestBody: + content: + application/json: + schema: + "$ref": "#/components/schemas/DunningCampaignCreate" + required: true + responses: + '201': + description: A new dunning campaign. + content: + application/json: + schema: + "$ref": "#/components/schemas/DunningCampaign" + '400': + description: Bad request; perhaps missing or invalid parameters. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + '403': + description: Upgrade your plan to unlock multiple dunning campaigns. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + '404': + description: Incorrect site. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + '422': + description: Invalid request parameters. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + '503': + description: The email template service is temporarily unavailable; retry + the request. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + default: + description: Unexpected error. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + x-code-samples: [] "/dunning_campaigns/{dunning_campaign_id}": parameters: - "$ref": "#/components/parameters/dunning_campaign_id" get: tags: - - dunning_campaigns + - Dunning Campaigns operationId: get_dunning_campaign summary: Fetch a dunning campaign responses: @@ -27321,12 +27338,141 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: [] + put: + tags: + - Dunning Campaigns + operationId: update_dunning_campaign + summary: Update a dunning campaign + description: Each cycle write is a full replacement of that cycle's settings; + omitted scalars fall back to the model default rather than the prior version. + requestBody: + content: + application/json: + schema: + "$ref": "#/components/schemas/DunningCampaignUpdate" + required: true + responses: + '200': + description: The updated dunning campaign. + content: + application/json: + schema: + "$ref": "#/components/schemas/DunningCampaign" + '400': + description: Bad request; perhaps missing or invalid parameters. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + '403': + description: Upgrade your plan to unlock multiple dunning campaigns. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + '404': + description: Incorrect site or campaign ID. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + '422': + description: Invalid request parameters. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + '503': + description: The email template service is temporarily unavailable; retry + the request. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + default: + description: Unexpected error. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + x-code-samples: [] + delete: + tags: + - Dunning Campaigns + operationId: deactivate_dunning_campaign + summary: Deactivate a dunning campaign + description: The default dunning campaign cannot be deactivated. + responses: + '200': + description: The deactivated dunning campaign. + content: + application/json: + schema: + "$ref": "#/components/schemas/DunningCampaign" + '403': + description: Upgrade your plan to unlock multiple dunning campaigns. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + '404': + description: Incorrect site or campaign ID. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + '422': + description: Campaign is already inactive, or is the default campaign. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + default: + description: Unexpected error. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + x-code-samples: [] + "/dunning_campaigns/email_templates": + get: + tags: + - Dunning Campaigns + operationId: list_dunning_campaign_email_templates + summary: List the custom email templates assignable to a dunning campaign interval + responses: + '200': + description: A list of the site's assignable custom email templates. + content: + application/json: + schema: + "$ref": "#/components/schemas/DunningCampaignEmailTemplateList" + '404': + description: Incorrect site. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + '503': + description: The email template service is temporarily unavailable; retry + the request. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + default: + description: Unexpected error. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + x-code-samples: [] "/dunning_campaigns/{dunning_campaign_id}/bulk_update": parameters: - "$ref": "#/components/parameters/dunning_campaign_id" put: tags: - - dunning_campaigns + - Dunning Campaigns operationId: put_dunning_campaign_bulk_update summary: Assign a dunning campaign to multiple plans requestBody: @@ -27363,7 +27509,7 @@ paths: "/invoice_templates": get: tags: - - invoice_templates + - Invoice Templates operationId: list_invoice_templates summary: Show the invoice templates for a site description: See the [Pagination Guide](/developers/guides/pagination.html) @@ -27395,7 +27541,7 @@ paths: - "$ref": "#/components/parameters/invoice_template_id" get: tags: - - invoice_templates + - Invoice Templates operationId: get_invoice_template summary: Fetch an invoice template responses: @@ -27427,7 +27573,7 @@ paths: "/external_invoices": get: tags: - - external_invoices + - External Invoice operationId: list_external_invoices summary: List the external invoices on a site description: See the [Pagination Guide](/developers/guides/pagination.html) @@ -27461,7 +27607,7 @@ paths: - "$ref": "#/components/parameters/external_invoice_id" get: tags: - - external_invoices + - External Invoice operationId: show_external_invoice summary: Fetch an external invoice responses: @@ -27495,7 +27641,7 @@ paths: - "$ref": "#/components/parameters/external_subscription_id" get: tags: - - external_subscriptions + - External Subscription operationId: list_external_subscription_external_payment_phases summary: List the external payment phases on an external subscription description: See the [Pagination Guide](/developers/guides/pagination.html) @@ -27530,7 +27676,7 @@ paths: - "$ref": "#/components/parameters/external_payment_phase_id" get: tags: - - external_payment_phases + - External Payment Phase operationId: get_external_subscription_external_payment_phase summary: Fetch an external payment phase responses: @@ -27559,7 +27705,7 @@ paths: - "$ref": "#/components/parameters/filter_limited_subscription_state" get: tags: - - account + - Account operationId: list_entitlements summary: List entitlements granted to an account responses: @@ -27587,7 +27733,7 @@ paths: - "$ref": "#/components/parameters/account_id" get: tags: - - account + - Account operationId: list_account_external_subscriptions summary: List an account's external subscriptions description: See the [Pagination Guide](/developers/guides/pagination.html) @@ -27619,7 +27765,7 @@ paths: - "$ref": "#/components/parameters/business_entity_id" get: tags: - - business_entities + - Business Entities operationId: get_business_entity summary: Fetch a business entity responses: @@ -27645,7 +27791,7 @@ paths: "/business_entities": get: tags: - - business_entities + - Business Entities operationId: list_business_entities summary: List business entities responses: @@ -27671,7 +27817,7 @@ paths: "/gift_cards": get: tags: - - gift_cards + - Gift Cards operationId: list_gift_cards summary: List gift cards responses: @@ -27696,7 +27842,7 @@ paths: x-code-samples: [] post: tags: - - gift_cards + - Gift Cards operationId: create_gift_card summary: Create gift card requestBody: @@ -27736,7 +27882,7 @@ paths: - "$ref": "#/components/parameters/gift_card_id" get: tags: - - gift_cards + - Gift Cards operationId: get_gift_card summary: Fetch a gift card responses: @@ -27762,7 +27908,7 @@ paths: "/gift_cards/preview": post: tags: - - gift_cards + - Gift Cards operationId: preview_gift_card summary: Preview gift card requestBody: @@ -27802,7 +27948,7 @@ paths: - "$ref": "#/components/parameters/redemption_code" post: tags: - - gift_cards + - Gift Cards operationId: redeem_gift_card summary: Redeem gift card requestBody: @@ -27840,7 +27986,7 @@ paths: "/business_entities/{business_entity_id}/invoices": get: tags: - - invoice + - Invoice operationId: list_business_entity_invoices summary: List a business entity's invoices description: See the [Pagination Guide](/developers/guides/pagination.html) @@ -36745,6 +36891,155 @@ components: email_template: type: string description: Email template being used. + email_template_id: + type: string + nullable: true + description: The id of the custom email template assigned to this interval, + from `GET /dunning_campaigns/email_templates`. `null` means the system + default template for this interval. Accepted on write; round-tripped on + read. + DunningCampaignCreate: + type: object + properties: + name: + type: string + title: Name + description: Campaign name. + maxLength: 255 + code: + type: string + title: Code + description: Campaign code. + maxLength: 50 + description: + type: string + title: Description + description: Campaign description. + maxLength: 255 + dunning_cycles: + type: array + description: Dunning Cycle settings. One entry per collection method (`automatic`, + `manual`, `trial`); each type may appear at most once. + items: + "$ref": "#/components/schemas/DunningCycleCreate" + required: + - name + - code + DunningCampaignUpdate: + type: object + properties: + name: + type: string + title: Name + description: Campaign name. + maxLength: 255 + code: + type: string + title: Code + description: Campaign code. + maxLength: 50 + description: + type: string + title: Description + description: Campaign description. + maxLength: 255 + default_campaign: + type: boolean + title: Default Campaign + description: Set to `true` to make this the default campaign for accounts + or plans without an assigned dunning campaign. Cannot be set on an inactive + campaign, and cannot be unset directly—assign a different campaign as + the default instead. + dunning_cycles: + type: array + description: Dunning Cycle settings. One entry per collection method (`automatic`, + `manual`, `trial`); each type may appear at most once. Each cycle write + fully replaces that cycle's current settings version. + items: + "$ref": "#/components/schemas/DunningCycleCreate" + DunningCycleCreate: + type: object + description: Write shape for a single dunning cycle, shared by campaign create + and update. + properties: + type: + "$ref": "#/components/schemas/DunningCycleTypeEnum" + active: + type: boolean + description: Only meaningful on the `trial` cycle, where sending `false` + removes it. Other cycle types cannot be deactivated. + applies_to_manual_trial: + type: boolean + description: Whether the dunning settings will be applied to manual trials. + Only applies to trial cycles. + expire_subscription: + type: boolean + description: Whether the subscription(s) should be cancelled at the end + of the dunning cycle. + fail_invoice: + type: boolean + description: Whether the invoice should be failed at the end of the dunning + cycle. + send_immediately_on_hard_decline: + type: boolean + description: Whether or not to send an extra email immediately to customers + whose initial payment attempt fails with either a hard decline or invalid + billing info. + external_payment_recovery_extension_days: + type: integer + description: Number of days to extend external payment recovery. Only available + when the site has external payment retries enabled. + intervals: + type: array + description: Dunning intervals. Required unless `active` is `false`. + items: + "$ref": "#/components/schemas/DunningIntervalCreate" + required: + - type + DunningIntervalCreate: + type: object + description: Write shape for a dunning interval. Unlike the read `DunningInterval`, + the resolved `email_template` name is not accepted on write. + properties: + days: + type: integer + description: Number of days before sending the next email. + email_template_id: + type: string + nullable: true + description: The id of the custom email template to assign to this interval, + from `GET /dunning_campaigns/email_templates`. `null` uses the system + default template for this interval. + DunningCampaignEmailTemplate: + type: object + properties: + id: + type: string + description: The id to assign under `intervals[].email_template_id`. + name: + type: string + description: Template name. + type: + type: string + description: The root template this custom template replaces, e.g. `payment_declined`, + `invoice_past_due`, `post_trial_payment_declined`, `subscription_canceled_nonpayment`. + DunningCampaignEmailTemplateList: + type: object + properties: + object: + type: string + title: Object type + description: Will always be List. + has_more: + type: boolean + description: Indicates there are more results on subsequent pages. + next: + type: string + description: Path to subsequent page of results. + data: + type: array + items: + "$ref": "#/components/schemas/DunningCampaignEmailTemplate" DunningCampaignsBulkUpdate: properties: plan_codes: diff --git a/recurly/client.py b/recurly/client.py index 1147d016..0d4ea96b 100644 --- a/recurly/client.py +++ b/recurly/client.py @@ -5604,6 +5604,32 @@ def list_dunning_campaigns(self, **options): ) return Pager(self, path, **options) + def create_dunning_campaign(self, body, **options): + """Create a new dunning campaign + + Parameters + ---------- + + body : dict + The request body. It should follow the schema of DunningCampaignCreate. + + Keyword Arguments + ----------------- + + headers : dict + Extra HTTP headers to send with the request. + + Returns + ------- + + DunningCampaign + A new dunning campaign. + """ + path = self._interpolate_path( + "/dunning_campaigns", + ) + return self._make_request("POST", path, body, **options) + def get_dunning_campaign(self, dunning_campaign_id, **options): """Fetch a dunning campaign @@ -5628,6 +5654,70 @@ def get_dunning_campaign(self, dunning_campaign_id, **options): path = self._interpolate_path("/dunning_campaigns/%s", dunning_campaign_id) return self._make_request("GET", path, None, **options) + def update_dunning_campaign(self, dunning_campaign_id, body, **options): + """Update a dunning campaign + + Parameters + ---------- + + dunning_campaign_id : str + Dunning Campaign ID, e.g. `e28zov4fw0v2`. + body : dict + The request body. It should follow the schema of DunningCampaignUpdate. + + Keyword Arguments + ----------------- + + headers : dict + Extra HTTP headers to send with the request. + + Returns + ------- + + DunningCampaign + The updated dunning campaign. + """ + path = self._interpolate_path("/dunning_campaigns/%s", dunning_campaign_id) + return self._make_request("PUT", path, body, **options) + + def deactivate_dunning_campaign(self, dunning_campaign_id, **options): + """Deactivate a dunning campaign + + Parameters + ---------- + + dunning_campaign_id : str + Dunning Campaign ID, e.g. `e28zov4fw0v2`. + + Keyword Arguments + ----------------- + + headers : dict + Extra HTTP headers to send with the request. + + Returns + ------- + + DunningCampaign + The deactivated dunning campaign. + """ + path = self._interpolate_path("/dunning_campaigns/%s", dunning_campaign_id) + return self._make_request("DELETE", path, None, **options) + + def list_dunning_campaign_email_templates(self, **options): + """List the custom email templates assignable to a dunning campaign interval + + Returns + ------- + + Pager + A list of the site's assignable custom email templates. + """ + path = self._interpolate_path( + "/dunning_campaigns/email_templates", + ) + return Pager(self, path, **options) + def put_dunning_campaign_bulk_update(self, dunning_campaign_id, body, **options): """Assign a dunning campaign to multiple plans diff --git a/recurly/resources.py b/recurly/resources.py index 7008cf4e..aca69db9 100644 --- a/recurly/resources.py +++ b/recurly/resources.py @@ -3936,11 +3936,33 @@ class DunningInterval(Resource): Number of days before sending the next email. email_template : str Email template being used. + email_template_id : str + The id of the custom email template assigned to this interval, from `GET /dunning_campaigns/email_templates`. `null` means the system default template for this interval. Accepted on write; round-tripped on read. """ schema = { "days": int, "email_template": str, + "email_template_id": str, + } + + +class DunningCampaignEmailTemplate(Resource): + """ + Attributes + ---------- + id : str + The id to assign under `intervals[].email_template_id`. + name : str + Template name. + type : str + The root template this custom template replaces, e.g. `payment_declined`, `invoice_past_due`, `post_trial_payment_declined`, `subscription_canceled_nonpayment`. + """ + + schema = { + "id": str, + "name": str, + "type": str, }