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.39.0"
".": "5.40.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: 118
configured_endpoints: 126
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-a5a28a58483355d3cc3da7ac5c452d548ee17183324318198052968121ca7dba.yml
openapi_spec_hash: a317931a99e6d4a122919135a0363e40
config_hash: 05c94c0e6dbeab2c9b554c2e0d6371a0
config_hash: bcf82bddb691f6be773ac6cae8c03b9a
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 5.40.0 (2026-01-08)

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

### Features

* **api:** manual updates ([bdaaa9a](https://github.com/orbcorp/orb-node/commit/bdaaa9af5f4d568507a10b4ca0e0e9daaf27937e))

## 5.39.0 (2026-01-06)

Full Changelog: [v5.38.0...v5.39.0](https://github.com/orbcorp/orb-node/compare/v5.38.0...v5.39.0)
Expand Down
30 changes: 30 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -355,15 +355,18 @@ Methods:
Types:

- <code><a href="./src/resources/invoices.ts">InvoiceFetchUpcomingResponse</a></code>
- <code><a href="./src/resources/invoices.ts">InvoiceListSummaryResponse</a></code>

Methods:

- <code title="post /invoices">client.invoices.<a href="./src/resources/invoices.ts">create</a>({ ...params }) -> Invoice</code>
- <code title="put /invoices/{invoice_id}">client.invoices.<a href="./src/resources/invoices.ts">update</a>(invoiceId, { ...params }) -> Invoice</code>
- <code title="get /invoices">client.invoices.<a href="./src/resources/invoices.ts">list</a>({ ...params }) -> InvoicesPage</code>
- <code title="delete /invoices/{invoice_id}/invoice_line_items/{line_item_id}">client.invoices.<a href="./src/resources/invoices.ts">deleteLineItem</a>(invoiceId, lineItemId) -> void</code>
- <code title="get /invoices/{invoice_id}">client.invoices.<a href="./src/resources/invoices.ts">fetch</a>(invoiceId) -> Invoice</code>
- <code title="get /invoices/upcoming">client.invoices.<a href="./src/resources/invoices.ts">fetchUpcoming</a>({ ...params }) -> InvoiceFetchUpcomingResponse</code>
- <code title="post /invoices/{invoice_id}/issue">client.invoices.<a href="./src/resources/invoices.ts">issue</a>(invoiceId, { ...params }) -> Invoice</code>
- <code title="get /invoices/summary">client.invoices.<a href="./src/resources/invoices.ts">listSummary</a>({ ...params }) -> InvoiceListSummaryResponsesPage</code>
- <code title="post /invoices/{invoice_id}/mark_paid">client.invoices.<a href="./src/resources/invoices.ts">markPaid</a>(invoiceId, { ...params }) -> Invoice</code>
- <code title="post /invoices/{invoice_id}/pay">client.invoices.<a href="./src/resources/invoices.ts">pay</a>(invoiceId) -> Invoice</code>
- <code title="post /invoices/{invoice_id}/void">client.invoices.<a href="./src/resources/invoices.ts">void</a>(invoiceId) -> Invoice</code>
Expand Down Expand Up @@ -415,6 +418,20 @@ Methods:
- <code title="put /plans/external_plan_id/{external_plan_id}">client.plans.externalPlanId.<a href="./src/resources/plans/external-plan-id.ts">update</a>(otherExternalPlanId, { ...params }) -> Plan</code>
- <code title="get /plans/external_plan_id/{external_plan_id}">client.plans.externalPlanId.<a href="./src/resources/plans/external-plan-id.ts">fetch</a>(externalPlanId) -> Plan</code>

## Migrations

Types:

- <code><a href="./src/resources/plans/migrations.ts">MigrationRetrieveResponse</a></code>
- <code><a href="./src/resources/plans/migrations.ts">MigrationListResponse</a></code>
- <code><a href="./src/resources/plans/migrations.ts">MigrationCancelResponse</a></code>

Methods:

- <code title="get /plans/{plan_id}/migrations/{migration_id}">client.plans.migrations.<a href="./src/resources/plans/migrations.ts">retrieve</a>(planId, migrationId) -> MigrationRetrieveResponse</code>
- <code title="get /plans/{plan_id}/migrations">client.plans.migrations.<a href="./src/resources/plans/migrations.ts">list</a>(planId, { ...params }) -> MigrationListResponsesPage</code>
- <code title="post /plans/{plan_id}/migrations/{migration_id}/cancel">client.plans.migrations.<a href="./src/resources/plans/migrations.ts">cancel</a>(planId, migrationId) -> MigrationCancelResponse</code>

# Prices

Types:
Expand Down Expand Up @@ -542,11 +559,24 @@ Types:

- <code><a href="./src/resources/subscription-changes.ts">MutatedSubscription</a></code>
- <code><a href="./src/resources/subscription-changes.ts">SubscriptionChangeRetrieveResponse</a></code>
- <code><a href="./src/resources/subscription-changes.ts">SubscriptionChangeListResponse</a></code>
- <code><a href="./src/resources/subscription-changes.ts">SubscriptionChangeApplyResponse</a></code>
- <code><a href="./src/resources/subscription-changes.ts">SubscriptionChangeCancelResponse</a></code>

Methods:

- <code title="get /subscription_changes/{subscription_change_id}">client.subscriptionChanges.<a href="./src/resources/subscription-changes.ts">retrieve</a>(subscriptionChangeId) -> SubscriptionChangeRetrieveResponse</code>
- <code title="get /subscription_changes">client.subscriptionChanges.<a href="./src/resources/subscription-changes.ts">list</a>({ ...params }) -> SubscriptionChangeListResponsesPage</code>
- <code title="post /subscription_changes/{subscription_change_id}/apply">client.subscriptionChanges.<a href="./src/resources/subscription-changes.ts">apply</a>(subscriptionChangeId, { ...params }) -> SubscriptionChangeApplyResponse</code>
- <code title="post /subscription_changes/{subscription_change_id}/cancel">client.subscriptionChanges.<a href="./src/resources/subscription-changes.ts">cancel</a>(subscriptionChangeId) -> SubscriptionChangeCancelResponse</code>

# CreditBlocks

Types:

- <code><a href="./src/resources/credit-blocks.ts">CreditBlockRetrieveResponse</a></code>

Methods:

- <code title="get /credit_blocks/{block_id}">client.creditBlocks.<a href="./src/resources/credit-blocks.ts">retrieve</a>(blockId) -> CreditBlockRetrieveResponse</code>
- <code title="delete /credit_blocks/{block_id}">client.creditBlocks.<a href="./src/resources/credit-blocks.ts">delete</a>(blockId) -> void</code>
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.39.0",
"version": "5.40.0",
"description": "The official TypeScript library for the Orb API",
"author": "Orb <team@withorb.com>",
"types": "dist/index.d.ts",
Expand Down
19 changes: 19 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
AlertsPage,
Threshold,
} from './resources/alerts';
import { CreditBlockRetrieveResponse, CreditBlocks } from './resources/credit-blocks';
import { CreditNoteCreateParams, CreditNoteListParams, CreditNotes } from './resources/credit-notes';
import {
InvoiceLineItemCreateParams,
Expand All @@ -33,6 +34,9 @@ import {
InvoiceFetchUpcomingResponse,
InvoiceIssueParams,
InvoiceListParams,
InvoiceListSummaryParams,
InvoiceListSummaryResponse,
InvoiceListSummaryResponsesPage,
InvoiceMarkPaidParams,
InvoiceUpdateParams,
Invoices,
Expand All @@ -58,6 +62,9 @@ import {
SubscriptionChangeApplyParams,
SubscriptionChangeApplyResponse,
SubscriptionChangeCancelResponse,
SubscriptionChangeListParams,
SubscriptionChangeListResponse,
SubscriptionChangeListResponsesPage,
SubscriptionChangeRetrieveResponse,
SubscriptionChanges,
} from './resources/subscription-changes';
Expand Down Expand Up @@ -326,6 +333,7 @@ export class Orb extends Core.APIClient {
alerts: API.Alerts = new API.Alerts(this);
dimensionalPriceGroups: API.DimensionalPriceGroups = new API.DimensionalPriceGroups(this);
subscriptionChanges: API.SubscriptionChanges = new API.SubscriptionChanges(this);
creditBlocks: API.CreditBlocks = new API.CreditBlocks(this);

/**
* Check whether the base URL is set to its default.
Expand Down Expand Up @@ -396,6 +404,7 @@ Orb.CustomersPage = CustomersPage;
Orb.Events = Events;
Orb.InvoiceLineItems = InvoiceLineItems;
Orb.Invoices = Invoices;
Orb.InvoiceListSummaryResponsesPage = InvoiceListSummaryResponsesPage;
Orb.Items = Items;
Orb.ItemsPage = ItemsPage;
Orb.Metrics = Metrics;
Expand All @@ -409,6 +418,8 @@ Orb.Alerts = Alerts;
Orb.AlertsPage = AlertsPage;
Orb.DimensionalPriceGroupsPage = DimensionalPriceGroupsPage;
Orb.SubscriptionChanges = SubscriptionChanges;
Orb.SubscriptionChangeListResponsesPage = SubscriptionChangeListResponsesPage;
Orb.CreditBlocks = CreditBlocks;

export declare namespace Orb {
export type RequestOptions = Core.RequestOptions;
Expand Down Expand Up @@ -478,11 +489,14 @@ export declare namespace Orb {
export {
Invoices as Invoices,
type InvoiceFetchUpcomingResponse as InvoiceFetchUpcomingResponse,
type InvoiceListSummaryResponse as InvoiceListSummaryResponse,
InvoiceListSummaryResponsesPage as InvoiceListSummaryResponsesPage,
type InvoiceCreateParams as InvoiceCreateParams,
type InvoiceUpdateParams as InvoiceUpdateParams,
type InvoiceListParams as InvoiceListParams,
type InvoiceFetchUpcomingParams as InvoiceFetchUpcomingParams,
type InvoiceIssueParams as InvoiceIssueParams,
type InvoiceListSummaryParams as InvoiceListSummaryParams,
type InvoiceMarkPaidParams as InvoiceMarkPaidParams,
};

Expand Down Expand Up @@ -604,11 +618,16 @@ export declare namespace Orb {
SubscriptionChanges as SubscriptionChanges,
type MutatedSubscription as MutatedSubscription,
type SubscriptionChangeRetrieveResponse as SubscriptionChangeRetrieveResponse,
type SubscriptionChangeListResponse as SubscriptionChangeListResponse,
type SubscriptionChangeApplyResponse as SubscriptionChangeApplyResponse,
type SubscriptionChangeCancelResponse as SubscriptionChangeCancelResponse,
SubscriptionChangeListResponsesPage as SubscriptionChangeListResponsesPage,
type SubscriptionChangeListParams as SubscriptionChangeListParams,
type SubscriptionChangeApplyParams as SubscriptionChangeApplyParams,
};

export { CreditBlocks as CreditBlocks, type CreditBlockRetrieveResponse as CreditBlockRetrieveResponse };

export type Address = API.Address;
export type AdjustmentInterval = API.AdjustmentInterval;
export type AggregatedCost = API.AggregatedCost;
Expand Down
81 changes: 81 additions & 0 deletions src/resources/credit-blocks.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

import { APIResource } from '../resource';
import * as Core from '../core';

export class CreditBlocks extends APIResource {
/**
* This endpoint returns a credit block identified by its block_id.
*/
retrieve(blockId: string, options?: Core.RequestOptions): Core.APIPromise<CreditBlockRetrieveResponse> {
return this._client.get(`/credit_blocks/${blockId}`, options);
}

/**
* This endpoint deletes a credit block by its ID.
*
* When a credit block is deleted:
*
* - The block is removed from the customer's credit ledger.
* - Any usage of the credit block is reversed, and the ledger is replayed as if
* the block never existed.
* - If invoices were generated from the purchase of the credit block, they will be
* deleted if in draft status, voided if issued, or a credit note will be issued
* if the invoice is paid.
*
* <Note>
* Issued invoices that had credits applied from this block will not be regenerated, but the ledger will
* reflect the state as if credits from the deleted block were never applied.
* </Note>
*/
delete(blockId: string, options?: Core.RequestOptions): Core.APIPromise<void> {
return this._client.delete(`/credit_blocks/${blockId}`, {
...options,
headers: { Accept: '*/*', ...options?.headers },
});
}
}

/**
* The Credit Block resource models prepaid credits within Orb.
*/
export interface CreditBlockRetrieveResponse {
id: string;

balance: number;

effective_date: string | null;

expiry_date: string | null;

filters: Array<CreditBlockRetrieveResponse.Filter>;

maximum_initial_balance: number | null;

per_unit_cost_basis: string | null;

status: 'active' | 'pending_payment';
}

export namespace CreditBlockRetrieveResponse {
export interface Filter {
/**
* The property of the price to filter on.
*/
field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id';

/**
* Should prices that match the filter be included or excluded.
*/
operator: 'includes' | 'excludes';

/**
* The IDs or values that match this filter.
*/
values: Array<string>;
}
}

export declare namespace CreditBlocks {
export { type CreditBlockRetrieveResponse as CreditBlockRetrieveResponse };
}
7 changes: 7 additions & 0 deletions src/resources/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export {
type CouponCreateParams,
type CouponListParams,
} from './coupons/coupons';
export { CreditBlocks, type CreditBlockRetrieveResponse } from './credit-blocks';
export { CreditNotes, type CreditNoteCreateParams, type CreditNoteListParams } from './credit-notes';
export {
CustomersPage,
Expand Down Expand Up @@ -78,13 +79,16 @@ export {
type InvoiceLineItemCreateParams,
} from './invoice-line-items';
export {
InvoiceListSummaryResponsesPage,
Invoices,
type InvoiceFetchUpcomingResponse,
type InvoiceListSummaryResponse,
type InvoiceCreateParams,
type InvoiceUpdateParams,
type InvoiceListParams,
type InvoiceFetchUpcomingParams,
type InvoiceIssueParams,
type InvoiceListSummaryParams,
type InvoiceMarkPaidParams,
} from './invoices';
export {
Expand Down Expand Up @@ -117,11 +121,14 @@ export {
type PriceEvaluatePreviewEventsParams,
} from './prices/prices';
export {
SubscriptionChangeListResponsesPage,
SubscriptionChanges,
type MutatedSubscription,
type SubscriptionChangeRetrieveResponse,
type SubscriptionChangeListResponse,
type SubscriptionChangeApplyResponse,
type SubscriptionChangeCancelResponse,
type SubscriptionChangeListParams,
type SubscriptionChangeApplyParams,
} from './subscription-changes';
export {
Expand Down
Loading