orb-billing
Version:
The official TypeScript library for the Orb API
41 lines • 2.02 kB
JavaScript
;
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
exports.Costs = void 0;
const resource_1 = require("../../resource.js");
const core_1 = require("../../core.js");
/**
* A customer is a buyer of your products, and the other party to the billing relationship.
*
* In Orb, customers are assigned system generated identifiers automatically, but it's often desirable to have these
* match existing identifiers in your system. To avoid having to denormalize Orb ID information, you can pass in an
* `external_customer_id` with your own identifier. See
* [Customer ID Aliases](/events-and-metrics/customer-aliases) for further information about how these
* aliases work in Orb.
*
* In addition to having an identifier in your system, a customer may exist in a payment provider solution like
* Stripe. Use the `payment_provider_id` and the `payment_provider` enum field to express this mapping.
*
* A customer also has a timezone (from the standard [IANA timezone database](https://www.iana.org/time-zones)), which
* defaults to your account's timezone. See [Timezone localization](/essentials/timezones) for
* information on what this timezone parameter influences within Orb.
*/
class Costs extends resource_1.APIResource {
list(customerId, query = {}, options) {
if ((0, core_1.isRequestOptions)(query)) {
return this.list(customerId, {}, query);
}
return this._client.get(`/customers/${customerId}/costs`, { query, ...options });
}
listByExternalId(externalCustomerId, query = {}, options) {
if ((0, core_1.isRequestOptions)(query)) {
return this.listByExternalId(externalCustomerId, {}, query);
}
return this._client.get(`/customers/external_customer_id/${externalCustomerId}/costs`, {
query,
...options,
});
}
}
exports.Costs = Costs;
//# sourceMappingURL=costs.js.map