diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION
index fe5aa3c0196..d9f3b7218ea 100644
--- a/OPENAPI_VERSION
+++ b/OPENAPI_VERSION
@@ -1 +1 @@
-v178
\ No newline at end of file
+v183
\ No newline at end of file
diff --git a/src/main/java/com/stripe/model/Account.java b/src/main/java/com/stripe/model/Account.java
index 467827e927e..f20124c79f0 100644
--- a/src/main/java/com/stripe/model/Account.java
+++ b/src/main/java/com/stripe/model/Account.java
@@ -19,6 +19,13 @@
import lombok.Getter;
import lombok.Setter;
+/**
+ * This is an object representing a Stripe account. You can retrieve it to see properties on the
+ * account like its current e-mail address or if the account is enabled yet to make live charges.
+ *
+ *
Some properties, marked below, are available only to platforms that want to create and manage Express or Custom accounts.
+ */
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
@@ -146,176 +153,57 @@ public class Account extends ApiResource implements MetadataStore, Paym
@SerializedName("type")
String type;
- /** Retrieves the details of an account. */
- public static Account retrieve() throws StripeException {
- return retrieve((Map) null, (RequestOptions) null);
- }
-
- /** Retrieves the details of an account. */
- public static Account retrieve(RequestOptions options) throws StripeException {
- return retrieve((Map) null, options);
- }
-
- /** Retrieves the details of an account. */
- public static Account retrieve(Map params, RequestOptions options)
- throws StripeException {
- String url = String.format("%s%s", Stripe.getApiBase(), "/v1/account");
- return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Account.class, options);
- }
-
- /** Retrieves the details of an account. */
- public static Account retrieve(AccountRetrieveParams params, RequestOptions options)
- throws StripeException {
- String url = String.format("%s%s", Stripe.getApiBase(), "/v1/account");
- return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Account.class, options);
- }
-
- /** Retrieves the details of an account. */
- public static Account retrieve(String account) throws StripeException {
- return retrieve(account, (Map) null, (RequestOptions) null);
- }
-
- /** Retrieves the details of an account. */
- public static Account retrieve(String account, RequestOptions options) throws StripeException {
- return retrieve(account, (Map) null, options);
- }
-
- /** Retrieves the details of an account. */
- public static Account retrieve(String account, Map params, RequestOptions options)
- throws StripeException {
- String url =
- String.format(
- "%s%s",
- Stripe.getApiBase(),
- String.format("/v1/accounts/%s", ApiResource.urlEncodeId(account)));
- return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Account.class, options);
- }
-
- /** Retrieves the details of an account. */
- public static Account retrieve(
- String account, AccountRetrieveParams params, RequestOptions options) throws StripeException {
- String url =
- String.format(
- "%s%s",
- Stripe.getApiBase(),
- String.format("/v1/accounts/%s", ApiResource.urlEncodeId(account)));
- return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Account.class, options);
- }
-
/**
- * Updates a connected account by setting
- * the values of the parameters passed. Any parameters not provided are left unchanged. Most
- * parameters can be changed only for Custom accounts. (These are marked Custom
- * Only below.) Parameters marked Custom and Express are not supported
- * for Standard accounts.
- *
- * To update your own account, use the Dashboard. Refer to our Connect documentation to learn
- * more about updating accounts.
- */
- @Override
- public Account update(Map params) throws StripeException {
- return update(params, (RequestOptions) null);
- }
-
- /**
- * Updates a connected account by setting
- * the values of the parameters passed. Any parameters not provided are left unchanged. Most
- * parameters can be changed only for Custom accounts. (These are marked Custom
- * Only below.) Parameters marked Custom and Express are not supported
- * for Standard accounts.
- *
- * To update your own account, use the Dashboard. Refer to our Connect documentation to learn
- * more about updating accounts.
+ * Returns a list of capabilities associated with the account. The capabilities are returned
+ * sorted by creation date, with the most recent capability appearing first.
*/
- @Override
- public Account update(Map params, RequestOptions options) throws StripeException {
- String url =
- String.format(
- "%s%s",
- Stripe.getApiBase(),
- String.format("/v1/accounts/%s", ApiResource.urlEncodeId(this.getId())));
- return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Account.class, options);
+ public CapabilityCollection capabilities() throws StripeException {
+ return capabilities((Map) null, (RequestOptions) null);
}
/**
- * Updates a connected account by setting
- * the values of the parameters passed. Any parameters not provided are left unchanged. Most
- * parameters can be changed only for Custom accounts. (These are marked Custom
- * Only below.) Parameters marked Custom and Express are not supported
- * for Standard accounts.
- *
- * To update your own account, use the Dashboard. Refer to our Connect documentation to learn
- * more about updating accounts.
+ * Returns a list of capabilities associated with the account. The capabilities are returned
+ * sorted by creation date, with the most recent capability appearing first.
*/
- public Account update(AccountUpdateParams params) throws StripeException {
- return update(params, (RequestOptions) null);
+ public CapabilityCollection capabilities(Map params) throws StripeException {
+ return capabilities(params, (RequestOptions) null);
}
/**
- * Updates a connected account by setting
- * the values of the parameters passed. Any parameters not provided are left unchanged. Most
- * parameters can be changed only for Custom accounts. (These are marked Custom
- * Only below.) Parameters marked Custom and Express are not supported
- * for Standard accounts.
- *
- * To update your own account, use the Dashboard. Refer to our Connect documentation to learn
- * more about updating accounts.
+ * Returns a list of capabilities associated with the account. The capabilities are returned
+ * sorted by creation date, with the most recent capability appearing first.
*/
- public Account update(AccountUpdateParams params, RequestOptions options) throws StripeException {
+ public CapabilityCollection capabilities(Map params, RequestOptions options)
+ throws StripeException {
String url =
String.format(
"%s%s",
Stripe.getApiBase(),
- String.format("/v1/accounts/%s", ApiResource.urlEncodeId(this.getId())));
- return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Account.class, options);
- }
-
- /**
- * Returns a list of accounts connected to your platform via Connect. If you’re not a platform, the list is
- * empty.
- */
- public static AccountCollection list(Map params) throws StripeException {
- return list(params, (RequestOptions) null);
+ String.format("/v1/accounts/%s/capabilities", ApiResource.urlEncodeId(this.getId())));
+ return ApiResource.requestCollection(url, params, CapabilityCollection.class, options);
}
/**
- * Returns a list of accounts connected to your platform via Connect. If you’re not a platform, the list is
- * empty.
+ * Returns a list of capabilities associated with the account. The capabilities are returned
+ * sorted by creation date, with the most recent capability appearing first.
*/
- public static AccountCollection list(Map params, RequestOptions options)
+ public CapabilityCollection capabilities(AccountCapabilitiesParams params)
throws StripeException {
- String url = String.format("%s%s", Stripe.getApiBase(), "/v1/accounts");
- return ApiResource.requestCollection(url, params, AccountCollection.class, options);
- }
-
- /**
- * Returns a list of accounts connected to your platform via Connect. If you’re not a platform, the list is
- * empty.
- */
- public static AccountCollection list(AccountListParams params) throws StripeException {
- return list(params, (RequestOptions) null);
+ return capabilities(params, (RequestOptions) null);
}
/**
- * Returns a list of accounts connected to your platform via Connect. If you’re not a platform, the list is
- * empty.
+ * Returns a list of capabilities associated with the account. The capabilities are returned
+ * sorted by creation date, with the most recent capability appearing first.
*/
- public static AccountCollection list(AccountListParams params, RequestOptions options)
+ public CapabilityCollection capabilities(AccountCapabilitiesParams params, RequestOptions options)
throws StripeException {
- String url = String.format("%s%s", Stripe.getApiBase(), "/v1/accounts");
- return ApiResource.requestCollection(url, params, AccountCollection.class, options);
+ String url =
+ String.format(
+ "%s%s",
+ Stripe.getApiBase(),
+ String.format("/v1/accounts/%s/capabilities", ApiResource.urlEncodeId(this.getId())));
+ return ApiResource.requestCollection(url, params, CapabilityCollection.class, options);
}
/**
@@ -425,57 +313,43 @@ public Account delete(Map params, RequestOptions options) throws
}
/**
- * With Connect, you may flag accounts as
- * suspicious.
- *
- * Test-mode Custom and Express accounts can be rejected at any time. Accounts created using
- * live-mode keys may only be rejected once all balances are zero.
+ * Returns a list of accounts connected to your platform via Connect. If you’re not a platform, the list is
+ * empty.
*/
- public Account reject(Map params) throws StripeException {
- return reject(params, (RequestOptions) null);
+ public static AccountCollection list(Map params) throws StripeException {
+ return list(params, (RequestOptions) null);
}
/**
- * With Connect, you may flag accounts as
- * suspicious.
- *
- * Test-mode Custom and Express accounts can be rejected at any time. Accounts created using
- * live-mode keys may only be rejected once all balances are zero.
+ * Returns a list of accounts connected to your platform via Connect. If you’re not a platform, the list is
+ * empty.
*/
- public Account reject(Map params, RequestOptions options) throws StripeException {
- String url =
- String.format(
- "%s%s",
- Stripe.getApiBase(),
- String.format("/v1/accounts/%s/reject", ApiResource.urlEncodeId(this.getId())));
- return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Account.class, options);
+ public static AccountCollection list(Map params, RequestOptions options)
+ throws StripeException {
+ String url = String.format("%s%s", Stripe.getApiBase(), "/v1/accounts");
+ return ApiResource.requestCollection(url, params, AccountCollection.class, options);
}
/**
- * With Connect, you may flag accounts as
- * suspicious.
- *
- * Test-mode Custom and Express accounts can be rejected at any time. Accounts created using
- * live-mode keys may only be rejected once all balances are zero.
+ * Returns a list of accounts connected to your platform via Connect. If you’re not a platform, the list is
+ * empty.
*/
- public Account reject(AccountRejectParams params) throws StripeException {
- return reject(params, (RequestOptions) null);
+ public static AccountCollection list(AccountListParams params) throws StripeException {
+ return list(params, (RequestOptions) null);
}
/**
- * With Connect, you may flag accounts as
- * suspicious.
- *
- *
Test-mode Custom and Express accounts can be rejected at any time. Accounts created using
- * live-mode keys may only be rejected once all balances are zero.
+ * Returns a list of accounts connected to your platform via Connect. If you’re not a platform, the list is
+ * empty.
*/
- public Account reject(AccountRejectParams params, RequestOptions options) throws StripeException {
- String url =
- String.format(
- "%s%s",
- Stripe.getApiBase(),
- String.format("/v1/accounts/%s/reject", ApiResource.urlEncodeId(this.getId())));
- return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Account.class, options);
+ public static AccountCollection list(AccountListParams params, RequestOptions options)
+ throws StripeException {
+ String url = String.format("%s%s", Stripe.getApiBase(), "/v1/accounts");
+ return ApiResource.requestCollection(url, params, AccountCollection.class, options);
}
/**
@@ -531,56 +405,189 @@ public PersonCollection persons(AccountPersonsParams params, RequestOptions opti
}
/**
- * Returns a list of capabilities associated with the account. The capabilities are returned
- * sorted by creation date, with the most recent capability appearing first.
+ * With Connect, you may flag accounts as
+ * suspicious.
+ *
+ *
Test-mode Custom and Express accounts can be rejected at any time. Accounts created using
+ * live-mode keys may only be rejected once all balances are zero.
*/
- public CapabilityCollection capabilities() throws StripeException {
- return capabilities((Map) null, (RequestOptions) null);
+ public Account reject(Map params) throws StripeException {
+ return reject(params, (RequestOptions) null);
}
/**
- * Returns a list of capabilities associated with the account. The capabilities are returned
- * sorted by creation date, with the most recent capability appearing first.
+ * With Connect, you may flag accounts as
+ * suspicious.
+ *
+ * Test-mode Custom and Express accounts can be rejected at any time. Accounts created using
+ * live-mode keys may only be rejected once all balances are zero.
*/
- public CapabilityCollection capabilities(Map params) throws StripeException {
- return capabilities(params, (RequestOptions) null);
+ public Account reject(Map params, RequestOptions options) throws StripeException {
+ String url =
+ String.format(
+ "%s%s",
+ Stripe.getApiBase(),
+ String.format("/v1/accounts/%s/reject", ApiResource.urlEncodeId(this.getId())));
+ return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Account.class, options);
}
/**
- * Returns a list of capabilities associated with the account. The capabilities are returned
- * sorted by creation date, with the most recent capability appearing first.
+ * With Connect, you may flag accounts as
+ * suspicious.
+ *
+ * Test-mode Custom and Express accounts can be rejected at any time. Accounts created using
+ * live-mode keys may only be rejected once all balances are zero.
*/
- public CapabilityCollection capabilities(Map params, RequestOptions options)
+ public Account reject(AccountRejectParams params) throws StripeException {
+ return reject(params, (RequestOptions) null);
+ }
+
+ /**
+ * With Connect, you may flag accounts as
+ * suspicious.
+ *
+ * Test-mode Custom and Express accounts can be rejected at any time. Accounts created using
+ * live-mode keys may only be rejected once all balances are zero.
+ */
+ public Account reject(AccountRejectParams params, RequestOptions options) throws StripeException {
+ String url =
+ String.format(
+ "%s%s",
+ Stripe.getApiBase(),
+ String.format("/v1/accounts/%s/reject", ApiResource.urlEncodeId(this.getId())));
+ return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Account.class, options);
+ }
+
+ /** Retrieves the details of an account. */
+ public static Account retrieve() throws StripeException {
+ return retrieve((Map) null, (RequestOptions) null);
+ }
+
+ /** Retrieves the details of an account. */
+ public static Account retrieve(RequestOptions options) throws StripeException {
+ return retrieve((Map) null, options);
+ }
+
+ /** Retrieves the details of an account. */
+ public static Account retrieve(Map params, RequestOptions options)
+ throws StripeException {
+ String url = String.format("%s%s", Stripe.getApiBase(), "/v1/account");
+ return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Account.class, options);
+ }
+
+ /** Retrieves the details of an account. */
+ public static Account retrieve(AccountRetrieveParams params, RequestOptions options)
+ throws StripeException {
+ String url = String.format("%s%s", Stripe.getApiBase(), "/v1/account");
+ return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Account.class, options);
+ }
+
+ /** Retrieves the details of an account. */
+ public static Account retrieve(String account) throws StripeException {
+ return retrieve(account, (Map) null, (RequestOptions) null);
+ }
+
+ /** Retrieves the details of an account. */
+ public static Account retrieve(String account, RequestOptions options) throws StripeException {
+ return retrieve(account, (Map) null, options);
+ }
+
+ /** Retrieves the details of an account. */
+ public static Account retrieve(String account, Map params, RequestOptions options)
throws StripeException {
String url =
String.format(
"%s%s",
Stripe.getApiBase(),
- String.format("/v1/accounts/%s/capabilities", ApiResource.urlEncodeId(this.getId())));
- return ApiResource.requestCollection(url, params, CapabilityCollection.class, options);
+ String.format("/v1/accounts/%s", ApiResource.urlEncodeId(account)));
+ return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Account.class, options);
+ }
+
+ /** Retrieves the details of an account. */
+ public static Account retrieve(
+ String account, AccountRetrieveParams params, RequestOptions options) throws StripeException {
+ String url =
+ String.format(
+ "%s%s",
+ Stripe.getApiBase(),
+ String.format("/v1/accounts/%s", ApiResource.urlEncodeId(account)));
+ return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Account.class, options);
}
/**
- * Returns a list of capabilities associated with the account. The capabilities are returned
- * sorted by creation date, with the most recent capability appearing first.
+ * Updates a connected account by setting
+ * the values of the parameters passed. Any parameters not provided are left unchanged. Most
+ * parameters can be changed only for Custom accounts. (These are marked Custom
+ * Only below.) Parameters marked Custom and Express are not supported
+ * for Standard accounts.
+ *
+ * To update your own account, use the Dashboard. Refer to our Connect documentation to learn
+ * more about updating accounts.
*/
- public CapabilityCollection capabilities(AccountCapabilitiesParams params)
- throws StripeException {
- return capabilities(params, (RequestOptions) null);
+ @Override
+ public Account update(Map params) throws StripeException {
+ return update(params, (RequestOptions) null);
}
/**
- * Returns a list of capabilities associated with the account. The capabilities are returned
- * sorted by creation date, with the most recent capability appearing first.
+ * Updates a connected account by setting
+ * the values of the parameters passed. Any parameters not provided are left unchanged. Most
+ * parameters can be changed only for Custom accounts. (These are marked Custom
+ * Only below.) Parameters marked Custom and Express are not supported
+ * for Standard accounts.
+ *
+ * To update your own account, use the Dashboard. Refer to our Connect documentation to learn
+ * more about updating accounts.
*/
- public CapabilityCollection capabilities(AccountCapabilitiesParams params, RequestOptions options)
- throws StripeException {
+ @Override
+ public Account update(Map params, RequestOptions options) throws StripeException {
String url =
String.format(
"%s%s",
Stripe.getApiBase(),
- String.format("/v1/accounts/%s/capabilities", ApiResource.urlEncodeId(this.getId())));
- return ApiResource.requestCollection(url, params, CapabilityCollection.class, options);
+ String.format("/v1/accounts/%s", ApiResource.urlEncodeId(this.getId())));
+ return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Account.class, options);
+ }
+
+ /**
+ * Updates a connected account by setting
+ * the values of the parameters passed. Any parameters not provided are left unchanged. Most
+ * parameters can be changed only for Custom accounts. (These are marked Custom
+ * Only below.) Parameters marked Custom and Express are not supported
+ * for Standard accounts.
+ *
+ * To update your own account, use the Dashboard. Refer to our Connect documentation to learn
+ * more about updating accounts.
+ */
+ public Account update(AccountUpdateParams params) throws StripeException {
+ return update(params, (RequestOptions) null);
+ }
+
+ /**
+ * Updates a connected account by setting
+ * the values of the parameters passed. Any parameters not provided are left unchanged. Most
+ * parameters can be changed only for Custom accounts. (These are marked Custom
+ * Only below.) Parameters marked Custom and Express are not supported
+ * for Standard accounts.
+ *
+ *
To update your own account, use the Dashboard. Refer to our Connect documentation to learn
+ * more about updating accounts.
+ */
+ public Account update(AccountUpdateParams params, RequestOptions options) throws StripeException {
+ String url =
+ String.format(
+ "%s%s",
+ Stripe.getApiBase(),
+ String.format("/v1/accounts/%s", ApiResource.urlEncodeId(this.getId())));
+ return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Account.class, options);
}
@Getter
@@ -971,13 +978,6 @@ public static class Company extends StripeObject {
@SerializedName("name_kanji")
String nameKanji;
- /**
- * This hash is used to attest that the beneficial owner information provided to Stripe is both
- * current and correct.
- */
- @SerializedName("ownership_declaration")
- OwnershipDeclaration ownershipDeclaration;
-
/**
* Whether the company's owners have been provided. This Boolean will be {@code true} if you've
* manually indicated that all owners are provided via Related guide: Connect
+ * Onboarding.
+ */
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
diff --git a/src/main/java/com/stripe/model/ApplePayDomain.java b/src/main/java/com/stripe/model/ApplePayDomain.java
index e23d63b90bb..d80fd050754 100644
--- a/src/main/java/com/stripe/model/ApplePayDomain.java
+++ b/src/main/java/com/stripe/model/ApplePayDomain.java
@@ -49,31 +49,6 @@ public class ApplePayDomain extends ApiResource implements HasId {
@SerializedName("object")
String object;
- /** List apple pay domains. */
- public static ApplePayDomainCollection list(Map params) throws StripeException {
- return list(params, (RequestOptions) null);
- }
-
- /** List apple pay domains. */
- public static ApplePayDomainCollection list(Map params, RequestOptions options)
- throws StripeException {
- String url = String.format("%s%s", Stripe.getApiBase(), "/v1/apple_pay/domains");
- return ApiResource.requestCollection(url, params, ApplePayDomainCollection.class, options);
- }
-
- /** List apple pay domains. */
- public static ApplePayDomainCollection list(ApplePayDomainListParams params)
- throws StripeException {
- return list(params, (RequestOptions) null);
- }
-
- /** List apple pay domains. */
- public static ApplePayDomainCollection list(
- ApplePayDomainListParams params, RequestOptions options) throws StripeException {
- String url = String.format("%s%s", Stripe.getApiBase(), "/v1/apple_pay/domains");
- return ApiResource.requestCollection(url, params, ApplePayDomainCollection.class, options);
- }
-
/** Create an apple pay domain. */
public static ApplePayDomain create(Map params) throws StripeException {
return create(params, (RequestOptions) null);
@@ -100,6 +75,58 @@ public static ApplePayDomain create(ApplePayDomainCreateParams params, RequestOp
ApiResource.RequestMethod.POST, url, params, ApplePayDomain.class, options);
}
+ /** Delete an apple pay domain. */
+ public ApplePayDomain delete() throws StripeException {
+ return delete((Map) null, (RequestOptions) null);
+ }
+
+ /** Delete an apple pay domain. */
+ public ApplePayDomain delete(RequestOptions options) throws StripeException {
+ return delete((Map) null, options);
+ }
+
+ /** Delete an apple pay domain. */
+ public ApplePayDomain delete(Map params) throws StripeException {
+ return delete(params, (RequestOptions) null);
+ }
+
+ /** Delete an apple pay domain. */
+ public ApplePayDomain delete(Map params, RequestOptions options)
+ throws StripeException {
+ String url =
+ String.format(
+ "%s%s",
+ Stripe.getApiBase(),
+ String.format("/v1/apple_pay/domains/%s", ApiResource.urlEncodeId(this.getId())));
+ return ApiResource.request(
+ ApiResource.RequestMethod.DELETE, url, params, ApplePayDomain.class, options);
+ }
+
+ /** List apple pay domains. */
+ public static ApplePayDomainCollection list(Map params) throws StripeException {
+ return list(params, (RequestOptions) null);
+ }
+
+ /** List apple pay domains. */
+ public static ApplePayDomainCollection list(Map params, RequestOptions options)
+ throws StripeException {
+ String url = String.format("%s%s", Stripe.getApiBase(), "/v1/apple_pay/domains");
+ return ApiResource.requestCollection(url, params, ApplePayDomainCollection.class, options);
+ }
+
+ /** List apple pay domains. */
+ public static ApplePayDomainCollection list(ApplePayDomainListParams params)
+ throws StripeException {
+ return list(params, (RequestOptions) null);
+ }
+
+ /** List apple pay domains. */
+ public static ApplePayDomainCollection list(
+ ApplePayDomainListParams params, RequestOptions options) throws StripeException {
+ String url = String.format("%s%s", Stripe.getApiBase(), "/v1/apple_pay/domains");
+ return ApiResource.requestCollection(url, params, ApplePayDomainCollection.class, options);
+ }
+
/** Retrieve an apple pay domain. */
public static ApplePayDomain retrieve(String domain) throws StripeException {
return retrieve(domain, (Map) null, (RequestOptions) null);
@@ -135,31 +162,4 @@ public static ApplePayDomain retrieve(
return ApiResource.request(
ApiResource.RequestMethod.GET, url, params, ApplePayDomain.class, options);
}
-
- /** Delete an apple pay domain. */
- public ApplePayDomain delete() throws StripeException {
- return delete((Map) null, (RequestOptions) null);
- }
-
- /** Delete an apple pay domain. */
- public ApplePayDomain delete(RequestOptions options) throws StripeException {
- return delete((Map) null, options);
- }
-
- /** Delete an apple pay domain. */
- public ApplePayDomain delete(Map params) throws StripeException {
- return delete(params, (RequestOptions) null);
- }
-
- /** Delete an apple pay domain. */
- public ApplePayDomain delete(Map params, RequestOptions options)
- throws StripeException {
- String url =
- String.format(
- "%s%s",
- Stripe.getApiBase(),
- String.format("/v1/apple_pay/domains/%s", ApiResource.urlEncodeId(this.getId())));
- return ApiResource.request(
- ApiResource.RequestMethod.DELETE, url, params, ApplePayDomain.class, options);
- }
}
diff --git a/src/main/java/com/stripe/model/Balance.java b/src/main/java/com/stripe/model/Balance.java
index 2a5d50622f0..f15ea717791 100644
--- a/src/main/java/com/stripe/model/Balance.java
+++ b/src/main/java/com/stripe/model/Balance.java
@@ -13,6 +13,20 @@
import lombok.Getter;
import lombok.Setter;
+/**
+ * This is an object representing your Stripe balance. You can retrieve it to see the balance
+ * currently on your Stripe account.
+ *
+ * You can also retrieve the balance history, which contains a list of transactions that
+ * contributed to the balance (charges, payouts, and so forth).
+ *
+ *
The available and pending amounts for each currency are broken down further by payment source
+ * types.
+ *
+ *
Related guide: Understanding
+ * Connect Account Balances.
+ */
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
diff --git a/src/main/java/com/stripe/model/BalanceTransaction.java b/src/main/java/com/stripe/model/BalanceTransaction.java
index 5e8ceb1e506..eb01d4db328 100644
--- a/src/main/java/com/stripe/model/BalanceTransaction.java
+++ b/src/main/java/com/stripe/model/BalanceTransaction.java
@@ -15,6 +15,13 @@
import lombok.Getter;
import lombok.Setter;
+/**
+ * Balance transactions represent funds moving through your Stripe account. They're created for
+ * every type of transaction that comes into or flows out of your Stripe account balance.
+ *
+ *
Related guide: Balance
+ * Transaction Types.
+ */
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
diff --git a/src/main/java/com/stripe/model/BankAccount.java b/src/main/java/com/stripe/model/BankAccount.java
index 5a7e71ae810..116b4612309 100644
--- a/src/main/java/com/stripe/model/BankAccount.java
+++ b/src/main/java/com/stripe/model/BankAccount.java
@@ -16,6 +16,17 @@
import lombok.Getter;
import lombok.Setter;
+/**
+ * These bank accounts are payment methods on {@code Customer} objects.
+ *
+ *
On the other hand External
+ * Accounts are transfer destinations on {@code Account} objects for Custom accounts. They can be bank
+ * accounts or debit cards as well, and are documented in the links above.
+ *
+ *
Related guide: Bank Debits
+ * and Transfers.
+ */
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
diff --git a/src/main/java/com/stripe/model/Capability.java b/src/main/java/com/stripe/model/Capability.java
index 27da638fe3a..f22bf7eeec4 100644
--- a/src/main/java/com/stripe/model/Capability.java
+++ b/src/main/java/com/stripe/model/Capability.java
@@ -13,6 +13,12 @@
import lombok.Getter;
import lombok.Setter;
+/**
+ * This is an object representing a capability for a Stripe account.
+ *
+ *
Related guide: Account
+ * capabilities.
+ */
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
diff --git a/src/main/java/com/stripe/model/Card.java b/src/main/java/com/stripe/model/Card.java
index ecb6b519163..72a92276fec 100644
--- a/src/main/java/com/stripe/model/Card.java
+++ b/src/main/java/com/stripe/model/Card.java
@@ -15,6 +15,12 @@
import lombok.Getter;
import lombok.Setter;
+/**
+ * You can store multiple cards on a customer in order to charge the customer later. You can also
+ * store multiple debit cards on a recipient in order to transfer to those cards later.
+ *
+ *
Related guide: Card Payments with Sources.
+ */
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
diff --git a/src/main/java/com/stripe/model/CashBalance.java b/src/main/java/com/stripe/model/CashBalance.java
index 2802bbb8289..2127f2580ee 100644
--- a/src/main/java/com/stripe/model/CashBalance.java
+++ b/src/main/java/com/stripe/model/CashBalance.java
@@ -13,6 +13,11 @@
import lombok.Getter;
import lombok.Setter;
+/**
+ * A customer's {@code Cash balance} represents real funds. Customers can add funds to their cash
+ * balance by sending a bank transfer. These funds can be used for payment and can eventually be
+ * paid out to your bank account.
+ */
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
@@ -119,6 +124,39 @@ public CashBalance update(CashBalanceUpdateParams params, RequestOptions options
ApiResource.RequestMethod.POST, url, params, CashBalance.class, options);
}
+ @Getter
+ @Setter
+ @EqualsAndHashCode(callSuper = false)
+ public static class AppliedToPaymentTransaction extends StripeObject {
+ /**
+ * The Payment Intent that
+ * funds were applied to.
+ */
+ @SerializedName("payment_intent")
+ @Getter(lombok.AccessLevel.NONE)
+ @Setter(lombok.AccessLevel.NONE)
+ ExpandableField paymentIntent;
+
+ /** Get ID of expandable {@code paymentIntent} object. */
+ public String getPaymentIntent() {
+ return (this.paymentIntent != null) ? this.paymentIntent.getId() : null;
+ }
+
+ public void setPaymentIntent(String id) {
+ this.paymentIntent = ApiResource.setExpandableFieldId(id, this.paymentIntent);
+ }
+
+ /** Get expanded {@code paymentIntent}. */
+ public PaymentIntent getPaymentIntentObject() {
+ return (this.paymentIntent != null) ? this.paymentIntent.getExpanded() : null;
+ }
+
+ public void setPaymentIntentObject(PaymentIntent expandableObject) {
+ this.paymentIntent =
+ new ExpandableField(expandableObject.getId(), expandableObject);
+ }
+ }
+
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
@@ -131,4 +169,117 @@ public static class BalanceSettings extends StripeObject {
@SerializedName("reconciliation_mode")
String reconciliationMode;
}
+
+ @Getter
+ @Setter
+ @EqualsAndHashCode(callSuper = false)
+ public static class FundedTransaction extends StripeObject {
+ @SerializedName("bank_transfer")
+ BankTransfer bankTransfer;
+
+ @Getter
+ @Setter
+ @EqualsAndHashCode(callSuper = false)
+ public static class BankTransfer extends StripeObject {
+ @SerializedName("eu_bank_transfer")
+ EuBankTransfer euBankTransfer;
+
+ /** The user-supplied reference field on the bank transfer. */
+ @SerializedName("reference")
+ String reference;
+
+ /**
+ * The funding method type used to fund the customer balance. Permitted values include: {@code
+ * eu_bank_transfer}, {@code gb_bank_transfer}, {@code jp_bank_transfer}, or {@code
+ * mx_bank_transfer}.
+ *
+ * One of {@code eu_bank_transfer}, {@code gb_bank_transfer}, {@code jp_bank_transfer}, or
+ * {@code mx_bank_transfer}.
+ */
+ @SerializedName("type")
+ String type;
+
+ @Getter
+ @Setter
+ @EqualsAndHashCode(callSuper = false)
+ public static class EuBankTransfer extends StripeObject {
+ /** The BIC of the bank of the sender of the funding. */
+ @SerializedName("bic")
+ String bic;
+
+ /** The last 4 digits of the IBAN of the sender of the funding. */
+ @SerializedName("iban_last4")
+ String ibanLast4;
+
+ /** The full name of the sender, as supplied by the sending bank. */
+ @SerializedName("sender_name")
+ String senderName;
+ }
+ }
+ }
+
+ @Getter
+ @Setter
+ @EqualsAndHashCode(callSuper = false)
+ public static class RefundedFromPaymentTransaction extends StripeObject {
+ /**
+ * The Refund that moved these funds
+ * into the customer's cash balance.
+ */
+ @SerializedName("refund")
+ @Getter(lombok.AccessLevel.NONE)
+ @Setter(lombok.AccessLevel.NONE)
+ ExpandableField refund;
+
+ /** Get ID of expandable {@code refund} object. */
+ public String getRefund() {
+ return (this.refund != null) ? this.refund.getId() : null;
+ }
+
+ public void setRefund(String id) {
+ this.refund = ApiResource.setExpandableFieldId(id, this.refund);
+ }
+
+ /** Get expanded {@code refund}. */
+ public Refund getRefundObject() {
+ return (this.refund != null) ? this.refund.getExpanded() : null;
+ }
+
+ public void setRefundObject(Refund expandableObject) {
+ this.refund = new ExpandableField(expandableObject.getId(), expandableObject);
+ }
+ }
+
+ @Getter
+ @Setter
+ @EqualsAndHashCode(callSuper = false)
+ public static class UnappliedFromPaymentTransaction extends StripeObject {
+ /**
+ * The Payment Intent that
+ * funds were unapplied from.
+ */
+ @SerializedName("payment_intent")
+ @Getter(lombok.AccessLevel.NONE)
+ @Setter(lombok.AccessLevel.NONE)
+ ExpandableField paymentIntent;
+
+ /** Get ID of expandable {@code paymentIntent} object. */
+ public String getPaymentIntent() {
+ return (this.paymentIntent != null) ? this.paymentIntent.getId() : null;
+ }
+
+ public void setPaymentIntent(String id) {
+ this.paymentIntent = ApiResource.setExpandableFieldId(id, this.paymentIntent);
+ }
+
+ /** Get expanded {@code paymentIntent}. */
+ public PaymentIntent getPaymentIntentObject() {
+ return (this.paymentIntent != null) ? this.paymentIntent.getExpanded() : null;
+ }
+
+ public void setPaymentIntentObject(PaymentIntent expandableObject) {
+ this.paymentIntent =
+ new ExpandableField(expandableObject.getId(), expandableObject);
+ }
+ }
}
diff --git a/src/main/java/com/stripe/model/Charge.java b/src/main/java/com/stripe/model/Charge.java
index e29e63aca00..26bbc83cb1d 100644
--- a/src/main/java/com/stripe/model/Charge.java
+++ b/src/main/java/com/stripe/model/Charge.java
@@ -19,6 +19,14 @@
import lombok.Getter;
import lombok.Setter;
+/**
+ * To charge a credit or a debit card, you create a {@code Charge} object. You can retrieve and
+ * refund individual charges as well as list all charges. Charges are identified by a unique, random
+ * ID.
+ *
+ * Related guide: Accept a
+ * payment with the Charges API.
+ */
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
@@ -600,91 +608,97 @@ public void setTransferObject(Transfer expandableObject) {
}
/**
- * Search for charges you’ve previously created using Stripe’s Search Query Language. Don’t
- * use search in read-after-write flows where strict consistency is necessary. Under normal
- * operating conditions, data is searchable in less than a minute. Occasionally, propagation of
- * new or updated data can be up to an hour behind during outages. Search functionality is not
- * available to merchants in India.
- */
- public static ChargeSearchResult search(Map params) throws StripeException {
- return search(params, (RequestOptions) null);
- }
-
- /**
- * Search for charges you’ve previously created using Stripe’s Search Query Language. Don’t
- * use search in read-after-write flows where strict consistency is necessary. Under normal
- * operating conditions, data is searchable in less than a minute. Occasionally, propagation of
- * new or updated data can be up to an hour behind during outages. Search functionality is not
- * available to merchants in India.
- */
- public static ChargeSearchResult search(Map params, RequestOptions options)
- throws StripeException {
- String url = String.format("%s%s", Stripe.getApiBase(), "/v1/charges/search");
- return ApiResource.requestSearchResult(url, params, ChargeSearchResult.class, options);
- }
-
- /**
- * Search for charges you’ve previously created using Stripe’s Search Query Language. Don’t
- * use search in read-after-write flows where strict consistency is necessary. Under normal
- * operating conditions, data is searchable in less than a minute. Occasionally, propagation of
- * new or updated data can be up to an hour behind during outages. Search functionality is not
- * available to merchants in India.
+ * Capture the payment of an existing, uncaptured, charge. This is the second half of the two-step
+ * payment flow, where first you created a
+ * charge with the capture option set to false.
+ *
+ * Uncaptured payments expire a set number of days after they are created (7 by default). If they are not
+ * captured by that point in time, they will be marked as refunded and will no longer be
+ * capturable.
*/
- public static ChargeSearchResult search(ChargeSearchParams params) throws StripeException {
- return search(params, (RequestOptions) null);
+ public Charge capture() throws StripeException {
+ return capture((Map) null, (RequestOptions) null);
}
/**
- * Search for charges you’ve previously created using Stripe’s Search Query Language. Don’t
- * use search in read-after-write flows where strict consistency is necessary. Under normal
- * operating conditions, data is searchable in less than a minute. Occasionally, propagation of
- * new or updated data can be up to an hour behind during outages. Search functionality is not
- * available to merchants in India.
+ * Capture the payment of an existing, uncaptured, charge. This is the second half of the two-step
+ * payment flow, where first you created a
+ * charge with the capture option set to false.
+ *
+ * Uncaptured payments expire a set number of days after they are created (7 by default). If they are not
+ * captured by that point in time, they will be marked as refunded and will no longer be
+ * capturable.
*/
- public static ChargeSearchResult search(ChargeSearchParams params, RequestOptions options)
- throws StripeException {
- String url = String.format("%s%s", Stripe.getApiBase(), "/v1/charges/search");
- return ApiResource.requestSearchResult(url, params, ChargeSearchResult.class, options);
+ public Charge capture(RequestOptions options) throws StripeException {
+ return capture((Map) null, options);
}
/**
- * Returns a list of charges you’ve previously created. The charges are returned in sorted order,
- * with the most recent charges appearing first.
+ * Capture the payment of an existing, uncaptured, charge. This is the second half of the two-step
+ * payment flow, where first you created a
+ * charge with the capture option set to false.
+ *
+ * Uncaptured payments expire a set number of days after they are created (7 by default). If they are not
+ * captured by that point in time, they will be marked as refunded and will no longer be
+ * capturable.
*/
- public static ChargeCollection list(Map params) throws StripeException {
- return list(params, (RequestOptions) null);
+ public Charge capture(Map params) throws StripeException {
+ return capture(params, (RequestOptions) null);
}
/**
- * Returns a list of charges you’ve previously created. The charges are returned in sorted order,
- * with the most recent charges appearing first.
+ * Capture the payment of an existing, uncaptured, charge. This is the second half of the two-step
+ * payment flow, where first you created a
+ * charge with the capture option set to false.
+ *
+ * Uncaptured payments expire a set number of days after they are created (7 by default). If they are not
+ * captured by that point in time, they will be marked as refunded and will no longer be
+ * capturable.
*/
- public static ChargeCollection list(Map params, RequestOptions options)
- throws StripeException {
- String url = String.format("%s%s", Stripe.getApiBase(), "/v1/charges");
- return ApiResource.requestCollection(url, params, ChargeCollection.class, options);
+ public Charge capture(Map params, RequestOptions options) throws StripeException {
+ String url =
+ String.format(
+ "%s%s",
+ Stripe.getApiBase(),
+ String.format("/v1/charges/%s/capture", ApiResource.urlEncodeId(this.getId())));
+ return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Charge.class, options);
}
/**
- * Returns a list of charges you’ve previously created. The charges are returned in sorted order,
- * with the most recent charges appearing first.
+ * Capture the payment of an existing, uncaptured, charge. This is the second half of the two-step
+ * payment flow, where first you created a
+ * charge with the capture option set to false.
+ *
+ * Uncaptured payments expire a set number of days after they are created (7 by default). If they are not
+ * captured by that point in time, they will be marked as refunded and will no longer be
+ * capturable.
*/
- public static ChargeCollection list(ChargeListParams params) throws StripeException {
- return list(params, (RequestOptions) null);
+ public Charge capture(ChargeCaptureParams params) throws StripeException {
+ return capture(params, (RequestOptions) null);
}
/**
- * Returns a list of charges you’ve previously created. The charges are returned in sorted order,
- * with the most recent charges appearing first.
+ * Capture the payment of an existing, uncaptured, charge. This is the second half of the two-step
+ * payment flow, where first you created a
+ * charge with the capture option set to false.
+ *
+ *
Uncaptured payments expire a set number of days after they are created (7 by default). If they are not
+ * captured by that point in time, they will be marked as refunded and will no longer be
+ * capturable.
*/
- public static ChargeCollection list(ChargeListParams params, RequestOptions options)
- throws StripeException {
- String url = String.format("%s%s", Stripe.getApiBase(), "/v1/charges");
- return ApiResource.requestCollection(url, params, ChargeCollection.class, options);
+ public Charge capture(ChargeCaptureParams params, RequestOptions options) throws StripeException {
+ String url =
+ String.format(
+ "%s%s",
+ Stripe.getApiBase(),
+ String.format("/v1/charges/%s/capture", ApiResource.urlEncodeId(this.getId())));
+ return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Charge.class, options);
}
/**
@@ -731,6 +745,42 @@ public static Charge create(ChargeCreateParams params, RequestOptions options)
return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Charge.class, options);
}
+ /**
+ * Returns a list of charges you’ve previously created. The charges are returned in sorted order,
+ * with the most recent charges appearing first.
+ */
+ public static ChargeCollection list(Map params) throws StripeException {
+ return list(params, (RequestOptions) null);
+ }
+
+ /**
+ * Returns a list of charges you’ve previously created. The charges are returned in sorted order,
+ * with the most recent charges appearing first.
+ */
+ public static ChargeCollection list(Map params, RequestOptions options)
+ throws StripeException {
+ String url = String.format("%s%s", Stripe.getApiBase(), "/v1/charges");
+ return ApiResource.requestCollection(url, params, ChargeCollection.class, options);
+ }
+
+ /**
+ * Returns a list of charges you’ve previously created. The charges are returned in sorted order,
+ * with the most recent charges appearing first.
+ */
+ public static ChargeCollection list(ChargeListParams params) throws StripeException {
+ return list(params, (RequestOptions) null);
+ }
+
+ /**
+ * Returns a list of charges you’ve previously created. The charges are returned in sorted order,
+ * with the most recent charges appearing first.
+ */
+ public static ChargeCollection list(ChargeListParams params, RequestOptions options)
+ throws StripeException {
+ String url = String.format("%s%s", Stripe.getApiBase(), "/v1/charges");
+ return ApiResource.requestCollection(url, params, ChargeCollection.class, options);
+ }
+
/**
* Retrieves the details of a charge that has previously been created. Supply the unique charge ID
* that was returned from your previous request, and Stripe will return the corresponding charge
@@ -777,6 +827,58 @@ public static Charge retrieve(String charge, ChargeRetrieveParams params, Reques
return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Charge.class, options);
}
+ /**
+ * Search for charges you’ve previously created using Stripe’s Search Query Language. Don’t
+ * use search in read-after-write flows where strict consistency is necessary. Under normal
+ * operating conditions, data is searchable in less than a minute. Occasionally, propagation of
+ * new or updated data can be up to an hour behind during outages. Search functionality is not
+ * available to merchants in India.
+ */
+ public static ChargeSearchResult search(Map params) throws StripeException {
+ return search(params, (RequestOptions) null);
+ }
+
+ /**
+ * Search for charges you’ve previously created using Stripe’s Search Query Language. Don’t
+ * use search in read-after-write flows where strict consistency is necessary. Under normal
+ * operating conditions, data is searchable in less than a minute. Occasionally, propagation of
+ * new or updated data can be up to an hour behind during outages. Search functionality is not
+ * available to merchants in India.
+ */
+ public static ChargeSearchResult search(Map params, RequestOptions options)
+ throws StripeException {
+ String url = String.format("%s%s", Stripe.getApiBase(), "/v1/charges/search");
+ return ApiResource.requestSearchResult(url, params, ChargeSearchResult.class, options);
+ }
+
+ /**
+ * Search for charges you’ve previously created using Stripe’s Search Query Language. Don’t
+ * use search in read-after-write flows where strict consistency is necessary. Under normal
+ * operating conditions, data is searchable in less than a minute. Occasionally, propagation of
+ * new or updated data can be up to an hour behind during outages. Search functionality is not
+ * available to merchants in India.
+ */
+ public static ChargeSearchResult search(ChargeSearchParams params) throws StripeException {
+ return search(params, (RequestOptions) null);
+ }
+
+ /**
+ * Search for charges you’ve previously created using Stripe’s Search Query Language. Don’t
+ * use search in read-after-write flows where strict consistency is necessary. Under normal
+ * operating conditions, data is searchable in less than a minute. Occasionally, propagation of
+ * new or updated data can be up to an hour behind during outages. Search functionality is not
+ * available to merchants in India.
+ */
+ public static ChargeSearchResult search(ChargeSearchParams params, RequestOptions options)
+ throws StripeException {
+ String url = String.format("%s%s", Stripe.getApiBase(), "/v1/charges/search");
+ return ApiResource.requestSearchResult(url, params, ChargeSearchResult.class, options);
+ }
+
/**
* Updates the specified charge by setting the values of the parameters passed. Any parameters not
* provided will be left unchanged.
@@ -821,100 +923,6 @@ public Charge update(ChargeUpdateParams params, RequestOptions options) throws S
return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Charge.class, options);
}
- /**
- * Capture the payment of an existing, uncaptured, charge. This is the second half of the two-step
- * payment flow, where first you created a
- * charge with the capture option set to false.
- *
- * Uncaptured payments expire a set number of days after they are created (7 by default). If they are not
- * captured by that point in time, they will be marked as refunded and will no longer be
- * capturable.
- */
- public Charge capture() throws StripeException {
- return capture((Map) null, (RequestOptions) null);
- }
-
- /**
- * Capture the payment of an existing, uncaptured, charge. This is the second half of the two-step
- * payment flow, where first you created a
- * charge with the capture option set to false.
- *
- * Uncaptured payments expire a set number of days after they are created (7 by default). If they are not
- * captured by that point in time, they will be marked as refunded and will no longer be
- * capturable.
- */
- public Charge capture(RequestOptions options) throws StripeException {
- return capture((Map) null, options);
- }
-
- /**
- * Capture the payment of an existing, uncaptured, charge. This is the second half of the two-step
- * payment flow, where first you created a
- * charge with the capture option set to false.
- *
- * Uncaptured payments expire a set number of days after they are created (7 by default). If they are not
- * captured by that point in time, they will be marked as refunded and will no longer be
- * capturable.
- */
- public Charge capture(Map params) throws StripeException {
- return capture(params, (RequestOptions) null);
- }
-
- /**
- * Capture the payment of an existing, uncaptured, charge. This is the second half of the two-step
- * payment flow, where first you created a
- * charge with the capture option set to false.
- *
- * Uncaptured payments expire a set number of days after they are created (7 by default). If they are not
- * captured by that point in time, they will be marked as refunded and will no longer be
- * capturable.
- */
- public Charge capture(Map params, RequestOptions options) throws StripeException {
- String url =
- String.format(
- "%s%s",
- Stripe.getApiBase(),
- String.format("/v1/charges/%s/capture", ApiResource.urlEncodeId(this.getId())));
- return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Charge.class, options);
- }
-
- /**
- * Capture the payment of an existing, uncaptured, charge. This is the second half of the two-step
- * payment flow, where first you created a
- * charge with the capture option set to false.
- *
- * Uncaptured payments expire a set number of days after they are created (7 by default). If they are not
- * captured by that point in time, they will be marked as refunded and will no longer be
- * capturable.
- */
- public Charge capture(ChargeCaptureParams params) throws StripeException {
- return capture(params, (RequestOptions) null);
- }
-
- /**
- * Capture the payment of an existing, uncaptured, charge. This is the second half of the two-step
- * payment flow, where first you created a
- * charge with the capture option set to false.
- *
- *
Uncaptured payments expire a set number of days after they are created (7 by default). If they are not
- * captured by that point in time, they will be marked as refunded and will no longer be
- * capturable.
- */
- public Charge capture(ChargeCaptureParams params, RequestOptions options) throws StripeException {
- String url =
- String.format(
- "%s%s",
- Stripe.getApiBase(),
- String.format("/v1/charges/%s/capture", ApiResource.urlEncodeId(this.getId())));
- return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Charge.class, options);
- }
-
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
@@ -2658,6 +2666,10 @@ public static class WechatPay extends StripeObject {
}
}
+ /**
+ * Options to configure Radar. See Radar
+ * Session for more information.
+ */
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
diff --git a/src/main/java/com/stripe/model/CountrySpec.java b/src/main/java/com/stripe/model/CountrySpec.java
index aeacd627422..0305dfbb6a3 100644
--- a/src/main/java/com/stripe/model/CountrySpec.java
+++ b/src/main/java/com/stripe/model/CountrySpec.java
@@ -14,6 +14,14 @@
import lombok.Getter;
import lombok.Setter;
+/**
+ * Stripe needs to collect certain pieces of information about each account created. These
+ * requirements can differ depending on the account's country. The Country Specs API makes these
+ * rules available to your integration.
+ *
+ *
You can also view the information from this API call as an online guide.
+ */
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
diff --git a/src/main/java/com/stripe/model/Coupon.java b/src/main/java/com/stripe/model/Coupon.java
index 6e3bd1a9473..605feebbbd8 100644
--- a/src/main/java/com/stripe/model/Coupon.java
+++ b/src/main/java/com/stripe/model/Coupon.java
@@ -17,6 +17,16 @@
import lombok.Getter;
import lombok.Setter;
+/**
+ * A coupon contains information about a percent-off or amount-off discount you might want to apply
+ * to a customer. Coupons may be applied to subscriptions, invoices, checkout sessions, quotes, and more. Coupons do not work with
+ * conventional one-off charges or payment intents.
+ */
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
@@ -131,30 +141,6 @@ public class Coupon extends ApiResource implements HasId, MetadataStore
@SerializedName("valid")
Boolean valid;
- /** Returns a list of your coupons. */
- public static CouponCollection list(Map params) throws StripeException {
- return list(params, (RequestOptions) null);
- }
-
- /** Returns a list of your coupons. */
- public static CouponCollection list(Map params, RequestOptions options)
- throws StripeException {
- String url = String.format("%s%s", Stripe.getApiBase(), "/v1/coupons");
- return ApiResource.requestCollection(url, params, CouponCollection.class, options);
- }
-
- /** Returns a list of your coupons. */
- public static CouponCollection list(CouponListParams params) throws StripeException {
- return list(params, (RequestOptions) null);
- }
-
- /** Returns a list of your coupons. */
- public static CouponCollection list(CouponListParams params, RequestOptions options)
- throws StripeException {
- String url = String.format("%s%s", Stripe.getApiBase(), "/v1/coupons");
- return ApiResource.requestCollection(url, params, CouponCollection.class, options);
- }
-
/**
* You can create coupons easily via the coupon
* management page of the Stripe dashboard. Coupon creation is also accessible via the API if
@@ -223,6 +209,76 @@ public static Coupon create(CouponCreateParams params, RequestOptions options)
return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Coupon.class, options);
}
+ /**
+ * You can delete coupons via the coupon
+ * management page of the Stripe dashboard. However, deleting a coupon does not affect any
+ * customers who have already applied the coupon; it means that new customers can’t redeem the
+ * coupon. You can also delete coupons via the API.
+ */
+ public Coupon delete() throws StripeException {
+ return delete((Map) null, (RequestOptions) null);
+ }
+
+ /**
+ * You can delete coupons via the coupon
+ * management page of the Stripe dashboard. However, deleting a coupon does not affect any
+ * customers who have already applied the coupon; it means that new customers can’t redeem the
+ * coupon. You can also delete coupons via the API.
+ */
+ public Coupon delete(RequestOptions options) throws StripeException {
+ return delete((Map) null, options);
+ }
+
+ /**
+ * You can delete coupons via the coupon
+ * management page of the Stripe dashboard. However, deleting a coupon does not affect any
+ * customers who have already applied the coupon; it means that new customers can’t redeem the
+ * coupon. You can also delete coupons via the API.
+ */
+ public Coupon delete(Map params) throws StripeException {
+ return delete(params, (RequestOptions) null);
+ }
+
+ /**
+ * You can delete coupons via the coupon
+ * management page of the Stripe dashboard. However, deleting a coupon does not affect any
+ * customers who have already applied the coupon; it means that new customers can’t redeem the
+ * coupon. You can also delete coupons via the API.
+ */
+ public Coupon delete(Map params, RequestOptions options) throws StripeException {
+ String url =
+ String.format(
+ "%s%s",
+ Stripe.getApiBase(),
+ String.format("/v1/coupons/%s", ApiResource.urlEncodeId(this.getId())));
+ return ApiResource.request(
+ ApiResource.RequestMethod.DELETE, url, params, Coupon.class, options);
+ }
+
+ /** Returns a list of your coupons. */
+ public static CouponCollection list(Map params) throws StripeException {
+ return list(params, (RequestOptions) null);
+ }
+
+ /** Returns a list of your coupons. */
+ public static CouponCollection list(Map params, RequestOptions options)
+ throws StripeException {
+ String url = String.format("%s%s", Stripe.getApiBase(), "/v1/coupons");
+ return ApiResource.requestCollection(url, params, CouponCollection.class, options);
+ }
+
+ /** Returns a list of your coupons. */
+ public static CouponCollection list(CouponListParams params) throws StripeException {
+ return list(params, (RequestOptions) null);
+ }
+
+ /** Returns a list of your coupons. */
+ public static CouponCollection list(CouponListParams params, RequestOptions options)
+ throws StripeException {
+ String url = String.format("%s%s", Stripe.getApiBase(), "/v1/coupons");
+ return ApiResource.requestCollection(url, params, CouponCollection.class, options);
+ }
+
/** Retrieves the coupon with the given ID. */
public static Coupon retrieve(String coupon) throws StripeException {
return retrieve(coupon, (Map) null, (RequestOptions) null);
@@ -297,52 +353,6 @@ public Coupon update(CouponUpdateParams params, RequestOptions options) throws S
return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Coupon.class, options);
}
- /**
- * You can delete coupons via the coupon
- * management page of the Stripe dashboard. However, deleting a coupon does not affect any
- * customers who have already applied the coupon; it means that new customers can’t redeem the
- * coupon. You can also delete coupons via the API.
- */
- public Coupon delete() throws StripeException {
- return delete((Map) null, (RequestOptions) null);
- }
-
- /**
- * You can delete coupons via the coupon
- * management page of the Stripe dashboard. However, deleting a coupon does not affect any
- * customers who have already applied the coupon; it means that new customers can’t redeem the
- * coupon. You can also delete coupons via the API.
- */
- public Coupon delete(RequestOptions options) throws StripeException {
- return delete((Map) null, options);
- }
-
- /**
- * You can delete coupons via the coupon
- * management page of the Stripe dashboard. However, deleting a coupon does not affect any
- * customers who have already applied the coupon; it means that new customers can’t redeem the
- * coupon. You can also delete coupons via the API.
- */
- public Coupon delete(Map params) throws StripeException {
- return delete(params, (RequestOptions) null);
- }
-
- /**
- * You can delete coupons via the coupon
- * management page of the Stripe dashboard. However, deleting a coupon does not affect any
- * customers who have already applied the coupon; it means that new customers can’t redeem the
- * coupon. You can also delete coupons via the API.
- */
- public Coupon delete(Map params, RequestOptions options) throws StripeException {
- String url =
- String.format(
- "%s%s",
- Stripe.getApiBase(),
- String.format("/v1/coupons/%s", ApiResource.urlEncodeId(this.getId())));
- return ApiResource.request(
- ApiResource.RequestMethod.DELETE, url, params, Coupon.class, options);
- }
-
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
diff --git a/src/main/java/com/stripe/model/CreditNote.java b/src/main/java/com/stripe/model/CreditNote.java
index 5af4775f951..c0d208b2d00 100644
--- a/src/main/java/com/stripe/model/CreditNote.java
+++ b/src/main/java/com/stripe/model/CreditNote.java
@@ -18,6 +18,12 @@
import lombok.Getter;
import lombok.Setter;
+/**
+ * Issue a credit note to adjust an invoice's amount after the invoice is finalized.
+ *
+ * Related guide: Credit
+ * Notes.
+ */
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
@@ -371,6 +377,30 @@ public static CreditNote create(CreditNoteCreateParams params, RequestOptions op
ApiResource.RequestMethod.POST, url, params, CreditNote.class, options);
}
+ /** Returns a list of credit notes. */
+ public static CreditNoteCollection list(Map params) throws StripeException {
+ return list(params, (RequestOptions) null);
+ }
+
+ /** Returns a list of credit notes. */
+ public static CreditNoteCollection list(Map params, RequestOptions options)
+ throws StripeException {
+ String url = String.format("%s%s", Stripe.getApiBase(), "/v1/credit_notes");
+ return ApiResource.requestCollection(url, params, CreditNoteCollection.class, options);
+ }
+
+ /** Returns a list of credit notes. */
+ public static CreditNoteCollection list(CreditNoteListParams params) throws StripeException {
+ return list(params, (RequestOptions) null);
+ }
+
+ /** Returns a list of credit notes. */
+ public static CreditNoteCollection list(CreditNoteListParams params, RequestOptions options)
+ throws StripeException {
+ String url = String.format("%s%s", Stripe.getApiBase(), "/v1/credit_notes");
+ return ApiResource.requestCollection(url, params, CreditNoteCollection.class, options);
+ }
+
/** Get a preview of a credit note without creating it. */
public static CreditNote preview(Map params) throws StripeException {
return preview(params, (RequestOptions) null);
@@ -429,30 +459,6 @@ public static CreditNote retrieve(
ApiResource.RequestMethod.GET, url, params, CreditNote.class, options);
}
- /** Returns a list of credit notes. */
- public static CreditNoteCollection list(Map params) throws StripeException {
- return list(params, (RequestOptions) null);
- }
-
- /** Returns a list of credit notes. */
- public static CreditNoteCollection list(Map params, RequestOptions options)
- throws StripeException {
- String url = String.format("%s%s", Stripe.getApiBase(), "/v1/credit_notes");
- return ApiResource.requestCollection(url, params, CreditNoteCollection.class, options);
- }
-
- /** Returns a list of credit notes. */
- public static CreditNoteCollection list(CreditNoteListParams params) throws StripeException {
- return list(params, (RequestOptions) null);
- }
-
- /** Returns a list of credit notes. */
- public static CreditNoteCollection list(CreditNoteListParams params, RequestOptions options)
- throws StripeException {
- String url = String.format("%s%s", Stripe.getApiBase(), "/v1/credit_notes");
- return ApiResource.requestCollection(url, params, CreditNoteCollection.class, options);
- }
-
/** Updates an existing credit note. */
@Override
public CreditNote update(Map params) throws StripeException {
diff --git a/src/main/java/com/stripe/model/Customer.java b/src/main/java/com/stripe/model/Customer.java
index dabc8ddd71d..4cc817f1e5a 100644
--- a/src/main/java/com/stripe/model/Customer.java
+++ b/src/main/java/com/stripe/model/Customer.java
@@ -23,6 +23,13 @@
import lombok.Getter;
import lombok.Setter;
+/**
+ * This object represents a customer of your business. It lets you create recurring charges and
+ * track payments that belong to the same customer.
+ *
+ * Related guide: Save a card
+ * during payment.
+ */
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
@@ -238,91 +245,61 @@ public void setTestClockObject(TestClock expandableObject) {
}
/**
- * Search for customers you’ve previously created using Stripe’s Search Query Language. Don’t
- * use search in read-after-write flows where strict consistency is necessary. Under normal
- * operating conditions, data is searchable in less than a minute. Occasionally, propagation of
- * new or updated data can be up to an hour behind during outages. Search functionality is not
- * available to merchants in India.
- */
- public static CustomerSearchResult search(Map params) throws StripeException {
- return search(params, (RequestOptions) null);
- }
-
- /**
- * Search for customers you’ve previously created using Stripe’s Search Query Language. Don’t
- * use search in read-after-write flows where strict consistency is necessary. Under normal
- * operating conditions, data is searchable in less than a minute. Occasionally, propagation of
- * new or updated data can be up to an hour behind during outages. Search functionality is not
- * available to merchants in India.
- */
- public static CustomerSearchResult search(Map params, RequestOptions options)
- throws StripeException {
- String url = String.format("%s%s", Stripe.getApiBase(), "/v1/customers/search");
- return ApiResource.requestSearchResult(url, params, CustomerSearchResult.class, options);
- }
-
- /**
- * Search for customers you’ve previously created using Stripe’s Search Query Language. Don’t
- * use search in read-after-write flows where strict consistency is necessary. Under normal
- * operating conditions, data is searchable in less than a minute. Occasionally, propagation of
- * new or updated data can be up to an hour behind during outages. Search functionality is not
- * available to merchants in India.
+ * Returns a list of transactions that updated the customer’s balances.
*/
- public static CustomerSearchResult search(CustomerSearchParams params) throws StripeException {
- return search(params, (RequestOptions) null);
+ public CustomerBalanceTransactionCollection balanceTransactions() throws StripeException {
+ return balanceTransactions((Map) null, (RequestOptions) null);
}
/**
- * Search for customers you’ve previously created using Stripe’s Search Query Language. Don’t
- * use search in read-after-write flows where strict consistency is necessary. Under normal
- * operating conditions, data is searchable in less than a minute. Occasionally, propagation of
- * new or updated data can be up to an hour behind during outages. Search functionality is not
- * available to merchants in India.
+ * Returns a list of transactions that updated the customer’s balances.
*/
- public static CustomerSearchResult search(CustomerSearchParams params, RequestOptions options)
+ public CustomerBalanceTransactionCollection balanceTransactions(Map params)
throws StripeException {
- String url = String.format("%s%s", Stripe.getApiBase(), "/v1/customers/search");
- return ApiResource.requestSearchResult(url, params, CustomerSearchResult.class, options);
- }
-
- /**
- * Returns a list of your customers. The customers are returned sorted by creation date, with the
- * most recent customers appearing first.
- */
- public static CustomerCollection list(Map params) throws StripeException {
- return list(params, (RequestOptions) null);
+ return balanceTransactions(params, (RequestOptions) null);
}
/**
- * Returns a list of your customers. The customers are returned sorted by creation date, with the
- * most recent customers appearing first.
+ * Returns a list of transactions that updated the customer’s balances.
*/
- public static CustomerCollection list(Map params, RequestOptions options)
- throws StripeException {
- String url = String.format("%s%s", Stripe.getApiBase(), "/v1/customers");
- return ApiResource.requestCollection(url, params, CustomerCollection.class, options);
+ public CustomerBalanceTransactionCollection balanceTransactions(
+ Map params, RequestOptions options) throws StripeException {
+ String url =
+ String.format(
+ "%s%s",
+ Stripe.getApiBase(),
+ String.format(
+ "/v1/customers/%s/balance_transactions", ApiResource.urlEncodeId(this.getId())));
+ return ApiResource.requestCollection(
+ url, params, CustomerBalanceTransactionCollection.class, options);
}
/**
- * Returns a list of your customers. The customers are returned sorted by creation date, with the
- * most recent customers appearing first.
+ * Returns a list of transactions that updated the customer’s balances.
*/
- public static CustomerCollection list(CustomerListParams params) throws StripeException {
- return list(params, (RequestOptions) null);
+ public CustomerBalanceTransactionCollection balanceTransactions(
+ CustomerBalanceTransactionsParams params) throws StripeException {
+ return balanceTransactions(params, (RequestOptions) null);
}
/**
- * Returns a list of your customers. The customers are returned sorted by creation date, with the
- * most recent customers appearing first.
+ * Returns a list of transactions that updated the customer’s balances.
*/
- public static CustomerCollection list(CustomerListParams params, RequestOptions options)
- throws StripeException {
- String url = String.format("%s%s", Stripe.getApiBase(), "/v1/customers");
- return ApiResource.requestCollection(url, params, CustomerCollection.class, options);
+ public CustomerBalanceTransactionCollection balanceTransactions(
+ CustomerBalanceTransactionsParams params, RequestOptions options) throws StripeException {
+ String url =
+ String.format(
+ "%s%s",
+ Stripe.getApiBase(),
+ String.format(
+ "/v1/customers/%s/balance_transactions", ApiResource.urlEncodeId(this.getId())));
+ return ApiResource.requestCollection(
+ url, params, CustomerBalanceTransactionCollection.class, options);
}
/** Creates a new customer object. */
@@ -351,125 +328,63 @@ public static Customer create(CustomerCreateParams params, RequestOptions option
ApiResource.RequestMethod.POST, url, params, Customer.class, options);
}
- /** Retrieves a Customer object. */
- public static Customer retrieve(String customer) throws StripeException {
- return retrieve(customer, (Map) null, (RequestOptions) null);
- }
-
- /** Retrieves a Customer object. */
- public static Customer retrieve(String customer, RequestOptions options) throws StripeException {
- return retrieve(customer, (Map) null, options);
- }
-
- /** Retrieves a Customer object. */
- public static Customer retrieve(
- String customer, Map params, RequestOptions options) throws StripeException {
- String url =
- String.format(
- "%s%s",
- Stripe.getApiBase(),
- String.format("/v1/customers/%s", ApiResource.urlEncodeId(customer)));
- return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Customer.class, options);
- }
-
- /** Retrieves a Customer object. */
- public static Customer retrieve(
- String customer, CustomerRetrieveParams params, RequestOptions options)
- throws StripeException {
- String url =
- String.format(
- "%s%s",
- Stripe.getApiBase(),
- String.format("/v1/customers/%s", ApiResource.urlEncodeId(customer)));
- return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Customer.class, options);
- }
-
/**
- * Updates the specified customer by setting the values of the parameters passed. Any parameters
- * not provided will be left unchanged. For example, if you pass the source
- * parameter, that becomes the customer’s active source (e.g., a card) to be used for all charges
- * in the future. When you update a customer to a new valid card source by passing the
- * source parameter: for each of the customer’s current subscriptions, if the
- * subscription bills automatically and is in the past_due
state, then the latest
- * open invoice for the subscription with automatic collection enabled will be retried. This retry
- * will not count as an automatic retry, and will not affect the next regularly scheduled payment
- * for the invoice. Changing the default_source for a customer will not trigger
- * this behavior.
- *
- * This request accepts mostly the same arguments as the customer creation call.
+ * Retrieve funding instructions for a customer cash balance. If funding instructions do not yet
+ * exist for the customer, new funding instructions will be created. If funding instructions have
+ * already been created for a given customer, the same funding instructions will be retrieved. In
+ * other words, we will return the same funding instructions each time.
*/
- @Override
- public Customer update(Map params) throws StripeException {
- return update(params, (RequestOptions) null);
+ public FundingInstructions createFundingInstructions(Map params)
+ throws StripeException {
+ return createFundingInstructions(params, (RequestOptions) null);
}
/**
- * Updates the specified customer by setting the values of the parameters passed. Any parameters
- * not provided will be left unchanged. For example, if you pass the source
- * parameter, that becomes the customer’s active source (e.g., a card) to be used for all charges
- * in the future. When you update a customer to a new valid card source by passing the
- * source parameter: for each of the customer’s current subscriptions, if the
- * subscription bills automatically and is in the past_due
state, then the latest
- * open invoice for the subscription with automatic collection enabled will be retried. This retry
- * will not count as an automatic retry, and will not affect the next regularly scheduled payment
- * for the invoice. Changing the default_source for a customer will not trigger
- * this behavior.
- *
- * This request accepts mostly the same arguments as the customer creation call.
+ * Retrieve funding instructions for a customer cash balance. If funding instructions do not yet
+ * exist for the customer, new funding instructions will be created. If funding instructions have
+ * already been created for a given customer, the same funding instructions will be retrieved. In
+ * other words, we will return the same funding instructions each time.
*/
- @Override
- public Customer update(Map params, RequestOptions options)
- throws StripeException {
+ public FundingInstructions createFundingInstructions(
+ Map params, RequestOptions options) throws StripeException {
String url =
String.format(
"%s%s",
Stripe.getApiBase(),
- String.format("/v1/customers/%s", ApiResource.urlEncodeId(this.getId())));
+ String.format(
+ "/v1/customers/%s/funding_instructions", ApiResource.urlEncodeId(this.getId())));
return ApiResource.request(
- ApiResource.RequestMethod.POST, url, params, Customer.class, options);
+ ApiResource.RequestMethod.POST, url, params, FundingInstructions.class, options);
}
/**
- * Updates the specified customer by setting the values of the parameters passed. Any parameters
- * not provided will be left unchanged. For example, if you pass the source
- * parameter, that becomes the customer’s active source (e.g., a card) to be used for all charges
- * in the future. When you update a customer to a new valid card source by passing the
- * source parameter: for each of the customer’s current subscriptions, if the
- * subscription bills automatically and is in the past_due
state, then the latest
- * open invoice for the subscription with automatic collection enabled will be retried. This retry
- * will not count as an automatic retry, and will not affect the next regularly scheduled payment
- * for the invoice. Changing the default_source for a customer will not trigger
- * this behavior.
- *
- * This request accepts mostly the same arguments as the customer creation call.
+ * Retrieve funding instructions for a customer cash balance. If funding instructions do not yet
+ * exist for the customer, new funding instructions will be created. If funding instructions have
+ * already been created for a given customer, the same funding instructions will be retrieved. In
+ * other words, we will return the same funding instructions each time.
*/
- public Customer update(CustomerUpdateParams params) throws StripeException {
- return update(params, (RequestOptions) null);
+ public FundingInstructions createFundingInstructions(
+ CustomerCreateFundingInstructionsParams params) throws StripeException {
+ return createFundingInstructions(params, (RequestOptions) null);
}
/**
- * Updates the specified customer by setting the values of the parameters passed. Any parameters
- * not provided will be left unchanged. For example, if you pass the source
- * parameter, that becomes the customer’s active source (e.g., a card) to be used for all charges
- * in the future. When you update a customer to a new valid card source by passing the
- * source parameter: for each of the customer’s current subscriptions, if the
- * subscription bills automatically and is in the past_due
state, then the latest
- * open invoice for the subscription with automatic collection enabled will be retried. This retry
- * will not count as an automatic retry, and will not affect the next regularly scheduled payment
- * for the invoice. Changing the default_source for a customer will not trigger
- * this behavior.
- *
- *
This request accepts mostly the same arguments as the customer creation call.
+ * Retrieve funding instructions for a customer cash balance. If funding instructions do not yet
+ * exist for the customer, new funding instructions will be created. If funding instructions have
+ * already been created for a given customer, the same funding instructions will be retrieved. In
+ * other words, we will return the same funding instructions each time.
*/
- public Customer update(CustomerUpdateParams params, RequestOptions options)
+ public FundingInstructions createFundingInstructions(
+ CustomerCreateFundingInstructionsParams params, RequestOptions options)
throws StripeException {
String url =
String.format(
"%s%s",
Stripe.getApiBase(),
- String.format("/v1/customers/%s", ApiResource.urlEncodeId(this.getId())));
+ String.format(
+ "/v1/customers/%s/funding_instructions", ApiResource.urlEncodeId(this.getId())));
return ApiResource.request(
- ApiResource.RequestMethod.POST, url, params, Customer.class, options);
+ ApiResource.RequestMethod.POST, url, params, FundingInstructions.class, options);
}
/**
@@ -511,6 +426,64 @@ public Customer delete(Map params, RequestOptions options)
ApiResource.RequestMethod.DELETE, url, params, Customer.class, options);
}
+ /** Removes the currently applied discount on a customer. */
+ public Discount deleteDiscount() throws StripeException {
+ return deleteDiscount((Map) null, (RequestOptions) null);
+ }
+
+ /** Removes the currently applied discount on a customer. */
+ public Discount deleteDiscount(Map params) throws StripeException {
+ return deleteDiscount(params, (RequestOptions) null);
+ }
+
+ /** Removes the currently applied discount on a customer. */
+ public Discount deleteDiscount(Map params, RequestOptions options)
+ throws StripeException {
+ String url =
+ String.format(
+ "%s%s",
+ Stripe.getApiBase(),
+ String.format("/v1/customers/%s/discount", ApiResource.urlEncodeId(this.getId())));
+ return ApiResource.request(
+ ApiResource.RequestMethod.DELETE, url, params, Discount.class, options);
+ }
+
+ /**
+ * Returns a list of your customers. The customers are returned sorted by creation date, with the
+ * most recent customers appearing first.
+ */
+ public static CustomerCollection list(Map params) throws StripeException {
+ return list(params, (RequestOptions) null);
+ }
+
+ /**
+ * Returns a list of your customers. The customers are returned sorted by creation date, with the
+ * most recent customers appearing first.
+ */
+ public static CustomerCollection list(Map params, RequestOptions options)
+ throws StripeException {
+ String url = String.format("%s%s", Stripe.getApiBase(), "/v1/customers");
+ return ApiResource.requestCollection(url, params, CustomerCollection.class, options);
+ }
+
+ /**
+ * Returns a list of your customers. The customers are returned sorted by creation date, with the
+ * most recent customers appearing first.
+ */
+ public static CustomerCollection list(CustomerListParams params) throws StripeException {
+ return list(params, (RequestOptions) null);
+ }
+
+ /**
+ * Returns a list of your customers. The customers are returned sorted by creation date, with the
+ * most recent customers appearing first.
+ */
+ public static CustomerCollection list(CustomerListParams params, RequestOptions options)
+ throws StripeException {
+ String url = String.format("%s%s", Stripe.getApiBase(), "/v1/customers");
+ return ApiResource.requestCollection(url, params, CustomerCollection.class, options);
+ }
+
/** Returns a list of PaymentMethods for a given Customer. */
public PaymentMethodCollection listPaymentMethods(Map params)
throws StripeException {
@@ -547,6 +520,39 @@ public PaymentMethodCollection listPaymentMethods(
return ApiResource.requestCollection(url, params, PaymentMethodCollection.class, options);
}
+ /** Retrieves a Customer object. */
+ public static Customer retrieve(String customer) throws StripeException {
+ return retrieve(customer, (Map) null, (RequestOptions) null);
+ }
+
+ /** Retrieves a Customer object. */
+ public static Customer retrieve(String customer, RequestOptions options) throws StripeException {
+ return retrieve(customer, (Map) null, options);
+ }
+
+ /** Retrieves a Customer object. */
+ public static Customer retrieve(
+ String customer, Map params, RequestOptions options) throws StripeException {
+ String url =
+ String.format(
+ "%s%s",
+ Stripe.getApiBase(),
+ String.format("/v1/customers/%s", ApiResource.urlEncodeId(customer)));
+ return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Customer.class, options);
+ }
+
+ /** Retrieves a Customer object. */
+ public static Customer retrieve(
+ String customer, CustomerRetrieveParams params, RequestOptions options)
+ throws StripeException {
+ String url =
+ String.format(
+ "%s%s",
+ Stripe.getApiBase(),
+ String.format("/v1/customers/%s", ApiResource.urlEncodeId(customer)));
+ return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Customer.class, options);
+ }
+
/** Retrieves a PaymentMethod object for a given Customer. */
public PaymentMethod retrievePaymentMethod(
String customer, Map params, RequestOptions options) throws StripeException {
@@ -577,142 +583,143 @@ public PaymentMethod retrievePaymentMethod(
}
/**
- * Returns a list of transactions that updated the customer’s balances.
+ * Search for customers you’ve previously created using Stripe’s Search Query Language. Don’t
+ * use search in read-after-write flows where strict consistency is necessary. Under normal
+ * operating conditions, data is searchable in less than a minute. Occasionally, propagation of
+ * new or updated data can be up to an hour behind during outages. Search functionality is not
+ * available to merchants in India.
*/
- public CustomerBalanceTransactionCollection balanceTransactions() throws StripeException {
- return balanceTransactions((Map) null, (RequestOptions) null);
+ public static CustomerSearchResult search(Map params) throws StripeException {
+ return search(params, (RequestOptions) null);
}
/**
- * Returns a list of transactions that updated the customer’s balances.
+ * Search for customers you’ve previously created using Stripe’s Search Query Language. Don’t
+ * use search in read-after-write flows where strict consistency is necessary. Under normal
+ * operating conditions, data is searchable in less than a minute. Occasionally, propagation of
+ * new or updated data can be up to an hour behind during outages. Search functionality is not
+ * available to merchants in India.
*/
- public CustomerBalanceTransactionCollection balanceTransactions(Map params)
+ public static CustomerSearchResult search(Map params, RequestOptions options)
throws StripeException {
- return balanceTransactions(params, (RequestOptions) null);
+ String url = String.format("%s%s", Stripe.getApiBase(), "/v1/customers/search");
+ return ApiResource.requestSearchResult(url, params, CustomerSearchResult.class, options);
}
/**
- * Returns a list of transactions that updated the customer’s balances.
+ * Search for customers you’ve previously created using Stripe’s Search Query Language. Don’t
+ * use search in read-after-write flows where strict consistency is necessary. Under normal
+ * operating conditions, data is searchable in less than a minute. Occasionally, propagation of
+ * new or updated data can be up to an hour behind during outages. Search functionality is not
+ * available to merchants in India.
*/
- public CustomerBalanceTransactionCollection balanceTransactions(
- Map params, RequestOptions options) throws StripeException {
- String url =
- String.format(
- "%s%s",
- Stripe.getApiBase(),
- String.format(
- "/v1/customers/%s/balance_transactions", ApiResource.urlEncodeId(this.getId())));
- return ApiResource.requestCollection(
- url, params, CustomerBalanceTransactionCollection.class, options);
+ public static CustomerSearchResult search(CustomerSearchParams params) throws StripeException {
+ return search(params, (RequestOptions) null);
}
/**
- * Returns a list of transactions that updated the customer’s balances.
+ * Search for customers you’ve previously created using Stripe’s Search Query Language. Don’t
+ * use search in read-after-write flows where strict consistency is necessary. Under normal
+ * operating conditions, data is searchable in less than a minute. Occasionally, propagation of
+ * new or updated data can be up to an hour behind during outages. Search functionality is not
+ * available to merchants in India.
*/
- public CustomerBalanceTransactionCollection balanceTransactions(
- CustomerBalanceTransactionsParams params) throws StripeException {
- return balanceTransactions(params, (RequestOptions) null);
+ public static CustomerSearchResult search(CustomerSearchParams params, RequestOptions options)
+ throws StripeException {
+ String url = String.format("%s%s", Stripe.getApiBase(), "/v1/customers/search");
+ return ApiResource.requestSearchResult(url, params, CustomerSearchResult.class, options);
}
/**
- * Returns a list of transactions that updated the customer’s balances.
+ * Updates the specified customer by setting the values of the parameters passed. Any parameters
+ * not provided will be left unchanged. For example, if you pass the source
+ * parameter, that becomes the customer’s active source (e.g., a card) to be used for all charges
+ * in the future. When you update a customer to a new valid card source by passing the
+ * source parameter: for each of the customer’s current subscriptions, if the
+ * subscription bills automatically and is in the past_due
state, then the latest
+ * open invoice for the subscription with automatic collection enabled will be retried. This retry
+ * will not count as an automatic retry, and will not affect the next regularly scheduled payment
+ * for the invoice. Changing the default_source for a customer will not trigger
+ * this behavior.
+ *
+ * This request accepts mostly the same arguments as the customer creation call.
*/
- public CustomerBalanceTransactionCollection balanceTransactions(
- CustomerBalanceTransactionsParams params, RequestOptions options) throws StripeException {
- String url =
- String.format(
- "%s%s",
- Stripe.getApiBase(),
- String.format(
- "/v1/customers/%s/balance_transactions", ApiResource.urlEncodeId(this.getId())));
- return ApiResource.requestCollection(
- url, params, CustomerBalanceTransactionCollection.class, options);
+ @Override
+ public Customer update(Map params) throws StripeException {
+ return update(params, (RequestOptions) null);
}
/**
- * Retrieve funding instructions for a customer cash balance. If funding instructions do not yet
- * exist for the customer, new funding instructions will be created. If funding instructions have
- * already been created for a given customer, the same funding instructions will be retrieved. In
- * other words, we will return the same funding instructions each time.
+ * Updates the specified customer by setting the values of the parameters passed. Any parameters
+ * not provided will be left unchanged. For example, if you pass the source
+ * parameter, that becomes the customer’s active source (e.g., a card) to be used for all charges
+ * in the future. When you update a customer to a new valid card source by passing the
+ * source parameter: for each of the customer’s current subscriptions, if the
+ * subscription bills automatically and is in the past_due
state, then the latest
+ * open invoice for the subscription with automatic collection enabled will be retried. This retry
+ * will not count as an automatic retry, and will not affect the next regularly scheduled payment
+ * for the invoice. Changing the default_source for a customer will not trigger
+ * this behavior.
+ *
+ * This request accepts mostly the same arguments as the customer creation call.
*/
- public FundingInstructions createFundingInstructions(Map params)
+ @Override
+ public Customer update(Map params, RequestOptions options)
throws StripeException {
- return createFundingInstructions(params, (RequestOptions) null);
- }
-
- /**
- * Retrieve funding instructions for a customer cash balance. If funding instructions do not yet
- * exist for the customer, new funding instructions will be created. If funding instructions have
- * already been created for a given customer, the same funding instructions will be retrieved. In
- * other words, we will return the same funding instructions each time.
- */
- public FundingInstructions createFundingInstructions(
- Map params, RequestOptions options) throws StripeException {
String url =
String.format(
"%s%s",
Stripe.getApiBase(),
- String.format(
- "/v1/customers/%s/funding_instructions", ApiResource.urlEncodeId(this.getId())));
+ String.format("/v1/customers/%s", ApiResource.urlEncodeId(this.getId())));
return ApiResource.request(
- ApiResource.RequestMethod.POST, url, params, FundingInstructions.class, options);
+ ApiResource.RequestMethod.POST, url, params, Customer.class, options);
}
/**
- * Retrieve funding instructions for a customer cash balance. If funding instructions do not yet
- * exist for the customer, new funding instructions will be created. If funding instructions have
- * already been created for a given customer, the same funding instructions will be retrieved. In
- * other words, we will return the same funding instructions each time.
+ * Updates the specified customer by setting the values of the parameters passed. Any parameters
+ * not provided will be left unchanged. For example, if you pass the source
+ * parameter, that becomes the customer’s active source (e.g., a card) to be used for all charges
+ * in the future. When you update a customer to a new valid card source by passing the
+ * source parameter: for each of the customer’s current subscriptions, if the
+ * subscription bills automatically and is in the past_due
state, then the latest
+ * open invoice for the subscription with automatic collection enabled will be retried. This retry
+ * will not count as an automatic retry, and will not affect the next regularly scheduled payment
+ * for the invoice. Changing the default_source for a customer will not trigger
+ * this behavior.
+ *
+ * This request accepts mostly the same arguments as the customer creation call.
*/
- public FundingInstructions createFundingInstructions(
- CustomerCreateFundingInstructionsParams params) throws StripeException {
- return createFundingInstructions(params, (RequestOptions) null);
+ public Customer update(CustomerUpdateParams params) throws StripeException {
+ return update(params, (RequestOptions) null);
}
/**
- * Retrieve funding instructions for a customer cash balance. If funding instructions do not yet
- * exist for the customer, new funding instructions will be created. If funding instructions have
- * already been created for a given customer, the same funding instructions will be retrieved. In
- * other words, we will return the same funding instructions each time.
+ * Updates the specified customer by setting the values of the parameters passed. Any parameters
+ * not provided will be left unchanged. For example, if you pass the source
+ * parameter, that becomes the customer’s active source (e.g., a card) to be used for all charges
+ * in the future. When you update a customer to a new valid card source by passing the
+ * source parameter: for each of the customer’s current subscriptions, if the
+ * subscription bills automatically and is in the past_due
state, then the latest
+ * open invoice for the subscription with automatic collection enabled will be retried. This retry
+ * will not count as an automatic retry, and will not affect the next regularly scheduled payment
+ * for the invoice. Changing the default_source for a customer will not trigger
+ * this behavior.
+ *
+ *
This request accepts mostly the same arguments as the customer creation call.
*/
- public FundingInstructions createFundingInstructions(
- CustomerCreateFundingInstructionsParams params, RequestOptions options)
- throws StripeException {
- String url =
- String.format(
- "%s%s",
- Stripe.getApiBase(),
- String.format(
- "/v1/customers/%s/funding_instructions", ApiResource.urlEncodeId(this.getId())));
- return ApiResource.request(
- ApiResource.RequestMethod.POST, url, params, FundingInstructions.class, options);
- }
-
- /** Removes the currently applied discount on a customer. */
- public Discount deleteDiscount() throws StripeException {
- return deleteDiscount((Map) null, (RequestOptions) null);
- }
-
- /** Removes the currently applied discount on a customer. */
- public Discount deleteDiscount(Map params) throws StripeException {
- return deleteDiscount(params, (RequestOptions) null);
- }
-
- /** Removes the currently applied discount on a customer. */
- public Discount deleteDiscount(Map params, RequestOptions options)
+ public Customer update(CustomerUpdateParams params, RequestOptions options)
throws StripeException {
String url =
String.format(
"%s%s",
Stripe.getApiBase(),
- String.format("/v1/customers/%s/discount", ApiResource.urlEncodeId(this.getId())));
+ String.format("/v1/customers/%s", ApiResource.urlEncodeId(this.getId())));
return ApiResource.request(
- ApiResource.RequestMethod.DELETE, url, params, Discount.class, options);
+ ApiResource.RequestMethod.POST, url, params, Customer.class, options);
}
@Getter
diff --git a/src/main/java/com/stripe/model/CustomerBalanceTransaction.java b/src/main/java/com/stripe/model/CustomerBalanceTransaction.java
index 62bd7d83bc8..cd08da9a102 100644
--- a/src/main/java/com/stripe/model/CustomerBalanceTransaction.java
+++ b/src/main/java/com/stripe/model/CustomerBalanceTransaction.java
@@ -12,6 +12,18 @@
import lombok.Getter;
import lombok.Setter;
+/**
+ * Each customer has a {@code balance}
+ * value, which denotes a debit or credit that's automatically applied to their next invoice upon
+ * finalization. You may modify the value directly by using the update customer API, or by creating a
+ * Customer Balance Transaction, which increments or decrements the customer's {@code balance} by
+ * the specified {@code amount}.
+ *
+ * Related guide: Customer Balance
+ * to learn more.
+ */
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
diff --git a/src/main/java/com/stripe/model/CustomerBalanceTransactionCollection.java b/src/main/java/com/stripe/model/CustomerBalanceTransactionCollection.java
index e7c6ef53b33..63c3b69b587 100644
--- a/src/main/java/com/stripe/model/CustomerBalanceTransactionCollection.java
+++ b/src/main/java/com/stripe/model/CustomerBalanceTransactionCollection.java
@@ -13,51 +13,43 @@
public class CustomerBalanceTransactionCollection
extends StripeCollection {
/**
- * Retrieves a specific customer balance transaction that updated the customer’s balances.
+ * Creates an immutable transaction that updates the customer’s credit balance.
*/
- public CustomerBalanceTransaction retrieve(String id) throws StripeException {
- return retrieve(id, (Map) null, (RequestOptions) null);
+ public CustomerBalanceTransaction create(Map params) throws StripeException {
+ return create(params, (RequestOptions) null);
}
/**
- * Retrieves a specific customer balance transaction that updated the customer’s balances.
+ * Creates an immutable transaction that updates the customer’s credit balance.
*/
- public CustomerBalanceTransaction retrieve(String id, RequestOptions options)
+ public CustomerBalanceTransaction create(Map params, RequestOptions options)
throws StripeException {
- return retrieve(id, (Map) null, options);
+ String url = String.format("%s%s", Stripe.getApiBase(), this.getUrl());
+ return ApiResource.request(
+ ApiResource.RequestMethod.POST, url, params, CustomerBalanceTransaction.class, options);
}
/**
- * Retrieves a specific customer balance transaction that updated the customer’s balances.
+ * Creates an immutable transaction that updates the customer’s credit balance.
*/
- public CustomerBalanceTransaction retrieve(
- String id, Map params, RequestOptions options) throws StripeException {
- String url =
- String.format(
- "%s%s",
- Stripe.getApiBase(),
- String.format("%s/%s", this.getUrl(), ApiResource.urlEncodeId(id)));
- return ApiResource.request(
- ApiResource.RequestMethod.GET, url, params, CustomerBalanceTransaction.class, options);
+ public CustomerBalanceTransaction create(CustomerBalanceTransactionCollectionCreateParams params)
+ throws StripeException {
+ return create(params, (RequestOptions) null);
}
/**
- * Retrieves a specific customer balance transaction that updated the customer’s balances.
+ * Creates an immutable transaction that updates the customer’s credit balance.
*/
- public CustomerBalanceTransaction retrieve(
- String id, CustomerBalanceTransactionCollectionRetrieveParams params, RequestOptions options)
+ public CustomerBalanceTransaction create(
+ CustomerBalanceTransactionCollectionCreateParams params, RequestOptions options)
throws StripeException {
- String url =
- String.format(
- "%s%s",
- Stripe.getApiBase(),
- String.format("%s/%s", this.getUrl(), ApiResource.urlEncodeId(id)));
+ String url = String.format("%s%s", Stripe.getApiBase(), this.getUrl());
return ApiResource.request(
- ApiResource.RequestMethod.GET, url, params, CustomerBalanceTransaction.class, options);
+ ApiResource.RequestMethod.POST, url, params, CustomerBalanceTransaction.class, options);
}
/**
@@ -102,42 +94,50 @@ public CustomerBalanceTransactionCollection list(
}
/**
- * Creates an immutable transaction that updates the customer’s credit balance.
+ * Retrieves a specific customer balance transaction that updated the customer’s balances.
*/
- public CustomerBalanceTransaction create(Map params) throws StripeException {
- return create(params, (RequestOptions) null);
+ public CustomerBalanceTransaction retrieve(String id) throws StripeException {
+ return retrieve(id, (Map) null, (RequestOptions) null);
}
/**
- * Creates an immutable transaction that updates the customer’s credit balance.
+ * Retrieves a specific customer balance transaction that updated the customer’s balances.
*/
- public CustomerBalanceTransaction create(Map params, RequestOptions options)
+ public CustomerBalanceTransaction retrieve(String id, RequestOptions options)
throws StripeException {
- String url = String.format("%s%s", Stripe.getApiBase(), this.getUrl());
- return ApiResource.request(
- ApiResource.RequestMethod.POST, url, params, CustomerBalanceTransaction.class, options);
+ return retrieve(id, (Map) null, options);
}
/**
- * Creates an immutable transaction that updates the customer’s credit balance.
+ * Retrieves a specific customer balance transaction that updated the customer’s balances.
*/
- public CustomerBalanceTransaction create(CustomerBalanceTransactionCollectionCreateParams params)
- throws StripeException {
- return create(params, (RequestOptions) null);
+ public CustomerBalanceTransaction retrieve(
+ String id, Map params, RequestOptions options) throws StripeException {
+ String url =
+ String.format(
+ "%s%s",
+ Stripe.getApiBase(),
+ String.format("%s/%s", this.getUrl(), ApiResource.urlEncodeId(id)));
+ return ApiResource.request(
+ ApiResource.RequestMethod.GET, url, params, CustomerBalanceTransaction.class, options);
}
/**
- * Creates an immutable transaction that updates the customer’s credit balance.
+ * Retrieves a specific customer balance transaction that updated the customer’s balances.
*/
- public CustomerBalanceTransaction create(
- CustomerBalanceTransactionCollectionCreateParams params, RequestOptions options)
+ public CustomerBalanceTransaction retrieve(
+ String id, CustomerBalanceTransactionCollectionRetrieveParams params, RequestOptions options)
throws StripeException {
- String url = String.format("%s%s", Stripe.getApiBase(), this.getUrl());
+ String url =
+ String.format(
+ "%s%s",
+ Stripe.getApiBase(),
+ String.format("%s/%s", this.getUrl(), ApiResource.urlEncodeId(id)));
return ApiResource.request(
- ApiResource.RequestMethod.POST, url, params, CustomerBalanceTransaction.class, options);
+ ApiResource.RequestMethod.GET, url, params, CustomerBalanceTransaction.class, options);
}
}
diff --git a/src/main/java/com/stripe/model/CustomerCashBalanceTransaction.java b/src/main/java/com/stripe/model/CustomerCashBalanceTransaction.java
new file mode 100644
index 00000000000..d85751c4558
--- /dev/null
+++ b/src/main/java/com/stripe/model/CustomerCashBalanceTransaction.java
@@ -0,0 +1,259 @@
+// File generated from our OpenAPI spec
+package com.stripe.model;
+
+import com.google.gson.annotations.SerializedName;
+import com.stripe.net.ApiResource;
+import lombok.EqualsAndHashCode;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * Customers with certain payments enabled have a cash balance, representing funds that were paid by
+ * the customer to a merchant, but have not yet been allocated to a payment. Cash Balance
+ * Transactions represent when funds are moved into or out of this balance. This includes funding by
+ * the customer, allocation to payments, and refunds to the customer.
+ */
+@Getter
+@Setter
+@EqualsAndHashCode(callSuper = false)
+public class CustomerCashBalanceTransaction extends StripeObject implements HasId {
+ @SerializedName("applied_to_payment")
+ AppliedToPayment appliedToPayment;
+
+ /** Time at which the object was created. Measured in seconds since the Unix epoch. */
+ @SerializedName("created")
+ Long created;
+
+ /**
+ * Three-letter ISO currency code,
+ * in lowercase. Must be a supported currency.
+ */
+ @SerializedName("currency")
+ String currency;
+
+ /** The customer whose available cash balance changed as a result of this transaction. */
+ @SerializedName("customer")
+ @Getter(lombok.AccessLevel.NONE)
+ @Setter(lombok.AccessLevel.NONE)
+ ExpandableField customer;
+
+ /**
+ * The total available cash balance for the specified currency after this transaction was applied.
+ * Represented in the smallest currency
+ * unit.
+ */
+ @SerializedName("ending_balance")
+ Long endingBalance;
+
+ @SerializedName("funded")
+ Funded funded;
+
+ /** Unique identifier for the object. */
+ @Getter(onMethod_ = {@Override})
+ @SerializedName("id")
+ String id;
+
+ /**
+ * Has the value {@code true} if the object exists in live mode or the value {@code false} if the
+ * object exists in test mode.
+ */
+ @SerializedName("livemode")
+ Boolean livemode;
+
+ /**
+ * The amount by which the cash balance changed, represented in the smallest currency unit. A positive
+ * value represents funds being added to the cash balance, a negative value represents funds being
+ * removed from the cash balance.
+ */
+ @SerializedName("net_amount")
+ Long netAmount;
+
+ /**
+ * String representing the object's type. Objects of the same type share the same value.
+ *
+ * Equal to {@code customer_cash_balance_transaction}.
+ */
+ @SerializedName("object")
+ String object;
+
+ @SerializedName("refunded_from_payment")
+ RefundedFromPayment refundedFromPayment;
+
+ /**
+ * The type of the cash balance transaction. One of {@code applied_to_payment}, {@code
+ * unapplied_from_payment}, {@code refunded_from_payment}, {@code funded}, {@code
+ * return_initiated}, or {@code return_canceled}. New types may be added in future. See Customer Balance to learn
+ * more about these types.
+ */
+ @SerializedName("type")
+ String type;
+
+ @SerializedName("unapplied_from_payment")
+ UnappliedFromPayment unappliedFromPayment;
+
+ /** Get ID of expandable {@code customer} object. */
+ public String getCustomer() {
+ return (this.customer != null) ? this.customer.getId() : null;
+ }
+
+ public void setCustomer(String id) {
+ this.customer = ApiResource.setExpandableFieldId(id, this.customer);
+ }
+
+ /** Get expanded {@code customer}. */
+ public Customer getCustomerObject() {
+ return (this.customer != null) ? this.customer.getExpanded() : null;
+ }
+
+ public void setCustomerObject(Customer expandableObject) {
+ this.customer = new ExpandableField(expandableObject.getId(), expandableObject);
+ }
+
+ @Getter
+ @Setter
+ @EqualsAndHashCode(callSuper = false)
+ public static class AppliedToPayment extends StripeObject {
+ /**
+ * The Payment Intent that
+ * funds were applied to.
+ */
+ @SerializedName("payment_intent")
+ @Getter(lombok.AccessLevel.NONE)
+ @Setter(lombok.AccessLevel.NONE)
+ ExpandableField paymentIntent;
+
+ /** Get ID of expandable {@code paymentIntent} object. */
+ public String getPaymentIntent() {
+ return (this.paymentIntent != null) ? this.paymentIntent.getId() : null;
+ }
+
+ public void setPaymentIntent(String id) {
+ this.paymentIntent = ApiResource.setExpandableFieldId(id, this.paymentIntent);
+ }
+
+ /** Get expanded {@code paymentIntent}. */
+ public PaymentIntent getPaymentIntentObject() {
+ return (this.paymentIntent != null) ? this.paymentIntent.getExpanded() : null;
+ }
+
+ public void setPaymentIntentObject(PaymentIntent expandableObject) {
+ this.paymentIntent =
+ new ExpandableField(expandableObject.getId(), expandableObject);
+ }
+ }
+
+ @Getter
+ @Setter
+ @EqualsAndHashCode(callSuper = false)
+ public static class Funded extends StripeObject {
+ @SerializedName("bank_transfer")
+ CashBalance.FundedTransaction.BankTransfer bankTransfer;
+
+ @Getter
+ @Setter
+ @EqualsAndHashCode(callSuper = false)
+ public static class BankTransfer extends StripeObject {
+ @SerializedName("eu_bank_transfer")
+ EuBankTransfer euBankTransfer;
+
+ /** The user-supplied reference field on the bank transfer. */
+ @SerializedName("reference")
+ String reference;
+
+ /**
+ * The funding method type used to fund the customer balance. Permitted values include: {@code
+ * eu_bank_transfer}, {@code gb_bank_transfer}, {@code jp_bank_transfer}, or {@code
+ * mx_bank_transfer}.
+ *
+ * One of {@code eu_bank_transfer}, {@code gb_bank_transfer}, {@code jp_bank_transfer}, or
+ * {@code mx_bank_transfer}.
+ */
+ @SerializedName("type")
+ String type;
+
+ @Getter
+ @Setter
+ @EqualsAndHashCode(callSuper = false)
+ public static class EuBankTransfer extends StripeObject {
+ /** The BIC of the bank of the sender of the funding. */
+ @SerializedName("bic")
+ String bic;
+
+ /** The last 4 digits of the IBAN of the sender of the funding. */
+ @SerializedName("iban_last4")
+ String ibanLast4;
+
+ /** The full name of the sender, as supplied by the sending bank. */
+ @SerializedName("sender_name")
+ String senderName;
+ }
+ }
+ }
+
+ @Getter
+ @Setter
+ @EqualsAndHashCode(callSuper = false)
+ public static class RefundedFromPayment extends StripeObject {
+ /**
+ * The Refund that moved these funds
+ * into the customer's cash balance.
+ */
+ @SerializedName("refund")
+ @Getter(lombok.AccessLevel.NONE)
+ @Setter(lombok.AccessLevel.NONE)
+ ExpandableField refund;
+
+ /** Get ID of expandable {@code refund} object. */
+ public String getRefund() {
+ return (this.refund != null) ? this.refund.getId() : null;
+ }
+
+ public void setRefund(String id) {
+ this.refund = ApiResource.setExpandableFieldId(id, this.refund);
+ }
+
+ /** Get expanded {@code refund}. */
+ public Refund getRefundObject() {
+ return (this.refund != null) ? this.refund.getExpanded() : null;
+ }
+
+ public void setRefundObject(Refund expandableObject) {
+ this.refund = new ExpandableField(expandableObject.getId(), expandableObject);
+ }
+ }
+
+ @Getter
+ @Setter
+ @EqualsAndHashCode(callSuper = false)
+ public static class UnappliedFromPayment extends StripeObject {
+ /**
+ * The Payment Intent that
+ * funds were unapplied from.
+ */
+ @SerializedName("payment_intent")
+ @Getter(lombok.AccessLevel.NONE)
+ @Setter(lombok.AccessLevel.NONE)
+ ExpandableField paymentIntent;
+
+ /** Get ID of expandable {@code paymentIntent} object. */
+ public String getPaymentIntent() {
+ return (this.paymentIntent != null) ? this.paymentIntent.getId() : null;
+ }
+
+ public void setPaymentIntent(String id) {
+ this.paymentIntent = ApiResource.setExpandableFieldId(id, this.paymentIntent);
+ }
+
+ /** Get expanded {@code paymentIntent}. */
+ public PaymentIntent getPaymentIntentObject() {
+ return (this.paymentIntent != null) ? this.paymentIntent.getExpanded() : null;
+ }
+
+ public void setPaymentIntentObject(PaymentIntent expandableObject) {
+ this.paymentIntent =
+ new ExpandableField(expandableObject.getId(), expandableObject);
+ }
+ }
+}
diff --git a/src/main/java/com/stripe/model/CustomerCashBalanceTransactionCollection.java b/src/main/java/com/stripe/model/CustomerCashBalanceTransactionCollection.java
new file mode 100644
index 00000000000..e54e03ba8d9
--- /dev/null
+++ b/src/main/java/com/stripe/model/CustomerCashBalanceTransactionCollection.java
@@ -0,0 +1,104 @@
+// File generated from our OpenAPI spec
+package com.stripe.model;
+
+import com.stripe.Stripe;
+import com.stripe.exception.StripeException;
+import com.stripe.net.ApiResource;
+import com.stripe.net.RequestOptions;
+import com.stripe.param.CustomerCashBalanceTransactionCollectionListParams;
+import com.stripe.param.CustomerCashBalanceTransactionCollectionRetrieveParams;
+import java.util.Map;
+
+public class CustomerCashBalanceTransactionCollection
+ extends StripeCollection {
+ /**
+ * Returns a list of transactions that modified the customer’s cash balance.
+ */
+ public CustomerCashBalanceTransactionCollection list(Map params)
+ throws StripeException {
+ return list(params, (RequestOptions) null);
+ }
+
+ /**
+ * Returns a list of transactions that modified the customer’s cash balance.
+ */
+ public CustomerCashBalanceTransactionCollection list(
+ Map params, RequestOptions options) throws StripeException {
+ String url = String.format("%s%s", Stripe.getApiBase(), this.getUrl());
+ return ApiResource.requestCollection(
+ url, params, CustomerCashBalanceTransactionCollection.class, options);
+ }
+
+ /**
+ * Returns a list of transactions that modified the customer’s cash balance.
+ */
+ public CustomerCashBalanceTransactionCollection list(
+ CustomerCashBalanceTransactionCollectionListParams params) throws StripeException {
+ return list(params, (RequestOptions) null);
+ }
+
+ /**
+ * Returns a list of transactions that modified the customer’s cash balance.
+ */
+ public CustomerCashBalanceTransactionCollection list(
+ CustomerCashBalanceTransactionCollectionListParams params, RequestOptions options)
+ throws StripeException {
+ String url = String.format("%s%s", Stripe.getApiBase(), this.getUrl());
+ return ApiResource.requestCollection(
+ url, params, CustomerCashBalanceTransactionCollection.class, options);
+ }
+
+ /**
+ * Retrieves a specific cash balance transaction, which updated the customer’s cash balance.
+ */
+ public CustomerCashBalanceTransaction retrieve(String id) throws StripeException {
+ return retrieve(id, (Map) null, (RequestOptions) null);
+ }
+
+ /**
+ * Retrieves a specific cash balance transaction, which updated the customer’s cash balance.
+ */
+ public CustomerCashBalanceTransaction retrieve(String id, RequestOptions options)
+ throws StripeException {
+ return retrieve(id, (Map) null, options);
+ }
+
+ /**
+ * Retrieves a specific cash balance transaction, which updated the customer’s cash balance.
+ */
+ public CustomerCashBalanceTransaction retrieve(
+ String id, Map params, RequestOptions options) throws StripeException {
+ String url =
+ String.format(
+ "%s%s",
+ Stripe.getApiBase(),
+ String.format("%s/%s", this.getUrl(), ApiResource.urlEncodeId(id)));
+ return ApiResource.request(
+ ApiResource.RequestMethod.GET, url, params, CustomerCashBalanceTransaction.class, options);
+ }
+
+ /**
+ * Retrieves a specific cash balance transaction, which updated the customer’s cash balance.
+ */
+ public CustomerCashBalanceTransaction retrieve(
+ String id,
+ CustomerCashBalanceTransactionCollectionRetrieveParams params,
+ RequestOptions options)
+ throws StripeException {
+ String url =
+ String.format(
+ "%s%s",
+ Stripe.getApiBase(),
+ String.format("%s/%s", this.getUrl(), ApiResource.urlEncodeId(id)));
+ return ApiResource.request(
+ ApiResource.RequestMethod.GET, url, params, CustomerCashBalanceTransaction.class, options);
+ }
+}
diff --git a/src/main/java/com/stripe/model/Discount.java b/src/main/java/com/stripe/model/Discount.java
index a6284071bbf..4842a8e123f 100644
--- a/src/main/java/com/stripe/model/Discount.java
+++ b/src/main/java/com/stripe/model/Discount.java
@@ -7,6 +7,15 @@
import lombok.Getter;
import lombok.Setter;
+/**
+ * A discount represents the actual application of a coupon or promotion code. It contains information
+ * about when the discount began, when it will end, and what it is applied to.
+ *
+ * Related guide: Applying
+ * Discounts to Subscriptions.
+ */
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
diff --git a/src/main/java/com/stripe/model/Dispute.java b/src/main/java/com/stripe/model/Dispute.java
index 1c2f9a6a82c..b61ea7bc863 100644
--- a/src/main/java/com/stripe/model/Dispute.java
+++ b/src/main/java/com/stripe/model/Dispute.java
@@ -16,6 +16,14 @@
import lombok.Getter;
import lombok.Setter;
+/**
+ * A dispute occurs when a customer questions your charge with their card issuer. When this happens,
+ * you're given the opportunity to respond to the dispute with evidence that shows that the charge
+ * is legitimate. You can find more information about the dispute process in our Disputes and Fraud documentation.
+ *
+ *
Related guide: Disputes and Fraud.
+ */
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
@@ -165,6 +173,82 @@ public void setPaymentIntentObject(PaymentIntent expandableObject) {
new ExpandableField(expandableObject.getId(), expandableObject);
}
+ /**
+ * Closing the dispute for a charge indicates that you do not have any evidence to submit and are
+ * essentially dismissing the dispute, acknowledging it as lost.
+ *
+ * The status of the dispute will change from needs_response
to lost
.
+ * Closing a dispute is irreversible.
+ */
+ public Dispute close() throws StripeException {
+ return close((Map) null, (RequestOptions) null);
+ }
+
+ /**
+ * Closing the dispute for a charge indicates that you do not have any evidence to submit and are
+ * essentially dismissing the dispute, acknowledging it as lost.
+ *
+ * The status of the dispute will change from needs_response
to lost
.
+ * Closing a dispute is irreversible.
+ */
+ public Dispute close(RequestOptions options) throws StripeException {
+ return close((Map) null, options);
+ }
+
+ /**
+ * Closing the dispute for a charge indicates that you do not have any evidence to submit and are
+ * essentially dismissing the dispute, acknowledging it as lost.
+ *
+ * The status of the dispute will change from needs_response
to lost
.
+ * Closing a dispute is irreversible.
+ */
+ public Dispute close(Map params) throws StripeException {
+ return close(params, (RequestOptions) null);
+ }
+
+ /**
+ * Closing the dispute for a charge indicates that you do not have any evidence to submit and are
+ * essentially dismissing the dispute, acknowledging it as lost.
+ *
+ * The status of the dispute will change from needs_response
to lost
.
+ * Closing a dispute is irreversible.
+ */
+ public Dispute close(Map params, RequestOptions options) throws StripeException {
+ String url =
+ String.format(
+ "%s%s",
+ Stripe.getApiBase(),
+ String.format("/v1/disputes/%s/close", ApiResource.urlEncodeId(this.getId())));
+ return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Dispute.class, options);
+ }
+
+ /**
+ * Closing the dispute for a charge indicates that you do not have any evidence to submit and are
+ * essentially dismissing the dispute, acknowledging it as lost.
+ *
+ * The status of the dispute will change from needs_response
to lost
.
+ * Closing a dispute is irreversible.
+ */
+ public Dispute close(DisputeCloseParams params) throws StripeException {
+ return close(params, (RequestOptions) null);
+ }
+
+ /**
+ * Closing the dispute for a charge indicates that you do not have any evidence to submit and are
+ * essentially dismissing the dispute, acknowledging it as lost.
+ *
+ *
The status of the dispute will change from needs_response
to lost
.
+ * Closing a dispute is irreversible.
+ */
+ public Dispute close(DisputeCloseParams params, RequestOptions options) throws StripeException {
+ String url =
+ String.format(
+ "%s%s",
+ Stripe.getApiBase(),
+ String.format("/v1/disputes/%s/close", ApiResource.urlEncodeId(this.getId())));
+ return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Dispute.class, options);
+ }
+
/** Returns a list of your disputes. */
public static DisputeCollection list(Map params) throws StripeException {
return list(params, (RequestOptions) null);
@@ -289,82 +373,6 @@ public Dispute update(DisputeUpdateParams params, RequestOptions options) throws
return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Dispute.class, options);
}
- /**
- * Closing the dispute for a charge indicates that you do not have any evidence to submit and are
- * essentially dismissing the dispute, acknowledging it as lost.
- *
- * The status of the dispute will change from needs_response
to lost
.
- * Closing a dispute is irreversible.
- */
- public Dispute close() throws StripeException {
- return close((Map) null, (RequestOptions) null);
- }
-
- /**
- * Closing the dispute for a charge indicates that you do not have any evidence to submit and are
- * essentially dismissing the dispute, acknowledging it as lost.
- *
- * The status of the dispute will change from needs_response
to lost
.
- * Closing a dispute is irreversible.
- */
- public Dispute close(RequestOptions options) throws StripeException {
- return close((Map) null, options);
- }
-
- /**
- * Closing the dispute for a charge indicates that you do not have any evidence to submit and are
- * essentially dismissing the dispute, acknowledging it as lost.
- *
- * The status of the dispute will change from needs_response
to lost
.
- * Closing a dispute is irreversible.
- */
- public Dispute close(Map params) throws StripeException {
- return close(params, (RequestOptions) null);
- }
-
- /**
- * Closing the dispute for a charge indicates that you do not have any evidence to submit and are
- * essentially dismissing the dispute, acknowledging it as lost.
- *
- * The status of the dispute will change from needs_response
to lost
.
- * Closing a dispute is irreversible.
- */
- public Dispute close(Map params, RequestOptions options) throws StripeException {
- String url =
- String.format(
- "%s%s",
- Stripe.getApiBase(),
- String.format("/v1/disputes/%s/close", ApiResource.urlEncodeId(this.getId())));
- return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Dispute.class, options);
- }
-
- /**
- * Closing the dispute for a charge indicates that you do not have any evidence to submit and are
- * essentially dismissing the dispute, acknowledging it as lost.
- *
- * The status of the dispute will change from needs_response
to lost
.
- * Closing a dispute is irreversible.
- */
- public Dispute close(DisputeCloseParams params) throws StripeException {
- return close(params, (RequestOptions) null);
- }
-
- /**
- * Closing the dispute for a charge indicates that you do not have any evidence to submit and are
- * essentially dismissing the dispute, acknowledging it as lost.
- *
- *
The status of the dispute will change from needs_response
to lost
.
- * Closing a dispute is irreversible.
- */
- public Dispute close(DisputeCloseParams params, RequestOptions options) throws StripeException {
- String url =
- String.format(
- "%s%s",
- Stripe.getApiBase(),
- String.format("/v1/disputes/%s/close", ApiResource.urlEncodeId(this.getId())));
- return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Dispute.class, options);
- }
-
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
diff --git a/src/main/java/com/stripe/model/Event.java b/src/main/java/com/stripe/model/Event.java
index d1c8a4c91ec..9ab4abc77e8 100644
--- a/src/main/java/com/stripe/model/Event.java
+++ b/src/main/java/com/stripe/model/Event.java
@@ -13,6 +13,34 @@
import lombok.Getter;
import lombok.Setter;
+/**
+ * Events are our way of letting you know when something interesting happens in your account. When
+ * an interesting event occurs, we create a new {@code Event} object. For example, when a charge
+ * succeeds, we create a {@code charge.succeeded} event; and when an invoice payment attempt fails,
+ * we create an {@code invoice.payment_failed} event. Note that many API requests may cause multiple
+ * events to be created. For example, if you create a new subscription for a customer, you will
+ * receive both a {@code customer.subscription.created} event and a {@code charge.succeeded} event.
+ *
+ *
Events occur when the state of another API resource changes. The state of that resource at the
+ * time of the change is embedded in the event's data field. For example, a {@code charge.succeeded}
+ * event will contain a charge, and an {@code invoice.payment_failed} event will contain an invoice.
+ *
+ *
As with other API resources, you can use endpoints to retrieve an individual event or a list of events from the API. We also have a
+ * separate webhooks system for sending the
+ * {@code Event} objects directly to an endpoint on your server. Webhooks are managed in your account settings, and our Using Webhooks guide will help you get set up.
+ *
+ *
When using Connect, you can also receive
+ * notifications of events that occur in connected accounts. For these events, there will be an
+ * additional {@code account} attribute in the received {@code Event} object.
+ *
+ *
NOTE: Right now, access to events through the Retrieve Event API is guaranteed only for
+ * 30 days.
+ */
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
diff --git a/src/main/java/com/stripe/model/EventDataClassLookup.java b/src/main/java/com/stripe/model/EventDataClassLookup.java
index 779c21b0dc4..f13a7d8fb91 100644
--- a/src/main/java/com/stripe/model/EventDataClassLookup.java
+++ b/src/main/java/com/stripe/model/EventDataClassLookup.java
@@ -31,6 +31,7 @@ final class EventDataClassLookup {
classLookup.put("credit_note_line_item", CreditNoteLineItem.class);
classLookup.put("customer", Customer.class);
classLookup.put("customer_balance_transaction", CustomerBalanceTransaction.class);
+ classLookup.put("customer_cash_balance_transaction", CustomerCashBalanceTransaction.class);
classLookup.put("discount", Discount.class);
classLookup.put("dispute", Dispute.class);
classLookup.put("ephemeral_key", EphemeralKey.class);
diff --git a/src/main/java/com/stripe/model/ExchangeRate.java b/src/main/java/com/stripe/model/ExchangeRate.java
index 6a04d03e1f1..94a78dd2b72 100644
--- a/src/main/java/com/stripe/model/ExchangeRate.java
+++ b/src/main/java/com/stripe/model/ExchangeRate.java
@@ -14,6 +14,17 @@
import lombok.Getter;
import lombok.Setter;
+/**
+ * {@code Exchange Rate} objects allow you to determine the rates that Stripe is currently using to
+ * convert from one currency to another. Since this number is variable throughout the day, there are
+ * various reasons why you might want to know the current rate (for example, to dynamically price an
+ * item for a user with a default payment in a foreign currency).
+ *
+ *
If you want a guarantee that the charge is made with a certain exchange rate you expect is
+ * current, you can pass in {@code exchange_rate} to charges endpoints. If the value is no longer up
+ * to date, the charge won't go through. Please refer to our Exchange Rates API guide for more details.
+ */
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
diff --git a/src/main/java/com/stripe/model/ExternalAccountCollection.java b/src/main/java/com/stripe/model/ExternalAccountCollection.java
index c9ccd7a9946..7369625969e 100644
--- a/src/main/java/com/stripe/model/ExternalAccountCollection.java
+++ b/src/main/java/com/stripe/model/ExternalAccountCollection.java
@@ -11,6 +11,33 @@
import java.util.Map;
public class ExternalAccountCollection extends StripeCollection {
+ /** Create an external account for a given account. */
+ public ExternalAccount create(Map params) throws StripeException {
+ return create(params, (RequestOptions) null);
+ }
+
+ /** Create an external account for a given account. */
+ public ExternalAccount create(Map params, RequestOptions options)
+ throws StripeException {
+ String url = String.format("%s%s", Stripe.getApiBase(), this.getUrl());
+ return ApiResource.request(
+ ApiResource.RequestMethod.POST, url, params, ExternalAccount.class, options);
+ }
+
+ /** Create an external account for a given account. */
+ public ExternalAccount create(ExternalAccountCollectionCreateParams params)
+ throws StripeException {
+ return create(params, (RequestOptions) null);
+ }
+
+ /** Create an external account for a given account. */
+ public ExternalAccount create(
+ ExternalAccountCollectionCreateParams params, RequestOptions options) throws StripeException {
+ String url = String.format("%s%s", Stripe.getApiBase(), this.getUrl());
+ return ApiResource.request(
+ ApiResource.RequestMethod.POST, url, params, ExternalAccount.class, options);
+ }
+
/** List external accounts for an account. */
public ExternalAccountCollection list(Map params) throws StripeException {
return list(params, (RequestOptions) null);
@@ -70,31 +97,4 @@ public ExternalAccount retrieve(
return ApiResource.request(
ApiResource.RequestMethod.GET, url, params, ExternalAccount.class, options);
}
-
- /** Create an external account for a given account. */
- public ExternalAccount create(Map params) throws StripeException {
- return create(params, (RequestOptions) null);
- }
-
- /** Create an external account for a given account. */
- public ExternalAccount create(Map params, RequestOptions options)
- throws StripeException {
- String url = String.format("%s%s", Stripe.getApiBase(), this.getUrl());
- return ApiResource.request(
- ApiResource.RequestMethod.POST, url, params, ExternalAccount.class, options);
- }
-
- /** Create an external account for a given account. */
- public ExternalAccount create(ExternalAccountCollectionCreateParams params)
- throws StripeException {
- return create(params, (RequestOptions) null);
- }
-
- /** Create an external account for a given account. */
- public ExternalAccount create(
- ExternalAccountCollectionCreateParams params, RequestOptions options) throws StripeException {
- String url = String.format("%s%s", Stripe.getApiBase(), this.getUrl());
- return ApiResource.request(
- ApiResource.RequestMethod.POST, url, params, ExternalAccount.class, options);
- }
}
diff --git a/src/main/java/com/stripe/model/FeeRefund.java b/src/main/java/com/stripe/model/FeeRefund.java
index cc61c813341..a750ce8c92c 100644
--- a/src/main/java/com/stripe/model/FeeRefund.java
+++ b/src/main/java/com/stripe/model/FeeRefund.java
@@ -12,6 +12,15 @@
import lombok.Getter;
import lombok.Setter;
+/**
+ * {@code Application Fee Refund} objects allow you to refund an application fee that has previously
+ * been created but not yet refunded. Funds will be refunded to the Stripe account from which the
+ * fee was originally collected.
+ *
+ * Related guide: Refunding
+ * Application Fees.
+ */
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
diff --git a/src/main/java/com/stripe/model/FileLink.java b/src/main/java/com/stripe/model/FileLink.java
index 00f8fb0d41a..249c79803f8 100644
--- a/src/main/java/com/stripe/model/FileLink.java
+++ b/src/main/java/com/stripe/model/FileLink.java
@@ -15,6 +15,11 @@
import lombok.Getter;
import lombok.Setter;
+/**
+ * To share the contents of a {@code File} object with non-Stripe users, you can create a {@code
+ * FileLink}. {@code FileLink}s contain a URL that can be used to retrieve the contents of the file
+ * without authentication.
+ */
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
@@ -88,6 +93,56 @@ public void setFileObject(File expandableObject) {
this.file = new ExpandableField(expandableObject.getId(), expandableObject);
}
+ /** Creates a new file link object. */
+ public static FileLink create(Map params) throws StripeException {
+ return create(params, (RequestOptions) null);
+ }
+
+ /** Creates a new file link object. */
+ public static FileLink create(Map params, RequestOptions options)
+ throws StripeException {
+ String url = String.format("%s%s", Stripe.getApiBase(), "/v1/file_links");
+ return ApiResource.request(
+ ApiResource.RequestMethod.POST, url, params, FileLink.class, options);
+ }
+
+ /** Creates a new file link object. */
+ public static FileLink create(FileLinkCreateParams params) throws StripeException {
+ return create(params, (RequestOptions) null);
+ }
+
+ /** Creates a new file link object. */
+ public static FileLink create(FileLinkCreateParams params, RequestOptions options)
+ throws StripeException {
+ String url = String.format("%s%s", Stripe.getApiBase(), "/v1/file_links");
+ return ApiResource.request(
+ ApiResource.RequestMethod.POST, url, params, FileLink.class, options);
+ }
+
+ /** Returns a list of file links. */
+ public static FileLinkCollection list(Map params) throws StripeException {
+ return list(params, (RequestOptions) null);
+ }
+
+ /** Returns a list of file links. */
+ public static FileLinkCollection list(Map params, RequestOptions options)
+ throws StripeException {
+ String url = String.format("%s%s", Stripe.getApiBase(), "/v1/file_links");
+ return ApiResource.requestCollection(url, params, FileLinkCollection.class, options);
+ }
+
+ /** Returns a list of file links. */
+ public static FileLinkCollection list(FileLinkListParams params) throws StripeException {
+ return list(params, (RequestOptions) null);
+ }
+
+ /** Returns a list of file links. */
+ public static FileLinkCollection list(FileLinkListParams params, RequestOptions options)
+ throws StripeException {
+ String url = String.format("%s%s", Stripe.getApiBase(), "/v1/file_links");
+ return ApiResource.requestCollection(url, params, FileLinkCollection.class, options);
+ }
+
/** Retrieves the file link with the given ID. */
public static FileLink retrieve(String link) throws StripeException {
return retrieve(link, (Map) null, (RequestOptions) null);
@@ -118,32 +173,6 @@ public static FileLink retrieve(
return ApiResource.request(ApiResource.RequestMethod.GET, url, params, FileLink.class, options);
}
- /** Creates a new file link object. */
- public static FileLink create(Map params) throws StripeException {
- return create(params, (RequestOptions) null);
- }
-
- /** Creates a new file link object. */
- public static FileLink create(Map params, RequestOptions options)
- throws StripeException {
- String url = String.format("%s%s", Stripe.getApiBase(), "/v1/file_links");
- return ApiResource.request(
- ApiResource.RequestMethod.POST, url, params, FileLink.class, options);
- }
-
- /** Creates a new file link object. */
- public static FileLink create(FileLinkCreateParams params) throws StripeException {
- return create(params, (RequestOptions) null);
- }
-
- /** Creates a new file link object. */
- public static FileLink create(FileLinkCreateParams params, RequestOptions options)
- throws StripeException {
- String url = String.format("%s%s", Stripe.getApiBase(), "/v1/file_links");
- return ApiResource.request(
- ApiResource.RequestMethod.POST, url, params, FileLink.class, options);
- }
-
/** Updates an existing file link object. Expired links can no longer be updated. */
@Override
public FileLink update(Map params) throws StripeException {
@@ -179,28 +208,4 @@ public FileLink update(FileLinkUpdateParams params, RequestOptions options)
return ApiResource.request(
ApiResource.RequestMethod.POST, url, params, FileLink.class, options);
}
-
- /** Returns a list of file links. */
- public static FileLinkCollection list(Map params) throws StripeException {
- return list(params, (RequestOptions) null);
- }
-
- /** Returns a list of file links. */
- public static FileLinkCollection list(Map params, RequestOptions options)
- throws StripeException {
- String url = String.format("%s%s", Stripe.getApiBase(), "/v1/file_links");
- return ApiResource.requestCollection(url, params, FileLinkCollection.class, options);
- }
-
- /** Returns a list of file links. */
- public static FileLinkCollection list(FileLinkListParams params) throws StripeException {
- return list(params, (RequestOptions) null);
- }
-
- /** Returns a list of file links. */
- public static FileLinkCollection list(FileLinkListParams params, RequestOptions options)
- throws StripeException {
- String url = String.format("%s%s", Stripe.getApiBase(), "/v1/file_links");
- return ApiResource.requestCollection(url, params, FileLinkCollection.class, options);
- }
}
diff --git a/src/main/java/com/stripe/model/FundingInstructions.java b/src/main/java/com/stripe/model/FundingInstructions.java
index a38c01b0911..80f13b4d412 100644
--- a/src/main/java/com/stripe/model/FundingInstructions.java
+++ b/src/main/java/com/stripe/model/FundingInstructions.java
@@ -7,6 +7,15 @@
import lombok.Getter;
import lombok.Setter;
+/**
+ * Each customer has a {@code balance}
+ * that is automatically applied to future invoices and payments using the {@code customer_balance}
+ * payment method. Customers can fund this balance by initiating a bank transfer to any account in
+ * the {@code financial_addresses} field. Related guide: Customer Balance -
+ * Funding Instructions to learn more
+ */
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
@@ -64,6 +73,7 @@ public static class BankTransfer extends StripeObject {
@SerializedName("type")
String type;
+ /** FinancialAddresses contain identifying information that resolves to a FinancialAccount. */
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
@@ -96,6 +106,7 @@ public static class FinancialAddress extends StripeObject {
@SerializedName("zengin")
Zengin zengin;
+ /** Iban Records contain E.U. bank account details per the SEPA format. */
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
@@ -120,6 +131,7 @@ public static class Iban extends StripeObject {
String iban;
}
+ /** Sort Code Records contain U.K. bank account details per the sort code format. */
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
@@ -137,6 +149,7 @@ public static class SortCode extends StripeObject {
String sortCode;
}
+ /** SPEI Records contain Mexico bank account details per the SPEI format. */
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
@@ -154,6 +167,7 @@ public static class Spei extends StripeObject {
String clabe;
}
+ /** Zengin Records contain Japan bank account details per the Zengin format. */
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
diff --git a/src/main/java/com/stripe/model/Invoice.java b/src/main/java/com/stripe/model/Invoice.java
index a5f5097b0cc..247b7f769d6 100644
--- a/src/main/java/com/stripe/model/Invoice.java
+++ b/src/main/java/com/stripe/model/Invoice.java
@@ -25,6 +25,39 @@
import lombok.Getter;
import lombok.Setter;
+/**
+ * Invoices are statements of amounts owed by a customer, and are either generated one-off, or
+ * generated periodically from a subscription.
+ *
+ * They contain invoice items, and
+ * proration adjustments that may be caused by subscription upgrades/downgrades (if necessary).
+ *
+ *
If your invoice is configured to be billed through automatic charges, Stripe automatically
+ * finalizes your invoice and attempts payment. Note that finalizing the invoice, when automatic, does
+ * not happen immediately as the invoice is created. Stripe waits until one hour after the last
+ * webhook was successfully sent (or the last webhook timed out after failing). If you (and the
+ * platforms you may have connected to) have no webhooks configured, Stripe waits one hour after
+ * creation to finalize the invoice.
+ *
+ *
If your invoice is configured to be billed by sending an email, then based on your email settings, Stripe will
+ * email the invoice to your customer and await payment. These emails can contain a link to a hosted
+ * page to pay the invoice.
+ *
+ *
Stripe applies any customer credit on the account before determining the amount due for the
+ * invoice (i.e., the amount that will be actually charged). If the amount due for the invoice is
+ * less than Stripe's minimum allowed
+ * charge per currency, the invoice is automatically marked paid, and we add the amount due to
+ * the customer's credit balance which is applied to the next invoice.
+ *
+ *
More details on the customer's credit balance are here.
+ *
+ *
Related guide: Send Invoices to
+ * Customers.
+ */
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
@@ -153,6 +186,10 @@ public class Invoice extends ApiResource implements HasId, MetadataStore customFields;
+
/** The ID of the customer who will be billed. */
@SerializedName("customer")
@Getter(lombok.AccessLevel.NONE)
@@ -211,10 +248,6 @@ public class Invoice extends ApiResource implements HasId, MetadataStore customerTaxIds;
- /** Custom fields displayed on the invoice. */
- @SerializedName("custom_fields")
- List customFields;
-
/**
* ID of the default payment method for the invoice. It must belong to the customer associated
* with the invoice. If not set, defaults to the subscription's default payment method, if any, or
@@ -789,55 +822,157 @@ public void setDiscountObjects(List objs) {
}
/**
- * Search for invoices you’ve previously created using Stripe’s Search Query Language. Don’t
- * use search in read-after-write flows where strict consistency is necessary. Under normal
- * operating conditions, data is searchable in less than a minute. Occasionally, propagation of
- * new or updated data can be up to an hour behind during outages. Search functionality is not
- * available to merchants in India.
+ * This endpoint creates a draft invoice for a given customer. The draft invoice created pulls in
+ * all pending invoice items on that customer, including prorations. The invoice remains a draft
+ * until you finalize the invoice,
+ * which allows you to pay or send the invoice to your customers.
*/
- public static InvoiceSearchResult search(Map params) throws StripeException {
- return search(params, (RequestOptions) null);
+ public static Invoice create(Map params) throws StripeException {
+ return create(params, (RequestOptions) null);
}
/**
- * Search for invoices you’ve previously created using Stripe’s Search Query Language. Don’t
- * use search in read-after-write flows where strict consistency is necessary. Under normal
- * operating conditions, data is searchable in less than a minute. Occasionally, propagation of
- * new or updated data can be up to an hour behind during outages. Search functionality is not
- * available to merchants in India.
+ * This endpoint creates a draft invoice for a given customer. The draft invoice created pulls in
+ * all pending invoice items on that customer, including prorations. The invoice remains a draft
+ * until you finalize the invoice,
+ * which allows you to pay or send the invoice to your customers.
*/
- public static InvoiceSearchResult search(Map params, RequestOptions options)
+ public static Invoice create(Map params, RequestOptions options)
throws StripeException {
- String url = String.format("%s%s", Stripe.getApiBase(), "/v1/invoices/search");
- return ApiResource.requestSearchResult(url, params, InvoiceSearchResult.class, options);
+ String url = String.format("%s%s", Stripe.getApiBase(), "/v1/invoices");
+ return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Invoice.class, options);
}
/**
- * Search for invoices you’ve previously created using Stripe’s Search Query Language. Don’t
- * use search in read-after-write flows where strict consistency is necessary. Under normal
- * operating conditions, data is searchable in less than a minute. Occasionally, propagation of
- * new or updated data can be up to an hour behind during outages. Search functionality is not
- * available to merchants in India.
+ * This endpoint creates a draft invoice for a given customer. The draft invoice created pulls in
+ * all pending invoice items on that customer, including prorations. The invoice remains a draft
+ * until you finalize the invoice,
+ * which allows you to pay or send the invoice to your customers.
*/
- public static InvoiceSearchResult search(InvoiceSearchParams params) throws StripeException {
- return search(params, (RequestOptions) null);
+ public static Invoice create(InvoiceCreateParams params) throws StripeException {
+ return create(params, (RequestOptions) null);
}
/**
- * Search for invoices you’ve previously created using Stripe’s Search Query Language. Don’t
- * use search in read-after-write flows where strict consistency is necessary. Under normal
- * operating conditions, data is searchable in less than a minute. Occasionally, propagation of
- * new or updated data can be up to an hour behind during outages. Search functionality is not
- * available to merchants in India.
+ * This endpoint creates a draft invoice for a given customer. The draft invoice created pulls in
+ * all pending invoice items on that customer, including prorations. The invoice remains a draft
+ * until you finalize the invoice,
+ * which allows you to pay or send the invoice to your customers.
*/
- public static InvoiceSearchResult search(InvoiceSearchParams params, RequestOptions options)
+ public static Invoice create(InvoiceCreateParams params, RequestOptions options)
throws StripeException {
- String url = String.format("%s%s", Stripe.getApiBase(), "/v1/invoices/search");
- return ApiResource.requestSearchResult(url, params, InvoiceSearchResult.class, options);
+ String url = String.format("%s%s", Stripe.getApiBase(), "/v1/invoices");
+ return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Invoice.class, options);
+ }
+
+ /**
+ * Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices
+ * that are no longer in a draft state will fail; once an invoice has been finalized or if an
+ * invoice is for a subscription, it must be voided.
+ */
+ public Invoice delete() throws StripeException {
+ return delete((Map) null, (RequestOptions) null);
+ }
+
+ /**
+ * Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices
+ * that are no longer in a draft state will fail; once an invoice has been finalized or if an
+ * invoice is for a subscription, it must be voided.
+ */
+ public Invoice delete(RequestOptions options) throws StripeException {
+ return delete((Map) null, options);
+ }
+
+ /**
+ * Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices
+ * that are no longer in a draft state will fail; once an invoice has been finalized or if an
+ * invoice is for a subscription, it must be voided.
+ */
+ public Invoice delete(Map params) throws StripeException {
+ return delete(params, (RequestOptions) null);
+ }
+
+ /**
+ * Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices
+ * that are no longer in a draft state will fail; once an invoice has been finalized or if an
+ * invoice is for a subscription, it must be voided.
+ */
+ public Invoice delete(Map params, RequestOptions options) throws StripeException {
+ String url =
+ String.format(
+ "%s%s",
+ Stripe.getApiBase(),
+ String.format("/v1/invoices/%s", ApiResource.urlEncodeId(this.getId())));
+ return ApiResource.request(
+ ApiResource.RequestMethod.DELETE, url, params, Invoice.class, options);
+ }
+
+ /**
+ * Stripe automatically finalizes drafts before sending and attempting payment on invoices.
+ * However, if you’d like to finalize a draft invoice manually, you can do so using this method.
+ */
+ public Invoice finalizeInvoice() throws StripeException {
+ return finalizeInvoice((Map) null, (RequestOptions) null);
+ }
+
+ /**
+ * Stripe automatically finalizes drafts before sending and attempting payment on invoices.
+ * However, if you’d like to finalize a draft invoice manually, you can do so using this method.
+ */
+ public Invoice finalizeInvoice(RequestOptions options) throws StripeException {
+ return finalizeInvoice((Map) null, options);
+ }
+
+ /**
+ * Stripe automatically finalizes drafts before sending and attempting payment on invoices.
+ * However, if you’d like to finalize a draft invoice manually, you can do so using this method.
+ */
+ public Invoice finalizeInvoice(Map params) throws StripeException {
+ return finalizeInvoice(params, (RequestOptions) null);
+ }
+
+ /**
+ * Stripe automatically finalizes drafts before sending and attempting payment on invoices.
+ * However, if you’d like to finalize a draft invoice manually, you can do so using this method.
+ */
+ public Invoice finalizeInvoice(Map params, RequestOptions options)
+ throws StripeException {
+ String url =
+ String.format(
+ "%s%s",
+ Stripe.getApiBase(),
+ String.format("/v1/invoices/%s/finalize", ApiResource.urlEncodeId(this.getId())));
+ return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Invoice.class, options);
+ }
+
+ /**
+ * Stripe automatically finalizes drafts before sending and attempting payment on invoices.
+ * However, if you’d like to finalize a draft invoice manually, you can do so using this method.
+ */
+ public Invoice finalizeInvoice(InvoiceFinalizeInvoiceParams params) throws StripeException {
+ return finalizeInvoice(params, (RequestOptions) null);
+ }
+
+ /**
+ * Stripe automatically finalizes drafts before sending and attempting payment on invoices.
+ * However, if you’d like to finalize a draft invoice manually, you can do so using this method.
+ */
+ public Invoice finalizeInvoice(InvoiceFinalizeInvoiceParams params, RequestOptions options)
+ throws StripeException {
+ String url =
+ String.format(
+ "%s%s",
+ Stripe.getApiBase(),
+ String.format("/v1/invoices/%s/finalize", ApiResource.urlEncodeId(this.getId())));
+ return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Invoice.class, options);
}
/**
@@ -877,323 +1012,67 @@ public static InvoiceCollection list(InvoiceListParams params, RequestOptions op
}
/**
- * At any time, you can preview the upcoming invoice for a customer. This will show you all the
- * charges that are pending, including subscription renewal charges, invoice item charges, etc. It
- * will also show you any discounts that are applicable to the invoice.
- *
- * Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the
- * invoice has not yet been created. As such, the upcoming invoice will not show up in invoice
- * listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the
- * amount that your customer will be billed, you can add, remove, or update pending invoice items,
- * or update the customer’s discount.
- *
- *
You can preview the effects of updating a subscription, including a preview of what
- * proration will take place. To ensure that the actual proration is calculated exactly the same
- * as the previewed proration, you should pass a proration_date
parameter when doing
- * the actual subscription update. The value passed in should be the same as the
- * subscription_proration_date
returned on the upcoming invoice resource. The recommended
- * way to get only the prorations being previewed is to consider only proration line items where
- * period[start]
is equal to the subscription_proration_date
on the
- * upcoming invoice resource.
+ * Marking an invoice as uncollectible is useful for keeping track of bad debts that can be
+ * written off for accounting purposes.
*/
- public static Invoice upcoming() throws StripeException {
- return upcoming((Map) null, (RequestOptions) null);
+ public Invoice markUncollectible() throws StripeException {
+ return markUncollectible((Map) null, (RequestOptions) null);
}
/**
- * At any time, you can preview the upcoming invoice for a customer. This will show you all the
- * charges that are pending, including subscription renewal charges, invoice item charges, etc. It
- * will also show you any discounts that are applicable to the invoice.
- *
- * Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the
- * invoice has not yet been created. As such, the upcoming invoice will not show up in invoice
- * listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the
- * amount that your customer will be billed, you can add, remove, or update pending invoice items,
- * or update the customer’s discount.
- *
- *
You can preview the effects of updating a subscription, including a preview of what
- * proration will take place. To ensure that the actual proration is calculated exactly the same
- * as the previewed proration, you should pass a proration_date
parameter when doing
- * the actual subscription update. The value passed in should be the same as the
- * subscription_proration_date
returned on the upcoming invoice resource. The recommended
- * way to get only the prorations being previewed is to consider only proration line items where
- * period[start]
is equal to the subscription_proration_date
on the
- * upcoming invoice resource.
+ * Marking an invoice as uncollectible is useful for keeping track of bad debts that can be
+ * written off for accounting purposes.
*/
- public static Invoice upcoming(Map params) throws StripeException {
- return upcoming(params, (RequestOptions) null);
+ public Invoice markUncollectible(RequestOptions options) throws StripeException {
+ return markUncollectible((Map) null, options);
}
/**
- * At any time, you can preview the upcoming invoice for a customer. This will show you all the
- * charges that are pending, including subscription renewal charges, invoice item charges, etc. It
- * will also show you any discounts that are applicable to the invoice.
- *
- * Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the
- * invoice has not yet been created. As such, the upcoming invoice will not show up in invoice
- * listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the
- * amount that your customer will be billed, you can add, remove, or update pending invoice items,
- * or update the customer’s discount.
- *
- *
You can preview the effects of updating a subscription, including a preview of what
- * proration will take place. To ensure that the actual proration is calculated exactly the same
- * as the previewed proration, you should pass a proration_date
parameter when doing
- * the actual subscription update. The value passed in should be the same as the
- * subscription_proration_date
returned on the upcoming invoice resource. The recommended
- * way to get only the prorations being previewed is to consider only proration line items where
- * period[start]
is equal to the subscription_proration_date
on the
- * upcoming invoice resource.
+ * Marking an invoice as uncollectible is useful for keeping track of bad debts that can be
+ * written off for accounting purposes.
*/
- public static Invoice upcoming(Map params, RequestOptions options)
- throws StripeException {
- String url = String.format("%s%s", Stripe.getApiBase(), "/v1/invoices/upcoming");
- return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Invoice.class, options);
+ public Invoice markUncollectible(Map params) throws StripeException {
+ return markUncollectible(params, (RequestOptions) null);
}
/**
- * At any time, you can preview the upcoming invoice for a customer. This will show you all the
- * charges that are pending, including subscription renewal charges, invoice item charges, etc. It
- * will also show you any discounts that are applicable to the invoice.
- *
- *