@@ -68,6 +68,7 @@ def create(
6868 currency : str ,
6969 invoice_date : Union [str , datetime ],
7070 line_items : Iterable [invoice_create_params .LineItem ],
71+ auto_collection : Optional [bool ] | Omit = omit ,
7172 customer_id : Optional [str ] | Omit = omit ,
7273 discount : Optional [Discount ] | Omit = omit ,
7374 due_date : Union [Union [str , date ], Union [str , datetime ], None ] | Omit = omit ,
@@ -94,6 +95,10 @@ def create(
9495 invoice_date: Optional invoice date to set. Must be in the past, if not set, `invoice_date` is
9596 set to the current time in the customer's timezone.
9697
98+ auto_collection: Determines whether this invoice will automatically attempt to charge a saved
99+ payment method, if any. If not specified, the invoice inherits the customer's
100+ auto_collection setting.
101+
97102 customer_id: The id of the `Customer` to create this invoice for. One of `customer_id` and
98103 `external_customer_id` are required.
99104
@@ -139,6 +144,7 @@ def create(
139144 "currency" : currency ,
140145 "invoice_date" : invoice_date ,
141146 "line_items" : line_items ,
147+ "auto_collection" : auto_collection ,
142148 "customer_id" : customer_id ,
143149 "discount" : discount ,
144150 "due_date" : due_date ,
@@ -164,6 +170,7 @@ def update(
164170 self ,
165171 invoice_id : str ,
166172 * ,
173+ auto_collection : Optional [bool ] | Omit = omit ,
167174 due_date : Union [Union [str , date ], Union [str , datetime ], None ] | Omit = omit ,
168175 invoice_date : Union [Union [str , date ], Union [str , datetime ], None ] | Omit = omit ,
169176 metadata : Optional [Dict [str , Optional [str ]]] | Omit = omit ,
@@ -177,15 +184,20 @@ def update(
177184 idempotency_key : str | None = None ,
178185 ) -> Invoice :
179186 """
180- This endpoint allows you to update the `metadata`, `net_terms`, `due_date`, and
181- `invoice_date` properties on an invoice. If you pass null for the metadata
182- value, it will clear any existing metadata for that invoice.
187+ This endpoint allows you to update the `metadata`, `net_terms`, `due_date`,
188+ `invoice_date`, and `auto_collection` properties on an invoice. If you pass null
189+ for the metadata value, it will clear any existing metadata for that invoice.
183190
184191 `metadata` can be modified regardless of invoice state. `net_terms`, `due_date`,
185- and `invoice_date` can only be modified if the invoice is in a `draft` state.
186- `invoice_date` can only be modified for non-subscription invoices.
192+ `invoice_date`, and `auto_collection` can only be modified if the invoice is in
193+ a `draft` state. `invoice_date` can only be modified for non-subscription
194+ invoices.
187195
188196 Args:
197+ auto_collection: Determines whether this invoice will automatically attempt to charge a saved
198+ payment method, if any. Can only be modified on draft invoices. If not
199+ specified, the invoice's existing setting is unchanged.
200+
189201 due_date: An optional custom due date for the invoice. If not set, the due date will be
190202 calculated based on the `net_terms` value.
191203
@@ -217,6 +229,7 @@ def update(
217229 f"/invoices/{ invoice_id } " ,
218230 body = maybe_transform (
219231 {
232+ "auto_collection" : auto_collection ,
220233 "due_date" : due_date ,
221234 "invoice_date" : invoice_date ,
222235 "metadata" : metadata ,
@@ -852,6 +865,7 @@ async def create(
852865 currency : str ,
853866 invoice_date : Union [str , datetime ],
854867 line_items : Iterable [invoice_create_params .LineItem ],
868+ auto_collection : Optional [bool ] | Omit = omit ,
855869 customer_id : Optional [str ] | Omit = omit ,
856870 discount : Optional [Discount ] | Omit = omit ,
857871 due_date : Union [Union [str , date ], Union [str , datetime ], None ] | Omit = omit ,
@@ -878,6 +892,10 @@ async def create(
878892 invoice_date: Optional invoice date to set. Must be in the past, if not set, `invoice_date` is
879893 set to the current time in the customer's timezone.
880894
895+ auto_collection: Determines whether this invoice will automatically attempt to charge a saved
896+ payment method, if any. If not specified, the invoice inherits the customer's
897+ auto_collection setting.
898+
881899 customer_id: The id of the `Customer` to create this invoice for. One of `customer_id` and
882900 `external_customer_id` are required.
883901
@@ -923,6 +941,7 @@ async def create(
923941 "currency" : currency ,
924942 "invoice_date" : invoice_date ,
925943 "line_items" : line_items ,
944+ "auto_collection" : auto_collection ,
926945 "customer_id" : customer_id ,
927946 "discount" : discount ,
928947 "due_date" : due_date ,
@@ -948,6 +967,7 @@ async def update(
948967 self ,
949968 invoice_id : str ,
950969 * ,
970+ auto_collection : Optional [bool ] | Omit = omit ,
951971 due_date : Union [Union [str , date ], Union [str , datetime ], None ] | Omit = omit ,
952972 invoice_date : Union [Union [str , date ], Union [str , datetime ], None ] | Omit = omit ,
953973 metadata : Optional [Dict [str , Optional [str ]]] | Omit = omit ,
@@ -961,15 +981,20 @@ async def update(
961981 idempotency_key : str | None = None ,
962982 ) -> Invoice :
963983 """
964- This endpoint allows you to update the `metadata`, `net_terms`, `due_date`, and
965- `invoice_date` properties on an invoice. If you pass null for the metadata
966- value, it will clear any existing metadata for that invoice.
984+ This endpoint allows you to update the `metadata`, `net_terms`, `due_date`,
985+ `invoice_date`, and `auto_collection` properties on an invoice. If you pass null
986+ for the metadata value, it will clear any existing metadata for that invoice.
967987
968988 `metadata` can be modified regardless of invoice state. `net_terms`, `due_date`,
969- and `invoice_date` can only be modified if the invoice is in a `draft` state.
970- `invoice_date` can only be modified for non-subscription invoices.
989+ `invoice_date`, and `auto_collection` can only be modified if the invoice is in
990+ a `draft` state. `invoice_date` can only be modified for non-subscription
991+ invoices.
971992
972993 Args:
994+ auto_collection: Determines whether this invoice will automatically attempt to charge a saved
995+ payment method, if any. Can only be modified on draft invoices. If not
996+ specified, the invoice's existing setting is unchanged.
997+
973998 due_date: An optional custom due date for the invoice. If not set, the due date will be
974999 calculated based on the `net_terms` value.
9751000
@@ -1001,6 +1026,7 @@ async def update(
10011026 f"/invoices/{ invoice_id } " ,
10021027 body = await async_maybe_transform (
10031028 {
1029+ "auto_collection" : auto_collection ,
10041030 "due_date" : due_date ,
10051031 "invoice_date" : invoice_date ,
10061032 "metadata" : metadata ,
0 commit comments