openapi: 3.0.0 info: title: Schematic accesstokens billing API version: '0.1' description: Schematic API x-rules-engine-schema-version: v97288f60 servers: - url: https://api.schematichq.com security: - ApiKeyAuth: [] tags: - name: billing paths: /billing/coupons: get: operationId: listCoupons summary: List coupons tags: - billing parameters: - name: is_active in: query schema: type: boolean - name: q in: query schema: type: string - name: limit in: query description: Page limit (default 100) schema: type: integer description: Page limit (default 100) format: int64 example: '100' - name: offset in: query description: Page offset (default 0) schema: type: integer description: Page offset (default 0) format: int64 example: '0' responses: '200': description: OK content: application/json: schema: type: object properties: data: type: array items: $ref: '#/components/schemas/BillingCouponResponseData' title: ListCouponsResponseData maxItems: 250 params: type: object description: Input parameters properties: is_active: type: boolean limit: type: integer description: Page limit (default 100) format: int64 example: '100' offset: type: integer description: Page offset (default 0) format: int64 example: '0' q: type: string title: ListCouponsParams required: - data - params title: ListCouponsResponse '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' post: operationId: upsertBillingCoupon summary: Upsert billing coupon tags: - billing requestBody: content: application/json: schema: $ref: '#/components/schemas/CreateCouponRequestBody' required: true responses: '201': description: Created content: application/json: schema: type: object properties: data: $ref: '#/components/schemas/BillingCouponResponseData' params: type: object description: Input parameters title: UpsertBillingCouponParams required: - data - params title: UpsertBillingCouponResponse '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' /billing/customer/upsert: post: operationId: upsertBillingCustomer summary: Upsert billing customer tags: - billing requestBody: content: application/json: schema: $ref: '#/components/schemas/CreateBillingCustomerRequestBody' required: true responses: '201': description: Created content: application/json: schema: type: object properties: data: $ref: '#/components/schemas/BillingCustomerResponseData' params: type: object description: Input parameters title: UpsertBillingCustomerParams required: - data - params title: UpsertBillingCustomerResponse '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' /billing/customers: get: operationId: listCustomersWithSubscriptions summary: List customers with subscriptions tags: - billing parameters: - name: company_ids in: query schema: type: array items: type: string maxItems: 100 - name: name in: query schema: type: string maxLength: 255 - name: provider_type in: query schema: $ref: '#/components/schemas/BillingProviderType' - name: q in: query schema: type: string maxLength: 512 - name: limit in: query description: Page limit (default 100) schema: type: integer description: Page limit (default 100) format: int64 example: '100' - name: offset in: query description: Page offset (default 0) schema: type: integer description: Page offset (default 0) format: int64 example: '0' responses: '200': description: OK content: application/json: schema: type: object properties: data: type: array items: $ref: '#/components/schemas/BillingCustomerWithSubscriptionsResponseData' title: ListCustomersWithSubscriptionsResponseData maxItems: 250 params: type: object description: Input parameters properties: company_ids: type: array items: type: string maxItems: 100 limit: type: integer description: Page limit (default 100) format: int64 example: '100' name: type: string maxLength: 255 offset: type: integer description: Page offset (default 0) format: int64 example: '0' provider_type: $ref: '#/components/schemas/BillingProviderType' q: type: string maxLength: 512 title: ListCustomersWithSubscriptionsParams required: - data - params title: ListCustomersWithSubscriptionsResponse '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' /billing/customers/count: get: operationId: countCustomers summary: Count customers tags: - billing parameters: - name: company_ids in: query schema: type: array items: type: string maxItems: 100 - name: name in: query schema: type: string maxLength: 255 - name: provider_type in: query schema: $ref: '#/components/schemas/BillingProviderType' - name: q in: query schema: type: string maxLength: 512 - name: limit in: query description: Page limit (default 100) schema: type: integer description: Page limit (default 100) format: int64 example: '100' - name: offset in: query description: Page offset (default 0) schema: type: integer description: Page offset (default 0) format: int64 example: '0' responses: '200': description: OK content: application/json: schema: type: object properties: data: $ref: '#/components/schemas/CountResponse' params: type: object description: Input parameters properties: company_ids: type: array items: type: string maxItems: 100 limit: type: integer description: Page limit (default 100) format: int64 example: '100' name: type: string maxLength: 255 offset: type: integer description: Page offset (default 0) format: int64 example: '0' provider_type: $ref: '#/components/schemas/BillingProviderType' q: type: string maxLength: 512 title: CountCustomersParams required: - data - params title: CountCustomersResponse '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' /billing/invoices: get: operationId: listInvoices summary: List invoices tags: - billing parameters: - name: company_id in: query schema: type: string - name: customer_external_id in: query required: true schema: type: string maxLength: 255 - name: subscription_external_id in: query required: true schema: type: string maxLength: 255 - name: limit in: query description: Page limit (default 100) schema: type: integer description: Page limit (default 100) format: int64 example: '100' - name: offset in: query description: Page offset (default 0) schema: type: integer description: Page offset (default 0) format: int64 example: '0' responses: '200': description: OK content: application/json: schema: type: object properties: data: type: array items: $ref: '#/components/schemas/InvoiceResponseData' title: ListInvoicesResponseData maxItems: 250 params: type: object description: Input parameters properties: company_id: type: string customer_external_id: type: string maxLength: 255 limit: type: integer description: Page limit (default 100) format: int64 example: '100' offset: type: integer description: Page offset (default 0) format: int64 example: '0' subscription_external_id: type: string maxLength: 255 title: ListInvoicesParams required: - data - params title: ListInvoicesResponse '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' post: operationId: upsertInvoice summary: Upsert invoice tags: - billing requestBody: content: application/json: schema: $ref: '#/components/schemas/CreateInvoiceRequestBody' required: true responses: '201': description: Created content: application/json: schema: type: object properties: data: $ref: '#/components/schemas/InvoiceResponseData' params: type: object description: Input parameters title: UpsertInvoiceParams required: - data - params title: UpsertInvoiceResponse '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' /billing/meter: get: operationId: listMeters summary: List meters tags: - billing parameters: - name: display_name in: query schema: type: string maxLength: 255 - name: limit in: query description: Page limit (default 100) schema: type: integer description: Page limit (default 100) format: int64 example: '100' - name: offset in: query description: Page offset (default 0) schema: type: integer description: Page offset (default 0) format: int64 example: '0' responses: '200': description: OK content: application/json: schema: type: object properties: data: type: array items: $ref: '#/components/schemas/BillingMeterResponseData' title: ListMetersResponseData maxItems: 250 params: type: object description: Input parameters properties: display_name: type: string maxLength: 255 limit: type: integer description: Page limit (default 100) format: int64 example: '100' offset: type: integer description: Page offset (default 0) format: int64 example: '0' title: ListMetersParams required: - data - params title: ListMetersResponse '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' /billing/meter/upsert: post: operationId: upsertBillingMeter summary: Upsert billing meter tags: - billing requestBody: content: application/json: schema: $ref: '#/components/schemas/CreateMeterRequestBody' required: true responses: '201': description: Created content: application/json: schema: type: object properties: data: $ref: '#/components/schemas/BillingMeterResponseData' params: type: object description: Input parameters title: UpsertBillingMeterParams required: - data - params title: UpsertBillingMeterResponse '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' /billing/payment-methods: get: operationId: listPaymentMethods summary: List payment methods tags: - billing parameters: - name: company_id in: query schema: type: string - name: customer_external_id in: query required: true schema: type: string maxLength: 255 - name: limit in: query description: Page limit (default 100) schema: type: integer description: Page limit (default 100) format: int64 example: '100' - name: offset in: query description: Page offset (default 0) schema: type: integer description: Page offset (default 0) format: int64 example: '0' responses: '200': description: OK content: application/json: schema: type: object properties: data: type: array items: $ref: '#/components/schemas/PaymentMethodResponseData' title: ListPaymentMethodsResponseData maxItems: 250 params: type: object description: Input parameters properties: company_id: type: string customer_external_id: type: string maxLength: 255 limit: type: integer description: Page limit (default 100) format: int64 example: '100' offset: type: integer description: Page offset (default 0) format: int64 example: '0' title: ListPaymentMethodsParams required: - data - params title: ListPaymentMethodsResponse '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' post: operationId: upsertPaymentMethod summary: Upsert payment method tags: - billing requestBody: content: application/json: schema: $ref: '#/components/schemas/CreatePaymentMethodRequestBody' required: true responses: '201': description: Created content: application/json: schema: type: object properties: data: $ref: '#/components/schemas/PaymentMethodResponseData' params: type: object description: Input parameters title: UpsertPaymentMethodParams required: - data - params title: UpsertPaymentMethodResponse '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' /billing/price: get: operationId: listBillingPrices summary: List billing prices tags: - billing parameters: - name: currency in: query description: Filter for prices in a specific currency (e.g. usd, eur) schema: type: string description: Filter for prices in a specific currency (e.g. usd, eur) maxLength: 3 - name: for_initial_plan in: query description: Filter for prices valid for initial plans (free prices only) schema: type: boolean description: Filter for prices valid for initial plans (free prices only) - name: for_trial_expiry_plan in: query description: Filter for prices valid for trial expiry plans (free prices only) schema: type: boolean description: Filter for prices valid for trial expiry plans (free prices only) - name: ids in: query schema: type: array items: type: string maxItems: 100 - name: interval in: query schema: type: string maxLength: 255 - name: is_active in: query description: Filter for active prices on active products (defaults to true if not specified) schema: type: boolean description: Filter for active prices on active products (defaults to true if not specified) - name: price in: query schema: type: integer format: int64 - name: product_id in: query schema: type: string - name: product_ids in: query schema: type: array items: type: string maxItems: 100 - name: provider_type in: query schema: $ref: '#/components/schemas/BillingProviderType' - name: q in: query schema: type: string - name: tiers_mode in: query schema: $ref: '#/components/schemas/BillingTiersMode' - name: usage_type in: query schema: $ref: '#/components/schemas/BillingPriceUsageType' - name: with_meter in: query description: Filter for prices with a meter schema: type: boolean description: Filter for prices with a meter - name: limit in: query description: Page limit (default 100) schema: type: integer description: Page limit (default 100) format: int64 example: '100' - name: offset in: query description: Page offset (default 0) schema: type: integer description: Page offset (default 0) format: int64 example: '0' responses: '200': description: OK content: application/json: schema: type: object properties: data: type: array items: $ref: '#/components/schemas/BillingPriceView' title: ListBillingPricesResponseData maxItems: 250 params: type: object description: Input parameters properties: currency: type: string description: Filter for prices in a specific currency (e.g. usd, eur) maxLength: 3 for_initial_plan: type: boolean description: Filter for prices valid for initial plans (free prices only) for_trial_expiry_plan: type: boolean description: Filter for prices valid for trial expiry plans (free prices only) ids: type: array items: type: string maxItems: 100 interval: type: string maxLength: 255 is_active: type: boolean description: Filter for active prices on active products (defaults to true if not specified) limit: type: integer description: Page limit (default 100) format: int64 example: '100' offset: type: integer description: Page offset (default 0) format: int64 example: '0' price: type: integer format: int64 product_id: type: string product_ids: type: array items: type: string maxItems: 100 provider_type: $ref: '#/components/schemas/BillingProviderType' q: type: string tiers_mode: $ref: '#/components/schemas/BillingTiersMode' usage_type: $ref: '#/components/schemas/BillingPriceUsageType' with_meter: type: boolean description: Filter for prices with a meter title: ListBillingPricesParams required: - data - params title: ListBillingPricesResponse '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' /billing/price/upsert: post: operationId: upsertBillingPrice summary: Upsert billing price tags: - billing requestBody: content: application/json: schema: $ref: '#/components/schemas/CreateBillingPriceRequestBody' required: true responses: '201': description: Created content: application/json: schema: type: object properties: data: $ref: '#/components/schemas/BillingPriceResponseData' params: type: object description: Input parameters title: UpsertBillingPriceParams required: - data - params title: UpsertBillingPriceResponse '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' /billing/product/{billing_id}: delete: operationId: deleteBillingProduct summary: Delete billing product tags: - billing parameters: - name: billing_id in: path description: billing_id required: true schema: type: string responses: '200': description: OK content: application/json: schema: type: object properties: data: $ref: '#/components/schemas/DeleteResponse' params: type: object description: Input parameters title: DeleteBillingProductParams required: - data - params title: DeleteBillingProductResponse '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' /billing/product/prices: get: operationId: listBillingProductPrices summary: List billing product prices tags: - billing parameters: - name: currency in: query description: Filter for prices in a specific currency (e.g. usd, eur) schema: type: string description: Filter for prices in a specific currency (e.g. usd, eur) maxLength: 3 - name: for_initial_plan in: query description: Filter for prices valid for initial plans (free prices only) schema: type: boolean description: Filter for prices valid for initial plans (free prices only) - name: for_trial_expiry_plan in: query description: Filter for prices valid for trial expiry plans (free prices only) schema: type: boolean description: Filter for prices valid for trial expiry plans (free prices only) - name: ids in: query schema: type: array items: type: string maxItems: 100 - name: interval in: query schema: type: string maxLength: 255 - name: is_active in: query description: Filter for active prices on active products (defaults to true if not specified) schema: type: boolean description: Filter for active prices on active products (defaults to true if not specified) - name: price in: query schema: type: integer format: int64 - name: product_id in: query schema: type: string - name: product_ids in: query schema: type: array items: type: string maxItems: 100 - name: provider_type in: query schema: $ref: '#/components/schemas/BillingProviderType' - name: q in: query schema: type: string - name: tiers_mode in: query schema: $ref: '#/components/schemas/BillingTiersMode' - name: usage_type in: query schema: $ref: '#/components/schemas/BillingPriceUsageType' - name: with_meter in: query description: Filter for prices with a meter schema: type: boolean description: Filter for prices with a meter - name: limit in: query description: Page limit (default 100) schema: type: integer description: Page limit (default 100) format: int64 example: '100' - name: offset in: query description: Page offset (default 0) schema: type: integer description: Page offset (default 0) format: int64 example: '0' responses: '200': description: OK content: application/json: schema: type: object properties: data: type: array items: $ref: '#/components/schemas/BillingPriceView' title: ListBillingProductPricesResponseData maxItems: 250 params: type: object description: Input parameters properties: currency: type: string description: Filter for prices in a specific currency (e.g. usd, eur) maxLength: 3 for_initial_plan: type: boolean description: Filter for prices valid for initial plans (free prices only) for_trial_expiry_plan: type: boolean description: Filter for prices valid for trial expiry plans (free prices only) ids: type: array items: type: string maxItems: 100 interval: type: string maxLength: 255 is_active: type: boolean description: Filter for active prices on active products (defaults to true if not specified) limit: type: integer description: Page limit (default 100) format: int64 example: '100' offset: type: integer description: Page offset (default 0) format: int64 example: '0' price: type: integer format: int64 product_id: type: string product_ids: type: array items: type: string maxItems: 100 provider_type: $ref: '#/components/schemas/BillingProviderType' q: type: string tiers_mode: $ref: '#/components/schemas/BillingTiersMode' usage_type: $ref: '#/components/schemas/BillingPriceUsageType' with_meter: type: boolean description: Filter for prices with a meter title: ListBillingProductPricesParams required: - data - params title: ListBillingProductPricesResponse '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' /billing/product/prices/{billing_id}: delete: operationId: deleteProductPrice summary: Delete product price tags: - billing parameters: - name: billing_id in: path description: billing_id required: true schema: type: string responses: '200': description: OK content: application/json: schema: type: object properties: data: $ref: '#/components/schemas/DeleteResponse' params: type: object description: Input parameters title: DeleteProductPriceParams required: - data - params title: DeleteProductPriceResponse '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' /billing/product/upsert: post: operationId: upsertBillingProduct summary: Upsert billing product tags: - billing requestBody: content: application/json: schema: $ref: '#/components/schemas/CreateBillingProductRequestBody' required: true responses: '201': description: Created content: application/json: schema: type: object properties: data: $ref: '#/components/schemas/BillingProductResponseData' params: type: object description: Input parameters title: UpsertBillingProductParams required: - data - params title: UpsertBillingProductResponse '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' /billing/products: get: operationId: listBillingProducts summary: List billing products tags: - billing parameters: - name: ids in: query schema: type: array items: type: string maxItems: 100 - name: is_active in: query description: Filter products that are active. Defaults to true if not specified schema: type: boolean description: Filter products that are active. Defaults to true if not specified - name: name in: query schema: type: string maxLength: 255 - name: price_usage_type in: query schema: $ref: '#/components/schemas/BillingPriceUsageType' - name: provider_type in: query schema: $ref: '#/components/schemas/BillingProviderType' - name: q in: query schema: type: string maxLength: 512 - name: recurring_charges_only in: query description: Filter to products that have at least one recurring price schema: type: boolean description: Filter to products that have at least one recurring price - name: with_one_time_charges in: query description: Filter products that are one time charges schema: type: boolean description: Filter products that are one time charges - name: with_prices_only in: query description: Filter products that have prices schema: type: boolean description: Filter products that have prices - name: with_zero_price in: query description: Filter products that have zero price for free subscription type schema: type: boolean description: Filter products that have zero price for free subscription type - name: without_linked_to_plan in: query description: Filter products that are not linked to any plan schema: type: boolean description: Filter products that are not linked to any plan - name: limit in: query description: Page limit (default 100) schema: type: integer description: Page limit (default 100) format: int64 example: '100' - name: offset in: query description: Page offset (default 0) schema: type: integer description: Page offset (default 0) format: int64 example: '0' responses: '200': description: OK content: application/json: schema: type: object properties: data: type: array items: $ref: '#/components/schemas/BillingProductDetailResponseData' title: ListBillingProductsResponseData maxItems: 250 params: type: object description: Input parameters properties: ids: type: array items: type: string maxItems: 100 is_active: type: boolean description: Filter products that are active. Defaults to true if not specified limit: type: integer description: Page limit (default 100) format: int64 example: '100' name: type: string maxLength: 255 offset: type: integer description: Page offset (default 0) format: int64 example: '0' price_usage_type: $ref: '#/components/schemas/BillingPriceUsageType' provider_type: $ref: '#/components/schemas/BillingProviderType' q: type: string maxLength: 512 recurring_charges_only: type: boolean description: Filter to products that have at least one recurring price with_one_time_charges: type: boolean description: Filter products that are one time charges with_prices_only: type: boolean description: Filter products that have prices with_zero_price: type: boolean description: Filter products that have zero price for free subscription type without_linked_to_plan: type: boolean description: Filter products that are not linked to any plan title: ListBillingProductsParams required: - data - params title: ListBillingProductsResponse '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' /billing/products/count: get: operationId: countBillingProducts summary: Count billing products tags: - billing parameters: - name: ids in: query schema: type: array items: type: string maxItems: 100 - name: is_active in: query description: Filter products that are active. Defaults to true if not specified schema: type: boolean description: Filter products that are active. Defaults to true if not specified - name: name in: query schema: type: string maxLength: 255 - name: price_usage_type in: query schema: $ref: '#/components/schemas/BillingPriceUsageType' - name: provider_type in: query schema: $ref: '#/components/schemas/BillingProviderType' - name: q in: query schema: type: string maxLength: 512 - name: recurring_charges_only in: query description: Filter to products that have at least one recurring price schema: type: boolean description: Filter to products that have at least one recurring price - name: with_one_time_charges in: query description: Filter products that are one time charges schema: type: boolean description: Filter products that are one time charges - name: with_prices_only in: query description: Filter products that have prices schema: type: boolean description: Filter products that have prices - name: with_zero_price in: query description: Filter products that have zero price for free subscription type schema: type: boolean description: Filter products that have zero price for free subscription type - name: without_linked_to_plan in: query description: Filter products that are not linked to any plan schema: type: boolean description: Filter products that are not linked to any plan - name: limit in: query description: Page limit (default 100) schema: type: integer description: Page limit (default 100) format: int64 example: '100' - name: offset in: query description: Page offset (default 0) schema: type: integer description: Page offset (default 0) format: int64 example: '0' responses: '200': description: OK content: application/json: schema: type: object properties: data: $ref: '#/components/schemas/CountResponse' params: type: object description: Input parameters properties: ids: type: array items: type: string maxItems: 100 is_active: type: boolean description: Filter products that are active. Defaults to true if not specified limit: type: integer description: Page limit (default 100) format: int64 example: '100' name: type: string maxLength: 255 offset: type: integer description: Page offset (default 0) format: int64 example: '0' price_usage_type: $ref: '#/components/schemas/BillingPriceUsageType' provider_type: $ref: '#/components/schemas/BillingProviderType' q: type: string maxLength: 512 recurring_charges_only: type: boolean description: Filter to products that have at least one recurring price with_one_time_charges: type: boolean description: Filter products that are one time charges with_prices_only: type: boolean description: Filter products that have prices with_zero_price: type: boolean description: Filter products that have zero price for free subscription type without_linked_to_plan: type: boolean description: Filter products that are not linked to any plan title: CountBillingProductsParams required: - data - params title: CountBillingProductsResponse '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' /billing/subscription/upsert: post: operationId: upsertBillingSubscription summary: Upsert billing subscription tags: - billing requestBody: content: application/json: schema: $ref: '#/components/schemas/CreateBillingSubscriptionRequestBody' required: true responses: '201': description: Created content: application/json: schema: type: object properties: data: $ref: '#/components/schemas/BillingSubscriptionResponseData' params: type: object description: Input parameters title: UpsertBillingSubscriptionParams required: - data - params title: UpsertBillingSubscriptionResponse '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' components: responses: Forbidden: description: Forbidden content: application/json: schema: $ref: '#/components/schemas/ApiError' ServerError: description: Server error content: application/json: schema: $ref: '#/components/schemas/ApiError' NotFound: description: Not found content: application/json: schema: $ref: '#/components/schemas/ApiError' Unauthorized: description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/ApiError' BadRequest: description: Bad request content: application/json: schema: $ref: '#/components/schemas/ApiError' schemas: CreateBillingPriceTierRequestBody: type: object properties: flat_amount: type: integer format: int64 nullable: true per_unit_decimal: type: string nullable: true per_unit_price: type: integer format: int64 nullable: true price_external_id: type: string maxLength: 255 provider_type: allOf: - $ref: '#/components/schemas/BillingProviderType' nullable: true up_to: type: integer format: int64 nullable: true required: - price_external_id title: CreateBillingPriceTierRequestBody BillingPriceScheme: type: string enum: - per_unit - tiered BillingProductPricing: type: object properties: billing_threshold: type: integer format: int64 nullable: true maximum: 9999999999999 minimum: 50 currency: type: string maxLength: 3 interval: type: string maxLength: 255 meter_id: type: string nullable: true maxLength: 255 package_size: type: integer format: int64 nullable: true price: type: integer format: int64 price_decimal: type: string nullable: true price_external_id: type: string maxLength: 255 product_external_id: type: string maxLength: 255 quantity: type: integer format: int64 subscription_item_external_id: type: string nullable: true maxLength: 255 usage_type: $ref: '#/components/schemas/BillingPriceUsageType' required: - product_external_id - price - quantity - interval - currency - usage_type - price_external_id title: BillingProductPricing BillingProductPriceTierResponseData: type: object properties: flat_amount: type: integer format: int64 nullable: true per_unit_price: type: integer format: int64 nullable: true per_unit_price_decimal: type: string nullable: true up_to: type: integer format: int64 nullable: true title: BillingProductPriceTierResponseData BillingCustomerWithSubscriptionsResponseData: type: object properties: company_id: type: string nullable: true deleted_at: type: string format: date-time nullable: true email: type: string external_id: type: string id: type: string name: type: string provider_type: $ref: '#/components/schemas/BillingProviderType' subscriptions: type: array items: $ref: '#/components/schemas/BillingCustomerSubscription' maxItems: 1000 updated_at: type: string format: date-time required: - email - external_id - id - name - provider_type - subscriptions - updated_at title: BillingCustomerWithSubscriptionsResponseData BillingPriceUsageType: type: string enum: - licensed - metered InvoiceStatus: type: string enum: - draft - open - paid - uncollectible - void ApiError: type: object properties: error: type: string description: Error message required: - error CreateBillingCustomerRequestBody: type: object properties: company_id: type: string nullable: true default_payment_method_id: type: string nullable: true email: type: string maxLength: 255 external_id: type: string maxLength: 255 meta: additionalProperties: type: string type: object name: type: string maxLength: 255 provider_type: allOf: - $ref: '#/components/schemas/BillingProviderType' nullable: true required: - email - external_id - meta - name title: CreateBillingCustomerRequestBody CreateCouponRequestBody: type: object properties: amount_off: type: integer format: int64 currency: type: string nullable: true maxLength: 3 duration: type: string maxLength: 50 duration_in_months: type: integer format: int64 external_id: type: string maxLength: 255 max_redemptions: type: integer format: int64 name: type: string maxLength: 255 percent_off: type: number times_redeemed: type: integer format: int64 required: - external_id - name - percent_off - amount_off - times_redeemed - max_redemptions - duration - duration_in_months title: CreateCouponRequestBody BillingProviderType: type: string enum: - orb - schematic - stripe BillingTiersMode: type: string enum: - graduated - volume BillingPriceResponseData: type: object properties: currency: type: string external_price_id: type: string id: type: string interval: $ref: '#/components/schemas/BillingProductPriceInterval' nickname: type: string nullable: true price: type: integer format: int64 price_decimal: type: string nullable: true provider_type: $ref: '#/components/schemas/BillingProviderType' scheme: $ref: '#/components/schemas/BillingPriceScheme' required: - currency - external_price_id - id - interval - price - provider_type - scheme title: BillingPriceResponseData BillingCustomerSubscription: type: object properties: currency: type: string expired_at: type: string format: date-time nullable: true interval: type: string metered_usage: type: boolean per_unit_price: type: integer format: int64 total_price: type: integer format: int64 required: - total_price - interval - metered_usage - per_unit_price - currency title: BillingCustomerSubscription CreateInvoiceRequestBody: type: object properties: amount_due: type: integer format: int64 amount_paid: type: integer format: int64 amount_remaining: type: integer format: int64 collection_method: type: string maxLength: 32 currency: type: string maxLength: 16 customer_external_id: type: string maxLength: 255 due_date: type: string format: date-time nullable: true external_id: type: string nullable: true maxLength: 255 payment_method_external_id: type: string nullable: true maxLength: 255 status: allOf: - $ref: '#/components/schemas/InvoiceStatus' nullable: true subscription_external_id: type: string nullable: true maxLength: 255 subtotal: type: integer format: int64 url: type: string nullable: true maxLength: 512 required: - amount_due - amount_paid - amount_remaining - collection_method - currency - customer_external_id - subtotal title: CreateInvoiceRequestBody InvoiceResponseData: type: object properties: amount_due: type: integer format: int64 amount_paid: type: integer format: int64 amount_remaining: type: integer format: int64 collection_method: type: string company_id: type: string nullable: true created_at: type: string format: date-time currency: type: string customer_external_id: type: string due_date: type: string format: date-time nullable: true environment_id: type: string external_id: type: string nullable: true id: type: string payment_method_external_id: type: string nullable: true provider_type: $ref: '#/components/schemas/BillingProviderType' status: allOf: - $ref: '#/components/schemas/InvoiceStatus' nullable: true subscription_external_id: type: string nullable: true subtotal: type: integer format: int64 updated_at: type: string format: date-time url: type: string nullable: true required: - id - amount_due - amount_paid - amount_remaining - collection_method - created_at - currency - customer_external_id - environment_id - provider_type - subtotal - updated_at title: InvoiceResponseData BillingCouponResponseData: type: object properties: account_id: type: string amount_off: type: integer format: int64 nullable: true currency: type: string nullable: true duration: type: string nullable: true duration_in_months: type: integer format: int64 nullable: true environment_id: type: string external_id: type: string id: type: string is_active: type: boolean max_redemptions: type: integer format: int64 nullable: true metadata: type: object name: type: string percent_off: type: number nullable: true provider_type: $ref: '#/components/schemas/BillingProviderType' times_redeemed: type: integer format: int64 valid_from: type: string format: date-time nullable: true valid_until: type: string format: date-time nullable: true required: - id - account_id - environment_id - external_id - is_active - metadata - name - provider_type - times_redeemed title: BillingCouponResponseData BillingSubscriptionDiscount: type: object properties: coupon_external_id: type: string maxLength: 255 customer_facing_code: type: string nullable: true maxLength: 255 ended_at: type: string format: date-time nullable: true external_id: type: string maxLength: 255 is_active: type: boolean promo_code_external_id: type: string nullable: true maxLength: 255 started_at: type: string format: date-time required: - external_id - started_at - is_active - coupon_external_id title: BillingSubscriptionDiscount DeleteResponse: type: object properties: deleted: type: boolean description: Whether the delete was successful CreateBillingProductRequestBody: type: object properties: external_id: type: string maxLength: 255 is_active: type: boolean nullable: true name: type: string nullable: true maxLength: 255 price: type: number provider_type: allOf: - $ref: '#/components/schemas/BillingProviderType' nullable: true required: - price - external_id title: CreateBillingProductRequestBody BillingCustomerResponseData: type: object properties: company_id: type: string nullable: true deleted_at: type: string format: date-time nullable: true email: type: string external_id: type: string id: type: string name: type: string provider_type: $ref: '#/components/schemas/BillingProviderType' updated_at: type: string format: date-time required: - email - external_id - id - name - provider_type - updated_at title: BillingCustomerResponseData CreateBillingPriceRequestBody: type: object properties: billing_scheme: $ref: '#/components/schemas/BillingPriceScheme' currency: type: string maxLength: 3 external_account_id: type: string maxLength: 255 interval: type: string maxLength: 255 is_active: type: boolean meter_id: type: string nullable: true maxLength: 255 nickname: type: string nullable: true maxLength: 512 package_size: type: integer format: int64 nullable: true price: type: integer format: int64 price_decimal: type: string nullable: true price_external_id: type: string maxLength: 255 price_tiers: type: array items: $ref: '#/components/schemas/CreateBillingPriceTierRequestBody' maxItems: 100 product_external_id: type: string maxLength: 255 provider_type: allOf: - $ref: '#/components/schemas/BillingProviderType' nullable: true tiers_mode: allOf: - $ref: '#/components/schemas/BillingTiersMode' nullable: true usage_type: $ref: '#/components/schemas/BillingPriceUsageType' required: - billing_scheme - currency - external_account_id - interval - is_active - price - price_external_id - price_tiers - product_external_id - usage_type title: CreateBillingPriceRequestBody CreatePaymentMethodRequestBody: type: object properties: account_last4: type: string nullable: true maxLength: 4 account_name: type: string nullable: true maxLength: 255 bank_name: type: string nullable: true maxLength: 255 billing_email: type: string nullable: true maxLength: 255 billing_name: type: string nullable: true maxLength: 255 card_brand: type: string nullable: true maxLength: 32 card_exp_month: type: integer format: int64 nullable: true card_exp_year: type: integer format: int64 nullable: true card_last4: type: string nullable: true maxLength: 4 customer_external_id: type: string maxLength: 255 external_id: type: string maxLength: 255 payment_method_type: type: string maxLength: 32 required: - external_id - customer_external_id - payment_method_type title: CreatePaymentMethodRequestBody PaymentMethodResponseData: type: object properties: account_last4: type: string nullable: true account_name: type: string nullable: true bank_name: type: string nullable: true billing_email: type: string nullable: true billing_name: type: string nullable: true card_brand: type: string nullable: true card_exp_month: type: integer format: int64 nullable: true card_exp_year: type: integer format: int64 nullable: true card_last4: type: string nullable: true company_id: type: string nullable: true created_at: type: string format: date-time customer_external_id: type: string environment_id: type: string external_id: type: string id: type: string payment_method_type: type: string provider_type: $ref: '#/components/schemas/BillingProviderType' updated_at: type: string format: date-time required: - id - created_at - customer_external_id - environment_id - external_id - payment_method_type - provider_type - updated_at title: PaymentMethodResponseData BillingSubscriptionResponseData: type: object properties: application_id: type: string nullable: true cancel_at: type: integer format: int64 nullable: true cancel_at_period_end: type: boolean company_id: type: string nullable: true created_at: type: string format: date-time currency: type: string customer_external_id: type: string default_payment_method_id: type: string nullable: true expired_at: type: string format: date-time nullable: true id: type: string interval: type: string metadata: type: object period_end: type: integer format: int64 period_start: type: integer format: int64 provider_type: $ref: '#/components/schemas/BillingProviderType' status: type: string subscription_external_id: type: string total_price: type: integer format: int64 trial_end: type: integer format: int64 nullable: true trial_end_setting: allOf: - $ref: '#/components/schemas/BillingSubscriptionTrialEndSetting' nullable: true required: - cancel_at_period_end - created_at - currency - customer_external_id - subscription_external_id - id - interval - period_end - period_start - total_price - provider_type - status title: BillingSubscriptionResponseData BillingProductPriceInterval: type: string enum: - day - month - one-time - year BillingMeterResponseData: type: object properties: dispaly_name: type: string event_name: type: string event_payload_key: type: string external_price_id: type: string id: type: string provider_type: $ref: '#/components/schemas/BillingProviderType' required: - dispaly_name - event_name - event_payload_key - external_price_id - id - provider_type title: BillingMeterResponseData BillingProductResponseData: type: object properties: account_id: type: string created_at: type: string format: date-time currency: type: string description: Deprecated; currencies are associated with prices, not products nullable: true deprecated: true environment_id: type: string external_id: type: string is_active: type: boolean name: type: string price: type: number price_decimal: type: string nullable: true product_id: type: string provider_type: $ref: '#/components/schemas/BillingProviderType' quantity: type: number updated_at: type: string format: date-time required: - account_id - created_at - environment_id - external_id - is_active - name - price - product_id - provider_type - quantity - updated_at title: BillingProductResponseData CountResponse: type: object properties: count: type: integer description: The number of resources CreateBillingSubscriptionRequestBody: type: object properties: application_id: type: string nullable: true maxLength: 255 cancel_at: type: integer format: int64 nullable: true cancel_at_period_end: type: boolean currency: type: string maxLength: 3 customer_external_id: type: string maxLength: 255 default_payment_method_external_id: type: string nullable: true maxLength: 255 default_payment_method_id: type: string nullable: true discounts: type: array items: $ref: '#/components/schemas/BillingSubscriptionDiscount' maxItems: 100 expired_at: type: string format: date-time interval: type: string nullable: true maxLength: 255 metadata: type: object nullable: true period_end: type: integer format: int64 nullable: true period_start: type: integer format: int64 nullable: true product_external_ids: type: array items: $ref: '#/components/schemas/BillingProductPricing' maxItems: 100 provider_type: allOf: - $ref: '#/components/schemas/BillingProviderType' nullable: true status: type: string nullable: true maxLength: 255 subscription_external_id: type: string maxLength: 255 total_price: type: integer format: int64 trial_end: type: integer format: int64 nullable: true trial_end_setting: allOf: - $ref: '#/components/schemas/BillingSubscriptionTrialEndSetting' nullable: true required: - customer_external_id - subscription_external_id - total_price - currency - expired_at - product_external_ids - discounts - cancel_at_period_end title: CreateBillingSubscriptionRequestBody BillingProductDetailResponseData: type: object properties: account_id: type: string created_at: type: string format: date-time currency: type: string description: Deprecated; currencies are associated with prices, not products nullable: true deprecated: true environment_id: type: string external_id: type: string is_active: type: boolean name: type: string price: type: number price_decimal: type: string nullable: true prices: type: array items: $ref: '#/components/schemas/BillingPriceResponseData' maxItems: 1000 product_id: type: string provider_type: $ref: '#/components/schemas/BillingProviderType' quantity: type: number subscription_count: type: integer format: int64 updated_at: type: string format: date-time required: - account_id - created_at - environment_id - external_id - is_active - name - price - product_id - provider_type - quantity - updated_at - prices - subscription_count title: BillingProductDetailResponseData CreateMeterRequestBody: type: object properties: display_name: type: string maxLength: 255 event_name: type: string maxLength: 255 event_payload_key: type: string maxLength: 255 external_id: type: string maxLength: 255 provider_type: allOf: - $ref: '#/components/schemas/BillingProviderType' nullable: true required: - external_id - display_name - event_name - event_payload_key title: CreateMeterRequestBody BillingSubscriptionTrialEndSetting: type: string enum: - cancel - subscribe BillingPriceView: type: object properties: billing_scheme: $ref: '#/components/schemas/BillingPriceScheme' created_at: type: string format: date-time currency: type: string id: type: string interval: $ref: '#/components/schemas/BillingProductPriceInterval' is_active: type: boolean meter_event_name: type: string nullable: true meter_event_payload_key: type: string nullable: true meter_id: type: string nullable: true nickname: type: string nullable: true package_size: type: integer format: int64 price: type: integer format: int64 price_decimal: type: string nullable: true price_external_id: type: string price_id: type: string price_tier: type: array items: $ref: '#/components/schemas/BillingProductPriceTierResponseData' maxItems: 100 product_external_id: type: string product_id: type: string product_name: type: string provider_type: $ref: '#/components/schemas/BillingProviderType' tiers_mode: allOf: - $ref: '#/components/schemas/BillingTiersMode' nullable: true updated_at: type: string format: date-time usage_type: $ref: '#/components/schemas/BillingPriceUsageType' required: - id - billing_scheme - created_at - currency - interval - is_active - package_size - price - price_external_id - product_external_id - provider_type - updated_at - usage_type - price_id - product_id - product_name - price_tier title: BillingPriceView securitySchemes: ApiKeyAuth: type: apiKey in: header name: X-Schematic-Api-Key