Package com.stripe.model
Class Customer
- java.lang.Object
-
- com.stripe.model.StripeObject
-
- com.stripe.net.ApiResource
-
- com.stripe.model.Customer
-
- All Implemented Interfaces:
HasId,MetadataStore<Customer>,StripeObjectInterface
public class Customer extends ApiResource implements HasId, MetadataStore<Customer>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCustomer.InvoiceSettingsstatic classCustomer.Tax-
Nested classes/interfaces inherited from class com.stripe.net.ApiResource
ApiResource.RequestMethod
-
-
Field Summary
-
Fields inherited from class com.stripe.net.ApiResource
CHARSET, GSON
-
Fields inherited from class com.stripe.model.StripeObject
PRETTY_PRINT_GSON
-
-
Constructor Summary
Constructors Constructor Description Customer()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CustomerBalanceTransactionCollectionbalanceTransactions()Returns a list of transactions that updated the customer’s balances.CustomerBalanceTransactionCollectionbalanceTransactions(CustomerBalanceTransactionsParams params)Returns a list of transactions that updated the customer’s balances.CustomerBalanceTransactionCollectionbalanceTransactions(CustomerBalanceTransactionsParams params, RequestOptions options)Returns a list of transactions that updated the customer’s balances.CustomerBalanceTransactionCollectionbalanceTransactions(java.util.Map<java.lang.String,java.lang.Object> params)Returns a list of transactions that updated the customer’s balances.CustomerBalanceTransactionCollectionbalanceTransactions(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)Returns a list of transactions that updated the customer’s balances.protected booleancanEqual(java.lang.Object other)static Customercreate(CustomerCreateParams params)Creates a new customer object.static Customercreate(CustomerCreateParams params, RequestOptions options)Creates a new customer object.static Customercreate(java.util.Map<java.lang.String,java.lang.Object> params)Creates a new customer object.static Customercreate(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)Creates a new customer object.Customerdelete()Permanently deletes a customer.Customerdelete(RequestOptions options)Permanently deletes a customer.Customerdelete(java.util.Map<java.lang.String,java.lang.Object> params)Permanently deletes a customer.Customerdelete(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)Permanently deletes a customer.DiscountdeleteDiscount()Removes the currently applied discount on a customer.DiscountdeleteDiscount(java.util.Map<java.lang.String,java.lang.Object> params)Removes the currently applied discount on a customer.DiscountdeleteDiscount(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)Removes the currently applied discount on a customer.booleanequals(java.lang.Object o)AddressgetAddress()The customer's address.java.lang.LonggetBalance()Current balance, if any, being stored on the customer.java.lang.LonggetCreated()Time at which the object was created.java.lang.StringgetCurrency()Three-letter ISO code for the currency the customer can be charged in for recurring billing purposes.java.lang.StringgetDefaultSource()Get ID of expandabledefaultSourceobject.PaymentSourcegetDefaultSourceObject()Get expandeddefaultSource.java.lang.BooleangetDeleted()Always true for a deleted object.java.lang.BooleangetDelinquent()When the customer's latest invoice is billed by charging automatically,delinquentistrueif the invoice's latest charge failed.java.lang.StringgetDescription()An arbitrary string attached to the object.DiscountgetDiscount()Describes the current discount active on the customer, if there is one.java.lang.StringgetEmail()The customer's email address.java.lang.StringgetId()Unique identifier for the object.java.lang.StringgetInvoicePrefix()The prefix for the customer used to generate unique invoice numbers.Customer.InvoiceSettingsgetInvoiceSettings()java.lang.BooleangetLivemode()Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.java.util.Map<java.lang.String,java.lang.String>getMetadata()Set of key-value pairs that you can attach to an object.java.lang.StringgetName()The customer's full name or business name.java.lang.LonggetNextInvoiceSequence()The suffix of the customer's next invoice number, e.g., 0001.java.lang.StringgetObject()String representing the object's type.java.lang.StringgetPhone()The customer's phone number.java.util.List<java.lang.String>getPreferredLocales()The customer's preferred locales (languages), ordered by preference.ShippingDetailsgetShipping()Mailing and shipping address for the customer.PaymentSourceCollectiongetSources()The customer's payment sources, if any.SubscriptionCollectiongetSubscriptions()The customer's current subscriptions, if any.Customer.TaxgetTax()java.lang.StringgetTaxExempt()Describes the customer's tax exemption status.TaxIdCollectiongetTaxIds()The customer's tax IDs.inthashCode()static CustomerCollectionlist(CustomerListParams params)Returns a list of your customers.static CustomerCollectionlist(CustomerListParams params, RequestOptions options)Returns a list of your customers.static CustomerCollectionlist(java.util.Map<java.lang.String,java.lang.Object> params)Returns a list of your customers.static CustomerCollectionlist(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)Returns a list of your customers.static Customerretrieve(java.lang.String customer)Retrieves the details of an existing customer.static Customerretrieve(java.lang.String customer, RequestOptions options)Retrieves the details of an existing customer.static Customerretrieve(java.lang.String customer, CustomerRetrieveParams params, RequestOptions options)Retrieves the details of an existing customer.static Customerretrieve(java.lang.String customer, java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)Retrieves the details of an existing customer.voidsetAddress(Address address)The customer's address.voidsetBalance(java.lang.Long balance)Current balance, if any, being stored on the customer.voidsetCreated(java.lang.Long created)Time at which the object was created.voidsetCurrency(java.lang.String currency)Three-letter ISO code for the currency the customer can be charged in for recurring billing purposes.voidsetDefaultSource(java.lang.String id)voidsetDefaultSourceObject(PaymentSource expandableObject)voidsetDeleted(java.lang.Boolean deleted)Always true for a deleted object.voidsetDelinquent(java.lang.Boolean delinquent)When the customer's latest invoice is billed by charging automatically,delinquentistrueif the invoice's latest charge failed.voidsetDescription(java.lang.String description)An arbitrary string attached to the object.voidsetDiscount(Discount discount)Describes the current discount active on the customer, if there is one.voidsetEmail(java.lang.String email)The customer's email address.voidsetId(java.lang.String id)Unique identifier for the object.voidsetInvoicePrefix(java.lang.String invoicePrefix)The prefix for the customer used to generate unique invoice numbers.voidsetInvoiceSettings(Customer.InvoiceSettings invoiceSettings)voidsetLivemode(java.lang.Boolean livemode)Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.voidsetMetadata(java.util.Map<java.lang.String,java.lang.String> metadata)Set of key-value pairs that you can attach to an object.voidsetName(java.lang.String name)The customer's full name or business name.voidsetNextInvoiceSequence(java.lang.Long nextInvoiceSequence)The suffix of the customer's next invoice number, e.g., 0001.voidsetObject(java.lang.String object)String representing the object's type.voidsetPhone(java.lang.String phone)The customer's phone number.voidsetPreferredLocales(java.util.List<java.lang.String> preferredLocales)The customer's preferred locales (languages), ordered by preference.voidsetShipping(ShippingDetails shipping)Mailing and shipping address for the customer.voidsetSources(PaymentSourceCollection sources)The customer's payment sources, if any.voidsetSubscriptions(SubscriptionCollection subscriptions)The customer's current subscriptions, if any.voidsetTax(Customer.Tax tax)voidsetTaxExempt(java.lang.String taxExempt)Describes the customer's tax exemption status.voidsetTaxIds(TaxIdCollection taxIds)The customer's tax IDs.Customerupdate(CustomerUpdateParams params)Updates the specified customer by setting the values of the parameters passed.Customerupdate(CustomerUpdateParams params, RequestOptions options)Updates the specified customer by setting the values of the parameters passed.Customerupdate(java.util.Map<java.lang.String,java.lang.Object> params)Updates the specified customer by setting the values of the parameters passed.Customerupdate(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)Updates the specified customer by setting the values of the parameters passed.-
Methods inherited from class com.stripe.net.ApiResource
checkNullTypedParams, classUrl, classUrl, instanceUrl, instanceUrl, request, request, requestCollection, requestCollection, setExpandableFieldId, setStripeResponseGetter, singleClassUrl, singleClassUrl, subresourceUrl, urlEncode, urlEncodeId
-
Methods inherited from class com.stripe.model.StripeObject
equals, getLastResponse, getRawJsonObject, setLastResponse, toJson, toString
-
-
-
-
Method Detail
-
getDefaultSource
public java.lang.String getDefaultSource()
Get ID of expandabledefaultSourceobject.
-
setDefaultSource
public void setDefaultSource(java.lang.String id)
-
getDefaultSourceObject
public PaymentSource getDefaultSourceObject()
Get expandeddefaultSource.
-
setDefaultSourceObject
public void setDefaultSourceObject(PaymentSource expandableObject)
-
list
public static CustomerCollection list(java.util.Map<java.lang.String,java.lang.Object> params) throws StripeException
Returns a list of your customers. The customers are returned sorted by creation date, with the most recent customers appearing first.- Throws:
StripeException
-
list
public static CustomerCollection list(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
Returns a list of your customers. The customers are returned sorted by creation date, with the most recent customers appearing first.- Throws:
StripeException
-
list
public static CustomerCollection list(CustomerListParams params) throws StripeException
Returns a list of your customers. The customers are returned sorted by creation date, with the most recent customers appearing first.- Throws:
StripeException
-
list
public static CustomerCollection list(CustomerListParams params, RequestOptions options) throws StripeException
Returns a list of your customers. The customers are returned sorted by creation date, with the most recent customers appearing first.- Throws:
StripeException
-
create
public static Customer create(java.util.Map<java.lang.String,java.lang.Object> params) throws StripeException
Creates a new customer object.- Throws:
StripeException
-
create
public static Customer create(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
Creates a new customer object.- Throws:
StripeException
-
create
public static Customer create(CustomerCreateParams params) throws StripeException
Creates a new customer object.- Throws:
StripeException
-
create
public static Customer create(CustomerCreateParams params, RequestOptions options) throws StripeException
Creates a new customer object.- Throws:
StripeException
-
retrieve
public static Customer retrieve(java.lang.String customer) throws StripeException
Retrieves the details of an existing customer. You need only supply the unique customer identifier that was returned upon customer creation.- Throws:
StripeException
-
retrieve
public static Customer retrieve(java.lang.String customer, RequestOptions options) throws StripeException
Retrieves the details of an existing customer. You need only supply the unique customer identifier that was returned upon customer creation.- Throws:
StripeException
-
retrieve
public static Customer retrieve(java.lang.String customer, java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
Retrieves the details of an existing customer. You need only supply the unique customer identifier that was returned upon customer creation.- Throws:
StripeException
-
retrieve
public static Customer retrieve(java.lang.String customer, CustomerRetrieveParams params, RequestOptions options) throws StripeException
Retrieves the details of an existing customer. You need only supply the unique customer identifier that was returned upon customer creation.- Throws:
StripeException
-
update
public Customer update(java.util.Map<java.lang.String,java.lang.Object> params) throws StripeException
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 thepast_duestate, 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.
- Specified by:
updatein interfaceMetadataStore<Customer>- Throws:
StripeException
-
update
public Customer update(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
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 thepast_duestate, 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.
- Specified by:
updatein interfaceMetadataStore<Customer>- Throws:
StripeException
-
update
public Customer update(CustomerUpdateParams params) throws StripeException
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 thepast_duestate, 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.
- Throws:
StripeException
-
update
public Customer update(CustomerUpdateParams params, RequestOptions options) throws StripeException
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 thepast_duestate, 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.
- Throws:
StripeException
-
delete
public Customer delete() throws StripeException
Permanently deletes a customer. It cannot be undone. Also immediately cancels any active subscriptions on the customer.- Throws:
StripeException
-
delete
public Customer delete(RequestOptions options) throws StripeException
Permanently deletes a customer. It cannot be undone. Also immediately cancels any active subscriptions on the customer.- Throws:
StripeException
-
delete
public Customer delete(java.util.Map<java.lang.String,java.lang.Object> params) throws StripeException
Permanently deletes a customer. It cannot be undone. Also immediately cancels any active subscriptions on the customer.- Throws:
StripeException
-
delete
public Customer delete(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
Permanently deletes a customer. It cannot be undone. Also immediately cancels any active subscriptions on the customer.- Throws:
StripeException
-
balanceTransactions
public CustomerBalanceTransactionCollection balanceTransactions() throws StripeException
Returns a list of transactions that updated the customer’s balances.- Throws:
StripeException
-
balanceTransactions
public CustomerBalanceTransactionCollection balanceTransactions(java.util.Map<java.lang.String,java.lang.Object> params) throws StripeException
Returns a list of transactions that updated the customer’s balances.- Throws:
StripeException
-
balanceTransactions
public CustomerBalanceTransactionCollection balanceTransactions(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
Returns a list of transactions that updated the customer’s balances.- Throws:
StripeException
-
balanceTransactions
public CustomerBalanceTransactionCollection balanceTransactions(CustomerBalanceTransactionsParams params) throws StripeException
Returns a list of transactions that updated the customer’s balances.- Throws:
StripeException
-
balanceTransactions
public CustomerBalanceTransactionCollection balanceTransactions(CustomerBalanceTransactionsParams params, RequestOptions options) throws StripeException
Returns a list of transactions that updated the customer’s balances.- Throws:
StripeException
-
deleteDiscount
public Discount deleteDiscount() throws StripeException
Removes the currently applied discount on a customer.- Throws:
StripeException
-
deleteDiscount
public Discount deleteDiscount(java.util.Map<java.lang.String,java.lang.Object> params) throws StripeException
Removes the currently applied discount on a customer.- Throws:
StripeException
-
deleteDiscount
public Discount deleteDiscount(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
Removes the currently applied discount on a customer.- Throws:
StripeException
-
getAddress
public Address getAddress()
The customer's address.
-
getBalance
public java.lang.Long getBalance()
Current balance, if any, being stored on the customer. If negative, the customer has credit to apply to their next invoice. If positive, the customer has an amount owed that will be added to their next invoice. The balance does not refer to any unpaid invoices; it solely takes into account amounts that have yet to be successfully applied to any invoice. This balance is only taken into account as invoices are finalized.
-
getCreated
public java.lang.Long getCreated()
Time at which the object was created. Measured in seconds since the Unix epoch.
-
getCurrency
public java.lang.String getCurrency()
Three-letter ISO code for the currency the customer can be charged in for recurring billing purposes.
-
getDeleted
public java.lang.Boolean getDeleted()
Always true for a deleted object.
-
getDelinquent
public java.lang.Boolean getDelinquent()
When the customer's latest invoice is billed by charging automatically,delinquentistrueif the invoice's latest charge failed. When the customer's latest invoice is billed by sending an invoice,delinquentistrueif the invoice isn't paid by its due date.If an invoice is marked uncollectible by dunning,
delinquentdoesn't get reset tofalse.
-
getDescription
public java.lang.String getDescription()
An arbitrary string attached to the object. Often useful for displaying to users.
-
getDiscount
public Discount getDiscount()
Describes the current discount active on the customer, if there is one.
-
getEmail
public java.lang.String getEmail()
The customer's email address.
-
getInvoicePrefix
public java.lang.String getInvoicePrefix()
The prefix for the customer used to generate unique invoice numbers.
-
getInvoiceSettings
public Customer.InvoiceSettings getInvoiceSettings()
-
getLivemode
public java.lang.Boolean getLivemode()
Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.
-
getName
public java.lang.String getName()
The customer's full name or business name.
-
getNextInvoiceSequence
public java.lang.Long getNextInvoiceSequence()
The suffix of the customer's next invoice number, e.g., 0001.
-
getObject
public java.lang.String getObject()
String representing the object's type. Objects of the same type share the same value.Equal to
customer.
-
getPhone
public java.lang.String getPhone()
The customer's phone number.
-
getPreferredLocales
public java.util.List<java.lang.String> getPreferredLocales()
The customer's preferred locales (languages), ordered by preference.
-
getShipping
public ShippingDetails getShipping()
Mailing and shipping address for the customer. Appears on invoices emailed to this customer.
-
getSources
public PaymentSourceCollection getSources()
The customer's payment sources, if any.
-
getSubscriptions
public SubscriptionCollection getSubscriptions()
The customer's current subscriptions, if any.
-
getTax
public Customer.Tax getTax()
-
getTaxExempt
public java.lang.String getTaxExempt()
Describes the customer's tax exemption status. One ofnone,exempt, orreverse. When set toreverse, invoice and receipt PDFs include the text "Reverse charge".
-
getTaxIds
public TaxIdCollection getTaxIds()
The customer's tax IDs.
-
setAddress
public void setAddress(Address address)
The customer's address.
-
setBalance
public void setBalance(java.lang.Long balance)
Current balance, if any, being stored on the customer. If negative, the customer has credit to apply to their next invoice. If positive, the customer has an amount owed that will be added to their next invoice. The balance does not refer to any unpaid invoices; it solely takes into account amounts that have yet to be successfully applied to any invoice. This balance is only taken into account as invoices are finalized.
-
setCreated
public void setCreated(java.lang.Long created)
Time at which the object was created. Measured in seconds since the Unix epoch.
-
setCurrency
public void setCurrency(java.lang.String currency)
Three-letter ISO code for the currency the customer can be charged in for recurring billing purposes.
-
setDeleted
public void setDeleted(java.lang.Boolean deleted)
Always true for a deleted object.
-
setDelinquent
public void setDelinquent(java.lang.Boolean delinquent)
When the customer's latest invoice is billed by charging automatically,delinquentistrueif the invoice's latest charge failed. When the customer's latest invoice is billed by sending an invoice,delinquentistrueif the invoice isn't paid by its due date.If an invoice is marked uncollectible by dunning,
delinquentdoesn't get reset tofalse.
-
setDescription
public void setDescription(java.lang.String description)
An arbitrary string attached to the object. Often useful for displaying to users.
-
setDiscount
public void setDiscount(Discount discount)
Describes the current discount active on the customer, if there is one.
-
setEmail
public void setEmail(java.lang.String email)
The customer's email address.
-
setId
public void setId(java.lang.String id)
Unique identifier for the object.
-
setInvoicePrefix
public void setInvoicePrefix(java.lang.String invoicePrefix)
The prefix for the customer used to generate unique invoice numbers.
-
setInvoiceSettings
public void setInvoiceSettings(Customer.InvoiceSettings invoiceSettings)
-
setLivemode
public void setLivemode(java.lang.Boolean livemode)
Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.
-
setMetadata
public void setMetadata(java.util.Map<java.lang.String,java.lang.String> metadata)
Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
-
setName
public void setName(java.lang.String name)
The customer's full name or business name.
-
setNextInvoiceSequence
public void setNextInvoiceSequence(java.lang.Long nextInvoiceSequence)
The suffix of the customer's next invoice number, e.g., 0001.
-
setObject
public void setObject(java.lang.String object)
String representing the object's type. Objects of the same type share the same value.Equal to
customer.
-
setPhone
public void setPhone(java.lang.String phone)
The customer's phone number.
-
setPreferredLocales
public void setPreferredLocales(java.util.List<java.lang.String> preferredLocales)
The customer's preferred locales (languages), ordered by preference.
-
setShipping
public void setShipping(ShippingDetails shipping)
Mailing and shipping address for the customer. Appears on invoices emailed to this customer.
-
setSources
public void setSources(PaymentSourceCollection sources)
The customer's payment sources, if any.
-
setSubscriptions
public void setSubscriptions(SubscriptionCollection subscriptions)
The customer's current subscriptions, if any.
-
setTax
public void setTax(Customer.Tax tax)
-
setTaxExempt
public void setTaxExempt(java.lang.String taxExempt)
Describes the customer's tax exemption status. One ofnone,exempt, orreverse. When set toreverse, invoice and receipt PDFs include the text "Reverse charge".
-
setTaxIds
public void setTaxIds(TaxIdCollection taxIds)
The customer's tax IDs.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
canEqual
protected boolean canEqual(java.lang.Object other)
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
getId
public java.lang.String getId()
Unique identifier for the object.
-
getMetadata
public java.util.Map<java.lang.String,java.lang.String> getMetadata()
Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.- Specified by:
getMetadatain interfaceMetadataStore<Customer>
-
-