orb-billing
Version:
The official TypeScript library for the Orb API
37 lines • 1.88 kB
JavaScript
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../resource.mjs";
import { isRequestOptions } from "../../core.mjs";
/**
* 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.
*/
export class Costs extends APIResource {
list(customerId, query = {}, options) {
if (isRequestOptions(query)) {
return this.list(customerId, {}, query);
}
return this._client.get(`/customers/${customerId}/costs`, { query, ...options });
}
listByExternalId(externalCustomerId, query = {}, options) {
if (isRequestOptions(query)) {
return this.listByExternalId(externalCustomerId, {}, query);
}
return this._client.get(`/customers/external_customer_id/${externalCustomerId}/costs`, {
query,
...options,
});
}
}
//# sourceMappingURL=costs.mjs.map