orb-billing
Version:
The official TypeScript library for the Orb API
49 lines • 2.04 kB
JavaScript
;
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
exports.ExternalPriceID = void 0;
const resource_1 = require("../../core/resource.js");
const path_1 = require("../../internal/utils/path.js");
/**
* The Price resource represents a price that can be billed on a subscription, resulting in a charge on an invoice in
* the form of an invoice line item. Prices take a quantity and determine an amount to bill.
*
* Orb supports a few different pricing models out of the box. Each of these models is serialized differently in a
* given Price object. The model_type field determines the key for the configuration object that is present.
*
* For more on the types of prices, see [the core concepts documentation](/core-concepts#plan-and-price)
*/
class ExternalPriceID extends resource_1.APIResource {
/**
* This endpoint allows you to update the `metadata` property on a price. If you
* pass null for the metadata value, it will clear any existing metadata for that
* price.
*
* @example
* ```ts
* const price = await client.prices.externalPriceID.update(
* 'external_price_id',
* );
* ```
*/
update(externalPriceID, body, options) {
return this._client.put((0, path_1.path) `/prices/external_price_id/${externalPriceID}`, { body, ...options });
}
/**
* This endpoint returns a price given an external price id. See the
* [price creation API](/api-reference/price/create-price) for more information
* about external price aliases.
*
* @example
* ```ts
* const price = await client.prices.externalPriceID.fetch(
* 'external_price_id',
* );
* ```
*/
fetch(externalPriceID, options) {
return this._client.get((0, path_1.path) `/prices/external_price_id/${externalPriceID}`, options);
}
}
exports.ExternalPriceID = ExternalPriceID;
//# sourceMappingURL=external-price-id.js.map