Skip to content

Commit 6314aab

Browse files
feat(api): api update
1 parent 642fae3 commit 6314aab

34 files changed

+40413
-3891
lines changed

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 106
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-e8dad7eee5621fe2ba948dfd00dabf170d9d92ce615a9f04b0f546f4d8bf39ba.yml
3-
openapi_spec_hash: 3f6a98e3a1b3a47acebd67a960090ebf
4-
config_hash: f6da12790e8f46d93592def474d41c69
1+
configured_endpoints: 113
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-c697450a215fdbd1a854d26381ce137b222726c3e6669a93afb1c0c5669906ca.yml
3+
openapi_spec_hash: b8b5388292baa73b5f2c686d4904ae45
4+
config_hash: 0e33d6c596feab76cb4df5d64f28350b

api.md

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ Methods:
225225
- <code title="post /items">client.items.<a href="./src/resources/items.ts">create</a>({ ...params }) -> Item</code>
226226
- <code title="put /items/{item_id}">client.items.<a href="./src/resources/items.ts">update</a>(itemId, { ...params }) -> Item</code>
227227
- <code title="get /items">client.items.<a href="./src/resources/items.ts">list</a>({ ...params }) -> ItemsPage</code>
228+
- <code title="post /items/{item_id}/archive">client.items.<a href="./src/resources/items.ts">archive</a>(itemId) -> Item</code>
228229
- <code title="get /items/{item_id}">client.items.<a href="./src/resources/items.ts">fetch</a>(itemId) -> Item</code>
229230

230231
# Metrics
@@ -252,13 +253,39 @@ Methods:
252253
- <code title="put /plans/{plan_id}">client.plans.<a href="./src/resources/plans/plans.ts">update</a>(planId, { ...params }) -> Plan</code>
253254
- <code title="get /plans">client.plans.<a href="./src/resources/plans/plans.ts">list</a>({ ...params }) -> PlansPage</code>
254255
- <code title="get /plans/{plan_id}">client.plans.<a href="./src/resources/plans/plans.ts">fetch</a>(planId) -> Plan</code>
256+
- <code title="post /plans/{plan_id}/set_default_version">client.plans.<a href="./src/resources/plans/plans.ts">setDefaultVersion</a>(planId, { ...params }) -> Plan</code>
255257

256258
## ExternalPlanID
257259

258260
Methods:
259261

260-
- <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>
261-
- <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>
262+
- <code title="put /plans/external_plan_id/{external_plan_id}">client.plans.externalPlanId.<a href="./src/resources/plans/external-plan-id/external-plan-id.ts">update</a>(otherExternalPlanId, { ...params }) -> Plan</code>
263+
- <code title="get /plans/external_plan_id/{external_plan_id}">client.plans.externalPlanId.<a href="./src/resources/plans/external-plan-id/external-plan-id.ts">fetch</a>(externalPlanId) -> Plan</code>
264+
- <code title="post /plans/external_plan_id/{external_plan_id}/set_default_version">client.plans.externalPlanId.<a href="./src/resources/plans/external-plan-id/external-plan-id.ts">setDefaultVersion</a>(externalPlanId, { ...params }) -> Plan</code>
265+
266+
### Versions
267+
268+
Types:
269+
270+
- <code><a href="./src/resources/plans/external-plan-id/versions.ts">VersionCreateResponse</a></code>
271+
- <code><a href="./src/resources/plans/external-plan-id/versions.ts">VersionRetrieveResponse</a></code>
272+
273+
Methods:
274+
275+
- <code title="post /plans/external_plan_id/{external_plan_id}/versions">client.plans.externalPlanId.versions.<a href="./src/resources/plans/external-plan-id/versions.ts">create</a>(externalPlanId, { ...params }) -> VersionCreateResponse</code>
276+
- <code title="get /plans/external_plan_id/{external_plan_id}/versions/{version}">client.plans.externalPlanId.versions.<a href="./src/resources/plans/external-plan-id/versions.ts">retrieve</a>(externalPlanId, version) -> VersionRetrieveResponse</code>
277+
278+
## Versions
279+
280+
Types:
281+
282+
- <code><a href="./src/resources/plans/versions.ts">VersionCreateResponse</a></code>
283+
- <code><a href="./src/resources/plans/versions.ts">VersionRetrieveResponse</a></code>
284+
285+
Methods:
286+
287+
- <code title="post /plans/{plan_id}/versions">client.plans.versions.<a href="./src/resources/plans/versions.ts">create</a>(planId, { ...params }) -> VersionCreateResponse</code>
288+
- <code title="get /plans/{plan_id}/versions/{version}">client.plans.versions.<a href="./src/resources/plans/versions.ts">retrieve</a>(planId, version) -> VersionRetrieveResponse</code>
262289

263290
# Prices
264291

