orb-billing
Version:
The official TypeScript library for the Orb API
44 lines • 2.44 kB
JavaScript
;
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
exports.BalanceTransactionListResponsesPage = exports.BalanceTransactions = void 0;
const resource_1 = require("../../resource.js");
const core_1 = require("../../core.js");
const pagination_1 = require("../../pagination.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 BalanceTransactions extends resource_1.APIResource {
/**
* Creates an immutable balance transaction that updates the customer's balance and
* returns back the newly created transaction.
*/
create(customerId, body, options) {
return this._client.post(`/customers/${customerId}/balance_transactions`, { body, ...options });
}
list(customerId, query = {}, options) {
if ((0, core_1.isRequestOptions)(query)) {
return this.list(customerId, {}, query);
}
return this._client.getAPIList(`/customers/${customerId}/balance_transactions`, BalanceTransactionListResponsesPage, { query, ...options });
}
}
exports.BalanceTransactions = BalanceTransactions;
class BalanceTransactionListResponsesPage extends pagination_1.Page {
}
exports.BalanceTransactionListResponsesPage = BalanceTransactionListResponsesPage;
BalanceTransactions.BalanceTransactionListResponsesPage = BalanceTransactionListResponsesPage;
//# sourceMappingURL=balance-transactions.js.map