From 2bfdae3d82f277d32fbf3459f7f9edfa3d2209f4 Mon Sep 17 00:00:00 2001 From: GAlexIHU <64845621+GAlexIHU@users.noreply.github.com> Date: Mon, 9 Dec 2024 15:57:18 +0000 Subject: [PATCH] chore(api): generate node client --- api/client/node/schemas/openapi.ts | 4822 ++++++++++++++-------------- 1 file changed, 2348 insertions(+), 2474 deletions(-) diff --git a/api/client/node/schemas/openapi.ts b/api/client/node/schemas/openapi.ts index 3b03a8baa..20da11d4f 100644 --- a/api/client/node/schemas/openapi.ts +++ b/api/client/node/schemas/openapi.ts @@ -79,7 +79,7 @@ export interface paths { * List customer overrides * @description List customer overrides */ - get: operations['billingListCustomerOverrides'] + get: operations['listBillingProfileCustomerOverrides'] put?: never post?: never delete?: never @@ -97,20 +97,20 @@ export interface paths { } /** * Get a customer override - * @description Get a customer override by id. + * @description Get a customer override by customer id. */ - get: operations['billingGetCustomerOverrideById'] + get: operations['getBillingProfileCustomerOverride'] put?: never /** - * Create/update a customer override - * @description Create/update a new customer override. + * Create a new or update a customer override + * @description Create a new or update an existing customer override. */ - post: operations['billingUpsertCustomerOverride'] + post: operations['upsertBillingProfileCustomerOverride'] /** * Delete a customer override - * @description Delete a customer override by id. + * @description Delete a customer override by customer id. */ - delete: operations['billingDeleteCustomerOverride'] + delete: operations['deleteBillingProfileCustomerOverride'] options?: never head?: never patch?: never @@ -125,9 +125,9 @@ export interface paths { } /** * List invoices - * @description List invoices + * @description List invoices for a specific customer */ - get: operations['billingListInvoices'] + get: operations['listInvoices'] put?: never post?: never delete?: never @@ -136,21 +136,17 @@ export interface paths { patch?: never trace?: never } - '/api/v1/billing/invoices/{customerId}': { + '/api/v1/billing/invoices/invoice': { parameters: { query?: never header?: never path?: never cookie?: never } - /** - * List invoices - * @description List invoices for a specific customer - */ - get: operations['billingListInvoicesByCustomer'] + get?: never put?: never /** - * Create an invoice + * Invoice a customer based on the pending line items * @description Create a new invoice from the pending line items. * * This should be only called if for some reason we need to invoice a customer outside of the normal billing cycle. @@ -161,14 +157,41 @@ export interface paths { * * The call can return multiple invoices if the pending line items are in different currencies. */ - post: operations['billingCreateInvoice'] + post: operations['invoicePendingLinesAction'] + delete?: never + options?: never + head?: never + patch?: never + trace?: never + } + '/api/v1/billing/invoices/lines': { + parameters: { + query?: never + header?: never + path?: never + cookie?: never + } + get?: never + put?: never + /** + * Create pending line items + * @description Create a new pending line item (charge). + * + * This call is used to create a new pending line item for the customer if required a new + * gathering invoice will be created. + * + * A new invoice will be created if: + * - there is no invoice in gathering state + * - the currency of the line item doesn't match the currency of any invoices in gathering state + */ + post: operations['createPendingInvoiceLine'] delete?: never options?: never head?: never patch?: never trace?: never } - '/api/v1/billing/invoices/{customerId}/invoices/{invoiceId}': { + '/api/v1/billing/invoices/{invoiceId}': { parameters: { query?: never header?: never @@ -179,7 +202,7 @@ export interface paths { * Get an invoice * @description Get an invoice by ID. */ - get: operations['billingGetInvoiceByCustomerInvoiceId'] + get: operations['getInvoice'] put?: never post?: never /** @@ -188,13 +211,13 @@ export interface paths { * * Only invoices that are in the draft (or earlier) status can be deleted. */ - delete: operations['billingDeleteInvoiceByCustomerInvoiceId'] + delete: operations['deleteInvoice'] options?: never head?: never patch?: never trace?: never } - '/api/v1/billing/invoices/{customerId}/invoices/{invoiceId}/advance': { + '/api/v1/billing/invoices/{invoiceId}/advance': { parameters: { query?: never header?: never @@ -211,14 +234,14 @@ export interface paths { * * The action can be called when the invoice's statusDetails' actions field contain the "advance" action. */ - post: operations['billingInvoiceAdvance'] + post: operations['advanceInvoiceAction'] delete?: never options?: never head?: never patch?: never trace?: never } - '/api/v1/billing/invoices/{customerId}/invoices/{invoiceId}/approve': { + '/api/v1/billing/invoices/{invoiceId}/approve': { parameters: { query?: never header?: never @@ -237,14 +260,14 @@ export interface paths { * - `draft`: the invoice will be sent to the customer, the invluce state becomes issued * - `manual_approval_needed`: the invoice will be sent to the customer, the invoice state becomes issued */ - post: operations['billingApproveInvoice'] + post: operations['approveInvoiceAction'] delete?: never options?: never head?: never patch?: never trace?: never } - '/api/v1/billing/invoices/{customerId}/invoices/{invoiceId}/lines/{lineId}': { + '/api/v1/billing/invoices/{invoiceId}/lines/{lineId}': { parameters: { query?: never header?: never @@ -255,24 +278,24 @@ export interface paths { * Get an invoice line * @description Get an invoice line */ - get: operations['billingGetInvoiceLine'] + get: operations['getInvoiceLine'] put?: never /** * Update an invoice line * @description Update an invoice line */ - post: operations['billingUpdateInvoiceLine'] + post: operations['updateInvoiceLine'] /** * Delete an invoice line * @description Delete an invoice line */ - delete: operations['billingDeleteInvoiceLine'] + delete: operations['deleteInvoiceLine'] options?: never head?: never patch?: never trace?: never } - '/api/v1/billing/invoices/{customerId}/invoices/{invoiceId}/retry': { + '/api/v1/billing/invoices/{invoiceId}/retry': { parameters: { query?: never header?: never @@ -287,14 +310,14 @@ export interface paths { * * The action can be called when the invoice's statusDetails' actions field contain the "retry" action. */ - post: operations['billingInvoiceRetry'] + post: operations['retryInvoiceAction'] delete?: never options?: never head?: never patch?: never trace?: never } - '/api/v1/billing/invoices/{customerId}/invoices/{invoiceId}/tax/recalculate': { + '/api/v1/billing/invoices/{invoiceId}/tax/recalculate': { parameters: { query?: never header?: never @@ -309,14 +332,14 @@ export interface paths { * * Note: charges might apply, depending on the tax provider. */ - post: operations['billingRecalculateInvoiceTax'] + post: operations['recalculateInvoiceTaxAction'] delete?: never options?: never head?: never patch?: never trace?: never } - '/api/v1/billing/invoices/{customerId}/invoices/{invoiceId}/void': { + '/api/v1/billing/invoices/{invoiceId}/void': { parameters: { query?: never header?: never @@ -333,37 +356,7 @@ export interface paths { * * Voiding an invoice will mark it as voided, the user can specify how to handle the voided line items. */ - post: operations['billingVoidInvoice'] - delete?: never - options?: never - head?: never - patch?: never - trace?: never - } - '/api/v1/billing/invoices/{customerId}/lines': { - parameters: { - query?: never - header?: never - path?: never - cookie?: never - } - get?: never - put?: never - /** - * Create line items - * @description Create a new pending line item (charge). - * - * This call is used to create a new pending line item for the customer without explicitly - * assigning it to an invoice. - * - * The line item will be either allocated to an existing invoice in gathering state or a new invoice is - * created for the line item. - * - * A new invoice will be created if: - * - there is no invoice in gathering state - * - the currency of the line item doesn't match the currency of any invoices in gathering state - */ - post: operations['billingCreateLineByCustomer'] + post: operations['voidInvoiceAction'] delete?: never options?: never head?: never @@ -381,7 +374,7 @@ export interface paths { * List billing profiles * @description List all billing profiles */ - get: operations['billingListProfiles'] + get: operations['listBillingProfiles'] put?: never /** * Create a new billing profile @@ -390,7 +383,7 @@ export interface paths { * Billing profiles are representations of a customer's billing information. Customer overrides * can be applied to a billing profile to customize the billing behavior for a specific customer. */ - post: operations['billingCreateProfile'] + post: operations['createBillingProfile'] delete?: never options?: never head?: never @@ -405,21 +398,21 @@ export interface paths { cookie?: never } /** - * Get a billing profile by ID + * Get a billing profile * @description Get a billing profile by ID */ - get: operations['billingGetProfile'] + get: operations['getBillingProfile'] /** * Update a billing profile * @description Update a billing profile */ - put: operations['billingUpdateProfile'] + put: operations['updateBillingProfile'] post?: never /** - * Archive a billing profile - * @description Archive a billing profile + * Delete a billing profile + * @description Delete a billing profile */ - delete: operations['billingArchiveProfile'] + delete: operations['deleteBillingProfile'] options?: never head?: never patch?: never @@ -1595,7 +1588,7 @@ export interface paths { path?: never cookie?: never } - /** Get subscription Get subscription */ + /** Get subscription */ get: operations['getSubscription'] put?: never post?: never @@ -1851,27 +1844,172 @@ export interface components { */ readonly balanceAtStart: number } - /** @description CreditNoteOriginalInvoiceRef is used to reference the original invoice that a credit note is based on. */ - BillingCreditNoteOriginalInvoiceRef: { - /** @enum {string} */ - type: 'credit_node_original_invoice' + /** @description InvoiceLineCharge represents an amount added to the line, and will be applied before taxes. */ + BillingLineCharge: { /** - * IssueAt reflects the time the document was issued. + * Creation Time * Format: date-time - * @description [RFC3339](https://tools.ietf.org/html/rfc3339) formatted date-time string in UTC. - * @example 2023-01-01T01:01:01.001Z + * @description Timestamp of when the resource was created. + * @example 2024-01-01T01:01:01.001Z */ - issuedAt?: string - /** (Serial) Number of the referenced document. */ - readonly number?: components['schemas']['BillingInvoiceNumber'] + readonly createdAt: string /** - * Link to the source document. - * Format: uri + * Last Update Time + * Format: date-time + * @description Timestamp of when the resource was last updated. + * @example 2024-01-01T01:01:01.001Z */ - url: string - } & WithRequired + readonly updatedAt: string + /** + * Deletion Time + * Format: date-time + * @description Timestamp of when the resource was permanently deleted. + * @example 2024-01-01T01:01:01.001Z + */ + readonly deletedAt?: string + /** + * @description ID of the charge or discount. + * @example 01G65Z755AFWAKHE12NY0CQ9FH + */ + readonly id: string + /** @description Percentage if fixed amount not applied */ + percent?: components['schemas']['Percentage'] + /** @description Fixed discount amount to apply (calculated if percent present). */ + amount: components['schemas']['Numeric'] + /** @description Reason code. */ + code?: string + /** @description Text description as to why the discount was applied. */ + description?: string + } + /** @description Party represents a person or business entity. */ + BillingParty: { + /** @description Unique identifier for the party (if available) */ + readonly id?: string + /** @description Legal name or representation of the organization. */ + name?: string + /** @description The entity's legal ID code used for tax purposes. They may have + * other numbers, but we're only interested in those valid for tax purposes. */ + taxId?: components['schemas']['BillingPartyTaxIdentity'] + /** @description Regular post addresses for where information should be sent if needed. */ + addresses?: components['schemas']['Address'][] + } + /** @description Identity stores the details required to identify an entity for tax purposes in a specific country. */ + BillingPartyTaxIdentity: { + /** @description Normalized tax code shown on the original identity document. */ + code?: components['schemas']['BillingTaxIdentificationCode'] + } + /** @description BillingProfile represents a billing profile */ + BillingProfile: { + /** + * ID + * @description A unique identifier for the resource. + * @example 01G65Z755AFWAKHE12NY0CQ9FH + */ + readonly id: string + /** + * Display name + * @description Human-readable name for the resource. Between 1 and 256 characters. + */ + name: string + /** + * Description + * @description Optional description of the resource. Maximum 1024 characters. + */ + description?: string + /** + * Metadata + * @description Additional metadata for the resource. + */ + metadata?: components['schemas']['Metadata'] | null + /** + * Creation Time + * Format: date-time + * @description Timestamp of when the resource was created. + * @example 2024-01-01T01:01:01.001Z + */ + readonly createdAt: string + /** + * Last Update Time + * Format: date-time + * @description Timestamp of when the resource was last updated. + * @example 2024-01-01T01:01:01.001Z + */ + readonly updatedAt: string + /** + * Deletion Time + * Format: date-time + * @description Timestamp of when the resource was permanently deleted. + * @example 2024-01-01T01:01:01.001Z + */ + readonly deletedAt?: string + /** @description The name and contact information for the supplier this billing profile represents */ + supplier: components['schemas']['BillingParty'] + /** @description The billing workflow settings for this profile */ + readonly workflow: components['schemas']['BillingWorkflow'] + /** @description The applications used by this billing profile. + * + * Expand settings govern if this includes the whole app object or just the ID references. */ + readonly apps: components['schemas']['BillingProfileAppsOrReference'] + /** @description Is this the default profile? */ + default: boolean + } + /** @description BillingProfileAppReferences represents the references (id, type) to the apps used by a billing profile */ + BillingProfileAppReferences: { + /** @description The tax app used for this workflow */ + readonly tax: components['schemas']['AppReference'] + /** @description The invoicing app used for this workflow */ + readonly invoicing: components['schemas']['AppReference'] + /** @description The payment app used for this workflow */ + readonly payment: components['schemas']['AppReference'] + } + /** @description BillingProfileApps represents the applications used by a billing profile */ + BillingProfileApps: { + readonly tax: Omit + readonly invoicing: Omit + readonly payment: Omit + } + /** @description BillingProfileAppsCreate represents the input for creating a billing profile's apps */ + BillingProfileAppsCreate: { + /** @description The tax app used for this workflow */ + tax: string + /** @description The invoicing app used for this workflow */ + invoicing: string + /** @description The payment app used for this workflow */ + payment: string + } + /** @description ProfileAppsOrReference represents the union of ProfileApps and ProfileAppReferences + * for a billing profile. */ + BillingProfileAppsOrReference: + | components['schemas']['BillingProfileApps'] + | components['schemas']['BillingProfileAppReferences'] + /** @description BillingProfileCreate represents the input for creating a billing profile */ + BillingProfileCreate: { + /** + * Display name + * @description Human-readable name for the resource. Between 1 and 256 characters. + */ + name: string + /** + * Description + * @description Optional description of the resource. Maximum 1024 characters. + */ + description?: string + /** + * Metadata + * @description Additional metadata for the resource. + */ + metadata?: components['schemas']['Metadata'] | null + /** @description The name and contact information for the supplier this billing profile represents */ + supplier: components['schemas']['BillingParty'] + /** @description Is this the default profile? */ + default: boolean + /** @description The billing workflow settings for this profile. */ + workflow: components['schemas']['BillingWorkflowCreate'] + /** @description The apps used by this billing profile. */ + apps: components['schemas']['BillingProfileAppsCreate'] + } /** @description Customer specific workflow overrides. */ - BillingCustomerOverride: { + BillingProfileCustomerOverride: { /** * Creation Time * Format: date-time @@ -1893,7 +2031,18 @@ export interface components { * @example 2024-01-01T01:01:01.001Z */ readonly deletedAt?: string - workflow: components['schemas']['BillingCustomerWorkflowOverride'] + workflow?: components['schemas']['BillingProfileCustomerWorkflowOverride'] + /** + * @description The billing profile this override is associated with. + * + * If not provided, the default billing profile is chosen if available. + * @example 01G65Z755AFWAKHE12NY0CQ9FH + */ + billingProfile?: string + } + /** @description Payload for creating a new or updating an existing customer override. */ + BillingProfileCustomerOverrideCreate: { + workflow?: components['schemas']['BillingProfileCustomerWorkflowOverrideCreate'] /** * @description The billing profile this override is associated with. * @@ -1906,9 +2055,29 @@ export interface components { * @description Order by options for customers. * @enum {string} */ - BillingCustomerOverrideOrderBy: 'id' + BillingProfileCustomerOverrideOrderBy: 'id' + /** @description Paginated response */ + BillingProfileCustomerOverridePaginatedResponse: { + /** + * @description The items in the current page. + * @example 500 + */ + totalCount: number + /** + * @description The items in the current page. + * @example 1 + */ + page: number + /** + * @description The items in the current page. + * @example 100 + */ + pageSize: number + /** @description The items in the current page. */ + items: components['schemas']['BillingProfileCustomerOverride'][] + } /** @description Customer specific workflow overrides. */ - BillingCustomerWorkflowOverride: { + BillingProfileCustomerWorkflowOverride: { /** * Creation Time * Format: date-time @@ -1930,14 +2099,13 @@ export interface components { * @example 2024-01-01T01:01:01.001Z */ readonly deletedAt?: string - /** The collection settings for this workflow */ + /** @description The collection settings for this workflow */ collection?: components['schemas']['BillingWorkflowCollectionSettings'] - /** The invoicing settings for this workflow */ + /** @description The invoicing settings for this workflow */ invoicing?: components['schemas']['BillingWorkflowInvoicingSettings'] - /** The payment settings for this workflow */ + /** @description The payment settings for this workflow */ payment?: components['schemas']['BillingWorkflowPaymentSettings'] /** - * ID * @description A unique identifier for the resource. * @example 01G65Z755AFWAKHE12NY0CQ9FH */ @@ -1946,33 +2114,50 @@ export interface components { readonly invoicingApp: Omit readonly paymentApp: Omit } - /** @description DocumentRef is used to describe a reference to an existing document (invoice). */ - BillingDocumentRef: components['schemas']['BillingCreditNoteOriginalInvoiceRef'] + /** @description Resource create operation model. */ + BillingProfileCustomerWorkflowOverrideCreate: { + /** @description The collection settings for this workflow */ + collection?: components['schemas']['BillingWorkflowCollectionSettings'] + /** @description The invoicing settings for this workflow */ + invoicing?: components['schemas']['BillingWorkflowInvoicingSettings'] + /** @description The payment settings for this workflow */ + payment?: components['schemas']['BillingWorkflowPaymentSettings'] + } + /** + * @description BillingProfileExpand details what profile fields to expand + * @enum {string} + */ + BillingProfileExpand: 'apps' | '*' /** - * @description DocumentRefType defines the type of document that is being referenced. + * @description BillingProfileOrderBy specifies the ordering options for profiles * @enum {string} */ - BillingDocumentRefType: 'credit_node_original_invoice' - /** @description DueDate contains an amount that should be paid by the given date. */ - BillingDueDate: { + BillingProfileOrderBy: 'createdAt' | 'updatedAt' | 'default' | 'name' + /** @description Paginated response */ + BillingProfilePaginatedResponse: { /** - * When the payment is due. - * Format: date-time - * @description [RFC3339](https://tools.ietf.org/html/rfc3339) formatted date-time string in UTC. - * @example 2023-01-01T01:01:01.001Z + * @description The items in the current page. + * @example 500 */ - dueAt: string - /** Other details to take into account for the due date. */ - notes?: string - /** How much needs to be paid by the date. */ - amount: components['schemas']['Numeric'] - /** Percentage of the total that should be paid by the date. */ - percent?: components['schemas']['Percentage'] - /** If different from the parent document's base currency. */ - currency?: components['schemas']['CurrencyCode'] + totalCount: number + /** + * @description The items in the current page. + * @example 1 + */ + page: number + /** + * @description The items in the current page. + * @example 100 + */ + pageSize: number + /** @description The items in the current page. */ + items: components['schemas']['BillingProfile'][] } - /** @description BillingFlatFeeLine represents a line item that is sold to the customer as a manually added fee. */ - BillingFlatFeeLine: { + /** @description BillingProfileReplaceUpdate represents the input for updating a billing profile + * + * The apps field cannot be updated directly, if an app change is desired a new + * profile should be created. */ + BillingProfileReplaceUpdateWithWorkflow: { /** * Display name * @description Human-readable name for the resource. Between 1 and 256 characters. @@ -1988,6 +2173,17 @@ export interface components { * @description Additional metadata for the resource. */ metadata?: components['schemas']['Metadata'] | null + /** @description The name and contact information for the supplier this billing profile represents */ + supplier: components['schemas']['BillingParty'] + /** @description Is this the default profile? */ + default: boolean + /** @description The billing workflow settings for this profile. */ + workflow: components['schemas']['BillingWorkflow'] + } + /** @description TaxIdentificationCode is a normalized tax code shown on the original identity document. */ + BillingTaxIdentificationCode: string + /** @description BillingWorkflow represents a billing workflow */ + BillingWorkflow: { /** * Creation Time * Format: date-time @@ -2009,160 +2205,272 @@ export interface components { * @example 2024-01-01T01:01:01.001Z */ readonly deletedAt?: string + /** @description The collection settings for this workflow */ + collection?: components['schemas']['BillingWorkflowCollectionSettings'] + /** @description The invoicing settings for this workflow */ + invoicing?: components['schemas']['BillingWorkflowInvoicingSettings'] + /** @description The payment settings for this workflow */ + payment?: components['schemas']['BillingWorkflowPaymentSettings'] /** - * @description ULID (Universally Unique Lexicographically Sortable Identifier). + * @description A unique identifier for the resource. * @example 01G65Z755AFWAKHE12NY0CQ9FH */ - id: string - readonly status: components['schemas']['BillingLineStatus'] - /** Discounts applied to this line. */ - readonly discounts?: components['schemas']['BillingLineDiscount'][] - /** Charges applied to this line. */ - readonly charges?: components['schemas']['BillingLineCharge'][] - /** The invoice this item belongs to. */ - invoice?: components['schemas']['BillingInvoiceReference'] - /** The currency of this line */ - currency: components['schemas']['CurrencyCode'] - /** Map of taxes to be applied and used in the invoice totals. */ - readonly taxes?: components['schemas']['BillingTaxItem'][] - /** Tax config specify the tax configuration for this line. */ - taxConfig?: components['schemas']['TaxConfig'] | null - /** The lines detailing the item or service sold. */ - readonly children?: components['schemas']['BillingInvoiceLine'][] | null - /** Totals for this line. */ - readonly totals: components['schemas']['BillingInvoiceTotals'] - /** Period of the line item applies to for revenue recognition pruposes. */ - period: components['schemas']['BillingPeriod'] - /** - * The time this line item should be invoiced. - * Format: date-time - * @description [RFC3339](https://tools.ietf.org/html/rfc3339) formatted date-time string in UTC. - * @example 2023-01-01T01:01:01.001Z - */ - invoiceAt: string + readonly id: string + } + /** @description The alignment for collecting the pending line items into an invoice. + * + * Defaults to subscription, which means that we are to create a new invoice every time the + * a subscription period starts (for in advance items) or ends (for in arrears items). */ + BillingWorkflowCollectionAlignment: components['schemas']['BillingWorkflowCollectionAlignmentSubscription'] + /** @description BillingWorkflowCollectionAlignmentSubscription specifies the alignment for collecting the pending line items + * into an invoice. */ + BillingWorkflowCollectionAlignmentSubscription: { /** @enum {string} */ - type: 'flat_fee' - /** Price of the item being sold. */ - perUnitAmount: components['schemas']['Numeric'] - /** - * Payment term of the line. - * @default in_advance - */ - paymentTerm: components['schemas']['PricePaymentTerm'] - /** Quantity of the item being sold. */ - quantity: components['schemas']['Numeric'] + type: 'subscription' } - /** @description BillingFlatFeeLine represents a line item that is sold to the customer as a manually added fee. */ - BillingFlatFeeLineCreate: { + /** @description Workflow collection specifies how to collect the pending line items for an invoice */ + BillingWorkflowCollectionSettings: { + /** @default { + * "type": "subscription" + * } */ + alignment: components['schemas']['BillingWorkflowCollectionAlignment'] /** - * Display name - * @description Human-readable name for the resource. Between 1 and 256 characters. + * Format: ISO8601 + * @description This grace period can be used to delay the collection of the pending line items specified in + * alignment. + * + * This is useful, in case of multiple subscriptions having slightly different billing periods. + * @default PT1H + * @example P1D */ - name: string + interval: string + } + /** @description Resource create operation model. */ + BillingWorkflowCreate: { + /** @description The collection settings for this workflow */ + collection?: components['schemas']['BillingWorkflowCollectionSettings'] + /** @description The invoicing settings for this workflow */ + invoicing?: components['schemas']['BillingWorkflowInvoicingSettings'] + /** @description The payment settings for this workflow */ + payment?: components['schemas']['BillingWorkflowPaymentSettings'] + } + /** + * Workflow invoice settings + * @description BillingWorkflowInvoicingSettings represents the invoice settings for a billing workflow + */ + BillingWorkflowInvoicingSettings: { /** - * Description - * @description Optional description of the resource. Maximum 1024 characters. + * @description Whether to automatically issue the invoice after the draftPeriod has passed. + * @default true */ - description?: string + autoAdvance: boolean /** - * Metadata - * @description Additional metadata for the resource. + * Format: ISO8601 + * @description The period for the invoice to be kept in draft status for manual reviews. + * @default P1D + * @example P1D */ - metadata?: components['schemas']['Metadata'] | null - /** The invoice this item belongs to. */ - invoice?: components['schemas']['BillingInvoiceReference'] - /** The currency of this line */ - currency: components['schemas']['CurrencyCode'] - /** Tax config specify the tax configuration for this line. */ - taxConfig?: components['schemas']['TaxConfig'] | null - /** Period of the line item applies to for revenue recognition pruposes. */ - period: components['schemas']['BillingPeriod'] + draftPeriod: string /** - * The time this line item should be invoiced. - * Format: date-time - * @description [RFC3339](https://tools.ietf.org/html/rfc3339) formatted date-time string in UTC. - * @example 2023-01-01T01:01:01.001Z + * Format: ISO8601 + * @description The period after which the invoice is due. + * @default P7D + * @example P1D */ - invoiceAt: string - /** @enum {string} */ - type: 'flat_fee' - /** Price of the item being sold. */ - perUnitAmount: components['schemas']['Numeric'] + dueAfter: string + } + /** + * Workflow payment settings + * @description BillingWorkflowPaymentSettings represents the payment settings for a billing workflow + */ + BillingWorkflowPaymentSettings: { /** - * Payment term of the line. - * @default in_advance + * @description The payment method for the invoice. + * @default charge_automatically */ - paymentTerm: components['schemas']['PricePaymentTerm'] - /** Quantity of the item being sold. */ - quantity: components['schemas']['Numeric'] + collectionMethod: components['schemas']['CollectionMethod'] + } + /** @description BillingWorkflowSettings represents the settings for a billing workflow. */ + BillingWorkflowSettings: { + /** @description The collection settings for this workflow */ + collection?: components['schemas']['BillingWorkflowCollectionSettings'] + /** @description The invoicing settings for this workflow */ + invoicing?: components['schemas']['BillingWorkflowInvoicingSettings'] + /** @description The payment settings for this workflow */ + payment?: components['schemas']['BillingWorkflowPaymentSettings'] + } + /** @description Stripe CheckoutSession.custom_text */ + CheckoutSessionCustomTextAfterSubmitParams: { + afterSubmit?: { + message?: string + } + shippingAddress?: { + message?: string + } + submit?: { + message?: string + } + termsOfServiceAcceptance?: { + message?: string + } + } + /** + * @description Stripe CheckoutSession.ui_mode + * @enum {string} + */ + CheckoutSessionUIMode: 'embedded' | 'hosted' + /** @description Response from the client app (OpenMeter backend) to start the OAuth2 flow. */ + ClientAppStartResponse: { + /** @description The URL to start the OAuth2 authorization code grant flow. */ + url: string } - /** @description BillingFlatFeeLine represents a line item that is sold to the customer as a manually added fee. */ - BillingFlatFeeLineCreateItem: { + /** + * Collection method + * @description CollectionMethod specifies how the invoice should be collected (automatic vs manual) + * @enum {string} + */ + CollectionMethod: 'charge_automatically' | 'send_invoice' + /** @description The request could not be completed due to a conflict with the current state of the target resource. */ + ConflictProblemResponse: components['schemas']['UnexpectedProblemResponse'] + /** + * @description [ISO 3166-1](https://www.iso.org/iso-3166-country-codes.html) alpha-2 country code. + * Custom two-letter country codes are also supported for convenience. + * @example US + */ + CountryCode: string + /** @description Create Stripe checkout session request. */ + CreateStripeCheckoutSessionRequest: { /** - * Display name - * @description Human-readable name for the resource. Between 1 and 256 characters. + * @description If not provided, the default Stripe app is used if any. + * @example 01G65Z755AFWAKHE12NY0CQ9FH */ - name: string + appId?: string + /** @description Provide a customer ID to use an existing OpenMeter customer. + * or provide a customer object to create a new customer. */ + customer: + | components['schemas']['CustomerId'] + | components['schemas']['CustomerCreate'] + /** @description Stripe customer ID. + * If not provided OpenMeter creates a new Stripe customer or + * uses the OpenMeter customer's default Stripe customer ID. */ + stripeCustomerId?: string + /** @description Options passed to Stripe when creating the checkout session. */ + options: components['schemas']['CreateStripeCheckoutSessionRequestOptions'] + } + /** @description Create Stripe checkout session options */ + CreateStripeCheckoutSessionRequestOptions: { + currency?: components['schemas']['CurrencyCode'] + cancelURL?: string + clientReferenceID?: string + customText?: components['schemas']['CheckoutSessionCustomTextAfterSubmitParams'] + metadata?: { + [key: string]: string + } + returnURL?: string + successURL?: string + uiMode?: components['schemas']['CheckoutSessionUIMode'] + paymentMethodTypes?: string[] + } + /** @description Create Stripe Checkout Session response. */ + CreateStripeCheckoutSessionResult: { /** - * Description - * @description Optional description of the resource. Maximum 1024 characters. + * @description The OpenMeter customer ID. + * @example 01G65Z755AFWAKHE12NY0CQ9FH */ - description?: string + customerId: string + /** @description The Stripe customer ID. */ + stripeCustomerId: string + /** @description The checkout session ID. */ + sessionId: string + /** @description The checkout session setup intent ID. */ + setupIntentId: string + /** @description URL to show the checkout session. */ + url: string + /** @description Mode + * Always `setup` for now. */ + mode: components['schemas']['StripeCheckoutSessionMode'] + /** @description Cancel URL. */ + cancelURL?: string + /** @description Success URL. */ + successURL?: string + /** @description Return URL. */ + returnURL?: string + } + /** @description CreditNoteOriginalInvoiceRef is used to reference the original invoice that a credit note is based on. */ + CreditNoteOriginalInvoiceRef: { + /** @enum {string} */ + type: 'credit_node_original_invoice' /** - * Metadata - * @description Additional metadata for the resource. + * Format: date-time + * @description IssueAt reflects the time the document was issued. + * @example 2023-01-01T01:01:01.001Z */ - metadata?: components['schemas']['Metadata'] | null - /** The invoice this item belongs to. */ - invoice?: components['schemas']['BillingInvoiceReference'] - /** The currency of this line */ - currency: components['schemas']['CurrencyCode'] - /** Tax config specify the tax configuration for this line. */ - taxConfig?: components['schemas']['TaxConfig'] | null - /** Period of the line item applies to for revenue recognition pruposes. */ - period: components['schemas']['BillingPeriod'] + readonly issuedAt?: string + /** @description (Serial) Number of the referenced document. */ + readonly number?: components['schemas']['InvoiceNumber'] + /** + * Format: uri + * @description Link to the source document. + */ + readonly url: string + } & WithRequired + /** + * @description Three-letter [ISO4217](https://www.iso.org/iso-4217-currency-codes.html) currency code. + * Custom three-letter currency codes are also supported for convenience. + * @example USD + */ + CurrencyCode: string + /** @description Change a custom subscription. */ + CustomSubscriptionChange: { /** - * The time this line item should be invoiced. * Format: date-time * @description [RFC3339](https://tools.ietf.org/html/rfc3339) formatted date-time string in UTC. * @example 2023-01-01T01:01:01.001Z */ - invoiceAt: string - /** @enum {string} */ - type: 'flat_fee' - /** Price of the item being sold. */ - perUnitAmount: components['schemas']['Numeric'] + activeFrom: string + customPlan: components['schemas']['PlanCreate'] + } + /** @description Create a custom subscription. */ + CustomSubscriptionCreate: { /** - * Payment term of the line. - * @default in_advance + * Format: date-time + * @description [RFC3339](https://tools.ietf.org/html/rfc3339) formatted date-time string in UTC. + * @example 2023-01-01T01:01:01.001Z */ - paymentTerm: components['schemas']['PricePaymentTerm'] - /** Quantity of the item being sold. */ - quantity: components['schemas']['Numeric'] + activeFrom: string + customPlan: components['schemas']['PlanCreate'] + /** + * @description ULID (Universally Unique Lexicographically Sortable Identifier). + * @example 01G65Z755AFWAKHE12NY0CQ9FH + */ + customerId: string } /** - * DocumentRef is used to describe an existing document or a specific part of it's contents. - * @description Omitted fields: - * period: Tax period in which the referred document had an effect required by some tax regimes and formats. - * stamps: Seals of approval from other organisations that may need to be listed. - * ext: Extensions for additional codes that may be required. + * @description A customer object. + * @example { + * "id": "01G65Z755AFWAKHE12NY0CQ9FH", + * "name": "ACME Inc.", + * "usageAttribution": { + * "subjectKeys": [ + * "my_subject_key" + * ] + * }, + * "createdAt": "2024-01-01T01:01:01.001Z", + * "updatedAt": "2024-01-01T01:01:01.001Z" + * } */ - BillingGenericDocumentRef: { - /** Type of the document referenced. */ - readonly type: components['schemas']['BillingDocumentRefType'] - /** Human readable description on why this reference is here or needs to be used. */ - reason?: string - /** Additional details about the document. */ - description?: string - } - /** @description Invoice represents an invoice in the system. */ - BillingInvoice: { + Customer: { /** * ID * @description A unique identifier for the resource. * @example 01G65Z755AFWAKHE12NY0CQ9FH */ readonly id: string + /** + * Display name + * @description Human-readable name for the resource. Between 1 and 256 characters. + */ + name: string /** * Description * @description Optional description of the resource. Maximum 1024 characters. @@ -2181,681 +2489,159 @@ export interface components { */ readonly createdAt: string /** - * Deletion Time + * Last Update Time * Format: date-time - * @description Timestamp of when the resource was permanently deleted. + * @description Timestamp of when the resource was last updated. * @example 2024-01-01T01:01:01.001Z */ - readonly deletedAt?: string + readonly updatedAt: string /** - * Last Update Time + * Deletion Time * Format: date-time - * @description Timestamp of when the resource was last updated. - * - * For updates the updatedAt field is used to detect conflicts. + * @description Timestamp of when the resource was permanently deleted. * @example 2024-01-01T01:01:01.001Z */ - updatedAt: string - readonly type: components['schemas']['BillingInvoiceType'] - /** The taxable entity supplying the goods or services. */ - supplier: components['schemas']['BillingParty'] - /** Legal entity receiving the goods or services. */ - customer: components['schemas']['BillingParty'] + readonly deletedAt?: string /** - * (Serial) Number of the invoice - * @description Number specifies the human readable key used to reference this Invoice. - * - * The number only gets populated after the invoice had been issued. - * - * Please note that the number is (depending on the upstream settings) either unique for the - * whole organization or unique for the customer, or in multi (stripe) account setups unique for the - * account. - */ - readonly number?: components['schemas']['BillingInvoiceNumber'] - /** Currency for all invoice totals. */ - readonly currency: components['schemas']['CurrencyCode'] - /** Key information regarding previous invoices and potentially details as to why they were corrected. */ - readonly preceding?: components['schemas']['BillingDocumentRef'][] - /** Summary of all the invoice totals, including taxes (calculated). */ - readonly totals: components['schemas']['BillingInvoiceTotals'] - /** The status of the invoice. */ - readonly status: components['schemas']['BillingInvoiceStatus'] - /** The details of the current invoice status */ - readonly statusDetails: components['schemas']['BillingInvoiceStatusDetails'] - /** - * The time the invoice was issued. - * Format: date-time - * @description The time the invoice was issued. - * - * Depending on the status of the invoice this can mean multiple things: - * - draft, gathering: The time the invoice will be issued based on the workflow settings. - * - issued: The time the invoice was issued. - * @example 2023-01-01T01:01:01.001Z + * Timezone + * @description Timezone of the customer. */ - readonly issuedAt?: string + timezone?: string /** - * The time until the invoice is in draft status. - * Format: date-time - * @description The time until the invoice is in draft status. - * - * On draft invoice creation it is calculated from the workflow settings. - * - * If manual approval is required, the draftUntil time is set. - * @example 2023-01-01T01:01:01.001Z - */ - draftUntil?: string - /** - * Due time of the fulfillment of the invoice. - * Format: date-time - * @description [RFC3339](https://tools.ietf.org/html/rfc3339) formatted date-time string in UTC. - * @example 2023-01-01T01:01:01.001Z + * Usage Attribution + * @description Mapping to attribute metered usage to the customer */ - readonly dueAt?: string - /** The period the invoice covers. If the invoice has no line items, it's not set. */ - period?: components['schemas']['BillingPeriod'] + usageAttribution: components['schemas']['CustomerUsageAttribution'] /** - * The time the invoice was voided. - * Format: date-time - * @description The time the invoice was voided. - * - * If the invoice was voided, this field will be set to the time the invoice was voided. - * @example 2023-01-01T01:01:01.001Z + * Primary Email + * @description The primary email address of the customer. */ - readonly voidedAt?: string - /** - * The workflow settings associated with this invoice - * @description The workflow associated with the invoice. - * - * It is always a snapshot of the workflow settings at the time of invoice creation. The - * field is optional as it should be explicitly requested with expand options. - */ - workflow?: components['schemas']['BillingInvoiceWorkflowSettings'] - /** List of invoice lines representing each of the items sold to the customer. */ - readonly lines?: components['schemas']['BillingInvoiceLine'][] - /** Discounts or allowances applied to the complete invoice. */ - readonly discounts?: components['schemas']['BillingInvoiceDiscount'][] - /** Information on when, how, and to whom the invoice should be paid. */ - readonly payment?: components['schemas']['BillingInvoicePayment'] - /** Validation issues reported by the invoice workflow. */ - readonly validationIssues?: components['schemas']['BillingValidationIssue'][] - } - /** - * @description BillingInvoiceAction represents the actions that can be performed on an invoice. - * @enum {string} - */ - BillingInvoiceAction: 'advance' | 'approve' | 'delete' | 'retry' | 'void' - /** @description BillingInvoiceCreate is the input for creating an invoice. - * - * Invoice creation is always based on already pending line items created by the billingCreateLineByCustomer - * operation. Empty invoices are not allowed. */ - BillingInvoiceCreate: { - /** @description The pending line items to include in the invoice, if not provided: - * - all line items that have invoice_at < asOf will be included - * - all usage based line items will be included up to asOf, new usage-based line items will be staged for the rest - * of the billing cycle */ - includePendingLines?: string[] + primaryEmail?: string /** - * Format: date-time - * @description The time as of which the invoice is created. - * - * If not provided, the current time is used. - * @example 2023-01-01T01:01:01.001Z + * Currency + * @description Currency of the customer. + * Used for billing, tax and invoicing. */ - asOf?: string - } - /** @description Discount represents an allowance applied to the complete document independent from the individual lines. */ - BillingInvoiceDiscount: { - /** Base represents the value used as a base for percent calculations instead of the invoice's sum of lines. */ - base?: components['schemas']['Numeric'] - /** Percentage to apply to the base or invoice's sum. */ - percent?: components['schemas']['Percentage'] - /** Amount to apply (calculated if percent present). */ - amount: components['schemas']['Numeric'] - /** Text description as to why the discount was applied */ - reason?: string - } - /** - * @description InvoiceExpand specifies the parts of the invoice to expand in the list output. - * @enum {string} - */ - BillingInvoiceExpand: - | '*' - | 'lines' - | 'preceding' - | 'workflow' - | 'workflow.apps' - /** - * @description InvoiceExtendedStatus describes the extended status of an invoice. - * - * This is used to provide more detailed information about the status of the invoice. Useful for - * troubelshooting invoice workflow issues. - * @enum {string} - */ - BillingInvoiceExtendedStatus: - | 'gathering' - | 'draft' - | 'issuing' - | 'issued' - | 'draft_created' - | 'draft_manual_approval_needed' - | 'draft_validating' - | 'draft_invalid' - | 'draft_syncing' - | 'draft_sync_failed' - | 'draft_waiting_auto_approval' - | 'draft_ready_to_issue' - | 'issuing_syncing' - | 'issuing_sync_failed' - /** @description BillingInvoiceLine represents a line item that is sold to the customer based on a specific (unit) price. */ - BillingInvoiceLine: - | components['schemas']['BillingUsageBasedLine'] - | components['schemas']['BillingFlatFeeLine'] - /** @description BillingInvoiceLine represents a line item that is sold to the customer based on a specific (unit) price. */ - BillingInvoiceLineCreate: - | components['schemas']['BillingUsageBasedLineCreate'] - | components['schemas']['BillingFlatFeeLineCreate'] - /** @description BillingInvoiceLine represents a line item that is sold to the customer based on a specific (unit) price. */ - BillingInvoiceLineCreateItem: - | components['schemas']['BillingUsageBasedLineCreateItem'] - | components['schemas']['BillingFlatFeeLineCreateItem'] - /** @description CreateLinesRequest is the request for creating manual line items. */ - BillingInvoiceLines: { - /** The line to create */ - lines: components['schemas']['BillingInvoiceLine'][] - } - /** - * @description InvoiceNumber is a unique identifier for the invoice, generated by the - * invoicing app. - * - * The uniqueness depends on a lot of factors: - * - app setting (unique per app or unique per customer) - * - multiple app scenarios (multiple apps generating invoices with the same prefix) - * @example INV-2024-01-01-01 - */ - BillingInvoiceNumber: string - /** - * @description InvoiceOrderBy specifies the ordering options for invoice listing. - * @enum {string} - */ - BillingInvoiceOrderBy: - | 'customer.name' - | 'issuedAt' - | 'status' - | 'createdAt' - | 'updatedAt' - /** @description Payment contains details as to how the invoice should be paid. */ - BillingInvoicePayment: { - terms?: components['schemas']['BillingPaymentTerms'] - } - /** @description Reference to an invoice. */ - BillingInvoiceReference: { + currency?: components['schemas']['CurrencyCode'] /** - * The ID of the invoice. - * @description ULID (Universally Unique Lexicographically Sortable Identifier). - * @example 01G65Z755AFWAKHE12NY0CQ9FH + * Billing Address + * @description The billing address of the customer. + * Used for tax and invoicing. */ - id: string - /** The number of the invoice. */ - readonly number?: components['schemas']['BillingInvoiceNumber'] - } - /** - * @description InvoiceStatus describes the status of an invoice. - * @enum {string} - */ - BillingInvoiceStatus: 'gathering' | 'draft' | 'issuing' | 'issued' - /** @description InvoiceStatusDetails represents the details of the invoice status. - * - * API users are encouraged to rely on the immutable/failed/avaliableActions fields to determine - * the next steps of the invoice instead of the extendedStatus field. */ - BillingInvoiceStatusDetails: { - /** Is the invoice editable? */ - immutable: boolean - /** Is the invoice in a failed state? */ - failed: boolean - /** Extended status information for the invoice. */ - extendedStatus: components['schemas']['BillingInvoiceExtendedStatus'] - /** The actions that can be performed on the invoice. */ - availableActions: components['schemas']['BillingInvoiceAction'][] - } - /** @description Totals contains the summaries of all calculations for the invoice. */ - BillingInvoiceTotals: { - /** The total value of the line before taxes, discounts and commitments. */ - amount: components['schemas']['Numeric'] - /** The amount of value of the line that are due to additional charges. */ - chargesTotal: components['schemas']['Numeric'] - /** The amount of value of the line that are due to discounts. */ - discountsTotal: components['schemas']['Numeric'] - /** The total amount of taxes that are included in the line. */ - taxesInclusiveTotal: components['schemas']['Numeric'] - /** The total amount of taxes that are added on top of amount from the line. */ - taxesExclusiveTotal: components['schemas']['Numeric'] - /** The total amount of taxes for this line. */ - taxesTotal: components['schemas']['Numeric'] - /** The total amount value of the line after taxes, discounts and commitments. */ - total: components['schemas']['Numeric'] - } - /** - * @description InvoiceType represents the type of invoice. - * - * The type of invoice determines the purpose of the invoice and how it should be handled. - * @enum {string} - */ - BillingInvoiceType: 'standard' | 'credit_note' - /** @description InvoiceWorkflowSettings represents the workflow settings used by the invoice. - * - * This is a clone of the billing profile's workflow settings at the time of invoice creation - * with customer overrides considered. */ - BillingInvoiceWorkflowSettings: { - /** The apps that will be used to orchestrate the invoice's workflow. */ - apps?: components['schemas']['BillingProfileAppsOrReference'] + billingAddress?: components['schemas']['Address'] /** - * The billing profile on which the workflow was based on. - * @description sourceBillingProfileID is the billing profile on which the workflow was based on. - * - * The profile is snapshotted on invoice creation, after which it can be altered independently - * of the profile itself. + * Current Subscription ID + * @description The ID of the Subscription if the customer has one. * @example 01G65Z755AFWAKHE12NY0CQ9FH */ - sourceBillingProfileID: string - /** The workflow details used by this invoice. */ - workflow: components['schemas']['BillingWorkflowSettings'] - /** Timezone of the invoice's date fields. */ - readonly timezone: string + readonly currentSubscriptionId?: string } - /** @description LineCharge represents an amount added to the line, and will be applied before taxes. */ - BillingLineCharge: { - /** - * Creation Time - * Format: date-time - * @description Timestamp of when the resource was created. - * @example 2024-01-01T01:01:01.001Z - */ - readonly createdAt: string + /** @description CustomerAppData + * Stores the app specific data for the customer. + * One of: stripe, sandbox */ + CustomerAppData: + | components['schemas']['StripeCustomerAppData'] + | components['schemas']['SandboxCustomerAppData'] + /** @description Paginated response */ + CustomerAppDataPaginatedResponse: { /** - * Last Update Time - * Format: date-time - * @description Timestamp of when the resource was last updated. - * @example 2024-01-01T01:01:01.001Z + * @description The items in the current page. + * @example 500 */ - readonly updatedAt: string + totalCount: number /** - * Deletion Time - * Format: date-time - * @description Timestamp of when the resource was permanently deleted. - * @example 2024-01-01T01:01:01.001Z + * @description The items in the current page. + * @example 1 */ - readonly deletedAt?: string + page: number /** - * ID of the entity - * @description ULID (Universally Unique Lexicographically Sortable Identifier). - * @example 01G65Z755AFWAKHE12NY0CQ9FH + * @description The items in the current page. + * @example 100 */ - readonly id: string + pageSize: number + /** @description The items in the current page. */ + items: components['schemas']['CustomerAppData'][] + } + /** @description Resource create operation model. */ + CustomerCreate: { /** - * Percent - * @description Percentage if fixed amount not applied + * Display name + * @description Human-readable name for the resource. Between 1 and 256 characters. */ - percent?: components['schemas']['Percentage'] + name: string /** - * Amount - * @description Fixed discount amount to apply (calculated if percent present). + * Description + * @description Optional description of the resource. Maximum 1024 characters. */ - amount: components['schemas']['Numeric'] - /** Reason code. */ - code?: string - /** Text description as to why the discount was applied. */ description?: string - } - /** @description LineDiscount represents an amount deducted from the line, and will be applied before taxes. */ - BillingLineDiscount: { /** - * Creation Time - * Format: date-time - * @description Timestamp of when the resource was created. - * @example 2024-01-01T01:01:01.001Z + * Metadata + * @description Additional metadata for the resource. */ - readonly createdAt: string + metadata?: components['schemas']['Metadata'] | null /** - * Last Update Time - * Format: date-time - * @description Timestamp of when the resource was last updated. - * @example 2024-01-01T01:01:01.001Z + * Timezone + * @description Timezone of the customer. */ - readonly updatedAt: string + timezone?: string /** - * Deletion Time - * Format: date-time - * @description Timestamp of when the resource was permanently deleted. - * @example 2024-01-01T01:01:01.001Z + * Usage Attribution + * @description Mapping to attribute metered usage to the customer */ - readonly deletedAt?: string + usageAttribution: components['schemas']['CustomerUsageAttribution'] /** - * ID of the entity - * @description ULID (Universally Unique Lexicographically Sortable Identifier). - * @example 01G65Z755AFWAKHE12NY0CQ9FH + * Primary Email + * @description The primary email address of the customer. */ - readonly id: string + primaryEmail?: string /** - * Percent - * @description Percentage if fixed amount not applied + * Currency + * @description Currency of the customer. + * Used for billing, tax and invoicing. */ - percent?: components['schemas']['Percentage'] + currency?: components['schemas']['CurrencyCode'] /** - * Amount - * @description Fixed discount amount to apply (calculated if percent present). + * Billing Address + * @description The billing address of the customer. + * Used for tax and invoicing. */ - amount: components['schemas']['Numeric'] - /** Reason code. */ - code?: string - /** Text description as to why the discount was applied. */ - description?: string + billingAddress?: components['schemas']['Address'] } - /** - * @description Line status specifies the status of the line. - * @enum {string} - */ - BillingLineStatus: 'valid' | 'deleted' | 'split' - /** @description Party represents a person or business entity. */ - BillingParty: { + /** @description Create Stripe checkout session customer ID. */ + CustomerId: { /** - * ID of the party. * @description ULID (Universally Unique Lexicographically Sortable Identifier). * @example 01G65Z755AFWAKHE12NY0CQ9FH */ - id?: string - /** Legal name or representation of the organization. */ - name?: string - /** The entity's legal ID code used for tax purposes. They may have other numbers, but we're only interested in those valid for tax purposes. */ - taxId?: components['schemas']['BillingTaxIdentity'] - /** Regular post addresses for where information should be sent if needed. */ - addresses?: components['schemas']['Address'][] - } - /** @description Party represents a person or business entity. */ - BillingPartyCreate: { - /** Legal name or representation of the organization. */ - name?: string - /** The entity's legal ID code used for tax purposes. They may have other numbers, but we're only interested in those valid for tax purposes. */ - taxId?: components['schemas']['BillingTaxIdentity'] - /** Regular post addresses for where information should be sent if needed. */ - addresses?: components['schemas']['Address'][] + id: string } - /** @description PaymentTermDueDate defines the terms for payment on a specific date. */ - BillingPaymentTermDueDate: { + /** + * @description Order by options for customers. + * @enum {string} + */ + CustomerOrderBy: 'id' | 'name' | 'createdAt' + /** @description Paginated response */ + CustomerPaginatedResponse: { /** - * Type of terms to be applied. - * @enum {string} + * @description The items in the current page. + * @example 500 */ - type: 'due_date' - /** Text detail of the chosen payment terms. */ - detail?: string - /** Description of the conditions for payment. */ - notes?: string - /** When the payment is due. */ - dueAt: components['schemas']['BillingDueDate'][] - } - /** @description PaymentTermInstant defines the terms for payment on receipt of invoice. */ - BillingPaymentTermInstant: { + totalCount: number /** - * Type of terms to be applied. - * @enum {string} + * @description The items in the current page. + * @example 1 */ - type: 'instant' - /** Text detail of the chosen payment terms. */ - detail?: string - /** Description of the conditions for payment. */ - notes?: string - } - /** @description PaymentTerms defines the terms for payment. */ - BillingPaymentTerms: - | components['schemas']['BillingPaymentTermInstant'] - | components['schemas']['BillingPaymentTermDueDate'] - /** @description Period represents a time range. - * - * Billing always treats periods as start being inclusive and end being exclusive. */ - BillingPeriod: { + page: number /** - * Start of the period. - * Format: date-time - * @description [RFC3339](https://tools.ietf.org/html/rfc3339) formatted date-time string in UTC. - * @example 2023-01-01T01:01:01.001Z - */ - start: string - /** - * End of the period. - * Format: date-time - * @description [RFC3339](https://tools.ietf.org/html/rfc3339) formatted date-time string in UTC. - * @example 2023-01-01T01:01:01.001Z - */ - end: string - } - /** @description Profile represents a billing profile */ - BillingProfile: { - /** - * ID - * @description A unique identifier for the resource. - * @example 01G65Z755AFWAKHE12NY0CQ9FH - */ - readonly id: string - /** - * Display name - * @description Human-readable name for the resource. Between 1 and 256 characters. - */ - name: string - /** - * Description - * @description Optional description of the resource. Maximum 1024 characters. - */ - description?: string - /** - * Metadata - * @description Additional metadata for the resource. - */ - metadata?: components['schemas']['Metadata'] | null - /** - * Creation Time - * Format: date-time - * @description Timestamp of when the resource was created. - * @example 2024-01-01T01:01:01.001Z - */ - readonly createdAt: string - /** - * Deletion Time - * Format: date-time - * @description Timestamp of when the resource was permanently deleted. - * @example 2024-01-01T01:01:01.001Z - */ - readonly deletedAt?: string - /** - * Last update time of the resource - * Format: date-time - * @description When the resource was last updated. - * - * For updates this field must be set to the last update time to detect conflicts. - * @example 2023-01-01T01:01:01.001Z - */ - updatedAt: string - /** The name and contact information for the supplier this billing profile represents */ - supplier: components['schemas']['BillingParty'] - /** The billing workflow settings for this profile */ - workflow: components['schemas']['BillingWorkflow'] - /** The applications used by this billing profile */ - readonly apps: components['schemas']['BillingProfileAppsOrReference'] - /** Is this the default profile? */ - default: boolean - } - /** @description ProfileAppsReference represents the references (id, type) to the apps used by a billing profile */ - BillingProfileAppReferences: { - /** The tax app used for this workflow */ - tax: components['schemas']['AppReference'] - /** The invoicing app used for this workflow */ - invoicing: components['schemas']['AppReference'] - /** The payment app used for this workflow */ - payment: components['schemas']['AppReference'] - } - /** @description ProfileApps represents the applications used by a billing profile */ - BillingProfileApps: { - tax: components['schemas']['App'] - invoicing: components['schemas']['App'] - payment: components['schemas']['App'] - } - /** @description ProfileAppsOrReference represents the union of ProfileApps and ProfileAppReferences - * for a billing profile. */ - BillingProfileAppsOrReference: - | components['schemas']['BillingProfileApps'] - | components['schemas']['BillingProfileAppReferences'] - /** @description ProfileCreateAppsInput represents the input for creating a billing profile's apps */ - BillingProfileCreateAppsInput: { - /** The tax app used for this workflow */ - tax: components['schemas']['BillingWorkflowAppIdOrType'] - /** The invoicing app used for this workflow */ - invoicing: components['schemas']['BillingWorkflowAppIdOrType'] - /** The payment app used for this workflow */ - payment: components['schemas']['BillingWorkflowAppIdOrType'] - } - /** @description ProfileCreateInput represents the input for creating a billing profile */ - BillingProfileCreateInput: { - /** - * Display name - * @description Human-readable name for the resource. Between 1 and 256 characters. - */ - name: string - /** - * Description - * @description Optional description of the resource. Maximum 1024 characters. - */ - description?: string - /** - * Metadata - * @description Additional metadata for the resource. - */ - metadata?: components['schemas']['Metadata'] | null - /** The name and contact information for the supplier this billing profile represents */ - supplier: components['schemas']['BillingPartyCreate'] - /** The billing workflow settings for this profile */ - workflow: components['schemas']['BillingWorkflow'] - /** Is this the default profile? */ - default: boolean - apps: components['schemas']['BillingProfileCreateAppsInput'] - } - /** - * @description ProfileExpand details what profile fields to expand - * @enum {string} - */ - BillingProfileExpand: 'apps' | '*' - /** - * @description ProfileOrderBy specifies the ordering options for profiles - * @enum {string} - */ - BillingProfileOrderBy: 'createdAt' | 'updatedAt' | 'default' | 'name' - /** - * @description TaxBehavior details how the tax item is applied to the base amount. - * - * Inclusive means the tax is included in the base amount. - * Exclusive means the tax is added to the base amount. - * @enum {string} - */ - BillingTaxBehavior: 'inclusive' | 'exclusive' - BillingTaxIdentificationCode: string - /** @description Identity stores the details required to identify an entity for tax purposes in a specific country. */ - BillingTaxIdentity: { - /** Normalized tax code shown on the original identity document. */ - code?: components['schemas']['BillingTaxIdentificationCode'] - } - /** @description TaxConfig stores the configuration for a tax line relative to an invoice line. */ - BillingTaxItem: { - /** Tax provider configuration. */ - config?: components['schemas']['TaxConfig'] - /** Percent defines the percentage set manually or determined from the rate - * key (calculated if rate present). A nil percent implies that this tax combo - * is **exempt** from tax. */ - percent?: components['schemas']['Percentage'] - /** Some countries require an additional surcharge (calculated if rate present). */ - surcharge?: components['schemas']['Numeric'] - /** Is the tax item inclusive or exclusive of the base amount. */ - behavior?: components['schemas']['BillingTaxBehavior'] - } - /** @description UsageBasedLine represents a line item that is sold to the customer based on usage. */ - BillingUsageBasedLine: { - /** - * Display name - * @description Human-readable name for the resource. Between 1 and 256 characters. - */ - name: string - /** - * Description - * @description Optional description of the resource. Maximum 1024 characters. - */ - description?: string - /** - * Metadata - * @description Additional metadata for the resource. - */ - metadata?: components['schemas']['Metadata'] | null - /** - * Creation Time - * Format: date-time - * @description Timestamp of when the resource was created. - * @example 2024-01-01T01:01:01.001Z - */ - readonly createdAt: string - /** - * Last Update Time - * Format: date-time - * @description Timestamp of when the resource was last updated. - * @example 2024-01-01T01:01:01.001Z - */ - readonly updatedAt: string - /** - * Deletion Time - * Format: date-time - * @description Timestamp of when the resource was permanently deleted. - * @example 2024-01-01T01:01:01.001Z - */ - readonly deletedAt?: string - /** - * @description ULID (Universally Unique Lexicographically Sortable Identifier). - * @example 01G65Z755AFWAKHE12NY0CQ9FH - */ - id: string - readonly status: components['schemas']['BillingLineStatus'] - /** Discounts applied to this line. */ - readonly discounts?: components['schemas']['BillingLineDiscount'][] - /** Charges applied to this line. */ - readonly charges?: components['schemas']['BillingLineCharge'][] - /** The invoice this item belongs to. */ - invoice?: components['schemas']['BillingInvoiceReference'] - /** The currency of this line */ - currency: components['schemas']['CurrencyCode'] - /** Map of taxes to be applied and used in the invoice totals. */ - readonly taxes?: components['schemas']['BillingTaxItem'][] - /** Tax config specify the tax configuration for this line. */ - taxConfig?: components['schemas']['TaxConfig'] | null - /** The lines detailing the item or service sold. */ - readonly children?: components['schemas']['BillingInvoiceLine'][] | null - /** Totals for this line. */ - readonly totals: components['schemas']['BillingInvoiceTotals'] - /** Period of the line item applies to for revenue recognition pruposes. */ - period: components['schemas']['BillingPeriod'] - /** - * The time this line item should be invoiced. - * Format: date-time - * @description [RFC3339](https://tools.ietf.org/html/rfc3339) formatted date-time string in UTC. - * @example 2023-01-01T01:01:01.001Z - */ - invoiceAt: string - /** @enum {string} */ - type: 'usage_based' - price: components['schemas']['RateCardUsageBasedPrice'] - /** - * The feature that the usage is based on. - * @description A key is a unique string that is used to identify a resource. + * @description The items in the current page. + * @example 100 */ - featureKey: string - /** Quantity of the item being sold. */ - readonly quantity?: components['schemas']['Numeric'] + pageSize: number + /** @description The items in the current page. */ + items: components['schemas']['Customer'][] } - /** @description UsageBasedLine represents a line item that is sold to the customer based on usage. */ - BillingUsageBasedLineCreate: { + /** @description Resource update operation model. */ + CustomerReplaceUpdate: { /** * Display name * @description Human-readable name for the resource. Between 1 and 256 characters. @@ -2871,407 +2657,182 @@ export interface components { * @description Additional metadata for the resource. */ metadata?: components['schemas']['Metadata'] | null - /** The invoice this item belongs to. */ - invoice?: components['schemas']['BillingInvoiceReference'] - /** The currency of this line */ - currency: components['schemas']['CurrencyCode'] - /** Tax config specify the tax configuration for this line. */ - taxConfig?: components['schemas']['TaxConfig'] | null - /** Period of the line item applies to for revenue recognition pruposes. */ - period: components['schemas']['BillingPeriod'] - /** - * The time this line item should be invoiced. - * Format: date-time - * @description [RFC3339](https://tools.ietf.org/html/rfc3339) formatted date-time string in UTC. - * @example 2023-01-01T01:01:01.001Z - */ - invoiceAt: string - /** @enum {string} */ - type: 'usage_based' - price: components['schemas']['RateCardUsageBasedPrice'] - /** - * The feature that the usage is based on. - * @description A key is a unique string that is used to identify a resource. - */ - featureKey: string - } - /** @description UsageBasedLine represents a line item that is sold to the customer based on usage. */ - BillingUsageBasedLineCreateItem: { /** - * Display name - * @description Human-readable name for the resource. Between 1 and 256 characters. - */ - name: string - /** - * Description - * @description Optional description of the resource. Maximum 1024 characters. - */ - description?: string - /** - * Metadata - * @description Additional metadata for the resource. + * Timezone + * @description Timezone of the customer. */ - metadata?: components['schemas']['Metadata'] | null - /** The invoice this item belongs to. */ - invoice?: components['schemas']['BillingInvoiceReference'] - /** The currency of this line */ - currency: components['schemas']['CurrencyCode'] - /** Tax config specify the tax configuration for this line. */ - taxConfig?: components['schemas']['TaxConfig'] | null - /** Period of the line item applies to for revenue recognition pruposes. */ - period: components['schemas']['BillingPeriod'] + timezone?: string /** - * The time this line item should be invoiced. - * Format: date-time - * @description [RFC3339](https://tools.ietf.org/html/rfc3339) formatted date-time string in UTC. - * @example 2023-01-01T01:01:01.001Z + * Usage Attribution + * @description Mapping to attribute metered usage to the customer */ - invoiceAt: string - /** @enum {string} */ - type: 'usage_based' - price: components['schemas']['RateCardUsageBasedPrice'] + usageAttribution: components['schemas']['CustomerUsageAttribution'] /** - * The feature that the usage is based on. - * @description A key is a unique string that is used to identify a resource. + * Primary Email + * @description The primary email address of the customer. */ - featureKey: string - } - /** @description ValidationIssue captures any validation issues related to the invoice. - * - * Issues with severity "critical" will prevent the invoice from being issued. */ - BillingValidationIssue: { - /** The severity of the issue. */ - severity: components['schemas']['BillingValidationIssueSeverity'] - /** The field that the issue is related to, if available in JSON path format. */ - field?: string - /** Machine indentifiable code for the issue, if available. */ - code?: string - /** Component reporting the issue. */ - component: string - /** A human-readable description of the issue. */ - message: string - /** Metadata */ - metadata?: components['schemas']['Metadata'] - } - /** - * @description ValidationIssueSeverity describes the severity of a validation issue. - * - * Issues with severity "critical" will prevent the invoice from being issued. - * @enum {string} - */ - BillingValidationIssueSeverity: 'critical' | 'warning' - /** @description InvoiceVoidAction describes how to handle the voided line items. */ - BillingVoidInvoiceAction: { - /** How much of the total line items to be voided? (e.g. 100% means all charges are voided) */ - percentage: components['schemas']['Percentage'] - /** How to handle the voided line items, default: pending */ - action: components['schemas']['BillingVoidInvoiceLineAction'] - } - /** @description Request to void an invoice */ - BillingVoidInvoiceInput: { + primaryEmail?: string /** - * The action to take on the voided lines. - * @description The action to take on the voided line items. + * Currency + * @description Currency of the customer. + * Used for billing, tax and invoicing. */ - action: components['schemas']['BillingVoidInvoiceAction'] + currency?: components['schemas']['CurrencyCode'] /** - * The reason for voiding the invoice - * @description The reason for voiding the invoice. + * Billing Address + * @description The billing address of the customer. + * Used for tax and invoicing. */ - reason: string - /** @description Per line item overrides for the action. - * - * If not specified, the `action` will be applied to all line items. */ - overrides: - | components['schemas']['BillingVoidInvoiceLineOverride'][] - | null + billingAddress?: components['schemas']['Address'] } - /** - * @description VoidInvoiceLineAction describes how to handle the voidied line item in the invoice. - * @enum {string} - */ - BillingVoidInvoiceLineAction: 'discard' | 'pending' | 'pending_next_cycle' - /** @description VoidInvoiceLineOverride describes how to handle a specific line item in the invoice when voiding. */ - BillingVoidInvoiceLineOverride: { + /** @description Mapping to attribute metered usage to the customer. + * One customer can have multiple subjects, + * but one subject can only belong to one customer. */ + CustomerUsageAttribution: { /** - * The line item ID to override - * @description ULID (Universally Unique Lexicographically Sortable Identifier). - * @example 01G65Z755AFWAKHE12NY0CQ9FH + * SubjectKeys + * @description The subjects that are attributed to the customer. */ - lineId: string - /** The action to take on the line item */ - action: components['schemas']['BillingVoidInvoiceAction'] + subjectKeys: string[] } - /** @description Workflow represents a billing workflow */ - BillingWorkflow: { - /** - * Creation Time - * Format: date-time - * @description Timestamp of when the resource was created. - * @example 2024-01-01T01:01:01.001Z - */ - readonly createdAt: string + /** @description A discount on a price. + * One of: percentage, amount, or usage. */ + Discount: components['schemas']['DiscountPercentage'] + /** @description Percentage discount. */ + DiscountPercentage: { /** - * Last Update Time - * Format: date-time - * @description Timestamp of when the resource was last updated. - * @example 2024-01-01T01:01:01.001Z + * Type + * @description The type of the discount. + * @enum {string} */ - readonly updatedAt: string + type: 'percentage' /** - * Deletion Time - * Format: date-time - * @description Timestamp of when the resource was permanently deleted. - * @example 2024-01-01T01:01:01.001Z + * Percentage + * @description The percentage of the discount. */ - readonly deletedAt?: string - /** The collection settings for this workflow */ - collection?: components['schemas']['BillingWorkflowCollectionSettings'] - /** The invoicing settings for this workflow */ - invoicing?: components['schemas']['BillingWorkflowInvoicingSettings'] - /** The payment settings for this workflow */ - payment?: components['schemas']['BillingWorkflowPaymentSettings'] + percentage: number /** - * ID - * @description A unique identifier for the resource. - * @example 01G65Z755AFWAKHE12NY0CQ9FH + * Discounted RateCards + * @description The rate cards that the discount applies to. + * When not specified, the discount applies to all rate cards. */ - readonly id: string + rateCards?: string[] } - /** @description AppIdOrType can be used to reference an app during creation only. - * - * This can be either an AppType or the ULID of an app. */ - BillingWorkflowAppIdOrType: string - /** - * Collection alignment - * @description CollectionAlignment specifies when the pending line items should be collected into - * an invoice. - * @enum {string} - */ - BillingWorkflowCollectionAlignment: 'subscription' - /** - * Collection method - * @description CollectionMethod specifies how the invoice should be collected (automatic vs manual) - * @enum {string} - */ - BillingWorkflowCollectionMethod: 'charge_automatically' | 'send_invoice' - /** @description Workflow collection specifies how to collect the pending line items for an invoice */ - BillingWorkflowCollectionSettings: { + /** @description Add a new item to a phase. */ + EditSubscriptionAddItem: { /** - * @description When to collect the pending line items into an invoice. - * @default subscription - */ - alignment: components['schemas']['BillingWorkflowCollectionAlignment'] - /** - * Format: ISO8601 - * @description The interval for collecting the pending line items into an invoice. - * @default PT1H - * @example P1D + * @description discriminator enum property added by openapi-typescript + * @enum {string} */ - interval: string + op: 'add_item' + phaseKey: string + rateCard: components['schemas']['RateCard'] } - /** - * Workflow invoice settings - * @description WorkflowInvoice represents the invoice settings for a billing workflow - */ - BillingWorkflowInvoicingSettings: { - /** - * @description Whether to automatically issue the invoice after the draftPeriod has passed. - * @default true - */ - autoAdvance: boolean + /** @description Add a new phase */ + EditSubscriptionAddPhase: { /** - * Format: ISO8601 - * @description The period for the invoice to be kept in draft status for manual reviews. - * @default P1D - * @example P1D - */ - draftPeriod: string - /** - * Format: ISO8601 - * @description The period after which the invoice is due. - * @default P7D - * @example P1D + * @description discriminator enum property added by openapi-typescript + * @enum {string} */ - dueAfter: string - } - /** - * Workflow payment settings - * @description WorkflowPaymentSettings represents the payment settings for a billing workflow - */ - BillingWorkflowPaymentSettings: { - /** @default charge_automatically */ - collectionMethod: components['schemas']['BillingWorkflowCollectionMethod'] - } - /** @description WorkflowSettings represents the settings for a billing workflow. */ - BillingWorkflowSettings: { - /** The collection settings for this workflow */ - collection?: components['schemas']['BillingWorkflowCollectionSettings'] - /** The invoicing settings for this workflow */ - invoicing?: components['schemas']['BillingWorkflowInvoicingSettings'] - /** The payment settings for this workflow */ - payment?: components['schemas']['BillingWorkflowPaymentSettings'] + op: 'add_phase' + phase: components['schemas']['SubscriptionPhaseCreate'] } - /** @description Stripe CheckoutSession.custom_text */ - CheckoutSessionCustomTextAfterSubmitParams: { - afterSubmit?: { - message?: string - } - shippingAddress?: { - message?: string - } - submit?: { - message?: string - } - termsOfServiceAcceptance?: { - message?: string - } - } - /** - * @description Stripe CheckoutSession.ui_mode - * @enum {string} - */ - CheckoutSessionUIMode: 'embedded' | 'hosted' - /** @description Response from the client app (OpenMeter backend) to start the OAuth2 flow. */ - ClientAppStartResponse: { - /** @description The URL to start the OAuth2 authorization code grant flow. */ - url: string - } - /** @description The request could not be completed due to a conflict with the current state of the target resource. */ - ConflictProblemResponse: components['schemas']['UnexpectedProblemResponse'] - /** - * @description [ISO 3166-1](https://www.iso.org/iso-3166-country-codes.html) alpha-2 country code. - * Custom two-letter country codes are also supported for convenience. - * @example US - */ - CountryCode: string - /** @description Create a custom subscription. */ - CreateCustomSubscriptionRequestBody: { - currency: components['schemas']['CurrencyCode'] - /** - * Format: date-time - * @description [RFC3339](https://tools.ietf.org/html/rfc3339) formatted date-time string in UTC. - * @example 2023-01-01T01:01:01.001Z - */ - activeFrom: string - customPlan: components['schemas']['PlanCreate'] + /** @description Remove an item from a phase. */ + EditSubscriptionRemoveItem: { /** - * @description ULID (Universally Unique Lexicographically Sortable Identifier). - * @example 01G65Z755AFWAKHE12NY0CQ9FH + * @description discriminator enum property added by openapi-typescript + * @enum {string} */ - customerId: string + op: 'remove_item' + phaseKey: string + itemKey: string } - /** @description Create Stripe checkout session request. */ - CreateStripeCheckoutSessionRequest: { + /** @description Remove a phase */ + EditSubscriptionRemovePhase: { /** - * @description If not provided, the default Stripe app is used if any. - * @example 01G65Z755AFWAKHE12NY0CQ9FH + * @description discriminator enum property added by openapi-typescript + * @enum {string} */ - appId?: string - /** @description Provide a customer ID to use an existing OpenMeter customer. - * or provide a customer object to create a new customer. */ - customer: - | components['schemas']['CustomerId'] - | components['schemas']['CustomerCreate'] - /** @description Stripe customer ID. - * If not provided OpenMeter creates a new Stripe customer or - * uses the OpenMeter customer's default Stripe customer ID. */ - stripeCustomerId?: string - /** @description Options passed to Stripe when creating the checkout session. */ - options: components['schemas']['CreateStripeCheckoutSessionRequestOptions'] + op: 'remove_phase' + phaseKey: string + shift: components['schemas']['RemovePhaseShifting'] } - /** @description Create Stripe checkout session options */ - CreateStripeCheckoutSessionRequestOptions: { - currency?: components['schemas']['CurrencyCode'] - cancelURL?: string - clientReferenceID?: string - customText?: components['schemas']['CheckoutSessionCustomTextAfterSubmitParams'] - metadata?: { - [key: string]: string - } - returnURL?: string - successURL?: string - uiMode?: components['schemas']['CheckoutSessionUIMode'] - paymentMethodTypes?: string[] - } - /** @description Create Stripe Checkout Session response. */ - CreateStripeCheckoutSessionResult: { + /** @description Stretch a phase */ + EditSubscriptionStretchPhase: { /** - * @description The OpenMeter customer ID. - * @example 01G65Z755AFWAKHE12NY0CQ9FH + * @description discriminator enum property added by openapi-typescript + * @enum {string} */ - customerId: string - /** @description The Stripe customer ID. */ - stripeCustomerId: string - /** @description The checkout session ID. */ - sessionId: string - /** @description The checkout session setup intent ID. */ - setupIntentId: string - /** @description URL to show the checkout session. */ - url: string - /** @description Mode - * Always `setup` for now. */ - mode: components['schemas']['StripeCheckoutSessionMode'] - /** @description Cancel URL. */ - cancelURL?: string - /** @description Success URL. */ - successURL?: string - /** @description Return URL. */ - returnURL?: string + op: 'stretch_phase' + phaseKey: string + /** Format: duration */ + extendBy: string } - /** - * @description Three-letter [ISO4217](https://www.iso.org/iso-4217-currency-codes.html) currency code. - * Custom three-letter currency codes are also supported for convenience. - * @example USD - */ - CurrencyCode: string - /** @description Change a custom subscription. */ - CustomSubscriptionChange: { - currency: components['schemas']['CurrencyCode'] + /** @description Entitlement templates are used to define the entitlements of a plan. + * Features are omitted from the entitlement template, as they are defined in the rate card. */ + Entitlement: + | components['schemas']['EntitlementMetered'] + | components['schemas']['EntitlementStatic'] + | components['schemas']['EntitlementBoolean'] + /** @description Shared fields of the entitlement templates. */ + EntitlementBaseTemplate: { /** + * Creation Time * Format: date-time - * @description [RFC3339](https://tools.ietf.org/html/rfc3339) formatted date-time string in UTC. - * @example 2023-01-01T01:01:01.001Z + * @description Timestamp of when the resource was created. + * @example 2024-01-01T01:01:01.001Z */ - activeFrom: string - customPlan: components['schemas']['PlanCreate'] - } - /** - * @description A customer object. - * @example { - * "id": "01G65Z755AFWAKHE12NY0CQ9FH", - * "name": "ACME Inc.", - * "usageAttribution": { - * "subjectKeys": [ - * "my_subject_key" - * ] - * }, - * "createdAt": "2024-01-01T01:01:01.001Z", - * "updatedAt": "2024-01-01T01:01:01.001Z" - * } - */ - Customer: { + readonly createdAt: string /** - * ID - * @description A unique identifier for the resource. - * @example 01G65Z755AFWAKHE12NY0CQ9FH + * Last Update Time + * Format: date-time + * @description Timestamp of when the resource was last updated. + * @example 2024-01-01T01:01:01.001Z + */ + readonly updatedAt: string + /** + * Deletion Time + * Format: date-time + * @description Timestamp of when the resource was permanently deleted. + * @example 2024-01-01T01:01:01.001Z + */ + readonly deletedAt?: string + /** @description Additional metadata for the feature. */ + metadata?: components['schemas']['Metadata'] + /** + * @description Readonly unique ULID identifier. + * @example 01ARZ3NDEKTSV4RRFFQ69G5FAV */ readonly id: string /** - * Display name - * @description Human-readable name for the resource. Between 1 and 256 characters. + * Type + * @description The type of the entitlement. */ - name: string + type: components['schemas']['EntitlementType'] /** - * Description - * @description Optional description of the resource. Maximum 1024 characters. + * @description The identifier key unique to the subject + * @example customer-1 */ - description?: string + subjectKey: string /** - * Metadata - * @description Additional metadata for the resource. + * @description The feature the subject is entitled to use. + * @example example-feature-key */ - metadata?: components['schemas']['Metadata'] | null + featureKey: string + /** + * @description The feature the subject is entitled to use. + * @example 01ARZ3NDEKTSV4RRFFQ69G5FAV + */ + featureId: string + /** @description The current usage period. */ + currentUsagePeriod?: components['schemas']['Period'] + /** @description The defined usage period of the entitlement */ + usagePeriod?: components['schemas']['RecurringPeriod'] + } + /** @description Entitlement template of a boolean entitlement. */ + EntitlementBoolean: { + /** @enum {string} */ + type: 'boolean' /** * Creation Time * Format: date-time @@ -3293,318 +2854,414 @@ export interface components { * @example 2024-01-01T01:01:01.001Z */ readonly deletedAt?: string + /** @description Additional metadata for the feature. */ + metadata?: components['schemas']['Metadata'] /** - * Timezone - * @description Timezone of the customer. + * @description Readonly unique ULID identifier. + * @example 01ARZ3NDEKTSV4RRFFQ69G5FAV */ - timezone?: string + readonly id: string /** - * Usage Attribution - * @description Mapping to attribute metered usage to the customer + * @description The identifier key unique to the subject + * @example customer-1 */ - usageAttribution: components['schemas']['CustomerUsageAttribution'] + subjectKey: string /** - * Primary Email - * @description The primary email address of the customer. + * @description The feature the subject is entitled to use. + * @example example-feature-key */ - primaryEmail?: string + featureKey: string /** - * Currency - * @description Currency of the customer. - * Used for billing, tax and invoicing. + * @description The feature the subject is entitled to use. + * @example 01ARZ3NDEKTSV4RRFFQ69G5FAV */ - currency?: components['schemas']['CurrencyCode'] + featureId: string + /** @description The current usage period. */ + currentUsagePeriod?: components['schemas']['Period'] + /** @description The defined usage period of the entitlement */ + usagePeriod?: components['schemas']['RecurringPeriod'] + } & WithRequired< + components['schemas']['EntitlementBaseTemplate'], + | 'type' + | 'createdAt' + | 'updatedAt' + | 'id' + | 'subjectKey' + | 'featureKey' + | 'featureId' + > + /** @description Create inputs for boolean entitlement */ + EntitlementBooleanCreateInputs: { /** - * Billing Address - * @description The billing address of the customer. - * Used for tax and invoicing. + * @description The feature the subject is entitled to use. + * Either featureKey or featureId is required. + * @example example-feature-key */ - billingAddress?: components['schemas']['Address'] + featureKey?: string + /** + * @description The feature the subject is entitled to use. + * Either featureKey or featureId is required. + * @example 01ARZ3NDEKTSV4RRFFQ69G5FAV + */ + featureId?: string + /** @description Additional metadata for the feature. */ + metadata?: components['schemas']['Metadata'] + /** @description The usage period associated with the entitlement. */ + usagePeriod?: components['schemas']['RecurringPeriodCreateInput'] + /** @enum {string} */ + type: 'boolean' } - /** @description CustomerAppData - * Stores the app specific data for the customer. - * One of: stripe, sandbox */ - CustomerAppData: - | components['schemas']['StripeCustomerAppData'] - | components['schemas']['SandboxCustomerAppData'] - /** @description Paginated response */ - CustomerAppDataPaginatedResponse: { + /** @description Create inputs for entitlement */ + EntitlementCreateInputs: + | components['schemas']['EntitlementMeteredCreateInputs'] + | components['schemas']['EntitlementStaticCreateInputs'] + | components['schemas']['EntitlementBooleanCreateInputs'] + /** @description The grant. */ + EntitlementGrant: { /** - * @description The items in the current page. - * @example 500 + * Creation Time + * Format: date-time + * @description Timestamp of when the resource was created. + * @example 2024-01-01T01:01:01.001Z */ - totalCount: number + readonly createdAt: string /** - * @description The items in the current page. - * @example 1 + * Last Update Time + * Format: date-time + * @description Timestamp of when the resource was last updated. + * @example 2024-01-01T01:01:01.001Z */ - page: number + readonly updatedAt: string /** - * @description The items in the current page. + * Deletion Time + * Format: date-time + * @description Timestamp of when the resource was permanently deleted. + * @example 2024-01-01T01:01:01.001Z + */ + readonly deletedAt?: string + /** + * Format: double + * @description The amount to grant. Should be a positive number. * @example 100 */ - pageSize: number - /** @description The items in the current page. */ - items: components['schemas']['CustomerAppData'][] - } - /** @description Resource create operation model. */ - CustomerCreate: { + amount: number /** - * Display name - * @description Human-readable name for the resource. Between 1 and 256 characters. + * Format: uint8 + * @description The priority of the grant. Grants with higher priority are applied first. + * Priority is a positive decimal numbers. With lower numbers indicating higher importance. + * For example, a priority of 1 is more urgent than a priority of 2. + * When there are several grants available for the same subject, the system selects the grant with the highest priority. + * In cases where grants share the same priority level, the grant closest to its expiration will be used first. + * In the case of two grants have identical priorities and expiration dates, the system will use the grant that was created first. + * @example 1 */ - name: string + priority?: number /** - * Description - * @description Optional description of the resource. Maximum 1024 characters. + * Format: date-time + * @description Effective date for grants and anchor for recurring grants. Provided value will be ceiled to metering windowSize (minute). + * @example 2023-01-01T01:01:01.001Z */ - description?: string + effectiveAt: string + /** @description The grant expiration definition */ + expiration: components['schemas']['ExpirationPeriod'] /** - * Metadata - * @description Additional metadata for the resource. + * Format: double + * @description Grants are rolled over at reset, after which they can have a different balance compared to what they had before the reset. + * Balance after the reset is calculated as: Balance_After_Reset = MIN(MaxRolloverAmount, MAX(Balance_Before_Reset, MinRolloverAmount)) + * @default 0 + * @example 100 */ - metadata?: components['schemas']['Metadata'] | null + maxRolloverAmount: number /** - * Timezone - * @description Timezone of the customer. + * Format: double + * @description Grants are rolled over at reset, after which they can have a different balance compared to what they had before the reset. + * Balance after the reset is calculated as: Balance_After_Reset = MIN(MaxRolloverAmount, MAX(Balance_Before_Reset, MinRolloverAmount)) + * @default 0 + * @example 100 */ - timezone?: string + minRolloverAmount: number /** - * Usage Attribution - * @description Mapping to attribute metered usage to the customer + * @description The grant metadata. + * @example { + * "stripePaymentId": "pi_4OrAkhLvyihio9p51h9iiFnB" + * } */ - usageAttribution: components['schemas']['CustomerUsageAttribution'] + metadata?: components['schemas']['Metadata'] /** - * Primary Email - * @description The primary email address of the customer. + * @description Readonly unique ULID identifier. + * @example 01ARZ3NDEKTSV4RRFFQ69G5FAV */ - primaryEmail?: string + readonly id: string /** - * Currency - * @description Currency of the customer. - * Used for billing, tax and invoicing. + * @description The unique entitlement ULID that the grant is associated with. + * @example 01ARZ3NDEKTSV4RRFFQ69G5FAV + */ + readonly entitlementId: string + /** + * Format: date-time + * @description The next time the grant will recurr. + * @example 2023-01-01T01:01:01.001Z */ - currency?: components['schemas']['CurrencyCode'] + nextRecurrence?: string /** - * Billing Address - * @description The billing address of the customer. - * Used for tax and invoicing. + * Format: date-time + * @description The time the grant expires. + * @example 2023-01-01T01:01:01.001Z */ - billingAddress?: components['schemas']['Address'] - } - /** @description Create Stripe checkout session customer ID. */ - CustomerId: { + readonly expiresAt?: string /** - * @description ULID (Universally Unique Lexicographically Sortable Identifier). - * @example 01G65Z755AFWAKHE12NY0CQ9FH + * Format: date-time + * @description The time the grant was voided. + * @example 2023-01-01T01:01:01.001Z */ - id: string + voidedAt?: string + /** @description The recurrence period of the grant. */ + recurrence?: components['schemas']['RecurringPeriod'] } - /** - * @description Order by options for customers. - * @enum {string} - */ - CustomerOrderBy: 'id' | 'name' | 'createdAt' - /** @description Paginated response */ - CustomerOverridePaginatedResponse: { + /** @description The grant creation input. */ + EntitlementGrantCreateInput: { /** - * @description The items in the current page. - * @example 500 + * Format: double + * @description The amount to grant. Should be a positive number. + * @example 100 */ - totalCount: number + amount: number /** - * @description The items in the current page. + * Format: uint8 + * @description The priority of the grant. Grants with higher priority are applied first. + * Priority is a positive decimal numbers. With lower numbers indicating higher importance. + * For example, a priority of 1 is more urgent than a priority of 2. + * When there are several grants available for the same subject, the system selects the grant with the highest priority. + * In cases where grants share the same priority level, the grant closest to its expiration will be used first. + * In the case of two grants have identical priorities and expiration dates, the system will use the grant that was created first. * @example 1 */ - page: number + priority?: number /** - * @description The items in the current page. - * @example 100 + * Format: date-time + * @description Effective date for grants and anchor for recurring grants. Provided value will be ceiled to metering windowSize (minute). + * @example 2023-01-01T01:01:01.001Z */ - pageSize: number - /** @description The items in the current page. */ - items: components['schemas']['BillingCustomerOverride'][] - } - /** @description Paginated response */ - CustomerPaginatedResponse: { + effectiveAt: string + /** @description The grant expiration definition */ + expiration: components['schemas']['ExpirationPeriod'] /** - * @description The items in the current page. - * @example 500 + * Format: double + * @description Grants are rolled over at reset, after which they can have a different balance compared to what they had before the reset. + * Balance after the reset is calculated as: Balance_After_Reset = MIN(MaxRolloverAmount, MAX(Balance_Before_Reset, MinRolloverAmount)) + * @default 0 + * @example 100 */ - totalCount: number + maxRolloverAmount: number /** - * @description The items in the current page. - * @example 1 + * Format: double + * @description Grants are rolled over at reset, after which they can have a different balance compared to what they had before the reset. + * Balance after the reset is calculated as: Balance_After_Reset = MIN(MaxRolloverAmount, MAX(Balance_Before_Reset, MinRolloverAmount)) + * @default 0 + * @example 100 */ - page: number + minRolloverAmount: number /** - * @description The items in the current page. - * @example 100 + * @description The grant metadata. + * @example { + * "stripePaymentId": "pi_4OrAkhLvyihio9p51h9iiFnB" + * } */ - pageSize: number - /** @description The items in the current page. */ - items: components['schemas']['Customer'][] + metadata?: components['schemas']['Metadata'] + /** @description The subject of the grant. */ + recurrence?: components['schemas']['RecurringPeriodCreateInput'] } - /** @description Resource update operation model. */ - CustomerReplaceUpdate: { + /** @description Metered entitlements are useful for many different use cases, from setting up usage based access to implementing complex credit systems. + * Access is determined based on feature usage using a balance calculation (the "usage allowance" provided by the issued grants is "burnt down" by the usage). */ + EntitlementMetered: { + /** @enum {string} */ + type: 'metered' /** - * Display name - * @description Human-readable name for the resource. Between 1 and 256 characters. + * Soft limit + * @description If softLimit=true the subject can use the feature even if the entitlement is exhausted, hasAccess will always be true. + * @default false */ - name: string + isSoftLimit: boolean /** - * Description - * @description Optional description of the resource. Maximum 1024 characters. + * @deprecated + * @description Deprecated, ignored by the backend. Please use isSoftLimit instead; this field will be removed in the future. + * @default false */ - description?: string + isUnlimited: boolean /** - * Metadata - * @description Additional metadata for the resource. + * Initial grant amount + * Format: double + * @description You can grant usage automatically alongside the entitlement, the example scenario would be creating a starting balance. + * If an amount is specified here, a grant will be created alongside the entitlement with the specified amount. + * That grant will have it's rollover settings configured in a way that after each reset operation, the balance will return the original amount specified here. + * Manually creating such a grant would mean having the "amount", "minRolloverAmount", and "maxRolloverAmount" fields all be the same. */ - metadata?: components['schemas']['Metadata'] | null + issueAfterReset?: number /** - * Timezone - * @description Timezone of the customer. + * Issue grant after reset priority + * Format: uint8 + * @description Defines the grant priority for the default grant. + * @default 1 */ - timezone?: string + issueAfterResetPriority: number /** - * Usage Attribution - * @description Mapping to attribute metered usage to the customer + * Preserve overage at reset + * @description If true, the overage is preserved at reset. If false, the usage is reset to 0. + * @default false */ - usageAttribution: components['schemas']['CustomerUsageAttribution'] + preserveOverageAtReset: boolean /** - * Primary Email - * @description The primary email address of the customer. + * Creation Time + * Format: date-time + * @description Timestamp of when the resource was created. + * @example 2024-01-01T01:01:01.001Z */ - primaryEmail?: string + readonly createdAt: string /** - * Currency - * @description Currency of the customer. - * Used for billing, tax and invoicing. + * Last Update Time + * Format: date-time + * @description Timestamp of when the resource was last updated. + * @example 2024-01-01T01:01:01.001Z */ - currency?: components['schemas']['CurrencyCode'] + readonly updatedAt: string /** - * Billing Address - * @description The billing address of the customer. - * Used for tax and invoicing. + * Deletion Time + * Format: date-time + * @description Timestamp of when the resource was permanently deleted. + * @example 2024-01-01T01:01:01.001Z */ - billingAddress?: components['schemas']['Address'] - } - /** @description Mapping to attribute metered usage to the customer. - * One customer can have multiple subjects, - * but one subject can only belong to one customer. */ - CustomerUsageAttribution: { + readonly deletedAt?: string + /** @description Additional metadata for the feature. */ + metadata?: components['schemas']['Metadata'] /** - * SubjectKeys - * @description The subjects that are attributed to the customer. + * @description Readonly unique ULID identifier. + * @example 01ARZ3NDEKTSV4RRFFQ69G5FAV */ - subjectKeys: string[] - } - /** @description A discount on a price. - * One of: percentage, amount, or usage. */ - Discount: components['schemas']['DiscountPercentage'] - /** @description Percentage discount. */ - DiscountPercentage: { + readonly id: string /** - * Type - * @description The type of the discount. - * @enum {string} + * @description The identifier key unique to the subject + * @example customer-1 */ - type: 'percentage' + subjectKey: string /** - * Percentage - * @description The percentage of the discount. + * @description The feature the subject is entitled to use. + * @example example-feature-key */ - percentage: number + featureKey: string /** - * Discounted RateCards - * @description The rate cards that the discount applies to. - * When not specified, the discount applies to all rate cards. + * @description The feature the subject is entitled to use. + * @example 01ARZ3NDEKTSV4RRFFQ69G5FAV */ - rateCards?: string[] - } - /** @description Percentage discount. */ - DiscountPercentageUpdateItem: { + featureId: string /** - * Percentage - * @description The percentage of the discount. + * Format: date-time + * @description The time the last reset happened. + * @example 2023-01-01T01:01:01.001Z */ - percentage: number + readonly lastReset: string + /** @description The current usage period. */ + readonly currentUsagePeriod: components['schemas']['Period'] /** - * Discounted RateCards - * @description The rate cards that the discount applies to. - * When not specified, the discount applies to all rate cards. + * Format: date-time + * @description The time from which usage is measured. If not specified on creation, defaults to entitlement creation time. + * @example 2023-01-01T01:01:01.001Z */ - rateCards?: string[] + readonly measureUsageFrom: string + /** @description THe usage period of the entitlement. */ + readonly usagePeriod: components['schemas']['RecurringPeriod'] } - /** @description A discount on a price. - * One of: percentage, amount, or usage. */ - DiscountUpdateItem: components['schemas']['DiscountPercentageUpdateItem'] - /** @description Entitlement templates are used to define the entitlements of a plan. - * Features are omitted from the entitlement template, as they are defined in the rate card. */ - Entitlement: - | components['schemas']['EntitlementMetered'] - | components['schemas']['EntitlementStatic'] - | components['schemas']['EntitlementBoolean'] - /** @description Shared fields of the entitlement templates. */ - EntitlementBaseTemplate: { + /** @description Create inpurs for metered entitlement */ + EntitlementMeteredCreateInputs: { /** - * Creation Time - * Format: date-time - * @description Timestamp of when the resource was created. - * @example 2024-01-01T01:01:01.001Z + * @description The feature the subject is entitled to use. + * Either featureKey or featureId is required. + * @example example-feature-key + */ + featureKey?: string + /** + * @description The feature the subject is entitled to use. + * Either featureKey or featureId is required. + * @example 01ARZ3NDEKTSV4RRFFQ69G5FAV + */ + featureId?: string + /** @description Additional metadata for the feature. */ + metadata?: components['schemas']['Metadata'] + /** @enum {string} */ + type: 'metered' + /** + * Soft limit + * @description If softLimit=true the subject can use the feature even if the entitlement is exhausted, hasAccess will always be true. + * @default false */ - readonly createdAt: string + isSoftLimit: boolean /** - * Last Update Time - * Format: date-time - * @description Timestamp of when the resource was last updated. - * @example 2024-01-01T01:01:01.001Z + * @deprecated + * @description Deprecated, ignored by the backend. Please use isSoftLimit instead; this field will be removed in the future. + * @default false */ - readonly updatedAt: string + isUnlimited: boolean + /** @description The usage period associated with the entitlement. */ + usagePeriod: components['schemas']['RecurringPeriodCreateInput'] + /** @description Defines the time from which usage is measured. If not specified on creation, defaults to entitlement creation time. */ + measureUsageFrom?: components['schemas']['MeasureUsageFrom'] /** - * Deletion Time - * Format: date-time - * @description Timestamp of when the resource was permanently deleted. - * @example 2024-01-01T01:01:01.001Z + * Initial grant amount + * Format: double + * @description You can grant usage automatically alongside the entitlement, the example scenario would be creating a starting balance. + * If an amount is specified here, a grant will be created alongside the entitlement with the specified amount. + * That grant will have it's rollover settings configured in a way that after each reset operation, the balance will return the original amount specified here. + * Manually creating such a grant would mean having the "amount", "minRolloverAmount", and "maxRolloverAmount" fields all be the same. */ - readonly deletedAt?: string - /** @description Additional metadata for the feature. */ - metadata?: components['schemas']['Metadata'] + issueAfterReset?: number /** - * @description Readonly unique ULID identifier. - * @example 01ARZ3NDEKTSV4RRFFQ69G5FAV + * Issue grant after reset priority + * Format: uint8 + * @description Defines the grant priority for the default grant. + * @default 1 */ - readonly id: string + issueAfterResetPriority: number /** - * Type - * @description The type of the entitlement. + * Preserve overage at reset + * @description If true, the overage is preserved at reset. If false, the usage is reset to 0. + * @default false */ - type: components['schemas']['EntitlementType'] + preserveOverageAtReset: boolean + } + /** + * @description Order by options for entitlements. + * @enum {string} + */ + EntitlementOrderBy: 'createdAt' | 'updatedAt' + /** @description Paginated response */ + EntitlementPaginatedResponse: { /** - * @description The identifier key unique to the subject - * @example customer-1 + * @description The items in the current page. + * @example 500 */ - subjectKey: string + totalCount: number /** - * @description The feature the subject is entitled to use. - * @example example-feature-key + * @description The items in the current page. + * @example 1 */ - featureKey: string + page: number /** - * @description The feature the subject is entitled to use. - * @example 01ARZ3NDEKTSV4RRFFQ69G5FAV + * @description The items in the current page. + * @example 100 */ - featureId: string - /** @description The current usage period. */ - currentUsagePeriod?: components['schemas']['Period'] - /** @description The defined usage period of the entitlement */ - usagePeriod?: components['schemas']['RecurringPeriod'] + pageSize: number + /** @description The items in the current page. */ + items: components['schemas']['Entitlement'][] } - /** @description Entitlement template of a boolean entitlement. */ - EntitlementBoolean: { + /** @description A static entitlement. */ + EntitlementStatic: { /** @enum {string} */ - type: 'boolean' + type: 'static' + /** + * Format: json + * @description The JSON parsable config of the entitlement. This value is also returned when checking entitlement access and it is useful for configuring fine-grained access settings to the feature, implemented in your own system. Has to be an object. + * @example { "integrations": ["github"] } + */ + config: string /** * Creation Time * Format: date-time @@ -3652,18 +3309,9 @@ export interface components { currentUsagePeriod?: components['schemas']['Period'] /** @description The defined usage period of the entitlement */ usagePeriod?: components['schemas']['RecurringPeriod'] - } & WithRequired< - components['schemas']['EntitlementBaseTemplate'], - | 'type' - | 'createdAt' - | 'updatedAt' - | 'id' - | 'subjectKey' - | 'featureKey' - | 'featureId' - > - /** @description Create inputs for boolean entitlement */ - EntitlementBooleanCreateInputs: { + } + /** @description Create inputs for static entitlement */ + EntitlementStaticCreateInputs: { /** * @description The feature the subject is entitled to use. * Either featureKey or featureId is required. @@ -3681,207 +3329,133 @@ export interface components { /** @description The usage period associated with the entitlement. */ usagePeriod?: components['schemas']['RecurringPeriodCreateInput'] /** @enum {string} */ - type: 'boolean' - } - /** @description Create inputs for entitlement */ - EntitlementCreateInputs: - | components['schemas']['EntitlementMeteredCreateInputs'] - | components['schemas']['EntitlementStaticCreateInputs'] - | components['schemas']['EntitlementBooleanCreateInputs'] - /** @description The grant. */ - EntitlementGrant: { - /** - * Creation Time - * Format: date-time - * @description Timestamp of when the resource was created. - * @example 2024-01-01T01:01:01.001Z - */ - readonly createdAt: string + type: 'static' /** - * Last Update Time - * Format: date-time - * @description Timestamp of when the resource was last updated. - * @example 2024-01-01T01:01:01.001Z + * Format: json + * @description The JSON parsable config of the entitlement. This value is also returned when checking entitlement access and it is useful for configuring fine-grained access settings to the feature, implemented in your own system. Has to be an object. + * @example { "integrations": ["github"] } */ - readonly updatedAt: string + config: string + } + /** + * @description Type of the entitlement. + * @enum {string} + */ + EntitlementType: 'metered' | 'boolean' | 'static' + /** @description Entitlements are the core of OpenMeter access management. They define access to features for subjects. Entitlements can be metered, boolean, or static. */ + EntitlementValue: { /** - * Deletion Time - * Format: date-time - * @description Timestamp of when the resource was permanently deleted. - * @example 2024-01-01T01:01:01.001Z + * @description Whether the subject has access to the feature. Shared accross all entitlement types. + * @example true */ - readonly deletedAt?: string + readonly hasAccess: boolean /** * Format: double - * @description The amount to grant. Should be a positive number. + * @description Only available for metered entitlements. Metered entitlements are built around a balance calculation where feature usage is deducted from the issued grants. Balance represents the remaining balance of the entitlement, it's value never turns negative. * @example 100 */ - amount: number - /** - * Format: uint8 - * @description The priority of the grant. Grants with higher priority are applied first. - * Priority is a positive decimal numbers. With lower numbers indicating higher importance. - * For example, a priority of 1 is more urgent than a priority of 2. - * When there are several grants available for the same subject, the system selects the grant with the highest priority. - * In cases where grants share the same priority level, the grant closest to its expiration will be used first. - * In the case of two grants have identical priorities and expiration dates, the system will use the grant that was created first. - * @example 1 - */ - priority?: number - /** - * Format: date-time - * @description Effective date for grants and anchor for recurring grants. Provided value will be ceiled to metering windowSize (minute). - * @example 2023-01-01T01:01:01.001Z - */ - effectiveAt: string - /** @description The grant expiration definition */ - expiration: components['schemas']['ExpirationPeriod'] + readonly balance?: number /** * Format: double - * @description Grants are rolled over at reset, after which they can have a different balance compared to what they had before the reset. - * Balance after the reset is calculated as: Balance_After_Reset = MIN(MaxRolloverAmount, MAX(Balance_Before_Reset, MinRolloverAmount)) - * @default 0 - * @example 100 + * @description Only available for metered entitlements. Returns the total feature usage in the current period. + * @example 50 */ - maxRolloverAmount: number + readonly usage?: number /** * Format: double - * @description Grants are rolled over at reset, after which they can have a different balance compared to what they had before the reset. - * Balance after the reset is calculated as: Balance_After_Reset = MIN(MaxRolloverAmount, MAX(Balance_Before_Reset, MinRolloverAmount)) - * @default 0 - * @example 100 - */ - minRolloverAmount: number - /** - * @description The grant metadata. - * @example { - * "stripePaymentId": "pi_4OrAkhLvyihio9p51h9iiFnB" - * } - */ - metadata?: components['schemas']['Metadata'] - /** - * @description Readonly unique ULID identifier. - * @example 01ARZ3NDEKTSV4RRFFQ69G5FAV - */ - readonly id: string - /** - * @description The unique entitlement ULID that the grant is associated with. - * @example 01ARZ3NDEKTSV4RRFFQ69G5FAV - */ - readonly entitlementId: string - /** - * Format: date-time - * @description The next time the grant will recurr. - * @example 2023-01-01T01:01:01.001Z - */ - nextRecurrence?: string - /** - * Format: date-time - * @description The time the grant expires. - * @example 2023-01-01T01:01:01.001Z + * @description Only available for metered entitlements. Overage represents the usage that wasn't covered by grants, e.g. if the subject had a total feature usage of 100 in the period but they were only granted 80, there would be 20 overage. + * @example 0 */ - readonly expiresAt?: string + readonly overage?: number /** - * Format: date-time - * @description The time the grant was voided. - * @example 2023-01-01T01:01:01.001Z + * @description Only available for static entitlements. The JSON parsable config of the entitlement. + * @example { key: "value" } */ - voidedAt?: string - /** @description The recurrence period of the grant. */ - recurrence?: components['schemas']['RecurringPeriod'] + readonly config?: string } - /** @description The grant creation input. */ - EntitlementGrantCreateInput: { - /** - * Format: double - * @description The amount to grant. Should be a positive number. - * @example 100 - */ - amount: number - /** - * Format: uint8 - * @description The priority of the grant. Grants with higher priority are applied first. - * Priority is a positive decimal numbers. With lower numbers indicating higher importance. - * For example, a priority of 1 is more urgent than a priority of 2. - * When there are several grants available for the same subject, the system selects the grant with the highest priority. - * In cases where grants share the same priority level, the grant closest to its expiration will be used first. - * In the case of two grants have identical priorities and expiration dates, the system will use the grant that was created first. - * @example 1 - */ - priority?: number + /** + * @description CloudEvents Specification JSON Schema + * + * Optional properties are nullable according to the CloudEvents specification: + * OPTIONAL not omitted attributes MAY be represented as a null JSON value. + * @example { + * "id": "5c10fade-1c9e-4d6c-8275-c52c36731d3c", + * "source": "service-name", + * "specversion": "1.0", + * "type": "prompt", + * "subject": "customer-id", + * "time": "2023-01-01T01:01:01.001Z" + * } + */ + Event: { /** - * Format: date-time - * @description Effective date for grants and anchor for recurring grants. Provided value will be ceiled to metering windowSize (minute). - * @example 2023-01-01T01:01:01.001Z + * @description Identifies the event. + * @example 5c10fade-1c9e-4d6c-8275-c52c36731d3c */ - effectiveAt: string - /** @description The grant expiration definition */ - expiration: components['schemas']['ExpirationPeriod'] + id: string /** - * Format: double - * @description Grants are rolled over at reset, after which they can have a different balance compared to what they had before the reset. - * Balance after the reset is calculated as: Balance_After_Reset = MIN(MaxRolloverAmount, MAX(Balance_Before_Reset, MinRolloverAmount)) - * @default 0 - * @example 100 + * Format: uri-reference + * @description Identifies the context in which an event happened. + * @example service-name */ - maxRolloverAmount: number + source: string /** - * Format: double - * @description Grants are rolled over at reset, after which they can have a different balance compared to what they had before the reset. - * Balance after the reset is calculated as: Balance_After_Reset = MIN(MaxRolloverAmount, MAX(Balance_Before_Reset, MinRolloverAmount)) - * @default 0 - * @example 100 + * @description The version of the CloudEvents specification which the event uses. + * @default 1.0 + * @example 1.0 */ - minRolloverAmount: number + specversion: string /** - * @description The grant metadata. - * @example { - * "stripePaymentId": "pi_4OrAkhLvyihio9p51h9iiFnB" - * } + * @description Contains a value describing the type of event related to the originating occurrence. + * @example com.example.someevent */ - metadata?: components['schemas']['Metadata'] - /** @description The subject of the grant. */ - recurrence?: components['schemas']['RecurringPeriodCreateInput'] - } - /** @description Metered entitlements are useful for many different use cases, from setting up usage based access to implementing complex credit systems. - * Access is determined based on feature usage using a balance calculation (the "usage allowance" provided by the issued grants is "burnt down" by the usage). */ - EntitlementMetered: { - /** @enum {string} */ - type: 'metered' + type: string /** - * Soft limit - * @description If softLimit=true the subject can use the feature even if the entitlement is exhausted, hasAccess will always be true. - * @default false + * @description Content type of the CloudEvents data value. Only the value "application/json" is allowed over HTTP. + * @example application/json + * @enum {string|null} */ - isSoftLimit: boolean + datacontenttype?: 'application/json' | null /** - * @deprecated - * @description Deprecated, ignored by the backend. Please use isSoftLimit instead; this field will be removed in the future. - * @default false + * Format: uri + * @description Identifies the schema that data adheres to. */ - isUnlimited: boolean + dataschema?: string | null /** - * Initial grant amount - * Format: double - * @description You can grant usage automatically alongside the entitlement, the example scenario would be creating a starting balance. - * If an amount is specified here, a grant will be created alongside the entitlement with the specified amount. - * That grant will have it's rollover settings configured in a way that after each reset operation, the balance will return the original amount specified here. - * Manually creating such a grant would mean having the "amount", "minRolloverAmount", and "maxRolloverAmount" fields all be the same. + * @description Describes the subject of the event in the context of the event producer (identified by source). + * @example customer-id */ - issueAfterReset?: number + subject: string /** - * Issue grant after reset priority - * Format: uint8 - * @description Defines the grant priority for the default grant. - * @default 1 + * Format: date-time + * @description Timestamp of when the occurrence happened. Must adhere to RFC 3339. + * @example 2023-01-01T01:01:01.001Z */ - issueAfterResetPriority: number + time?: string | null + /** @description The event payload. + * Optional, if present it must be a JSON object. */ + data?: { + [key: string]: unknown + } | null + } + /** + * @description The expiration duration enum + * @enum {string} + */ + ExpirationDuration: 'HOUR' | 'DAY' | 'WEEK' | 'MONTH' | 'YEAR' + /** @description The grant expiration definition */ + ExpirationPeriod: { + /** @description The unit of time for the expiration period. */ + duration: components['schemas']['ExpirationDuration'] /** - * Preserve overage at reset - * @description If true, the overage is preserved at reset. If false, the usage is reset to 0. - * @default false + * @description The number of time units in the expiration period. + * @example 12 */ - preserveOverageAtReset: boolean + count: number + } + /** @description Represents a feature that can be enabled or disabled for a plan. + * Used both for product catalog and entitlements. */ + Feature: { /** * Creation Time * Format: date-time @@ -3903,109 +3477,114 @@ export interface components { * @example 2024-01-01T01:01:01.001Z */ readonly deletedAt?: string - /** @description Additional metadata for the feature. */ - metadata?: components['schemas']['Metadata'] /** - * @description Readonly unique ULID identifier. - * @example 01ARZ3NDEKTSV4RRFFQ69G5FAV + * Archival Time + * Format: date-time + * @description Timestamp of when the resource was archived. + * @example 2023-01-01T01:01:01.001Z */ - readonly id: string + readonly archivedAt?: string /** - * @description The identifier key unique to the subject - * @example customer-1 + * The unique key of the feature + * @description A key is a unique string that is used to identify a resource. */ - subjectKey: string + key: string + /** The human-readable name of the feature */ + name: string /** - * @description The feature the subject is entitled to use. - * @example example-feature-key + * Optional metadata + * @example { + * "key": "value" + * } */ - featureKey: string + metadata?: components['schemas']['Metadata'] /** - * @description The feature the subject is entitled to use. - * @example 01ARZ3NDEKTSV4RRFFQ69G5FAV + * Meter slug + * @description A key is a unique string that is used to identify a resource. + * @example tokens_total */ - featureId: string + meterSlug?: string /** - * Format: date-time - * @description The time the last reset happened. - * @example 2023-01-01T01:01:01.001Z + * Meter group by filters + * @description Optional meter group by filters. + * Useful if the meter scope is broader than what feature tracks. + * Example scenario would be a meter tracking all token use with groupBy fields for the model, + * then the feature could filter for model=gpt-4. + * @example { + * "model": "gpt-4", + * "type": "input" + * } */ - readonly lastReset: string - /** @description The current usage period. */ - readonly currentUsagePeriod: components['schemas']['Period'] + meterGroupByFilters?: { + [key: string]: string + } /** - * Format: date-time - * @description The time from which usage is measured. If not specified on creation, defaults to entitlement creation time. - * @example 2023-01-01T01:01:01.001Z + * @description Readonly unique ULID identifier. + * @example 01ARZ3NDEKTSV4RRFFQ69G5FAV */ - readonly measureUsageFrom: string - /** @description THe usage period of the entitlement. */ - readonly usagePeriod: components['schemas']['RecurringPeriod'] + readonly id: string } - /** @description Create inpurs for metered entitlement */ - EntitlementMeteredCreateInputs: { + /** @description Represents a feature that can be enabled or disabled for a plan. + * Used both for product catalog and entitlements. */ + FeatureCreateInputs: { /** - * @description The feature the subject is entitled to use. - * Either featureKey or featureId is required. - * @example example-feature-key + * The unique key of the feature + * @description A key is a unique string that is used to identify a resource. */ - featureKey?: string + key: string + /** The human-readable name of the feature */ + name: string /** - * @description The feature the subject is entitled to use. - * Either featureKey or featureId is required. - * @example 01ARZ3NDEKTSV4RRFFQ69G5FAV + * Optional metadata + * @example { + * "key": "value" + * } */ - featureId?: string - /** @description Additional metadata for the feature. */ metadata?: components['schemas']['Metadata'] - /** @enum {string} */ - type: 'metered' - /** - * Soft limit - * @description If softLimit=true the subject can use the feature even if the entitlement is exhausted, hasAccess will always be true. - * @default false - */ - isSoftLimit: boolean /** - * @deprecated - * @description Deprecated, ignored by the backend. Please use isSoftLimit instead; this field will be removed in the future. - * @default false + * Meter slug + * @description A key is a unique string that is used to identify a resource. + * @example tokens_total */ - isUnlimited: boolean - /** @description The usage period associated with the entitlement. */ - usagePeriod: components['schemas']['RecurringPeriodCreateInput'] - /** @description Defines the time from which usage is measured. If not specified on creation, defaults to entitlement creation time. */ - measureUsageFrom?: components['schemas']['MeasureUsageFrom'] + meterSlug?: string /** - * Initial grant amount - * Format: double - * @description You can grant usage automatically alongside the entitlement, the example scenario would be creating a starting balance. - * If an amount is specified here, a grant will be created alongside the entitlement with the specified amount. - * That grant will have it's rollover settings configured in a way that after each reset operation, the balance will return the original amount specified here. - * Manually creating such a grant would mean having the "amount", "minRolloverAmount", and "maxRolloverAmount" fields all be the same. + * Meter group by filters + * @description Optional meter group by filters. + * Useful if the meter scope is broader than what feature tracks. + * Example scenario would be a meter tracking all token use with groupBy fields for the model, + * then the feature could filter for model=gpt-4. + * @example { + * "model": "gpt-4", + * "type": "input" + * } */ - issueAfterReset?: number + meterGroupByFilters?: { + [key: string]: string + } + } + /** @description Limited representation of a feature resource which includes only its unique identifiers (id, key). */ + FeatureMeta: { /** - * Issue grant after reset priority - * Format: uint8 - * @description Defines the grant priority for the default grant. - * @default 1 + * Feature Unique Identifier + * @description Unique identifier of a feature. + * @example 01ARZ3NDEKTSV4RRFFQ69G5FAV */ - issueAfterResetPriority: number + id: string /** - * Preserve overage at reset - * @description If true, the overage is preserved at reset. If false, the usage is reset to 0. - * @default false + * Feature Key + * @description The key is an immutable unique identifier of the feature used throughout the API, + * for example when interacting with a subject's entitlements. + * @example gpt4_tokens */ - preserveOverageAtReset: boolean + key: string } /** - * @description Order by options for entitlements. + * @description Order by options for features. * @enum {string} */ - EntitlementOrderBy: 'createdAt' | 'updatedAt' + FeatureOrderBy: 'id' | 'createdAt' | 'updatedAt' /** @description Paginated response */ - EntitlementPaginatedResponse: { + FeaturePaginatedResponse: { /** * @description The items in the current page. * @example 500 @@ -4022,212 +3601,332 @@ export interface components { */ pageSize: number /** @description The items in the current page. */ - items: components['schemas']['Entitlement'][] + items: components['schemas']['Feature'][] } - /** @description A static entitlement. */ - EntitlementStatic: { + /** @description Flat price. */ + FlatPrice: { /** @enum {string} */ - type: 'static' + type: 'flat' + /** @description The amount of the flat price. */ + amount: components['schemas']['Numeric'] + } + /** @description Flat price with payment term. */ + FlatPriceWithPaymentTerm: { /** - * Format: json - * @description The JSON parsable config of the entitlement. This value is also returned when checking entitlement access and it is useful for configuring fine-grained access settings to the feature, implemented in your own system. Has to be an object. - * @example { "integrations": ["github"] } + * @description discriminator enum property added by openapi-typescript + * @enum {string} */ - config: string + type: 'flat' + /** @description The amount of the flat price. */ + amount: components['schemas']['Numeric'] /** - * Creation Time - * Format: date-time - * @description Timestamp of when the resource was created. - * @example 2024-01-01T01:01:01.001Z + * @description The payment term of the flat price. + * Defaults to in advance. + * @default in_advance */ - readonly createdAt: string + paymentTerm: components['schemas']['PricePaymentTerm'] + } + /** @description The server understood the request but refuses to authorize it. */ + ForbiddenProblemResponse: components['schemas']['UnexpectedProblemResponse'] + /** @description The server, while acting as a gateway or proxy, did not receive a timely response from an upstream server it needed to access in order to complete the request. */ + GatewayTimeoutProblemResponse: components['schemas']['UnexpectedProblemResponse'] + /** @description A segment of the grant burn down history. + * + * A given segment represents the usage of a grant between events that changed either the grant burn down priority order or the usag period. */ + GrantBurnDownHistorySegment: { + /** @description The period of the segment. */ + period: components['schemas']['Period'] /** - * Last Update Time - * Format: date-time - * @description Timestamp of when the resource was last updated. - * @example 2024-01-01T01:01:01.001Z + * Format: double + * @description The total usage of the grant in the period. + * @example 100 */ - readonly updatedAt: string + readonly usage: number /** - * Deletion Time - * Format: date-time - * @description Timestamp of when the resource was permanently deleted. - * @example 2024-01-01T01:01:01.001Z + * Format: double + * @description Overuse that wasn't covered by grants. + * @example 100 */ - readonly deletedAt?: string - /** @description Additional metadata for the feature. */ - metadata?: components['schemas']['Metadata'] + readonly overage: number /** - * @description Readonly unique ULID identifier. - * @example 01ARZ3NDEKTSV4RRFFQ69G5FAV + * Format: double + * @description entitlement balance at the start of the period. + * @example 100 */ - readonly id: string + readonly balanceAtStart: number /** - * @description The identifier key unique to the subject - * @example customer-1 + * @description The balance breakdown of each active grant at the start of the period: GrantID: Balance + * @example { + * "01G65Z755AFWAKHE12NY0CQ9FH": 100 + * } */ - subjectKey: string + readonly grantBalancesAtStart: { + [key: string]: number + } /** - * @description The feature the subject is entitled to use. - * @example example-feature-key + * Format: double + * @description The entitlement balance at the end of the period. + * @example 100 */ - featureKey: string + readonly balanceAtEnd: number /** - * @description The feature the subject is entitled to use. - * @example 01ARZ3NDEKTSV4RRFFQ69G5FAV + * @description The balance breakdown of each active grant at the end of the period: GrantID: Balance + * @example { + * "01G65Z755AFWAKHE12NY0CQ9FH": 100 + * } */ - featureId: string - /** @description The current usage period. */ - currentUsagePeriod?: components['schemas']['Period'] - /** @description The defined usage period of the entitlement */ - usagePeriod?: components['schemas']['RecurringPeriod'] + readonly grantBalancesAtEnd: { + [key: string]: number + } + /** @description Which grants were actually burnt down in the period and by what amount. */ + readonly grantUsages: components['schemas']['GrantUsageRecord'][] } - /** @description Create inputs for static entitlement */ - EntitlementStaticCreateInputs: { + /** + * @description Order by options for grants. + * @enum {string} + */ + GrantOrderBy: 'id' | 'createdAt' | 'updatedAt' + /** @description Paginated response */ + GrantPaginatedResponse: { /** - * @description The feature the subject is entitled to use. - * Either featureKey or featureId is required. - * @example example-feature-key + * @description The items in the current page. + * @example 500 */ - featureKey?: string + totalCount: number /** - * @description The feature the subject is entitled to use. - * Either featureKey or featureId is required. - * @example 01ARZ3NDEKTSV4RRFFQ69G5FAV + * @description The items in the current page. + * @example 1 */ - featureId?: string - /** @description Additional metadata for the feature. */ - metadata?: components['schemas']['Metadata'] - /** @description The usage period associated with the entitlement. */ - usagePeriod?: components['schemas']['RecurringPeriodCreateInput'] - /** @enum {string} */ - type: 'static' + page: number /** - * Format: json - * @description The JSON parsable config of the entitlement. This value is also returned when checking entitlement access and it is useful for configuring fine-grained access settings to the feature, implemented in your own system. Has to be an object. - * @example { "integrations": ["github"] } + * @description The items in the current page. + * @example 100 */ - config: string + pageSize: number + /** @description The items in the current page. */ + items: components['schemas']['EntitlementGrant'][] } - /** - * @description Type of the entitlement. - * @enum {string} - */ - EntitlementType: 'metered' | 'boolean' | 'static' - /** @description Entitlements are the core of OpenMeter access management. They define access to features for subjects. Entitlements can be metered, boolean, or static. */ - EntitlementValue: { + /** @description Usage Record */ + GrantUsageRecord: { /** - * @description Whether the subject has access to the feature. Shared accross all entitlement types. - * @example true + * @description The id of the grant + * @example 01G65Z755AFWAKHE12NY0CQ9FH */ - readonly hasAccess: boolean + grantId: string /** * Format: double - * @description Only available for metered entitlements. Metered entitlements are built around a balance calculation where feature usage is deducted from the issued grants. Balance represents the remaining balance of the entitlement, it's value never turns negative. + * @description The usage in the period * @example 100 */ - readonly balance?: number + usage: number + } + /** @description The body of the events request. + * Either a single event or a batch of events. */ + IngestEventsBody: + | components['schemas']['Event'] + | components['schemas']['Event'][] + /** + * @description An ingested event with optional validation error. + * @example { + * "event": { + * "id": "5c10fade-1c9e-4d6c-8275-c52c36731d3c", + * "source": "service-name", + * "specversion": "1.0", + * "type": "prompt", + * "subject": "customer-id", + * "time": "2023-01-01T01:01:01.001Z" + * }, + * "ingestedAt": "2023-01-01T01:01:01.001Z", + * "storedAt": "2023-01-01T01:01:02.001Z" + * } + */ + IngestedEvent: { + event: components['schemas']['Event'] + /** @description The validation error if the event failed validation. */ + validationError?: string /** - * Format: double - * @description Only available for metered entitlements. Returns the total feature usage in the current period. - * @example 50 + * Format: date-time + * @description The date and time the event was ingested. + * @example 2023-01-01T01:01:01.001Z */ - readonly usage?: number + ingestedAt: string /** - * Format: double - * @description Only available for metered entitlements. Overage represents the usage that wasn't covered by grants, e.g. if the subject had a total feature usage of 100 in the period but they were only granted 80, there would be 20 overage. - * @example 0 + * Format: date-time + * @description The date and time the event was stored. + * @example 2023-01-01T01:01:01.001Z */ - readonly overage?: number + storedAt: string + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + InternalServerErrorProblemResponse: components['schemas']['UnexpectedProblemResponse'] + /** @description Invoice represents an invoice in the system. */ + Invoice: { /** - * @description Only available for static entitlements. The JSON parsable config of the entitlement. - * @example { key: "value" } + * ID + * @description A unique identifier for the resource. + * @example 01G65Z755AFWAKHE12NY0CQ9FH */ - readonly config?: string - } - /** - * @description CloudEvents Specification JSON Schema - * - * Optional properties are nullable according to the CloudEvents specification: - * OPTIONAL not omitted attributes MAY be represented as a null JSON value. - * @example { - * "id": "5c10fade-1c9e-4d6c-8275-c52c36731d3c", - * "source": "service-name", - * "specversion": "1.0", - * "type": "prompt", - * "subject": "customer-id", - * "time": "2023-01-01T01:01:01.001Z" - * } - */ - Event: { + readonly id: string /** - * @description Identifies the event. - * @example 5c10fade-1c9e-4d6c-8275-c52c36731d3c + * Description + * @description Optional description of the resource. Maximum 1024 characters. */ - id: string + description?: string /** - * Format: uri-reference - * @description Identifies the context in which an event happened. - * @example service-name + * Metadata + * @description Additional metadata for the resource. */ - source: string + metadata?: components['schemas']['Metadata'] | null /** - * @description The version of the CloudEvents specification which the event uses. - * @default 1.0 - * @example 1.0 + * Creation Time + * Format: date-time + * @description Timestamp of when the resource was created. + * @example 2024-01-01T01:01:01.001Z */ - specversion: string + readonly createdAt: string + /** + * Last Update Time + * Format: date-time + * @description Timestamp of when the resource was last updated. + * @example 2024-01-01T01:01:01.001Z + */ + readonly updatedAt: string /** - * @description Contains a value describing the type of event related to the originating occurrence. - * @example com.example.someevent + * Deletion Time + * Format: date-time + * @description Timestamp of when the resource was permanently deleted. + * @example 2024-01-01T01:01:01.001Z */ - type: string + readonly deletedAt?: string + /** @description Type of the invoice. + * + * The type of invoice determines the purpose of the invoice and how it should be handled. + * + * Supported types: + * - standard: A regular commercial invoice document between a supplier and customer. + * - credit_note: Reflects a refund either partial or complete of the preceding document. A credit note effectively *extends* the previous document. */ + readonly type: components['schemas']['InvoiceType'] + /** @description The taxable entity supplying the goods or services. */ + supplier: components['schemas']['BillingParty'] + /** @description Legal entity receiving the goods or services. */ + customer: components['schemas']['BillingParty'] + /** @description Number specifies the human readable key used to reference this Invoice. + * + * The number only gets populated after the invoice had been issued. + * + * Please note that the number is (depending on the upstream settings) either unique for the + * whole organization or unique for the customer, or in multi (stripe) account setups unique for the + * account. */ + readonly number?: components['schemas']['InvoiceNumber'] + /** @description Currency for all invoice line items. + * + * Multi currency invoices are not supported yet. */ + currency: components['schemas']['CurrencyCode'] + /** @description Key information regarding previous invoices and potentially details as to why they were corrected. */ + readonly preceding?: components['schemas']['InvoiceDocumentRef'][] + /** @description Summary of all the invoice totals, including taxes (calculated). */ + readonly totals: components['schemas']['InvoiceTotals'] + /** @description The status of the invoice. + * + * This field only conatins a simplified status, for more detailed information use the statusDetails field. */ + readonly status: components['schemas']['InvoiceStatus'] + /** @description The details of the current invoice status. */ + readonly statusDetails: components['schemas']['InvoiceStatusDetails'] /** - * @description Content type of the CloudEvents data value. Only the value "application/json" is allowed over HTTP. - * @example application/json - * @enum {string|null} + * Format: date-time + * @description The time the invoice was issued. + * + * Depending on the status of the invoice this can mean multiple things: + * - draft, gathering: The time the invoice will be issued based on the workflow settings. + * - issued: The time the invoice was issued. + * @example 2023-01-01T01:01:01.001Z */ - datacontenttype?: 'application/json' | null + readonly issuedAt?: string /** - * Format: uri - * @description Identifies the schema that data adheres to. + * Format: date-time + * @description The time until the invoice is in draft status. + * + * On draft invoice creation it is calculated from the workflow settings. + * + * If manual approval is required, the draftUntil time is set. + * @example 2023-01-01T01:01:01.001Z */ - dataschema?: string | null + draftUntil?: string /** - * @description Describes the subject of the event in the context of the event producer (identified by source). - * @example customer-id + * Format: date-time + * @description Due time of the fulfillment of the invoice (if available). + * @example 2023-01-01T01:01:01.001Z */ - subject: string + readonly dueAt?: string + /** @description The period the invoice covers. If the invoice has no line items, it's not set. */ + period?: components['schemas']['Period'] /** * Format: date-time - * @description Timestamp of when the occurrence happened. Must adhere to RFC 3339. + * @description The time the invoice was voided. + * + * If the invoice was voided, this field will be set to the time the invoice was voided. * @example 2023-01-01T01:01:01.001Z */ - time?: string | null - /** @description The event payload. - * Optional, if present it must be a JSON object. */ - data?: { - [key: string]: unknown - } | null + readonly voidedAt?: string + /** @description The workflow associated with the invoice. + * + * It is always a snapshot of the workflow settings at the time of invoice creation. The + * field is optional as it should be explicitly requested with expand options. */ + workflow?: components['schemas']['InvoiceWorkflowSettings'] + /** @description List of invoice lines representing each of the items sold to the customer. */ + readonly lines?: components['schemas']['InvoiceLine'][] + /** @description Discounts or allowances applied to the complete invoice. */ + discounts?: components['schemas']['Discount'][] + /** @description Information on when, how, and to whom the invoice should be paid. */ + payment?: components['schemas']['InvoicePaymentTerms'] + /** @description Validation issues reported by the invoice workflow. */ + readonly validationIssues?: components['schemas']['ValidationIssue'][] + /** @description External IDs of the invoice in other apps such as Stripe. */ + readonly externalIDs?: components['schemas']['InvoiceAppExternalIDs'] } /** - * @description The expiration duration enum + * @description InvoiceAction represents the actions that can be performed on an invoice. * @enum {string} */ - ExpirationDuration: 'HOUR' | 'DAY' | 'WEEK' | 'MONTH' | 'YEAR' - /** @description The grant expiration definition */ - ExpirationPeriod: { - /** @description The unit of time for the expiration period. */ - duration: components['schemas']['ExpirationDuration'] + InvoiceAction: 'advance' | 'approve' | 'delete' | 'retry' | 'void' + /** @description InvoiceAppExternalIDs contains the external IDs of the invoice in other apps such as Stripe. */ + InvoiceAppExternalIDs: { + /** @description The external ID of the invoice in the invoicing app if available. */ + readonly Invoicing?: string + /** @description The external ID of the invoice in the tax app if available. */ + readonly Tax?: string + /** @description The external ID of the invoice in the payment app if available. */ + readonly Payment?: string + } + /** @description InvoiceDocumentRef is used to describe a reference to an existing document (invoice). */ + InvoiceDocumentRef: components['schemas']['CreditNoteOriginalInvoiceRef'] + /** + * @description InvoiceDocumentRefType defines the type of document that is being referenced. + * @enum {string} + */ + InvoiceDocumentRefType: 'credit_node_original_invoice' + /** + * @description InvoiceExpand specifies the parts of the invoice to expand in the list output. + * @enum {string} + */ + InvoiceExpand: '*' | 'lines' | 'preceding' | 'workflow.apps' + /** @description InvoiceFlatFeeLine represents a line item that is sold to the customer as a manually added fee. */ + InvoiceFlatFeeLine: { /** - * @description The number of time units in the expiration period. - * @example 12 + * Display name + * @description Human-readable name for the resource. Between 1 and 256 characters. */ - count: number - } - /** @description Represents a feature that can be enabled or disabled for a plan. - * Used both for product catalog and entitlements. */ - Feature: { + name: string + /** + * Description + * @description Optional description of the resource. Maximum 1024 characters. + */ + description?: string + /** + * Metadata + * @description Additional metadata for the resource. + */ + metadata?: components['schemas']['Metadata'] | null /** * Creation Time * Format: date-time @@ -4250,113 +3949,265 @@ export interface components { */ readonly deletedAt?: string /** - * Archival Time + * @description ULID (Universally Unique Lexicographically Sortable Identifier). + * @example 01G65Z755AFWAKHE12NY0CQ9FH + */ + id: string + /** @description Status of the line. + * + * External calls always create valid lines, other line types are managed by the + * billing engine of OpenMeter. */ + readonly status: components['schemas']['InvoiceLineStatus'] + /** @description Discounts detailes applied to this line. + * + * New discounts can be added via the invoice's discounts API, to facilitate + * discounts that are affecting multiple lines. */ + readonly discounts?: components['schemas']['InvoiceLineDiscount'][] + /** @description Charges applied to this line. (like minimum spend) + * + * New charges can be added via the invoice's charges API, to facilitate + * charges that are affecting multiple lines. */ + readonly charges?: components['schemas']['BillingLineCharge'][] + /** @description The invoice this item belongs to. */ + invoice?: components['schemas']['InvoiceReference'] + /** @description The currency of this line. */ + currency: components['schemas']['CurrencyCode'] + /** @description Taxes applied to the invoice totals. */ + readonly taxes?: components['schemas']['InvoiceLineTaxItem'][] + /** @description Tax config specify the tax configuration for this line. */ + taxConfig?: components['schemas']['TaxConfig'] + /** @description The lines detailing the item or service sold. */ + readonly children?: components['schemas']['InvoiceLine'][] + /** @description Totals for this line. */ + readonly totals: components['schemas']['InvoiceTotals'] + /** @description Period of the line item applies to for revenue recognition pruposes. + * + * Billing always treats periods as start being inclusive and end being exclusive. */ + period: components['schemas']['Period'] + /** * Format: date-time - * @description Timestamp of when the resource was archived. + * @description The time this line item should be invoiced. * @example 2023-01-01T01:01:01.001Z */ - readonly archivedAt?: string + invoiceAt: string + /** @description External IDs of the invoice in other apps such as Stripe. */ + readonly externalIDs?: components['schemas']['InvoiceLineAppExternalIDs'] + /** @enum {string} */ + type: 'flat_fee' + /** @description Price of the item being sold. */ + perUnitAmount: components['schemas']['Numeric'] /** - * The unique key of the feature - * @description A key is a unique string that is used to identify a resource. + * @description Payment term of the line. + * @default in_advance + */ + paymentTerm: components['schemas']['PricePaymentTerm'] + /** @description Quantity of the item being sold. */ + quantity: components['schemas']['Numeric'] + } + /** @description Resource update operation model. */ + InvoiceFlatFeeLineReplaceUpdate: { + /** + * Display name + * @description Human-readable name for the resource. Between 1 and 256 characters. */ - key: string - /** The human-readable name of the feature */ name: string /** - * Optional metadata - * @example { - * "key": "value" - * } + * Description + * @description Optional description of the resource. Maximum 1024 characters. */ - metadata?: components['schemas']['Metadata'] + description?: string /** - * Meter slug - * @description A key is a unique string that is used to identify a resource. - * @example tokens_total + * Metadata + * @description Additional metadata for the resource. */ - meterSlug?: string + metadata?: components['schemas']['Metadata'] | null + /** @description Tax config specify the tax configuration for this line. */ + taxConfig?: components['schemas']['TaxConfig'] + /** @description Period of the line item applies to for revenue recognition pruposes. + * + * Billing always treats periods as start being inclusive and end being exclusive. */ + period: components['schemas']['Period'] /** - * Meter group by filters - * @description Optional meter group by filters. - * Useful if the meter scope is broader than what feature tracks. - * Example scenario would be a meter tracking all token use with groupBy fields for the model, - * then the feature could filter for model=gpt-4. - * @example { - * "model": "gpt-4", - * "type": "input" - * } + * Format: date-time + * @description The time this line item should be invoiced. + * @example 2023-01-01T01:01:01.001Z */ - meterGroupByFilters?: { - [key: string]: string - } + invoiceAt: string + /** @enum {string} */ + type: 'flat_fee' + /** @description Price of the item being sold. */ + perUnitAmount: components['schemas']['Numeric'] /** - * @description Readonly unique ULID identifier. - * @example 01ARZ3NDEKTSV4RRFFQ69G5FAV + * @description Payment term of the line. + * @default in_advance */ - readonly id: string + paymentTerm: components['schemas']['PricePaymentTerm'] + /** @description Quantity of the item being sold. */ + quantity: components['schemas']['Numeric'] } - /** @description Represents a feature that can be enabled or disabled for a plan. - * Used both for product catalog and entitlements. */ - FeatureCreateInputs: { + /** @description InvoiceFlatFeePendingLineCreate represents the create model for an invoice line that is sold to the customer as a manually added fee. */ + InvoiceFlatFeePendingLineCreate: { /** - * The unique key of the feature - * @description A key is a unique string that is used to identify a resource. + * Display name + * @description Human-readable name for the resource. Between 1 and 256 characters. */ - key: string - /** The human-readable name of the feature */ name: string /** - * Optional metadata - * @example { - * "key": "value" - * } + * Description + * @description Optional description of the resource. Maximum 1024 characters. */ - metadata?: components['schemas']['Metadata'] + description?: string /** - * Meter slug - * @description A key is a unique string that is used to identify a resource. - * @example tokens_total + * Metadata + * @description Additional metadata for the resource. */ - meterSlug?: string + metadata?: components['schemas']['Metadata'] | null + /** @description The currency of this line. */ + currency: components['schemas']['CurrencyCode'] + /** @description Tax config specify the tax configuration for this line. */ + taxConfig?: components['schemas']['TaxConfig'] + /** @description Period of the line item applies to for revenue recognition pruposes. + * + * Billing always treats periods as start being inclusive and end being exclusive. */ + period: components['schemas']['Period'] /** - * Meter group by filters - * @description Optional meter group by filters. - * Useful if the meter scope is broader than what feature tracks. - * Example scenario would be a meter tracking all token use with groupBy fields for the model, - * then the feature could filter for model=gpt-4. - * @example { - * "model": "gpt-4", - * "type": "input" - * } + * Format: date-time + * @description The time this line item should be invoiced. + * @example 2023-01-01T01:01:01.001Z */ - meterGroupByFilters?: { - [key: string]: string - } + invoiceAt: string + /** @enum {string} */ + type: 'flat_fee' + /** @description Price of the item being sold. */ + perUnitAmount: components['schemas']['Numeric'] + /** + * @description Payment term of the line. + * @default in_advance + */ + paymentTerm: components['schemas']['PricePaymentTerm'] + /** @description Quantity of the item being sold. */ + quantity: components['schemas']['Numeric'] + /** + * @description The customer this line item belongs to. + * @example 01G65Z755AFWAKHE12NY0CQ9FH + */ + customerId: string } - /** @description Limited representation of a feature resource which includes only its unique identifiers (id, key). */ - FeatureMeta: { + /** + * InvoiceGenericDocumentRef is used to describe an existing document or a specific part of it's contents. + * @description Omitted fields: + * period: Tax period in which the referred document had an effect required by some tax regimes and formats. + * stamps: Seals of approval from other organisations that may need to be listed. + * ext: Extensions for additional codes that may be required. + */ + InvoiceGenericDocumentRef: { + /** @description Type of the document referenced. */ + readonly type: components['schemas']['InvoiceDocumentRefType'] + /** @description Human readable description on why this reference is here or needs to be used. */ + readonly reason?: string + /** @description Additional details about the document. */ + readonly description?: string + } + /** @description BillingInvoiceLine represents a line item that is sold to the customer based on a specific (unit) price. */ + InvoiceLine: + | components['schemas']['InvoiceUsageBasedLine'] + | components['schemas']['InvoiceFlatFeeLine'] + /** @description InvoiceLineAppExternalIDs contains the external IDs of the invoice in other apps such as Stripe. */ + InvoiceLineAppExternalIDs: { + /** @description The external ID of the invoice in the invoicing app if available. */ + readonly Invoicing?: string + /** @description The external ID of the invoice in the tax app if available. */ + readonly Tax?: string + } + /** @description InvoiceLineDiscount represents an amount deducted from the line, and will be applied before taxes. */ + InvoiceLineDiscount: { /** - * Feature Unique Identifier - * @description Unique identifier of a feature. - * @example 01ARZ3NDEKTSV4RRFFQ69G5FAV + * Creation Time + * Format: date-time + * @description Timestamp of when the resource was created. + * @example 2024-01-01T01:01:01.001Z + */ + readonly createdAt: string + /** + * Last Update Time + * Format: date-time + * @description Timestamp of when the resource was last updated. + * @example 2024-01-01T01:01:01.001Z + */ + readonly updatedAt: string + /** + * Deletion Time + * Format: date-time + * @description Timestamp of when the resource was permanently deleted. + * @example 2024-01-01T01:01:01.001Z */ - id: string + readonly deletedAt?: string /** - * Feature Key - * @description The key is an immutable unique identifier of the feature used throughout the API, - * for example when interacting with a subject's entitlements. - * @example gpt4_tokens + * @description ID of the charge or discount. + * @example 01G65Z755AFWAKHE12NY0CQ9FH */ - key: string + readonly id: string + /** @description Percentage if fixed amount not applied */ + percent?: components['schemas']['Percentage'] + /** @description Fixed discount amount to apply (calculated if percent present). */ + amount: components['schemas']['Numeric'] + /** @description Reason code. */ + code?: string + /** @description Text description as to why the discount was applied. */ + description?: string } + /** @description InvoiceLineReplaceUpdate represents the update model for an invoice line. */ + InvoiceLineReplaceUpdate: + | components['schemas']['InvoiceUsageBasedLineReplaceUpdate'] + | components['schemas']['InvoiceFlatFeeLineReplaceUpdate'] /** - * @description Order by options for features. + * @description Line status specifies the status of the line. * @enum {string} */ - FeatureOrderBy: 'id' | 'createdAt' | 'updatedAt' + InvoiceLineStatus: 'valid' | 'detail' | 'split' + /** + * @description InvoiceLineTaxBehavior details how the tax item is applied to the base amount. + * + * Inclusive means the tax is included in the base amount. + * Exclusive means the tax is added to the base amount. + * @enum {string} + */ + InvoiceLineTaxBehavior: 'inclusive' | 'exclusive' + /** @description TaxConfig stores the configuration for a tax line relative to an invoice line. */ + InvoiceLineTaxItem: { + /** @description Tax provider configuration. */ + readonly config?: components['schemas']['TaxConfig'] + /** @description Percent defines the percentage set manually or determined from + * the rate key (calculated if rate present). A nil percent implies that + * this tax combo is **exempt** from tax.") */ + readonly percent?: components['schemas']['Percentage'] + /** @description Some countries require an additional surcharge (calculated if rate present). */ + readonly surcharge?: components['schemas']['Numeric'] + /** @description Is the tax item inclusive or exclusive of the base amount. */ + readonly behavior?: components['schemas']['InvoiceLineTaxBehavior'] + } + /** + * @description InvoiceNumber is a unique identifier for the invoice, generated by the + * invoicing app. + * + * The uniqueness depends on a lot of factors: + * - app setting (unique per app or unique per customer) + * - multiple app scenarios (multiple apps generating invoices with the same prefix) + * @example INV-2024-01-01-01 + */ + InvoiceNumber: string + /** + * @description InvoiceOrderBy specifies the ordering options for invoice listing. + * @enum {string} + */ + InvoiceOrderBy: + | 'customer.name' + | 'issuedAt' + | 'status' + | 'createdAt' + | 'updatedAt' /** @description Paginated response */ - FeaturePaginatedResponse: { + InvoicePaginatedResponse: { /** * @description The items in the current page. * @example 500 @@ -4373,188 +4224,282 @@ export interface components { */ pageSize: number /** @description The items in the current page. */ - items: components['schemas']['Feature'][] - } - /** @description Flat price. */ - FlatPrice: { - /** @enum {string} */ - type: 'flat' - /** @description The amount of the flat price. */ - amount: components['schemas']['Numeric'] + items: components['schemas']['Invoice'][] } - /** @description Flat price with payment term. */ - FlatPriceWithPaymentTerm: { + /** @description Payment contains details as to how the invoice should be paid. */ + InvoicePaymentTerms: { + /** @description The terms of payment for the invoice. */ + terms?: components['schemas']['PaymentTerms'] + } + /** @description InvoiceLineCreate represents the create model for an invoice line. */ + InvoicePendingLineCreate: + | components['schemas']['InvoiceUsageBasedPendingLineCreate'] + | components['schemas']['InvoiceFlatFeePendingLineCreate'] + /** @description BillingInvoiceActionInput is the input for creating an invoice. + * + * Invoice creation is always based on already pending line items created by the billingCreateLineByCustomer + * operation. Empty invoices are not allowed. */ + InvoicePendingLinesActionInput: { + /** @description The pending line items to include in the invoice, if not provided: + * - all line items that have invoice_at < asOf will be included + * - all usage based line items will be included up to asOf, new usage-based line items will be staged for the rest + * of the billing cycle */ + includePendingLines?: string[] /** - * @description discriminator enum property added by openapi-typescript - * @enum {string} + * Format: date-time + * @description The time as of which the invoice is created. + * + * If not provided, the current time is used. + * @example 2023-01-01T01:01:01.001Z */ - type: 'flat' - /** @description The amount of the flat price. */ - amount: components['schemas']['Numeric'] + asOf?: string /** - * @description The payment term of the flat price. - * Defaults to in advance. - * @default in_advance + * @description The customer ID for which to create the invoice. + * @example 01G65Z755AFWAKHE12NY0CQ9FH */ - paymentTerm: components['schemas']['PricePaymentTerm'] + customerId: string } - /** @description The server understood the request but refuses to authorize it. */ - ForbiddenProblemResponse: components['schemas']['UnexpectedProblemResponse'] - /** @description The server, while acting as a gateway or proxy, did not receive a timely response from an upstream server it needed to access in order to complete the request. */ - GatewayTimeoutProblemResponse: components['schemas']['UnexpectedProblemResponse'] - /** @description A segment of the grant burn down history. - * - * A given segment represents the usage of a grant between events that changed either the grant burn down priority order or the usag period. */ - GrantBurnDownHistorySegment: { - /** @description The period of the segment. */ - period: components['schemas']['Period'] + /** @description Reference to an invoice. */ + InvoiceReference: { /** - * Format: double - * @description The total usage of the grant in the period. - * @example 100 + * @description The ID of the invoice. + * @example 01G65Z755AFWAKHE12NY0CQ9FH */ - readonly usage: number + readonly id: string + /** @description The number of the invoice. */ + readonly number?: components['schemas']['InvoiceNumber'] + } + /** + * @description InvoiceStatus describes the status of an invoice. + * @enum {string} + */ + InvoiceStatus: 'gathering' | 'draft' | 'issuing' | 'issued' + /** @description InvoiceStatusDetails represents the details of the invoice status. + * + * API users are encouraged to rely on the immutable/failed/avaliableActions fields to determine + * the next steps of the invoice instead of the extendedStatus field. */ + InvoiceStatusDetails: { + /** @description Is the invoice editable? */ + readonly immutable: boolean + /** @description Is the invoice in a failed state? */ + readonly failed: boolean + /** @description Extended status information for the invoice. */ + readonly extendedStatus: string + /** @description The actions that can be performed on the invoice. */ + availableActions: components['schemas']['InvoiceAction'][] + } + /** @description Totals contains the summaries of all calculations for the invoice. */ + InvoiceTotals: { + /** @description The total value of the line before taxes, discounts and commitments. */ + readonly amount: components['schemas']['Numeric'] + /** @description The amount of value of the line that are due to additional charges. */ + readonly chargesTotal: components['schemas']['Numeric'] + /** @description The amount of value of the line that are due to discounts. */ + readonly discountsTotal: components['schemas']['Numeric'] + /** @description The total amount of taxes that are included in the line. */ + readonly taxesInclusiveTotal: components['schemas']['Numeric'] + /** @description The total amount of taxes that are added on top of amount from the line. */ + readonly taxesExclusiveTotal: components['schemas']['Numeric'] + /** @description The total amount of taxes for this line. */ + readonly taxesTotal: components['schemas']['Numeric'] + /** @description The total amount value of the line after taxes, discounts and commitments. */ + readonly total: components['schemas']['Numeric'] + } + /** + * @description InvoiceType represents the type of invoice. + * + * The type of invoice determines the purpose of the invoice and how it should be handled. + * @enum {string} + */ + InvoiceType: 'standard' | 'credit_note' + /** @description InvoiceUsageBasedLine represents a line item that is sold to the customer based on usage. */ + InvoiceUsageBasedLine: { /** - * Format: double - * @description Overuse that wasn't covered by grants. - * @example 100 + * Display name + * @description Human-readable name for the resource. Between 1 and 256 characters. */ - readonly overage: number + name: string /** - * Format: double - * @description entitlement balance at the start of the period. - * @example 100 + * Description + * @description Optional description of the resource. Maximum 1024 characters. */ - readonly balanceAtStart: number + description?: string /** - * @description The balance breakdown of each active grant at the start of the period: GrantID: Balance - * @example { - * "01G65Z755AFWAKHE12NY0CQ9FH": 100 - * } + * Metadata + * @description Additional metadata for the resource. */ - readonly grantBalancesAtStart: { - [key: string]: number - } + metadata?: components['schemas']['Metadata'] | null /** - * Format: double - * @description The entitlement balance at the end of the period. - * @example 100 + * Creation Time + * Format: date-time + * @description Timestamp of when the resource was created. + * @example 2024-01-01T01:01:01.001Z */ - readonly balanceAtEnd: number + readonly createdAt: string /** - * @description The balance breakdown of each active grant at the end of the period: GrantID: Balance - * @example { - * "01G65Z755AFWAKHE12NY0CQ9FH": 100 - * } + * Last Update Time + * Format: date-time + * @description Timestamp of when the resource was last updated. + * @example 2024-01-01T01:01:01.001Z */ - readonly grantBalancesAtEnd: { - [key: string]: number - } - /** @description Which grants were actually burnt down in the period and by what amount. */ - readonly grantUsages: components['schemas']['GrantUsageRecord'][] - } - /** - * @description Order by options for grants. - * @enum {string} - */ - GrantOrderBy: 'id' | 'createdAt' | 'updatedAt' - /** @description Paginated response */ - GrantPaginatedResponse: { + readonly updatedAt: string /** - * @description The items in the current page. - * @example 500 + * Deletion Time + * Format: date-time + * @description Timestamp of when the resource was permanently deleted. + * @example 2024-01-01T01:01:01.001Z */ - totalCount: number + readonly deletedAt?: string /** - * @description The items in the current page. - * @example 1 + * @description ULID (Universally Unique Lexicographically Sortable Identifier). + * @example 01G65Z755AFWAKHE12NY0CQ9FH */ - page: number + id: string + /** @description Status of the line. + * + * External calls always create valid lines, other line types are managed by the + * billing engine of OpenMeter. */ + readonly status: components['schemas']['InvoiceLineStatus'] + /** @description Discounts detailes applied to this line. + * + * New discounts can be added via the invoice's discounts API, to facilitate + * discounts that are affecting multiple lines. */ + readonly discounts?: components['schemas']['InvoiceLineDiscount'][] + /** @description Charges applied to this line. (like minimum spend) + * + * New charges can be added via the invoice's charges API, to facilitate + * charges that are affecting multiple lines. */ + readonly charges?: components['schemas']['BillingLineCharge'][] + /** @description The invoice this item belongs to. */ + invoice?: components['schemas']['InvoiceReference'] + /** @description The currency of this line. */ + currency: components['schemas']['CurrencyCode'] + /** @description Taxes applied to the invoice totals. */ + readonly taxes?: components['schemas']['InvoiceLineTaxItem'][] + /** @description Tax config specify the tax configuration for this line. */ + taxConfig?: components['schemas']['TaxConfig'] + /** @description The lines detailing the item or service sold. */ + readonly children?: components['schemas']['InvoiceLine'][] + /** @description Totals for this line. */ + readonly totals: components['schemas']['InvoiceTotals'] + /** @description Period of the line item applies to for revenue recognition pruposes. + * + * Billing always treats periods as start being inclusive and end being exclusive. */ + period: components['schemas']['Period'] /** - * @description The items in the current page. - * @example 100 + * Format: date-time + * @description The time this line item should be invoiced. + * @example 2023-01-01T01:01:01.001Z */ - pageSize: number - /** @description The items in the current page. */ - items: components['schemas']['EntitlementGrant'][] + invoiceAt: string + /** @description External IDs of the invoice in other apps such as Stripe. */ + readonly externalIDs?: components['schemas']['InvoiceLineAppExternalIDs'] + /** @enum {string} */ + type: 'usage_based' + price: components['schemas']['RateCardUsageBasedPrice'] + /** @description The feature that the usage is based on. */ + featureKey: string + /** @description The quantity of the item being sold. */ + readonly quantity?: components['schemas']['Numeric'] + /** @description The quantity of the item used in before this line's period. + * + * It is non-zero in case of progressive billing, when this shows how much of the usage was already billed. */ + readonly preLinePeriodQuantity?: components['schemas']['Numeric'] } - /** @description Usage Record */ - GrantUsageRecord: { + /** @description Resource update operation model. */ + InvoiceUsageBasedLineReplaceUpdate: { /** - * @description The id of the grant - * @example 01G65Z755AFWAKHE12NY0CQ9FH + * Display name + * @description Human-readable name for the resource. Between 1 and 256 characters. */ - grantId: string + name: string /** - * Format: double - * @description The usage in the period - * @example 100 + * Description + * @description Optional description of the resource. Maximum 1024 characters. */ - usage: number - } - /** @description The body of the events request. - * Either a single event or a batch of events. */ - IngestEventsBody: - | components['schemas']['Event'] - | components['schemas']['Event'][] - /** - * @description An ingested event with optional validation error. - * @example { - * "event": { - * "id": "5c10fade-1c9e-4d6c-8275-c52c36731d3c", - * "source": "service-name", - * "specversion": "1.0", - * "type": "prompt", - * "subject": "customer-id", - * "time": "2023-01-01T01:01:01.001Z" - * }, - * "ingestedAt": "2023-01-01T01:01:01.001Z", - * "storedAt": "2023-01-01T01:01:02.001Z" - * } - */ - IngestedEvent: { - event: components['schemas']['Event'] - /** @description The validation error if the event failed validation. */ - validationError?: string + description?: string /** - * Format: date-time - * @description The date and time the event was ingested. - * @example 2023-01-01T01:01:01.001Z + * Metadata + * @description Additional metadata for the resource. */ - ingestedAt: string + metadata?: components['schemas']['Metadata'] | null + /** @description Tax config specify the tax configuration for this line. */ + taxConfig?: components['schemas']['TaxConfig'] + /** @description Period of the line item applies to for revenue recognition pruposes. + * + * Billing always treats periods as start being inclusive and end being exclusive. */ + period: components['schemas']['Period'] /** * Format: date-time - * @description The date and time the event was stored. + * @description The time this line item should be invoiced. * @example 2023-01-01T01:01:01.001Z */ - storedAt: string + invoiceAt: string + /** @enum {string} */ + type: 'usage_based' + price: components['schemas']['RateCardUsageBasedPrice'] } - /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ - InternalServerErrorProblemResponse: components['schemas']['UnexpectedProblemResponse'] - /** @description Paginated response */ - InvoicePaginatedResponse: { + /** @description InvoiceUsageBasedLineCreateWithCustomer represents the create model for an invoice line that is sold to the customer based on usage. */ + InvoiceUsageBasedPendingLineCreate: { /** - * @description The items in the current page. - * @example 500 + * Display name + * @description Human-readable name for the resource. Between 1 and 256 characters. */ - totalCount: number + name: string /** - * @description The items in the current page. - * @example 1 + * Description + * @description Optional description of the resource. Maximum 1024 characters. */ - page: number + description?: string /** - * @description The items in the current page. - * @example 100 + * Metadata + * @description Additional metadata for the resource. */ - pageSize: number - /** @description The items in the current page. */ - items: components['schemas']['BillingInvoice'][] + metadata?: components['schemas']['Metadata'] | null + /** @description The currency of this line. */ + currency: components['schemas']['CurrencyCode'] + /** @description Tax config specify the tax configuration for this line. */ + taxConfig?: components['schemas']['TaxConfig'] + /** @description Period of the line item applies to for revenue recognition pruposes. + * + * Billing always treats periods as start being inclusive and end being exclusive. */ + period: components['schemas']['Period'] + /** + * Format: date-time + * @description The time this line item should be invoiced. + * @example 2023-01-01T01:01:01.001Z + */ + invoiceAt: string + /** @enum {string} */ + type: 'usage_based' + price: components['schemas']['RateCardUsageBasedPrice'] + /** @description The feature that the usage is based on. */ + featureKey: string + /** + * @description The customer this line item belongs to. + * @example 01G65Z755AFWAKHE12NY0CQ9FH + */ + customerId: string } - /** @description Resource create or update operation model. */ - LinesUpdate: { - /** The line to create */ - lines?: components['schemas']['BillingInvoiceLineCreateItem'][] + /** @description InvoiceWorkflowSettings represents the workflow settings used by the invoice. + * + * This is a clone of the billing profile's workflow settings at the time of invoice creation + * with customer overrides considered. */ + InvoiceWorkflowSettings: { + /** @description The apps that will be used to orchestrate the invoice's workflow. */ + readonly apps?: components['schemas']['BillingProfileAppsOrReference'] + /** + * @description sourceBillingProfileID is the billing profile on which the workflow was based on. + * + * The profile is snapshotted on invoice creation, after which it can be altered independently + * of the profile itself. + * @example 01G65Z755AFWAKHE12NY0CQ9FH + */ + readonly sourceBillingProfileID: string + /** @description The workflow details used by this invoice. */ + readonly workflow: components['schemas']['BillingWorkflowSettings'] + /** @description Timezone of the invoice's date fields. */ + readonly timezone: string } /** @description List entitlements result */ ListEntitlementsResult: @@ -5312,6 +5257,53 @@ export interface components { | 'invalid_scope' | 'server_error' | 'temporarily_unavailable' + /** @description PaymentDueDate contains an amount that should be paid by the given date. */ + PaymentDueDate: { + /** + * Format: date-time + * @description When the payment is due. + * @example 2023-01-01T01:01:01.001Z + */ + readonly dueAt: string + /** @description Other details to take into account for the due date. */ + readonly notes?: string + /** @description How much needs to be paid by the date. */ + readonly amount: components['schemas']['Numeric'] + /** @description Percentage of the total that should be paid by the date. */ + readonly percent?: components['schemas']['Percentage'] + /** @description If different from the parent document's base currency. */ + readonly currency?: components['schemas']['CurrencyCode'] + } + /** @description PaymentTermDueDate defines the terms for payment on a specific date. */ + PaymentTermDueDate: { + /** + * @description Type of terms to be applied. + * @enum {string} + */ + type: 'due_date' + /** @description Text detail of the chosen payment terms. */ + readonly detail?: string + /** @description Description of the conditions for payment. */ + readonly notes?: string + /** @description When the payment is due. */ + readonly dueAt: components['schemas']['PaymentDueDate'][] + } + /** @description PaymentTermInstant defines the terms for payment on receipt of invoice. */ + PaymentTermInstant: { + /** + * @description Type of terms to be applied. + * @enum {string} + */ + type: 'instant' + /** @description Text detail of the chosen payment terms. */ + readonly detail?: string + /** @description Description of the conditions for payment. */ + readonly notes?: string + } + /** @description PaymentTerms defines the terms for payment. */ + PaymentTerms: + | components['schemas']['PaymentTermInstant'] + | components['schemas']['PaymentTermDueDate'] /** @description Numeric representation of a percentage */ Percentage: string /** @description A period with a start and end time. */ @@ -5623,11 +5615,23 @@ export interface components { } /** @description References an exact plan. */ PlanReference: { + /** + * @description The plan ID. + * @example 01G65Z755AFWAKHE12NY0CQ9FH + */ + id: string /** @description The plan key. */ key: string /** @description The plan version. */ version: number } + /** @description References an exact plan defaulting to the current active version. */ + PlanReferenceInput: { + /** @description The plan key. */ + key: string + /** @description The plan version. */ + version?: number + } /** @description Resource update operation model. */ PlanReplaceUpdate: { /** @@ -5659,53 +5663,29 @@ export interface components { PlanStatus: 'draft' | 'active' | 'archived' | 'scheduled' /** @description Change subscription based on plan. */ PlanSubscriptionChange: { - plan: { - /** @description A key is a unique string that is used to identify a resource. */ - key: string - version: number - } - currency: components['schemas']['CurrencyCode'] + metadata?: components['schemas']['Metadata'] + plan: components['schemas']['PlanReferenceInput'] /** * Format: date-time * @description [RFC3339](https://tools.ietf.org/html/rfc3339) formatted date-time string in UTC. * @example 2023-01-01T01:01:01.001Z */ activeFrom: string - /** @description Batch processing commands for customizing the susbcription. - * The key format is `/phases/{phaseKey}/items/{itemKey}`. - * - * Add operations insert a new member based on the creation input without altering the existing members. - * - * Remove operations remove the member from the document. */ - customizations: ( - | components['schemas']['SubscriptionEditAddItem'] - | components['schemas']['SubscriptionEditRemoveItem'] - )[] + name: string + description?: string } /** @description Create subscription based on plan. */ PlanSubscriptionCreate: { - plan: { - /** @description A key is a unique string that is used to identify a resource. */ - key: string - version: number - } - currency: components['schemas']['CurrencyCode'] + metadata?: components['schemas']['Metadata'] + plan: components['schemas']['PlanReferenceInput'] /** * Format: date-time * @description [RFC3339](https://tools.ietf.org/html/rfc3339) formatted date-time string in UTC. * @example 2023-01-01T01:01:01.001Z */ activeFrom: string - /** @description Batch processing commands for customizing the susbcription. - * The key format is `/phases/{phaseKey}/items/{itemKey}`. - * - * Add operations insert a new member based on the creation input without altering the existing members. - * - * Remove operations remove the member from the document. */ - customizations: ( - | components['schemas']['SubscriptionEditAddItem'] - | components['schemas']['SubscriptionEditRemoveItem'] - )[] + name: string + description?: string /** * @description ULID (Universally Unique Lexicographically Sortable Identifier). * @example 01G65Z755AFWAKHE12NY0CQ9FH @@ -5779,26 +5759,6 @@ export interface components { */ unitPrice: components['schemas']['UnitPrice'] | null } - /** @description Paginated response */ - ProfilePaginatedResponse: { - /** - * @description The items in the current page. - * @example 500 - */ - totalCount: number - /** - * @description The items in the current page. - * @example 1 - */ - page: number - /** - * @description The items in the current page. - * @example 100 - */ - pageSize: number - /** @description The items in the current page. */ - items: components['schemas']['BillingProfile'][] - } /** @description A rate card defines the pricing and entitlement of a feature or service. */ RateCard: | components['schemas']['RateCardFlatFee'] @@ -5870,55 +5830,6 @@ export interface components { */ price: components['schemas']['FlatPriceWithPaymentTerm'] | null } - /** @description A flat fee rate card defines a one-time purchase or a recurring fee. */ - RateCardFlatFeeUpdateItem: { - /** - * @description The type of the RateCard. (enum property replaced by openapi-typescript) - * @enum {string} - */ - type: 'flat_fee' - /** - * Display name - * @description Human-readable name for the resource. Between 1 and 256 characters. - */ - name: string - /** - * Description - * @description Optional description of the resource. Maximum 1024 characters. - */ - description?: string - /** - * Metadata - * @description Additional metadata for the resource. - */ - metadata?: components['schemas']['Metadata'] | null - /** - * Feature key - * @description The feature the customer is entitled to use. - */ - featureKey?: string - entitlementTemplate?: components['schemas']['RateCardEntitlement'] - /** - * Tax config - * @description The tax config of the rate card. - * When undefined, the tax config of the feature or the default tax config of the plan is used. - */ - taxConfig?: components['schemas']['TaxConfig'] - /** - * Billing cadence - * Format: duration - * @description The billing cadence of the rate card. - * When null it means it is a one time fee. - */ - billingCadence: string | null - /** - * Price - * @description The price of the rate card. - * When null, the feature or service is free. - * @example {} - */ - price: components['schemas']['FlatPriceWithPaymentTerm'] | null - } /** @description The entitlement template with a metered entitlement. */ RateCardMeteredEntitlement: { /** @description Additional metadata for the feature. */ @@ -5974,10 +5885,6 @@ export interface components { */ config: string } - /** @description A rate card defines the pricing and entitlement of a feature or service. */ - RateCardUpdateItem: - | components['schemas']['RateCardFlatFeeUpdateItem'] - | components['schemas']['RateCardUsageBasedUpdateItem'] /** @description A usage-based rate card defines a price based on usage. */ RateCardUsageBased: { /** @@ -6033,51 +5940,6 @@ export interface components { | components['schemas']['FlatPriceWithPaymentTerm'] | components['schemas']['UnitPriceWithCommitments'] | components['schemas']['TieredPriceWithCommitments'] - /** @description A usage-based rate card defines a price based on usage. */ - RateCardUsageBasedUpdateItem: { - /** - * @description The type of the RateCard. (enum property replaced by openapi-typescript) - * @enum {string} - */ - type: 'usage_based' - /** - * Display name - * @description Human-readable name for the resource. Between 1 and 256 characters. - */ - name: string - /** - * Description - * @description Optional description of the resource. Maximum 1024 characters. - */ - description?: string - /** - * Metadata - * @description Additional metadata for the resource. - */ - metadata?: components['schemas']['Metadata'] | null - /** - * Feature key - * @description The feature the customer is entitled to use. - */ - featureKey?: string - entitlementTemplate?: components['schemas']['RateCardEntitlement'] - /** - * Tax config - * @description The tax config of the rate card. - * When undefined, the tax config of the feature or the default tax config of the plan is used. - */ - taxConfig?: components['schemas']['TaxConfig'] - /** - * Billing cadence - * Format: duration - * @description The billing cadence of the rate card. - */ - billingCadence: string - price: Omit< - components['schemas']['RateCardUsageBasedPrice'], - 'type' - > | null - } /** * @description Recurring period with an interval and an anchor. * @example { @@ -6130,7 +5992,7 @@ export interface components { * @description The direction of the phase shift when a phase is removed. * @enum {string} */ - RemovePhaseShifting: 'Next' | 'Prev' + RemovePhaseShifting: 'next' | 'prev' /** @description Reset parameters */ ResetEntitlementUsageInput: { /** @@ -6570,13 +6432,27 @@ export interface components { * @example 2024-01-01T01:01:01.001Z */ readonly deletedAt?: string + /** + * Format: date-time + * @description The cadence start of the resource. + * @example 2023-01-01T01:01:01.001Z + */ + activeFrom: string + /** + * Format: date-time + * @description The cadence end of the resource. + * @example 2023-01-01T01:01:01.001Z + */ + activeTo?: string + /** @description The status of the subscription. */ + readonly status: components['schemas']['SubscriptionStatus'] /** * @description The customer ID of the subscription. * @example 01G65Z755AFWAKHE12NY0CQ9FH */ customerId: string - /** @description The base plan of the subscription. */ - plan: components['schemas']['PlanReference'] + /** @description The plan of the subscription. */ + plan?: components['schemas']['PlanReference'] /** * Currency * @description The currency code of the subscription. @@ -6584,12 +6460,6 @@ export interface components { * @default USD */ currency: components['schemas']['CurrencyCode'] - /** - * Format: date-time - * @description If the subscription is canceled or otherwise have to end activeTo denotes the end date. - * @example 2023-01-01T01:01:01.001Z - */ - activeTo?: string } /** @description Change a subscription. */ SubscriptionChange: @@ -6598,62 +6468,19 @@ export interface components { /** @description Create a subscription. */ SubscriptionCreate: | components['schemas']['PlanSubscriptionCreate'] - | components['schemas']['CreateCustomSubscriptionRequestBody'] - /** @description Subscription item add operation. */ - SubscriptionEditAdd: { - /** @enum {string} */ - op: 'add' - path: string - value: components['schemas']['SubscriptionPhaseCreate'] - } - /** @description Subscription item add operation. */ - SubscriptionEditAddItem: { - /** @enum {string} */ - op: 'add' - path: string - value: components['schemas']['RateCard'] - } - /** @description Subscription item add operation. */ - SubscriptionEditAddUpdateItem: { - /** @enum {string} */ - op: 'add' - path: string - value: components['schemas']['RateCardUpdateItem'] - } - /** @description Subscription phase remove operation. */ - SubscriptionEditRemoveItem: { - /** @enum {string} */ - op: 'remove' - path: string - } - /** @description Subscription phase remove operation. */ - SubscriptionEditRemoveUpdateItem: { - /** @enum {string} */ - op: 'remove' - path: string - } - /** @description Subscription item remove operation with a value. */ - SubscriptionEditRemoveWithValue: { - /** @enum {string} */ - op: 'remove' - path: string - value: { - shift: components['schemas']['RemovePhaseShifting'] - } - } - /** @description Subscription phase stretch operation. */ - SubscriptionEditStretch: { - /** @enum {string} */ - op: 'extend' - path: string - value: { - /** - * Format: duration - * @description The signed duration to extend or shrink the phase by. - */ - extendBy: string - } - } + | components['schemas']['CustomSubscriptionCreate'] + /** @description Subscription edit input. */ + SubscriptionEdit: { + /** @description Batch processing commands for manipulating running subscriptions. + * The key format is `/phases/{phaseKey}` or `/phases/{phaseKey}/items/{itemKey}`. */ + customizations: components['schemas']['SubscriptionEditOperation'][] + } + SubscriptionEditOperation: + | components['schemas']['EditSubscriptionAddItem'] + | components['schemas']['EditSubscriptionRemoveItem'] + | components['schemas']['EditSubscriptionAddPhase'] + | components['schemas']['EditSubscriptionRemovePhase'] + | components['schemas']['EditSubscriptionStretchPhase'] /** @description Expanded subscription */ SubscriptionExpanded: { /** @@ -6694,17 +6521,31 @@ export interface components { /** * Deletion Time * Format: date-time - * @description Timestamp of when the resource was permanently deleted. - * @example 2024-01-01T01:01:01.001Z + * @description Timestamp of when the resource was permanently deleted. + * @example 2024-01-01T01:01:01.001Z + */ + readonly deletedAt?: string + /** + * Format: date-time + * @description The cadence start of the resource. + * @example 2023-01-01T01:01:01.001Z + */ + activeFrom: string + /** + * Format: date-time + * @description The cadence end of the resource. + * @example 2023-01-01T01:01:01.001Z */ - readonly deletedAt?: string + activeTo?: string + /** @description The status of the subscription. */ + readonly status: components['schemas']['SubscriptionStatus'] /** * @description The customer ID of the subscription. * @example 01G65Z755AFWAKHE12NY0CQ9FH */ customerId: string - /** @description The base plan of the subscription. */ - plan: components['schemas']['PlanReference'] + /** @description The plan of the subscription. */ + plan?: components['schemas']['PlanReference'] /** * Currency * @description The currency code of the subscription. @@ -6712,12 +6553,6 @@ export interface components { * @default USD */ currency: components['schemas']['CurrencyCode'] - /** - * Format: date-time - * @description If the subscription is canceled or otherwise have to end activeTo denotes the end date. - * @example 2023-01-01T01:01:01.001Z - */ - activeTo?: string phases: components['schemas']['SubscriptionPhaseExpanded'][] } /** @description The actual contents of the Subscription, what the user gets, what they pay, etc... */ @@ -6764,6 +6599,18 @@ export interface components { * @example 2024-01-01T01:01:01.001Z */ readonly deletedAt?: string + /** + * Format: date-time + * @description The cadence start of the resource. + * @example 2023-01-01T01:01:01.001Z + */ + activeFrom: string + /** + * Format: date-time + * @description The cadence end of the resource. + * @example 2023-01-01T01:01:01.001Z + */ + activeTo?: string /** @description The identifier of the RateCard. * SubscriptionItem/RateCard can be identified, it has a reference: * @@ -6792,13 +6639,8 @@ export interface components { | (components['schemas']['FlatPriceWithPaymentTerm'] | null) | (components['schemas']['UnitPriceWithCommitments'] | null) | (components['schemas']['TieredPriceWithCommitments'] | null) - | (components['schemas']['FlatPriceWithPaymentTerm'] | null) /** @description Describes what access is gained via the SubscriptionItem */ - included?: { - /** @description The feature the customer is entitled to use. */ - feature: components['schemas']['Feature'] - entitlement?: components['schemas']['Entitlement'] - } + included?: components['schemas']['SubscriptionItemIncluded'] /** * Tax config * @description The tax config of the Subscription Item. @@ -6806,6 +6648,12 @@ export interface components { */ taxConfig?: components['schemas']['TaxConfig'] } + /** @description Included contents like Entitlement, or the Feature. */ + SubscriptionItemIncluded: { + /** @description The feature the customer is entitled to use. */ + feature: components['schemas']['Feature'] + entitlement?: components['schemas']['Entitlement'] + } /** @description Subscription phase create input. */ SubscriptionPhaseCreate: { /** @@ -6820,14 +6668,21 @@ export interface components { * Duration * Format: duration * @description The intended duration of the new phase. + * Duration is required when the phase will not be the last phase. * @example P1M */ - duration: string + duration?: string /** * Discounts * @description The discounts on the plan. */ - discounts?: components['schemas']['DiscountUpdateItem'][] + discounts?: components['schemas']['Discount'][] + /** @description A locally unique identifier for the phase. */ + key: string + /** @description The name of the phase. */ + name: string + /** @description The description of the phase. */ + description?: string } /** @description Expanded subscription phase */ SubscriptionPhaseExpanded: { @@ -6875,13 +6730,6 @@ export interface components { readonly deletedAt?: string /** @description A locally unique identifier for the resource. */ key: string - /** - * Duration - * Format: duration - * @description The intended duration of the new phase. - * @example P1M - */ - duration: string /** * Discounts * @description The discounts on the plan. @@ -6893,8 +6741,19 @@ export interface components { * @example 2023-01-01T01:01:01.001Z */ activeFrom: string + /** + * Format: date-time + * @description The until which the Phase is active. + * @example 2023-01-01T01:01:01.001Z + */ + activeTo?: string items: components['schemas']['SubscriptionItem'][] } + /** + * @description Subscription status. + * @enum {string} + */ + SubscriptionStatus: 'active' | 'inactive' | 'canceled' /** @description Operational webhook reqeuest sent by Svix. */ SvixOperationalWebhookRequest: { /** @@ -7026,6 +6885,130 @@ export interface components { */ maximumAmount?: components['schemas']['Numeric'] } + /** @description ValidationIssue captures any validation issues related to the invoice. + * + * Issues with severity "critical" will prevent the invoice from being issued. */ + ValidationIssue: { + /** + * Creation Time + * Format: date-time + * @description Timestamp of when the resource was created. + * @example 2024-01-01T01:01:01.001Z + */ + readonly createdAt: string + /** + * Last Update Time + * Format: date-time + * @description Timestamp of when the resource was last updated. + * @example 2024-01-01T01:01:01.001Z + */ + readonly updatedAt: string + /** + * Deletion Time + * Format: date-time + * @description Timestamp of when the resource was permanently deleted. + * @example 2024-01-01T01:01:01.001Z + */ + readonly deletedAt?: string + /** + * @description ID of the charge or discount. + * @example 01G65Z755AFWAKHE12NY0CQ9FH + */ + readonly id: string + /** @description The severity of the issue. */ + readonly severity: components['schemas']['ValidationIssueSeverity'] + /** @description The field that the issue is related to, if available in JSON path format. */ + readonly field?: string + /** @description Machine indentifiable code for the issue, if available. */ + readonly code?: string + /** @description Component reporting the issue. */ + readonly component: string + /** @description A human-readable description of the issue. */ + readonly message: string + /** @description Additional context for the issue. */ + readonly metadata?: components['schemas']['Metadata'] + } + /** + * @description ValidationIssueSeverity describes the severity of a validation issue. + * + * Issues with severity "critical" will prevent the invoice from being issued. + * @enum {string} + */ + ValidationIssueSeverity: 'critical' | 'warning' + /** @description InvoiceVoidAction describes how to handle the voided line items. */ + VoidInvoiceActionCreate: { + /** @description How much of the total line items to be voided? (e.g. 100% means all charges are voided) */ + percentage: components['schemas']['Percentage'] + action: components['schemas']['VoidInvoiceLineActionCreate'] + } + /** @description InvoiceVoidAction describes how to handle the voided line items. */ + VoidInvoiceActionCreateItem: { + /** @description How much of the total line items to be voided? (e.g. 100% means all charges are voided) */ + percentage: components['schemas']['Percentage'] + action: components['schemas']['VoidInvoiceLineActionCreateItem'] + } + /** @description Request to void an invoice */ + VoidInvoiceActionInput: { + /** @description The action to take on the voided line items. */ + action: components['schemas']['VoidInvoiceActionCreate'] + /** @description The reason for voiding the invoice. */ + reason: string + /** @description Per line item overrides for the action. + * + * If not specified, the `action` will be applied to all line items. */ + overrides?: + | components['schemas']['VoidInvoiceActionLineOverride'][] + | null + } + /** @description VoidInvoiceLineOverride describes how to handle a specific line item in the invoice when voiding. */ + VoidInvoiceActionLineOverride: { + /** + * @description The line item ID to override. + * @example 01G65Z755AFWAKHE12NY0CQ9FH + */ + lineId: string + /** @description The action to take on the line item. */ + action: components['schemas']['VoidInvoiceActionCreateItem'] + } + /** @description VoidInvoiceLineAction describes how to handle a specific line item in the invoice when voiding. */ + VoidInvoiceLineActionCreate: + | components['schemas']['VoidInvoiceLineDiscardAction'] + | components['schemas']['VoidInvoiceLinePendingActionCreate'] + /** @description VoidInvoiceLineAction describes how to handle a specific line item in the invoice when voiding. */ + VoidInvoiceLineActionCreateItem: + | components['schemas']['VoidInvoiceLineDiscardAction'] + | components['schemas']['VoidInvoiceLinePendingActionCreateItem'] + /** @description VoidInvoiceLineDiscardAction describes how to handle the voidied line item in the invoice. */ + VoidInvoiceLineDiscardAction: { + /** @enum {string} */ + type: 'discard' + } + /** @description VoidInvoiceLinePendingAction describes how to handle the voidied line item in the invoice. */ + VoidInvoiceLinePendingActionCreate: { + /** @enum {string} */ + type: 'pending' + /** + * Format: date-time + * @description The time at which the line item should be invoiced again. + * + * If not provided, the line item will be re-invoiced now. + * @example 2023-01-01T01:01:01.001Z + */ + nextInvoiceAt?: string + } + /** @description VoidInvoiceLinePendingAction describes how to handle the voidied line item in the invoice. */ + VoidInvoiceLinePendingActionCreateItem: { + /** @enum {string} */ + type: 'pending' + /** + * Format: date-time + * @description The time at which the line item should be invoiced again. + * + * If not provided, the line item will be re-invoiced now. + * @example 2023-01-01T01:01:01.001Z + */ + nextInvoiceAt?: string + } /** * @description Aggregation window size. * @enum {string} @@ -7044,19 +7027,18 @@ export interface components { } responses: never parameters: { - 'BillingInvoiceListParams.expand': components['schemas']['BillingInvoiceExpand'][] - 'BillingInvoiceListParams.extendedStatuses': components['schemas']['BillingInvoiceExtendedStatus'][] - 'BillingInvoiceListParams.issuedAfter': string - 'BillingInvoiceListParams.issuedBefore': string - 'BillingInvoiceListParams.statuses': components['schemas']['BillingInvoiceStatus'][] /** @description The order direction. */ - 'CustomerOrderByOrdering.order': components['schemas']['SortOrder'] + 'BillingProfileCustomerOverrideOrderByOrdering.order': components['schemas']['SortOrder'] /** @description The order by field. */ - 'CustomerOrderByOrdering.orderBy': components['schemas']['CustomerOrderBy'] + 'BillingProfileCustomerOverrideOrderByOrdering.orderBy': components['schemas']['BillingProfileCustomerOverrideOrderBy'] /** @description The order direction. */ - 'CustomerOverrideOrderByOrdering.order': components['schemas']['SortOrder'] + 'BillingProfileOrderByOrdering.order': components['schemas']['SortOrder'] /** @description The order by field. */ - 'CustomerOverrideOrderByOrdering.orderBy': components['schemas']['BillingCustomerOverrideOrderBy'] + 'BillingProfileOrderByOrdering.orderBy': components['schemas']['BillingProfileOrderBy'] + /** @description The order direction. */ + 'CustomerOrderByOrdering.order': components['schemas']['SortOrder'] + /** @description The order by field. */ + 'CustomerOrderByOrdering.orderBy': components['schemas']['CustomerOrderBy'] /** @description The order direction. */ 'EntitlementOrderByOrdering.order': components['schemas']['SortOrder'] /** @description The order by field. */ @@ -7069,10 +7051,22 @@ export interface components { 'GrantOrderByOrdering.order': components['schemas']['SortOrder'] /** @description The order by field. */ 'GrantOrderByOrdering.orderBy': components['schemas']['GrantOrderBy'] + /** @description Filter by customer ID */ + 'InvoiceListParams.customers': string[] + /** @description What parts of the list output to expand in listings */ + 'InvoiceListParams.expand': components['schemas']['InvoiceExpand'][] + /** @description Filter by invoice extended statuses */ + 'InvoiceListParams.extendedStatuses': string[] + /** @description Filter by invoice creation time */ + 'InvoiceListParams.issuedAfter': string + /** @description Filter by invoice creation time */ + 'InvoiceListParams.issuedBefore': string + /** @description Filter by the invoice status. */ + 'InvoiceListParams.statuses': components['schemas']['InvoiceStatus'][] /** @description The order direction. */ 'InvoiceOrderByOrdering.order': components['schemas']['SortOrder'] /** @description The order by field. */ - 'InvoiceOrderByOrdering.orderBy': components['schemas']['BillingInvoiceOrderBy'] + 'InvoiceOrderByOrdering.orderBy': components['schemas']['InvoiceOrderBy'] /** @description Number of items to return. * * Default is 100. */ @@ -7158,10 +7152,6 @@ export interface components { 'PlanOrderByOrdering.order': components['schemas']['SortOrder'] /** @description The order by field. */ 'PlanOrderByOrdering.orderBy': components['schemas']['PlanOrderBy'] - /** @description The order direction. */ - 'ProfileOrderByOrdering.order': components['schemas']['SortOrder'] - /** @description The order by field. */ - 'ProfileOrderByOrdering.orderBy': components['schemas']['BillingProfileOrderBy'] /** @description Include deleted customers. */ 'queryCustomerList.includeDeleted': boolean /** @description Filter customers by name. @@ -7518,7 +7508,7 @@ export interface operations { } } } - billingListCustomerOverrides: { + listBillingProfileCustomerOverrides: { parameters: { query?: { billingProfile?: string[] @@ -7539,9 +7529,9 @@ export interface operations { * Default is 100. */ limit?: components['parameters']['LimitOffset.limit'] /** @description The order direction. */ - order?: components['parameters']['CustomerOverrideOrderByOrdering.order'] + order?: components['parameters']['BillingProfileCustomerOverrideOrderByOrdering.order'] /** @description The order by field. */ - orderBy?: components['parameters']['CustomerOverrideOrderByOrdering.orderBy'] + orderBy?: components['parameters']['BillingProfileCustomerOverrideOrderByOrdering.orderBy'] } header?: never path?: never @@ -7555,7 +7545,7 @@ export interface operations { [name: string]: unknown } content: { - 'application/json': components['schemas']['CustomerOverridePaginatedResponse'] + 'application/json': components['schemas']['BillingProfileCustomerOverridePaginatedResponse'] } } /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ @@ -7614,7 +7604,7 @@ export interface operations { } } } - billingGetCustomerOverrideById: { + getBillingProfileCustomerOverride: { parameters: { query?: never header?: never @@ -7631,7 +7621,7 @@ export interface operations { [name: string]: unknown } content: { - 'application/json': components['schemas']['BillingCustomerOverride'] + 'application/json': components['schemas']['BillingProfileCustomerOverride'] } } /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ @@ -7699,7 +7689,7 @@ export interface operations { } } } - billingUpsertCustomerOverride: { + upsertBillingProfileCustomerOverride: { parameters: { query?: never header?: never @@ -7710,7 +7700,7 @@ export interface operations { } requestBody: { content: { - 'application/json': components['schemas']['BillingCustomerWorkflowOverride'] + 'application/json': components['schemas']['BillingProfileCustomerOverrideCreate'] } } responses: { @@ -7720,7 +7710,9 @@ export interface operations { [name: string]: unknown } content: { - 'application/json': components['schemas']['BillingCustomerOverride'] + 'application/json': + | components['schemas']['BillingProfileCustomerOverride'] + | components['schemas']['BillingProfileCustomerOverride'] } } /** @description The request has succeeded and a new resource has been created as a result. */ @@ -7729,7 +7721,7 @@ export interface operations { [name: string]: unknown } content: { - 'application/json': components['schemas']['BillingCustomerOverride'] + 'application/json': components['schemas']['BillingProfileCustomerOverride'] } } /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ @@ -7797,7 +7789,7 @@ export interface operations { } } } - billingDeleteCustomerOverride: { + deleteBillingProfileCustomerOverride: { parameters: { query?: never header?: never @@ -7880,15 +7872,21 @@ export interface operations { } } } - billingListInvoices: { + listInvoices: { parameters: { query?: { - customers?: string[] - statuses?: components['parameters']['BillingInvoiceListParams.statuses'] - extendedStatuses?: components['parameters']['BillingInvoiceListParams.extendedStatuses'] - issuedAfter?: components['parameters']['BillingInvoiceListParams.issuedAfter'] - issuedBefore?: components['parameters']['BillingInvoiceListParams.issuedBefore'] - expand?: components['parameters']['BillingInvoiceListParams.expand'] + /** @description Filter by the invoice status. */ + statuses?: components['parameters']['InvoiceListParams.statuses'] + /** @description Filter by invoice extended statuses */ + extendedStatuses?: components['parameters']['InvoiceListParams.extendedStatuses'] + /** @description Filter by invoice creation time */ + issuedAfter?: components['parameters']['InvoiceListParams.issuedAfter'] + /** @description Filter by invoice creation time */ + issuedBefore?: components['parameters']['InvoiceListParams.issuedBefore'] + /** @description What parts of the list output to expand in listings */ + expand?: components['parameters']['InvoiceListParams.expand'] + /** @description Filter by customer ID */ + customers?: components['parameters']['InvoiceListParams.customers'] /** @description Start date-time in RFC 3339 format. * * Inclusive. */ @@ -7981,50 +7979,26 @@ export interface operations { } } } - billingListInvoicesByCustomer: { + invoicePendingLinesAction: { parameters: { - query?: { - statuses?: components['parameters']['BillingInvoiceListParams.statuses'] - extendedStatuses?: components['parameters']['BillingInvoiceListParams.extendedStatuses'] - issuedAfter?: components['parameters']['BillingInvoiceListParams.issuedAfter'] - issuedBefore?: components['parameters']['BillingInvoiceListParams.issuedBefore'] - expand?: components['parameters']['BillingInvoiceListParams.expand'] - /** @description Start date-time in RFC 3339 format. - * - * Inclusive. */ - page?: components['parameters']['Pagination.page'] - /** @description Number of items per page. - * - * Default is 100. */ - pageSize?: components['parameters']['Pagination.pageSize'] - /** @description Number of items to skip. - * - * Default is 0. */ - offset?: components['parameters']['LimitOffset.offset'] - /** @description Number of items to return. - * - * Default is 100. */ - limit?: components['parameters']['LimitOffset.limit'] - /** @description The order direction. */ - order?: components['parameters']['InvoiceOrderByOrdering.order'] - /** @description The order by field. */ - orderBy?: components['parameters']['InvoiceOrderByOrdering.orderBy'] - } + query?: never header?: never - path: { - customerId: string - } + path?: never cookie?: never } - requestBody?: never + requestBody: { + content: { + 'application/json': components['schemas']['InvoicePendingLinesActionInput'] + } + } responses: { - /** @description The request has succeeded. */ - 200: { + /** @description The request has succeeded and a new resource has been created as a result. */ + 201: { headers: { [name: string]: unknown } content: { - 'application/json': components['schemas']['InvoicePaginatedResponse'] + 'application/json': components['schemas']['Invoice'][] } } /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ @@ -8083,18 +8057,16 @@ export interface operations { } } } - billingCreateInvoice: { + createPendingInvoiceLine: { parameters: { query?: never header?: never - path: { - customerId: string - } + path?: never cookie?: never } requestBody: { content: { - 'application/json': components['schemas']['BillingInvoiceCreate'] + 'application/json': components['schemas']['InvoicePendingLineCreate'][] } } responses: { @@ -8104,7 +8076,7 @@ export interface operations { [name: string]: unknown } content: { - 'application/json': components['schemas']['BillingInvoice'][] + 'application/json': components['schemas']['InvoiceLine'][] } } /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ @@ -8163,14 +8135,14 @@ export interface operations { } } } - billingGetInvoiceByCustomerInvoiceId: { + getInvoice: { parameters: { query: { - expand: components['schemas']['BillingInvoiceExpand'][] + expand: components['schemas']['InvoiceExpand'][] + includeDeletedLines: boolean } header?: never path: { - customerId: string invoiceId: string } cookie?: never @@ -8183,7 +8155,7 @@ export interface operations { [name: string]: unknown } content: { - 'application/json': components['schemas']['BillingInvoice'] + 'application/json': components['schemas']['Invoice'] } } /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ @@ -8251,12 +8223,11 @@ export interface operations { } } } - billingDeleteInvoiceByCustomerInvoiceId: { + deleteInvoice: { parameters: { query?: never header?: never path: { - customerId: string invoiceId: string } cookie?: never @@ -8335,12 +8306,11 @@ export interface operations { } } } - billingInvoiceAdvance: { + advanceInvoiceAction: { parameters: { query?: never header?: never path: { - customerId: string invoiceId: string } cookie?: never @@ -8353,7 +8323,7 @@ export interface operations { [name: string]: unknown } content: { - 'application/json': components['schemas']['BillingInvoice'] + 'application/json': components['schemas']['Invoice'] } } /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ @@ -8421,12 +8391,11 @@ export interface operations { } } } - billingApproveInvoice: { + approveInvoiceAction: { parameters: { query?: never header?: never path: { - customerId: string invoiceId: string } cookie?: never @@ -8439,7 +8408,7 @@ export interface operations { [name: string]: unknown } content: { - 'application/json': components['schemas']['BillingInvoice'] + 'application/json': components['schemas']['Invoice'] } } /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ @@ -8507,12 +8476,11 @@ export interface operations { } } } - billingGetInvoiceLine: { + getInvoiceLine: { parameters: { query?: never header?: never path: { - customerId: string invoiceId: string lineId: string } @@ -8520,13 +8488,13 @@ export interface operations { } requestBody?: never responses: { - /** @description There is no content to send for this request, but the headers may be useful. */ - 204: { + /** @description The request has succeeded. */ + 200: { headers: { [name: string]: unknown } content: { - 'application/json': components['schemas']['BillingInvoiceLine'] + 'application/json': components['schemas']['InvoiceLine'] } } /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ @@ -8594,12 +8562,11 @@ export interface operations { } } } - billingUpdateInvoiceLine: { + updateInvoiceLine: { parameters: { query?: never header?: never path: { - customerId: string invoiceId: string lineId: string } @@ -8607,7 +8574,7 @@ export interface operations { } requestBody: { content: { - 'application/json': components['schemas']['BillingInvoiceLineCreate'] + 'application/json': components['schemas']['InvoiceLineReplaceUpdate'] } } responses: { @@ -8617,7 +8584,7 @@ export interface operations { [name: string]: unknown } content: { - 'application/json': components['schemas']['BillingInvoiceLine'] + 'application/json': components['schemas']['InvoiceLine'] } } /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ @@ -8685,12 +8652,11 @@ export interface operations { } } } - billingDeleteInvoiceLine: { + deleteInvoiceLine: { parameters: { query?: never header?: never path: { - customerId: string invoiceId: string lineId: string } @@ -8770,12 +8736,11 @@ export interface operations { } } } - billingInvoiceRetry: { + retryInvoiceAction: { parameters: { query?: never header?: never path: { - customerId: string invoiceId: string } cookie?: never @@ -8788,7 +8753,7 @@ export interface operations { [name: string]: unknown } content: { - 'application/json': components['schemas']['BillingInvoice'] + 'application/json': components['schemas']['Invoice'] } } /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ @@ -8856,12 +8821,11 @@ export interface operations { } } } - billingRecalculateInvoiceTax: { + recalculateInvoiceTaxAction: { parameters: { query?: never header?: never path: { - customerId: string invoiceId: string } cookie?: never @@ -8874,7 +8838,7 @@ export interface operations { [name: string]: unknown } content: { - 'application/json': components['schemas']['BillingInvoice'] + 'application/json': components['schemas']['Invoice'] } } /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ @@ -8942,19 +8906,18 @@ export interface operations { } } } - billingVoidInvoice: { + voidInvoiceAction: { parameters: { query?: never header?: never path: { - customerId: string invoiceId: string } cookie?: never } requestBody: { content: { - 'application/json': components['schemas']['BillingVoidInvoiceInput'] + 'application/json': components['schemas']['VoidInvoiceActionInput'] } } responses: { @@ -8964,7 +8927,7 @@ export interface operations { [name: string]: unknown } content: { - 'application/json': components['schemas']['BillingInvoice'] + 'application/json': components['schemas']['Invoice'] } } /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ @@ -9032,87 +8995,7 @@ export interface operations { } } } - billingCreateLineByCustomer: { - parameters: { - query?: never - header?: never - path: { - customerId: string - } - cookie?: never - } - requestBody: { - content: { - 'application/json': components['schemas']['LinesUpdate'] - } - } - responses: { - /** @description The request has succeeded and a new resource has been created as a result. */ - 201: { - headers: { - [name: string]: unknown - } - content: { - 'application/json': components['schemas']['BillingInvoiceLines'] - } - } - /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ - 400: { - headers: { - [name: string]: unknown - } - content: { - 'application/problem+json': components['schemas']['BadRequestProblemResponse'] - } - } - /** @description The request has not been applied because it lacks valid authentication credentials for the target resource. */ - 401: { - headers: { - [name: string]: unknown - } - content: { - 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] - } - } - /** @description The server understood the request but refuses to authorize it. */ - 403: { - headers: { - [name: string]: unknown - } - content: { - 'application/problem+json': components['schemas']['ForbiddenProblemResponse'] - } - } - /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ - 500: { - headers: { - [name: string]: unknown - } - content: { - 'application/problem+json': components['schemas']['InternalServerErrorProblemResponse'] - } - } - /** @description The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. */ - 503: { - headers: { - [name: string]: unknown - } - content: { - 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] - } - } - /** @description An unexpected error response. */ - default: { - headers: { - [name: string]: unknown - } - content: { - 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] - } - } - } - } - billingListProfiles: { + listBillingProfiles: { parameters: { query?: { includeArchived?: boolean @@ -9134,9 +9017,9 @@ export interface operations { * Default is 100. */ limit?: components['parameters']['LimitOffset.limit'] /** @description The order direction. */ - order?: components['parameters']['ProfileOrderByOrdering.order'] + order?: components['parameters']['BillingProfileOrderByOrdering.order'] /** @description The order by field. */ - orderBy?: components['parameters']['ProfileOrderByOrdering.orderBy'] + orderBy?: components['parameters']['BillingProfileOrderByOrdering.orderBy'] } header?: never path?: never @@ -9150,7 +9033,7 @@ export interface operations { [name: string]: unknown } content: { - 'application/json': components['schemas']['ProfilePaginatedResponse'] + 'application/json': components['schemas']['BillingProfilePaginatedResponse'] } } /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ @@ -9209,7 +9092,7 @@ export interface operations { } } } - billingCreateProfile: { + createBillingProfile: { parameters: { query?: never header?: never @@ -9218,7 +9101,7 @@ export interface operations { } requestBody: { content: { - 'application/json': components['schemas']['BillingProfileCreateInput'] + 'application/json': components['schemas']['BillingProfileCreate'] } } responses: { @@ -9287,7 +9170,7 @@ export interface operations { } } } - billingGetProfile: { + getBillingProfile: { parameters: { query?: { expand?: components['schemas']['BillingProfileExpand'][] @@ -9374,7 +9257,7 @@ export interface operations { } } } - billingUpdateProfile: { + updateBillingProfile: { parameters: { query?: never header?: never @@ -9385,7 +9268,7 @@ export interface operations { } requestBody: { content: { - 'application/json': components['schemas']['BillingProfile'] + 'application/json': components['schemas']['BillingProfileReplaceUpdateWithWorkflow'] } } responses: { @@ -9463,7 +9346,7 @@ export interface operations { } } } - billingArchiveProfile: { + deleteBillingProfile: { parameters: { query?: never header?: never @@ -16121,8 +16004,8 @@ export interface operations { } } responses: { - /** @description The request has succeeded. */ - 200: { + /** @description The request has succeeded and a new resource has been created as a result. */ + 201: { headers: { [name: string]: unknown } @@ -16198,7 +16081,6 @@ export interface operations { getSubscription: { parameters: { query?: { - expand?: false | true /** @description The time at which the subscription should be queried. If not provided the current time is used. */ at?: string } @@ -16216,9 +16098,7 @@ export interface operations { [name: string]: unknown } content: { - 'application/json': - | components['schemas']['Subscription'] - | components['schemas']['SubscriptionExpanded'] + 'application/json': components['schemas']['SubscriptionExpanded'] } } /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ @@ -16297,13 +16177,7 @@ export interface operations { } requestBody: { content: { - 'application/json': ( - | components['schemas']['SubscriptionEditAddUpdateItem'] - | components['schemas']['SubscriptionEditRemoveUpdateItem'] - | components['schemas']['SubscriptionEditAdd'] - | components['schemas']['SubscriptionEditStretch'] - | components['schemas']['SubscriptionEditRemoveWithValue'] - )[] + 'application/json': components['schemas']['SubscriptionEdit'] } } responses: {