@@ -273,7 +300,7 @@ Methods:
273300
- <code title="post /prices">client.prices.<a href="./src/resources/prices/prices.ts">create</a>({ ...params }) -> Price</code>
274301
- <code title="put /prices/{price_id}">client.prices.<a href="./src/resources/prices/prices.ts">update</a>(priceId, { ...params }) -> Price</code>
275302
- <code title="get /prices">client.prices.<a href="./src/resources/prices/prices.ts">list</a>({ ...params }) -> PricesPage</code>
276-
- <code title="post /prices/{price_id}/evaluate">client.prices.<a href="./src/resources/prices/prices.ts">evaluate</a>(priceId, { ...params }) -> PriceEvaluateResponse</code>
303+
- <code title="post /prices/evaluate">client.prices.<a href="./src/resources/prices/prices.ts">evaluate</a>({ ...params }) -> PriceEvaluateResponse</code>
277304
- <code title="get /prices/{price_id}">client.prices.<a href="./src/resources/prices/prices.ts">fetch</a>(priceId) -> Price</code>
278305

279306
## ExternalPriceID

src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ import {
137137
Plan,
138138
PlanCreateParams,
139139
PlanListParams,
140+
PlanSetDefaultVersionParams,
140141
PlanUpdateParams,
141142
Plans,
142143
PlansPage,
@@ -460,6 +461,7 @@ export declare namespace Orb {
460461
type PlanCreateParams as PlanCreateParams,
461462
type PlanUpdateParams as PlanUpdateParams,
462463
type PlanListParams as PlanListParams,
464+
type PlanSetDefaultVersionParams as PlanSetDefaultVersionParams,
463465
};
464466

465467
export {

src/resources/alerts.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,12 @@ export interface Alert {
224224
| 'credit_balance_recovered'
225225
| 'usage_exceeded'
226226
| 'cost_exceeded';
227+
228+
/**
229+
* The current status of the alert. This field is only present for credit balance
230+
* alerts.
231+
*/
232+
balance_alert_status?: Array<Alert.BalanceAlertStatus> | null;
227233
}
228234

229235
export namespace Alert {
@@ -280,6 +286,21 @@ export namespace Alert {
280286
*/
281287
value: number;
282288
}
289+
290+
/**
291+
* Alert status is used to determine if an alert is currently in-alert or not.
292+
*/
293+
export interface BalanceAlertStatus {
294+
/**
295+
* Whether the alert is currently in-alert or not.
296+
*/
297+
in_alert: boolean;
298+
299+
/**
300+
* The value of the threshold that defines the alert status.
301+
*/
302+
threshold_value: number;
303+
}
283304
}
284305

285306
export interface AlertUpdateParams {

src/resources/credit-notes.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -254,14 +254,14 @@ export interface CreditNoteCreateParams {
254254
line_items: Array<CreditNoteCreateParams.LineItem>;
255255

256256
/**
257-
* An optional memo to attach to the credit note.
257+
* An optional reason for the credit note.
258258
*/
259-
memo?: string | null;
259+
reason: 'duplicate' | 'fraudulent' | 'order_change' | 'product_unsatisfactory';
260260

261261
/**
262-
* An optional reason for the credit note.
262+
* An optional memo to attach to the credit note.
263263
*/
264-
reason?: 'duplicate' | 'fraudulent' | 'order_change' | 'product_unsatisfactory' | null;
264+
memo?: string | null;
265265
}
266266

267267
export namespace CreditNoteCreateParams {

src/resources/customers/balance-transactions.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,6 @@ export class BalanceTransactions extends APIResource {
4040
* This endpoint retrieves all customer balance transactions in reverse
4141
* chronological order for a single customer, providing a complete audit trail of
4242
* all adjustments and invoice applications.
43-
*
44-
* ## Eligibility
45-
*
46-
* The customer balance can only be applied to invoices or adjusted manually if
47-
* invoices are not synced to a separate invoicing provider. If a payment gateway
48-
* such as Stripe is used, the balance will be applied to the invoice before
49-
* forwarding payment to the gateway.
5043
*/
5144
list(
5245
customerId: string,

src/resources/customers/credits/ledger.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import { APIResource } from '../../../resource';
44
import { isRequestOptions } from '../../../core';
55
import * as Core from '../../../core';
6+
import * as InvoicesAPI from '../../invoices';
67
import { Page, type PageParams } from '../../../pagination';
78

89
export class Ledger extends APIResource {
@@ -513,6 +514,11 @@ export namespace LedgerListResponse {
513514
metadata: Record<string, string>;
514515

515516
starting_balance: number;
517+
518+
/**
519+
* If the increment resulted in invoice creation, the list of created invoices
520+
*/
521+
created_invoices?: Array<InvoicesAPI.Invoice> | null;
516522
}
517523

518524
export namespace IncrementLedgerEntry {
@@ -896,6 +902,11 @@ export namespace LedgerCreateEntryResponse {
896902
metadata: Record<string, string>;
897903

898904
starting_balance: number;
905+
906+
/**
907+
* If the increment resulted in invoice creation, the list of created invoices
908+
*/
909+
created_invoices?: Array<InvoicesAPI.Invoice> | null;
899910
}
900911

901912
export namespace IncrementLedgerEntry {
@@ -1279,6 +1290,11 @@ export namespace LedgerCreateEntryByExternalIDResponse {
12791290
metadata: Record<string, string>;
12801291

12811292
starting_balance: number;
1293+
1294+
/**
1295+
* If the increment resulted in invoice creation, the list of created invoices
1296+
*/
1297+
created_invoices?: Array<InvoicesAPI.Invoice> | null;
12821298
}
12831299

12841300
export namespace IncrementLedgerEntry {
@@ -1662,6 +1678,11 @@ export namespace LedgerListByExternalIDResponse {
16621678
metadata: Record<string, string>;
16631679

16641680
starting_balance: number;
1681+
1682+
/**
1683+
* If the increment resulted in invoice creation, the list of created invoices
1684+
*/
1685+
created_invoices?: Array<InvoicesAPI.Invoice> | null;
16651686
}
16661687

16671688
export namespace IncrementLedgerEntry {

src/resources/customers/credits/top-ups.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ export interface TopUpCreateParams {
449449

450450
/**
451451
* The date from which the top-up is active. If unspecified, the top-up is active
452-
* immediately.
452+
* immediately. This should not be more than 10 days in the past.
453453
*/
454454
active_from?: string | null;
455455

@@ -528,7 +528,7 @@ export interface TopUpCreateByExternalIDParams {
528528

529529
/**
530530
* The date from which the top-up is active. If unspecified, the top-up is active
531-
* immediately.
531+
* immediately. This should not be more than 10 days in the past.
532532
*/
533533
active_from?: string | null;
534534

src/resources/customers/customers.ts

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,7 @@ export class Customers extends APIResource {
103103
* **Note**: This operation happens asynchronously and can be expected to take a
104104
* few minutes to propagate to related resources. However, querying for the
105105
* customer on subsequent GET requests while deletion is in process will reflect
106-
* its deletion with a `deleted: true` property. Once the customer deletion has
107-
* been fully processed, the customer will not be returned in the API.
108-
*
109-
* On successful processing, this returns an empty dictionary (`{}`) in the API.
106+
* its deletion.
110107
*/
111108
delete(customerId: string, options?: Core.RequestOptions): Core.APIPromise<void> {
112109
return this._client.delete(`/customers/${customerId}`, {
@@ -812,6 +809,7 @@ export interface CustomerCreateParams {
812809
tax_configuration?:
813810
| CustomerCreateParams.NewAvalaraTaxConfiguration
814811
| CustomerCreateParams.NewTaxJarConfiguration
812+
| CustomerCreateParams.NewSphereConfiguration
815813
| null;
816814

817815
/**
@@ -1009,6 +1007,12 @@ export namespace CustomerCreateParams {
10091007
tax_provider: 'taxjar';
10101008
}
10111009

1010+
export interface NewSphereConfiguration {
1011+
tax_exempt: boolean;
1012+
1013+
tax_provider: 'sphere';
1014+
}
1015+
10121016
/**
10131017
* Tax IDs are commonly required to be displayed on customer invoices, which are
10141018
* added to the headers of invoices.
@@ -1352,6 +1356,7 @@ export interface CustomerUpdateParams {
13521356
tax_configuration?:
13531357
| CustomerUpdateParams.NewAvalaraTaxConfiguration
13541358
| CustomerUpdateParams.NewTaxJarConfiguration
1359+
| CustomerUpdateParams.NewSphereConfiguration
13551360
| null;
13561361

13571362
/**
@@ -1542,6 +1547,12 @@ export namespace CustomerUpdateParams {
15421547
tax_provider: 'taxjar';
15431548
}
15441549

1550+
export interface NewSphereConfiguration {
1551+
tax_exempt: boolean;
1552+
1553+
tax_provider: 'sphere';
1554+
}
1555+
15451556
/**
15461557
* Tax IDs are commonly required to be displayed on customer invoices, which are
15471558
* added to the headers of invoices.
@@ -1895,6 +1906,7 @@ export interface CustomerUpdateByExternalIDParams {
18951906
tax_configuration?:
18961907
| CustomerUpdateByExternalIDParams.NewAvalaraTaxConfiguration
18971908
| CustomerUpdateByExternalIDParams.NewTaxJarConfiguration
1909+
| CustomerUpdateByExternalIDParams.NewSphereConfiguration
18981910
| null;
18991911

19001912
/**
@@ -2085,6 +2097,12 @@ export namespace CustomerUpdateByExternalIDParams {
20852097
tax_provider: 'taxjar';
20862098
}
20872099

2100+
export interface NewSphereConfiguration {
2101+
tax_exempt: boolean;
2102+
2103+
tax_provider: 'sphere';
2104+
}
2105+
20882106
/**
20892107
* Tax IDs are commonly required to be displayed on customer invoices, which are
20902108
* added to the headers of invoices.

src/resources/dimensional-price-groups/dimensional-price-groups.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export class DimensionalPriceGroups extends APIResource {
2020
* For example, suppose we have a billable metric that measures the number of
2121
* widgets used and we want to charge differently depending on the color of the
2222
* widget. We can create a price group with a dimension "color" and two prices: one
23-
* that charges $10 per red widget and one that charges $20 per blue widget.
23+
* that charges \$10 per red widget and one that charges \$20 per blue widget.
2424
*/
2525
create(
2626
body: DimensionalPriceGroupCreateParams,

0 commit comments

Comments
 (0)