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 @@
{
".": "4.73.0"
".": "4.74.0"
}
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 114
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-6d2a5b5d2cfb485e1a548aa15e1e36844e1f14f42553033822e1c570c8aa0825.yml
openapi_spec_hash: 0266a5aaced5e768bcf6a70924d69799
config_hash: e63f2d098e5d12f63ae4cd8270aa5c3c
configured_endpoints: 115
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-d513be954ba2cb57489bd048f93790cabb13849f0f04d328a5a15694c99550df.yml
openapi_spec_hash: 0d42694f412abf65defc3f88646a809c
config_hash: 1e2186b09e57d7d27b6ab5c8e6410b31
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog

## 4.74.0 (2025-06-03)

Full Changelog: [v4.73.0...v4.74.0](https://github.com/orbcorp/orb-node/compare/v4.73.0...v4.74.0)

### Features

* **api:** api update ([011d28e](https://github.com/orbcorp/orb-node/commit/011d28ea580b817c6ddfed2189784f3e96298a2e))
* **api:** api update ([7e37115](https://github.com/orbcorp/orb-node/commit/7e3711516a3d51a16c8aac0e821eae40ab73815b))


### Chores

* **docs:** use top-level-await in example snippets ([28bedd6](https://github.com/orbcorp/orb-node/commit/28bedd68f0eac7f3cc10ff55bb4a0afb46c9294a))

## 4.73.0 (2025-05-28)

Full Changelog: [v4.72.3...v4.73.0](https://github.com/orbcorp/orb-node/compare/v4.72.3...v4.73.0)
Expand Down
48 changes: 18 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,12 @@ const client = new Orb({
apiKey: process.env['ORB_API_KEY'], // This is the default and can be omitted
});

async function main() {
const customer = await client.customers.create({
email: 'example-customer@withorb.com',
name: 'My Customer',
});

console.log(customer.id);
}
const customer = await client.customers.create({
email: 'example-customer@withorb.com',
name: 'My Customer',
});

main();
console.log(customer.id);
```

### Request & Response types
Expand All @@ -48,12 +44,8 @@ const client = new Orb({
apiKey: process.env['ORB_API_KEY'], // This is the default and can be omitted
});

async function main() {
const params: Orb.CustomerCreateParams = { email: 'example-customer@withorb.com', name: 'My Customer' };
const customer: Orb.Customer = await client.customers.create(params);
}

main();
const params: Orb.CustomerCreateParams = { email: 'example-customer@withorb.com', name: 'My Customer' };
const customer: Orb.Customer = await client.customers.create(params);
```

Documentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors.
Expand All @@ -66,21 +58,17 @@ a subclass of `APIError` will be thrown:

<!-- prettier-ignore -->
```ts
async function main() {
const customer = await client.customers
.create({ email: 'example-customer@withorb.com', name: 'My Customer' })
.catch(async (err) => {
if (err instanceof Orb.APIError) {
console.log(err.status); // 400
console.log(err.name); // BadRequestError
console.log(err.headers); // {server: 'nginx', ...}
} else {
throw err;
}
});
}

main();
const customer = await client.customers
.create({ email: 'example-customer@withorb.com', name: 'My Customer' })
.catch(async (err) => {
if (err instanceof Orb.APIError) {
console.log(err.status); // 400
console.log(err.name); // BadRequestError
console.log(err.headers); // {server: 'nginx', ...}
} else {
throw err;
}
});
```

Error codes are as follows:
Expand Down
2 changes: 2 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ Types:
- <code><a href="./src/resources/subscriptions.ts">SubscriptionFetchCostsResponse</a></code>
- <code><a href="./src/resources/subscriptions.ts">SubscriptionFetchScheduleResponse</a></code>
- <code><a href="./src/resources/subscriptions.ts">SubscriptionPriceIntervalsResponse</a></code>
- <code><a href="./src/resources/subscriptions.ts">SubscriptionRedeemCouponResponse</a></code>
- <code><a href="./src/resources/subscriptions.ts">SubscriptionSchedulePlanChangeResponse</a></code>
- <code><a href="./src/resources/subscriptions.ts">SubscriptionTriggerPhaseResponse</a></code>
- <code><a href="./src/resources/subscriptions.ts">SubscriptionUnscheduleCancellationResponse</a></code>
Expand All @@ -338,6 +339,7 @@ Methods:
- <code title="get /subscriptions/{subscription_id}/schedule">client.subscriptions.<a href="./src/resources/subscriptions.ts">fetchSchedule</a>(subscriptionId, { ...params }) -> SubscriptionFetchScheduleResponsesPage</code>
- <code title="get /subscriptions/{subscription_id}/usage">client.subscriptions.<a href="./src/resources/subscriptions.ts">fetchUsage</a>(subscriptionId, { ...params }) -> SubscriptionUsage</code>
- <code title="post /subscriptions/{subscription_id}/price_intervals">client.subscriptions.<a href="./src/resources/subscriptions.ts">priceIntervals</a>(subscriptionId, { ...params }) -> SubscriptionPriceIntervalsResponse</code>
- <code title="post /subscriptions/{subscription_id}/redeem_coupon">client.subscriptions.<a href="./src/resources/subscriptions.ts">redeemCoupon</a>(subscriptionId, { ...params }) -> SubscriptionRedeemCouponResponse</code>
- <code title="post /subscriptions/{subscription_id}/schedule_plan_change">client.subscriptions.<a href="./src/resources/subscriptions.ts">schedulePlanChange</a>(subscriptionId, { ...params }) -> SubscriptionSchedulePlanChangeResponse</code>
- <code title="post /subscriptions/{subscription_id}/trigger_phase">client.subscriptions.<a href="./src/resources/subscriptions.ts">triggerPhase</a>(subscriptionId, { ...params }) -> SubscriptionTriggerPhaseResponse</code>
- <code title="post /subscriptions/{subscription_id}/unschedule_cancellation">client.subscriptions.<a href="./src/resources/subscriptions.ts">unscheduleCancellation</a>(subscriptionId) -> SubscriptionUnscheduleCancellationResponse</code>
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": "4.73.0",
"version": "4.74.0",
"description": "The official TypeScript library for the Orb API",
"author": "Orb <team@withorb.com>",
"types": "dist/index.d.ts",
Expand Down
4 changes: 4 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ import {
SubscriptionListParams,
SubscriptionPriceIntervalsParams,
SubscriptionPriceIntervalsResponse,
SubscriptionRedeemCouponParams,
SubscriptionRedeemCouponResponse,
SubscriptionSchedulePlanChangeParams,
SubscriptionSchedulePlanChangeResponse,
SubscriptionTriggerPhaseParams,
Expand Down Expand Up @@ -504,6 +506,7 @@ export declare namespace Orb {
type SubscriptionFetchCostsResponse as SubscriptionFetchCostsResponse,
type SubscriptionFetchScheduleResponse as SubscriptionFetchScheduleResponse,
type SubscriptionPriceIntervalsResponse as SubscriptionPriceIntervalsResponse,
type SubscriptionRedeemCouponResponse as SubscriptionRedeemCouponResponse,
type SubscriptionSchedulePlanChangeResponse as SubscriptionSchedulePlanChangeResponse,
type SubscriptionTriggerPhaseResponse as SubscriptionTriggerPhaseResponse,
type SubscriptionUnscheduleCancellationResponse as SubscriptionUnscheduleCancellationResponse,
Expand All @@ -521,6 +524,7 @@ export declare namespace Orb {
type SubscriptionFetchScheduleParams as SubscriptionFetchScheduleParams,
type SubscriptionFetchUsageParams as SubscriptionFetchUsageParams,
type SubscriptionPriceIntervalsParams as SubscriptionPriceIntervalsParams,
type SubscriptionRedeemCouponParams as SubscriptionRedeemCouponParams,
type SubscriptionSchedulePlanChangeParams as SubscriptionSchedulePlanChangeParams,
type SubscriptionTriggerPhaseParams as SubscriptionTriggerPhaseParams,
type SubscriptionUnscheduleFixedFeeQuantityUpdatesParams as SubscriptionUnscheduleFixedFeeQuantityUpdatesParams,
Expand Down
36 changes: 24 additions & 12 deletions src/resources/customers/credits/top-ups.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,10 @@ export namespace TopUpCreateResponse {
memo?: string | null;

/**
* If true, new credit blocks created by this top-up will require that the
* corresponding invoice is paid before they can be drawn down from.
* When true, credit blocks created by this top-up will require that the
* corresponding invoice is paid before they are drawn down from. If any topup
* block is pending payment, further automatic top-ups will be paused until the
* invoice is paid or voided.
*/
require_successful_payment?: boolean;
}
Expand Down Expand Up @@ -266,8 +268,10 @@ export namespace TopUpListResponse {
memo?: string | null;

/**
* If true, new credit blocks created by this top-up will require that the
* corresponding invoice is paid before they can be drawn down from.
* When true, credit blocks created by this top-up will require that the
* corresponding invoice is paid before they are drawn down from. If any topup
* block is pending payment, further automatic top-ups will be paused until the
* invoice is paid or voided.
*/
require_successful_payment?: boolean;
}
Expand Down Expand Up @@ -339,8 +343,10 @@ export namespace TopUpCreateByExternalIDResponse {
memo?: string | null;

/**
* If true, new credit blocks created by this top-up will require that the
* corresponding invoice is paid before they can be drawn down from.
* When true, credit blocks created by this top-up will require that the
* corresponding invoice is paid before they are drawn down from. If any topup
* block is pending payment, further automatic top-ups will be paused until the
* invoice is paid or voided.
*/
require_successful_payment?: boolean;
}
Expand Down Expand Up @@ -412,8 +418,10 @@ export namespace TopUpListByExternalIDResponse {
memo?: string | null;

/**
* If true, new credit blocks created by this top-up will require that the
* corresponding invoice is paid before they can be drawn down from.
* When true, credit blocks created by this top-up will require that the
* corresponding invoice is paid before they are drawn down from. If any topup
* block is pending payment, further automatic top-ups will be paused until the
* invoice is paid or voided.
*/
require_successful_payment?: boolean;
}
Expand Down Expand Up @@ -489,8 +497,10 @@ export namespace TopUpCreateParams {
memo?: string | null;

/**
* If true, new credit blocks created by this top-up will require that the
* corresponding invoice is paid before they can be drawn down from.
* When true, credit blocks created by this top-up will require that the
* corresponding invoice is paid before they are drawn down from. If any topup
* block is pending payment, further automatic top-ups will be paused until the
* invoice is paid or voided.
*/
require_successful_payment?: boolean;
}
Expand Down Expand Up @@ -568,8 +578,10 @@ export namespace TopUpCreateByExternalIDParams {
memo?: string | null;

/**
* If true, new credit blocks created by this top-up will require that the
* corresponding invoice is paid before they can be drawn down from.
* When true, credit blocks created by this top-up will require that the
* corresponding invoice is paid before they are drawn down from. If any topup
* block is pending payment, further automatic top-ups will be paused until the
* invoice is paid or voided.
*/
require_successful_payment?: boolean;
}
Expand Down
6 changes: 3 additions & 3 deletions src/resources/events/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ export namespace EventSearchResponse {
* A dictionary of custom properties. Values in this dictionary must be numeric,
* boolean, or strings. Nested dictionaries are disallowed.
*/
properties: unknown;
properties: Record<string, unknown>;

/**
* An ISO 8601 format date with no timezone offset (i.e. UTC). This should
Expand All @@ -472,7 +472,7 @@ export interface EventUpdateParams {
* A dictionary of custom properties. Values in this dictionary must be numeric,
* boolean, or strings. Nested dictionaries are disallowed.
*/
properties: unknown;
properties: Record<string, unknown>;

/**
* An ISO 8601 format date with no timezone offset (i.e. UTC). This should
Expand Down Expand Up @@ -530,7 +530,7 @@ export namespace EventIngestParams {
* A dictionary of custom properties. Values in this dictionary must be numeric,
* boolean, or strings. Nested dictionaries are disallowed.
*/
properties: unknown;
properties: Record<string, unknown>;

/**
* An ISO 8601 format date with no timezone offset (i.e. UTC). This should
Expand Down
2 changes: 2 additions & 0 deletions src/resources/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ export {
type SubscriptionFetchCostsResponse,
type SubscriptionFetchScheduleResponse,
type SubscriptionPriceIntervalsResponse,
type SubscriptionRedeemCouponResponse,
type SubscriptionSchedulePlanChangeResponse,
type SubscriptionTriggerPhaseResponse,
type SubscriptionUnscheduleCancellationResponse,
Expand All @@ -147,6 +148,7 @@ export {
type SubscriptionFetchScheduleParams,
type SubscriptionFetchUsageParams,
type SubscriptionPriceIntervalsParams,
type SubscriptionRedeemCouponParams,
type SubscriptionSchedulePlanChangeParams,
type SubscriptionTriggerPhaseParams,
type SubscriptionUnscheduleFixedFeeQuantityUpdatesParams,
Expand Down
2 changes: 1 addition & 1 deletion src/resources/invoice-line-items.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export interface InvoiceLineItemCreateResponse {
* For more on the types of prices, see
* [the core concepts documentation](/core-concepts#plan-and-price)
*/
price: PricesAPI.Price | null;
price: PricesAPI.Price;

/**
* Either the fixed fee quantity or the usage during the service period.
Expand Down
4 changes: 2 additions & 2 deletions src/resources/invoices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -942,7 +942,7 @@ export namespace Invoice {
* For more on the types of prices, see
* [the core concepts documentation](/core-concepts#plan-and-price)
*/
price: PricesAPI.Price | null;
price: PricesAPI.Price;

/**
* Either the fixed fee quantity or the usage during the service period.
Expand Down Expand Up @@ -2381,7 +2381,7 @@ export namespace InvoiceFetchUpcomingResponse {
* For more on the types of prices, see
* [the core concepts documentation](/core-concepts#plan-and-price)
*/
price: PricesAPI.Price | null;
price: PricesAPI.Price;

/**
* Either the fixed fee quantity or the usage during the service period.
Expand Down
2 changes: 1 addition & 1 deletion src/resources/prices/prices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10150,7 +10150,7 @@ export namespace PriceEvaluateMultipleParams {
* A dictionary of custom properties. Values in this dictionary must be numeric,
* boolean, or strings. Nested dictionaries are disallowed.
*/
properties: unknown;
properties: Record<string, unknown>;

/**
* An ISO 8601 format date with no timezone offset (i.e. UTC). This should
Expand Down
Loading
Loading