Skip to content

Commit bfe8270

Browse files
feat(api): api update
1 parent bb3d420 commit bfe8270

File tree

3 files changed

+23
-7
lines changed

3 files changed

+23
-7
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 139
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-0186c0310e2a9f40302cc35f4248fca335b7ec8069502f684ba6f2fa37793033.yml
3-
openapi_spec_hash: 4fb1d2837ad3794864a7d59d393d6ff6
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-5bb582f84f0b4cf7bef84833fefd48a5f2734dc25805da2028fd8a6f1198da07.yml
3+
openapi_spec_hash: ced0e30dc67faa2414df511819408f12
44
config_hash: 3279841440b02d4e8303c961d6983492

src/resources/invoices.ts

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,14 @@ export class Invoices extends APIResource {
2222
}
2323

2424
/**
25-
* This endpoint allows you to update the `metadata`, `net_terms`, `due_date`, and
26-
* `invoice_date` properties on an invoice. If you pass null for the metadata
27-
* value, it will clear any existing metadata for that invoice.
25+
* This endpoint allows you to update the `metadata`, `net_terms`, `due_date`,
26+
* `invoice_date`, and `auto_collection` properties on an invoice. If you pass null
27+
* for the metadata value, it will clear any existing metadata for that invoice.
2828
*
2929
* `metadata` can be modified regardless of invoice state. `net_terms`, `due_date`,
30-
* and `invoice_date` can only be modified if the invoice is in a `draft` state.
31-
* `invoice_date` can only be modified for non-subscription invoices.
30+
* `invoice_date`, and `auto_collection` can only be modified if the invoice is in
31+
* a `draft` state. `invoice_date` can only be modified for non-subscription
32+
* invoices.
3233
*/
3334
update(
3435
invoiceId: string,
@@ -1745,6 +1746,13 @@ export interface InvoiceCreateParams {
17451746

17461747
line_items: Array<InvoiceCreateParams.LineItem>;
17471748

1749+
/**
1750+
* Determines whether this invoice will automatically attempt to charge a saved
1751+
* payment method, if any. If not specified, the invoice inherits the customer's
1752+
* auto_collection setting.
1753+
*/
1754+
auto_collection?: boolean | null;
1755+
17481756
/**
17491757
* The id of the `Customer` to create this invoice for. One of `customer_id` and
17501758
* `external_customer_id` are required.
@@ -1832,6 +1840,13 @@ export namespace InvoiceCreateParams {
18321840
}
18331841

18341842
export interface InvoiceUpdateParams {
1843+
/**
1844+
* Determines whether this invoice will automatically attempt to charge a saved
1845+
* payment method, if any. Can only be modified on draft invoices. If not
1846+
* specified, the invoice's existing setting is unchanged.
1847+
*/
1848+
auto_collection?: boolean | null;
1849+
18351850
/**
18361851
* An optional custom due date for the invoice. If not set, the due date will be
18371852
* calculated based on the `net_terms` value.

tests/api-resources/invoices.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ describe('resource invoices', () => {
4949
unit_config: { unit_amount: 'unit_amount', prorated: true },
5050
},
5151
],
52+
auto_collection: true,
5253
customer_id: '4khy3nwzktxv7',
5354
discount: {
5455
discount_type: 'percentage',

0 commit comments

Comments
 (0)