Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "5.48.0"
".": "5.49.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 139
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-1ca41c4b1d872cf2a198c8cf5edeeeddac012259a7cf211b102bf137c05b8240.yml
openapi_spec_hash: 955066d4865fc42440cd81e40f5f79cd
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-2b77f13a159cf689a3bba6ac5ff03b6c0df62b772e2da04aff52be86710ca4d4.yml
openapi_spec_hash: 28a3f685403d98ddd68b427d92ed28fb
config_hash: c01c1191b1cd696c7ca855ff6d28a8df
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# Changelog

## 5.49.0 (2026-04-11)

Full Changelog: [v5.48.0...v5.49.0](https://github.com/orbcorp/orb-node/compare/v5.48.0...v5.49.0)

### Features

* **api:** api update ([2745374](https://github.com/orbcorp/orb-node/commit/2745374c941524c812f8b1aff91159b406f04d47))


### Chores

* **internal:** codegen related update ([fbcbfe3](https://github.com/orbcorp/orb-node/commit/fbcbfe3ff0ea0836bbea11fdec50f47f786cc088))


### Documentation

* update examples ([7df8be5](https://github.com/orbcorp/orb-node/commit/7df8be59d5a426a2eeb1e6503b5c81c9f5eaee21))

## 5.48.0 (2026-04-03)

Full Changelog: [v5.47.0...v5.48.0](https://github.com/orbcorp/orb-node/compare/v5.47.0...v5.48.0)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "orb-billing",
"version": "5.48.0",
"version": "5.49.0",
"description": "The official TypeScript library for the Orb API",
"author": "Orb <[email protected]>",
"types": "dist/index.d.ts",
Expand Down
4 changes: 2 additions & 2 deletions src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1053,10 +1053,10 @@ export const ensurePresent = <T>(value: T | null | undefined): T => {
*/
export const readEnv = (env: string): string | undefined => {
if (typeof process !== 'undefined') {
return process.env?.[env]?.trim() ?? undefined;
return process.env?.[env]?.trim() || undefined;
}
if (typeof Deno !== 'undefined') {
return Deno.env?.get?.(env)?.trim();
return Deno.env?.get?.(env)?.trim() || undefined;
}
return undefined;
};
Expand Down
29 changes: 29 additions & 0 deletions src/resources/coupons/coupons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,17 @@ export class Coupons extends APIResource {
/**
* This endpoint allows the creation of coupons, which can then be redeemed at
* subscription creation or plan change.
*
* @example
* ```ts
* const coupon = await client.coupons.create({
* discount: {
* discount_type: 'percentage',
* percentage_discount: 0,
* },
* redemption_code: 'HALFOFF',
* });
* ```
*/
create(body: CouponCreateParams, options?: Core.RequestOptions): Core.APIPromise<Coupon> {
return this._client.post('/coupons', { body, ...options });
Expand All @@ -28,6 +39,14 @@ export class Coupons extends APIResource {
* The list of coupons is ordered starting from the most recently created coupon.
* The response also includes `pagination_metadata`, which lets the caller retrieve
* the next page of results if they exist.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const coupon of client.coupons.list()) {
* // ...
* }
* ```
*/
list(query?: CouponListParams, options?: Core.RequestOptions): Core.PagePromise<CouponsPage, Coupon>;
list(options?: Core.RequestOptions): Core.PagePromise<CouponsPage, Coupon>;
Expand All @@ -45,6 +64,11 @@ export class Coupons extends APIResource {
* This endpoint allows a coupon to be archived. Archived coupons can no longer be
* redeemed, and will be hidden from lists of active coupons. Additionally, once a
* coupon is archived, its redemption code can be reused for a different coupon.
*
* @example
* ```ts
* const coupon = await client.coupons.archive('coupon_id');
* ```
*/
archive(couponId: string, options?: Core.RequestOptions): Core.APIPromise<Coupon> {
return this._client.post(`/coupons/${couponId}/archive`, options);
Expand All @@ -54,6 +78,11 @@ export class Coupons extends APIResource {
* This endpoint retrieves a coupon by its ID. To fetch coupons by their redemption
* code, use the [List coupons](list-coupons) endpoint with the redemption_code
* parameter.
*
* @example
* ```ts
* const coupon = await client.coupons.fetch('coupon_id');
* ```
*/
fetch(couponId: string, options?: Core.RequestOptions): Core.APIPromise<Coupon> {
return this._client.get(`/coupons/${couponId}`, options);
Expand Down
10 changes: 10 additions & 0 deletions src/resources/coupons/subscriptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@ export class Subscriptions extends APIResource {
* coupon as a [paginated](/api-reference/pagination) list, ordered starting from
* the most recently created subscription. For a full discussion of the
* subscription resource, see [Subscription](/core-concepts#subscription).
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const subscription of client.coupons.subscriptions.list(
* 'coupon_id',
* )) {
* // ...
* }
* ```
*/
list(
couponId: string,
Expand Down
17 changes: 10 additions & 7 deletions src/resources/credit-blocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,17 @@ export class CreditBlocks extends APIResource {
/**
* This endpoint returns the credit block and its associated purchasing invoices.
*
* If a credit block was purchased (as opposed to being manually added or allocated
* from a subscription), this endpoint returns the invoices that were created to
* charge the customer for the credit block. For credit blocks with payment
* schedules spanning multiple periods (e.g., monthly payments over 12 months),
* multiple invoices will be returned.
* If a credit block was purchased (as opposed to being manually added), this
* endpoint returns the invoices that were created to charge the customer for the
* credit block. For credit blocks with payment schedules spanning multiple periods
* (e.g., monthly payments over 12 months), multiple invoices will be returned.
*
* If the credit block was not purchased (e.g., manual increment, allocation), an
* empty invoices list is returned.
* For credit blocks created by subscription allocation prices, this endpoint
* returns the subscription invoice containing the allocation line item that
* created the block.
*
* If the credit block was not purchased (e.g., manual increment), an empty
* invoices list is returned.
*
* **Note: This endpoint is currently experimental and its interface may change in
* future releases. Please contact support before building production integrations
Expand Down
28 changes: 28 additions & 0 deletions src/resources/credit-notes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,19 @@ export class CreditNotes extends APIResource {
* Note: Both start_date and end_date are inclusive - the service period will cover
* both the start date and end date completely (from start of start_date to end of
* end_date).
*
* @example
* ```ts
* const creditNote = await client.creditNotes.create({
* line_items: [
* {
* amount: 'amount',
* invoice_line_item_id: '4khy3nwzktxv7',
* },
* ],
* reason: 'duplicate',
* });
* ```
*/
create(body: CreditNoteCreateParams, options?: Core.RequestOptions): Core.APIPromise<Shared.CreditNote> {
return this._client.post('/credit_notes', { body, ...options });
Expand All @@ -49,6 +62,14 @@ export class CreditNotes extends APIResource {
* Get a paginated list of CreditNotes. Users can also filter by customer_id,
* subscription_id, or external_customer_id. The credit notes will be returned in
* reverse chronological order by `creation_time`.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const creditNote of client.creditNotes.list()) {
* // ...
* }
* ```
*/
list(
query?: CreditNoteListParams,
Expand All @@ -68,6 +89,13 @@ export class CreditNotes extends APIResource {
/**
* This endpoint is used to fetch a single [`Credit Note`](/invoicing/credit-notes)
* given an identifier.
*
* @example
* ```ts
* const creditNote = await client.creditNotes.fetch(
* 'credit_note_id',
* );
* ```
*/
fetch(creditNoteId: string, options?: Core.RequestOptions): Core.APIPromise<Shared.CreditNote> {
return this._client.get(`/credit_notes/${creditNoteId}`, options);
Expand Down
34 changes: 34 additions & 0 deletions src/resources/dimensional-price-groups/dimensional-price-groups.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ export class DimensionalPriceGroups extends APIResource {
* widgets used and we want to charge differently depending on the color of the
* widget. We can create a price group with a dimension "color" and two prices: one
* that charges \$10 per red widget and one that charges \$20 per blue widget.
*
* @example
* ```ts
* const dimensionalPriceGroup =
* await client.dimensionalPriceGroups.create({
* billable_metric_id: 'billable_metric_id',
* dimensions: ['region', 'instance_type'],
* name: 'name',
* });
* ```
*/
create(
body: DimensionalPriceGroupCreateParams,
Expand All @@ -34,6 +44,14 @@ export class DimensionalPriceGroups extends APIResource {

/**
* Fetch dimensional price group
*
* @example
* ```ts
* const dimensionalPriceGroup =
* await client.dimensionalPriceGroups.retrieve(
* 'dimensional_price_group_id',
* );
* ```
*/
retrieve(
dimensionalPriceGroupId: string,
Expand All @@ -46,6 +64,14 @@ export class DimensionalPriceGroups extends APIResource {
* This endpoint can be used to update the `external_dimensional_price_group_id`
* and `metadata` of an existing dimensional price group. Other fields on a
* dimensional price group are currently immutable.
*
* @example
* ```ts
* const dimensionalPriceGroup =
* await client.dimensionalPriceGroups.update(
* 'dimensional_price_group_id',
* );
* ```
*/
update(
dimensionalPriceGroupId: string,
Expand All @@ -57,6 +83,14 @@ export class DimensionalPriceGroups extends APIResource {

/**
* List dimensional price groups
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const dimensionalPriceGroup of client.dimensionalPriceGroups.list()) {
* // ...
* }
* ```
*/
list(
query?: DimensionalPriceGroupListParams,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ import * as DimensionalPriceGroupsAPI from './dimensional-price-groups';
export class ExternalDimensionalPriceGroupID extends APIResource {
/**
* Fetch dimensional price group by external ID
*
* @example
* ```ts
* const dimensionalPriceGroup =
* await client.dimensionalPriceGroups.externalDimensionalPriceGroupId.retrieve(
* 'external_dimensional_price_group_id',
* );
* ```
*/
retrieve(
externalDimensionalPriceGroupId: string,
Expand All @@ -22,6 +30,14 @@ export class ExternalDimensionalPriceGroupID extends APIResource {
* This endpoint can be used to update the `external_dimensional_price_group_id`
* and `metadata` of an existing dimensional price group. Other fields on a
* dimensional price group are currently immutable.
*
* @example
* ```ts
* const dimensionalPriceGroup =
* await client.dimensionalPriceGroups.externalDimensionalPriceGroupId.update(
* 'external_dimensional_price_group_id',
* );
* ```
*/
update(
externalDimensionalPriceGroupId: string,
Expand Down
37 changes: 37 additions & 0 deletions src/resources/events/backfills.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@ export class Backfills extends APIResource {
*
* You may not have multiple backfills in a pending or pending_revert state with
* overlapping timeframes.
*
* @example
* ```ts
* const backfill = await client.events.backfills.create({
* timeframe_end: '2019-12-27T18:11:19.117Z',
* timeframe_start: '2019-12-27T18:11:19.117Z',
* });
* ```
*/
create(body: BackfillCreateParams, options?: Core.RequestOptions): Core.APIPromise<BackfillCreateResponse> {
return this._client.post('/events/backfills', { body, ...options });
Expand All @@ -64,6 +72,14 @@ export class Backfills extends APIResource {
* backfill. The response also includes
* [`pagination_metadata`](/api-reference/pagination), which lets the caller
* retrieve the next page of results if they exist.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const backfillListResponse of client.events.backfills.list()) {
* // ...
* }
* ```
*/
list(
query?: BackfillListParams,
Expand All @@ -85,13 +101,27 @@ export class Backfills extends APIResource {
* backfill, Orb will asynchronously reflect the updated usage in invoice amounts
* and usage graphs. Once all of the updates are complete, the backfill's status
* will transition to `reflected`.
*
* @example
* ```ts
* const response = await client.events.backfills.close(
* 'backfill_id',
* );
* ```
*/
close(backfillId: string, options?: Core.RequestOptions): Core.APIPromise<BackfillCloseResponse> {
return this._client.post(`/events/backfills/${backfillId}/close`, options);
}

/**
* This endpoint is used to fetch a backfill given an identifier.
*
* @example
* ```ts
* const response = await client.events.backfills.fetch(
* 'backfill_id',
* );
* ```
*/
fetch(backfillId: string, options?: Core.RequestOptions): Core.APIPromise<BackfillFetchResponse> {
return this._client.get(`/events/backfills/${backfillId}`, options);
Expand All @@ -105,6 +135,13 @@ export class Backfills extends APIResource {
*
* If a backfill is reverted before its closed, no usage will be updated as a
* result of the backfill and it will immediately transition to `reverted`.
*
* @example
* ```ts
* const response = await client.events.backfills.revert(
* 'backfill_id',
* );
* ```
*/
revert(backfillId: string, options?: Core.RequestOptions): Core.APIPromise<BackfillRevertResponse> {
return this._client.post(`/events/backfills/${backfillId}/revert`, options);
Expand Down
Loading
Loading