@@ -122,6 +122,13 @@ public class SubscriptionCreateParams extends ApiRequestParams {
122
122
@ SerializedName (ApiRequestParams .EXTRA_PARAMS_KEY )
123
123
Map <String , Object > extraParams ;
124
124
125
+ /**
126
+ * All voided invoices now return the customer balance, independent of
127
+ * `consume_applied_balance_on_void`.
128
+ */
129
+ @ SerializedName ("invoice_customer_balance_settings" )
130
+ InvoiceCustomerBalanceSettings invoiceCustomerBalanceSettings ;
131
+
125
132
/** List of subscription items, each with an attached plan. */
126
133
@ SerializedName ("items" )
127
134
List <Item > items ;
@@ -234,6 +241,7 @@ private SubscriptionCreateParams(
234
241
Object defaultTaxRates ,
235
242
List <String > expand ,
236
243
Map <String , Object > extraParams ,
244
+ InvoiceCustomerBalanceSettings invoiceCustomerBalanceSettings ,
237
245
List <Item > items ,
238
246
Map <String , String > metadata ,
239
247
Boolean offSession ,
@@ -260,6 +268,7 @@ private SubscriptionCreateParams(
260
268
this .defaultTaxRates = defaultTaxRates ;
261
269
this .expand = expand ;
262
270
this .extraParams = extraParams ;
271
+ this .invoiceCustomerBalanceSettings = invoiceCustomerBalanceSettings ;
263
272
this .items = items ;
264
273
this .metadata = metadata ;
265
274
this .offSession = offSession ;
@@ -308,6 +317,8 @@ public static class Builder {
308
317
309
318
private Map <String , Object > extraParams ;
310
319
320
+ private InvoiceCustomerBalanceSettings invoiceCustomerBalanceSettings ;
321
+
311
322
private List <Item > items ;
312
323
313
324
private Map <String , String > metadata ;
@@ -348,6 +359,7 @@ public SubscriptionCreateParams build() {
348
359
this .defaultTaxRates ,
349
360
this .expand ,
350
361
this .extraParams ,
362
+ this .invoiceCustomerBalanceSettings ,
351
363
this .items ,
352
364
this .metadata ,
353
365
this .offSession ,
@@ -583,6 +595,16 @@ public Builder putAllExtraParam(Map<String, Object> map) {
583
595
return this ;
584
596
}
585
597
598
+ /**
599
+ * All voided invoices now return the customer balance, independent of
600
+ * `consume_applied_balance_on_void`.
601
+ */
602
+ public Builder setInvoiceCustomerBalanceSettings (
603
+ InvoiceCustomerBalanceSettings invoiceCustomerBalanceSettings ) {
604
+ this .invoiceCustomerBalanceSettings = invoiceCustomerBalanceSettings ;
605
+ return this ;
606
+ }
607
+
586
608
/**
587
609
* Add an element to `items` list. A list is initialized for the first `add/addAll` call, and
588
610
* subsequent calls adds additional elements to the original list. See {@link
@@ -868,6 +890,63 @@ public Builder setResetBillingCycleAnchor(Boolean resetBillingCycleAnchor) {
868
890
}
869
891
}
870
892
893
+ @ Getter
894
+ public static class InvoiceCustomerBalanceSettings {
895
+ /**
896
+ * Map of extra parameters for custom features not available in this client library. The content
897
+ * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
898
+ * key/value pair is serialized as if the key is a root-level field (serialized) name in this
899
+ * param object. Effectively, this map is flattened to its parent instance.
900
+ */
901
+ @ SerializedName (ApiRequestParams .EXTRA_PARAMS_KEY )
902
+ Map <String , Object > extraParams ;
903
+
904
+ private InvoiceCustomerBalanceSettings (Map <String , Object > extraParams ) {
905
+ this .extraParams = extraParams ;
906
+ }
907
+
908
+ public static Builder builder () {
909
+ return new Builder ();
910
+ }
911
+
912
+ public static class Builder {
913
+ private Map <String , Object > extraParams ;
914
+
915
+ /** Finalize and obtain parameter instance from this builder. */
916
+ public InvoiceCustomerBalanceSettings build () {
917
+ return new InvoiceCustomerBalanceSettings (this .extraParams );
918
+ }
919
+
920
+ /**
921
+ * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
922
+ * call, and subsequent calls add additional key/value pairs to the original map. See {@link
923
+ * SubscriptionCreateParams.InvoiceCustomerBalanceSettings#extraParams} for the field
924
+ * documentation.
925
+ */
926
+ public Builder putExtraParam (String key , Object value ) {
927
+ if (this .extraParams == null ) {
928
+ this .extraParams = new HashMap <>();
929
+ }
930
+ this .extraParams .put (key , value );
931
+ return this ;
932
+ }
933
+
934
+ /**
935
+ * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
936
+ * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
937
+ * See {@link SubscriptionCreateParams.InvoiceCustomerBalanceSettings#extraParams} for the
938
+ * field documentation.
939
+ */
940
+ public Builder putAllExtraParam (Map <String , Object > map ) {
941
+ if (this .extraParams == null ) {
942
+ this .extraParams = new HashMap <>();
943
+ }
944
+ this .extraParams .putAll (map );
945
+ return this ;
946
+ }
947
+ }
948
+ }
949
+
871
950
@ Getter
872
951
public static class Item {
873
952
/**
0 commit comments