UNPKG

orb-billing

Version:

The official TypeScript library for the Orb API

34 lines 1.52 kB
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from "../../core/resource.mjs"; import { path } from "../../internal/utils/path.mjs"; /** * The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be subscribed to by a * customer. Plans define the billing behavior of the subscription. You can see more about how to configure prices * in the [Price resource](/reference/price). */ export class ExternalPlanID extends APIResource { /** * This endpoint allows the creation of a new plan version for an existing plan. */ createPlanVersion(externalPlanID, body, options) { return this._client.post(path `/plans/external_plan_id/${externalPlanID}/versions`, { body, ...options }); } /** * This endpoint is used to fetch a plan version. It returns the phases, prices, * and adjustments present on this version of the plan. */ fetchPlanVersion(version, params, options) { const { external_plan_id } = params; return this._client.get(path `/plans/external_plan_id/${external_plan_id}/versions/${version}`, options); } /** * This endpoint allows setting the default version of a plan. */ setDefaultPlanVersion(externalPlanID, body, options) { return this._client.post(path `/plans/external_plan_id/${externalPlanID}/set_default_version`, { body, ...options, }); } } //# sourceMappingURL=external-plan-id.mjs.map