Package com.stripe.model
Class Margin
java.lang.Object
com.stripe.model.StripeObject
com.stripe.net.ApiResource
com.stripe.model.Margin
- All Implemented Interfaces:
HasId,MetadataStore<Margin>,StripeActiveObject,StripeObjectInterface
A (partner) margin represents a specific discount distributed in partner reseller programs to
business partners who resell products and services and earn a discount (margin) for doing so.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.stripe.net.ApiResource
ApiResource.RequestMethod -
Field Summary
Fields inherited from class com.stripe.net.ApiResource
CHARSET, GSON, INTERNAL_GSONFields inherited from class com.stripe.model.StripeObject
PRETTY_PRINT_GSON -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanstatic Margincreate(MarginCreateParams params) Create a margin object to be used with invoices, invoice items, and invoice line items for a customer to represent a partner discount.static Margincreate(MarginCreateParams params, RequestOptions options) Create a margin object to be used with invoices, invoice items, and invoice line items for a customer to represent a partner discount.static MarginCreate a margin object to be used with invoices, invoice items, and invoice line items for a customer to represent a partner discount.static Margincreate(Map<String, Object> params, RequestOptions options) Create a margin object to be used with invoices, invoice items, and invoice line items for a customer to represent a partner discount.booleanWhether the margin can be applied to invoices, invoice items, or invoice line items.Time at which the object was created.getId()Unique identifier for the object.Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.Set of key-value pairs that you can attach to an object.getName()Name of the margin that's displayed on, for example, invoices.String representing the object's type.Percent that will be taken off the subtotal before tax (after all other discounts and promotions) of any invoice to which the margin is applied.Time at which the object was last updated.inthashCode()static MarginCollectionlist(MarginListParams params) Retrieve a list of your margins.static MarginCollectionlist(MarginListParams params, RequestOptions options) Retrieve a list of your margins.static MarginCollectionRetrieve a list of your margins.static MarginCollectionlist(Map<String, Object> params, RequestOptions options) Retrieve a list of your margins.static MarginRetrieve a margin object with the given ID.static Marginretrieve(String margin, RequestOptions options) Retrieve a margin object with the given ID.static Marginretrieve(String margin, MarginRetrieveParams params, RequestOptions options) Retrieve a margin object with the given ID.static MarginRetrieve a margin object with the given ID.voidWhether the margin can be applied to invoices, invoice items, or invoice line items.voidsetCreated(Long created) Time at which the object was created.voidUnique identifier for the object.voidsetLivemode(Boolean livemode) Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.voidsetMetadata(Map<String, String> metadata) Set of key-value pairs that you can attach to an object.voidName of the margin that's displayed on, for example, invoices.voidString representing the object's type.voidsetPercentOff(BigDecimal percentOff) Percent that will be taken off the subtotal before tax (after all other discounts and promotions) of any invoice to which the margin is applied.voidsetUpdated(Long updated) Time at which the object was last updated.update(MarginUpdateParams params) Update the specified margin object.update(MarginUpdateParams params, RequestOptions options) Update the specified margin object.Update the specified margin object.update(Map<String, Object> params, RequestOptions options) Update the specified margin object.Methods inherited from class com.stripe.net.ApiResource
checkNullTypedParams, getGlobalResponseGetter, getResponseGetter, setExpandableFieldId, setGlobalResponseGetter, setResponseGetter, urlEncode, urlEncodeIdMethods inherited from class com.stripe.model.StripeObject
deserializeStripeObject, deserializeStripeObject, deserializeStripeObject, deserializeStripeObject, equals, getLastResponse, getRawJsonObject, setLastResponse, toJson, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.stripe.model.StripeActiveObject
trySetResponseGetter
-
Constructor Details
-
Margin
public Margin()
-
-
Method Details
-
create
Create a margin object to be used with invoices, invoice items, and invoice line items for a customer to represent a partner discount. A margin has apercent_offwhich is the percent that will be taken off the subtotal after all items and other discounts and promotions) of any invoices for a customer. Calculation of prorations do not include any partner margins applied on the original invoice item.- Throws:
StripeException
-
create
public static Margin create(Map<String, Object> params, RequestOptions options) throws StripeExceptionCreate a margin object to be used with invoices, invoice items, and invoice line items for a customer to represent a partner discount. A margin has apercent_offwhich is the percent that will be taken off the subtotal after all items and other discounts and promotions) of any invoices for a customer. Calculation of prorations do not include any partner margins applied on the original invoice item.- Throws:
StripeException
-
create
Create a margin object to be used with invoices, invoice items, and invoice line items for a customer to represent a partner discount. A margin has apercent_offwhich is the percent that will be taken off the subtotal after all items and other discounts and promotions) of any invoices for a customer. Calculation of prorations do not include any partner margins applied on the original invoice item.- Throws:
StripeException
-
create
public static Margin create(MarginCreateParams params, RequestOptions options) throws StripeException Create a margin object to be used with invoices, invoice items, and invoice line items for a customer to represent a partner discount. A margin has apercent_offwhich is the percent that will be taken off the subtotal after all items and other discounts and promotions) of any invoices for a customer. Calculation of prorations do not include any partner margins applied on the original invoice item.- Throws:
StripeException
-
list
Retrieve a list of your margins.- Throws:
StripeException
-
list
public static MarginCollection list(Map<String, Object> params, RequestOptions options) throws StripeExceptionRetrieve a list of your margins.- Throws:
StripeException
-
list
Retrieve a list of your margins.- Throws:
StripeException
-
list
public static MarginCollection list(MarginListParams params, RequestOptions options) throws StripeException Retrieve a list of your margins.- Throws:
StripeException
-
retrieve
Retrieve a margin object with the given ID.- Throws:
StripeException
-
retrieve
Retrieve a margin object with the given ID.- Throws:
StripeException
-
retrieve
public static Margin retrieve(String margin, Map<String, Object> params, RequestOptions options) throws StripeExceptionRetrieve a margin object with the given ID.- Throws:
StripeException
-
retrieve
public static Margin retrieve(String margin, MarginRetrieveParams params, RequestOptions options) throws StripeException Retrieve a margin object with the given ID.- Throws:
StripeException
-
update
Update the specified margin object. Certain fields of the margin object are not editable.- Specified by:
updatein interfaceMetadataStore<Margin>- Throws:
StripeException
-
update
Update the specified margin object. Certain fields of the margin object are not editable.- Specified by:
updatein interfaceMetadataStore<Margin>- Throws:
StripeException
-
update
Update the specified margin object. Certain fields of the margin object are not editable.- Throws:
StripeException
-
update
Update the specified margin object. Certain fields of the margin object are not editable.- Throws:
StripeException
-
getActive
Whether the margin can be applied to invoices, invoice items, or invoice line items. Defaults totrue. -
getCreated
Time at which the object was created. Measured in seconds since the Unix epoch. -
getLivemode
Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode. -
getName
Name of the margin that's displayed on, for example, invoices. -
getObject
String representing the object's type. Objects of the same type share the same value.Equal to
margin. -
getPercentOff
Percent that will be taken off the subtotal before tax (after all other discounts and promotions) of any invoice to which the margin is applied. -
getUpdated
Time at which the object was last updated. Measured in seconds since the Unix epoch. -
setActive
Whether the margin can be applied to invoices, invoice items, or invoice line items. Defaults totrue. -
setCreated
Time at which the object was created. Measured in seconds since the Unix epoch. -
setId
Unique identifier for the object. -
setLivemode
Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode. -
setMetadata
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
Name of the margin that's displayed on, for example, invoices. -
setObject
String representing the object's type. Objects of the same type share the same value.Equal to
margin. -
setPercentOff
Percent that will be taken off the subtotal before tax (after all other discounts and promotions) of any invoice to which the margin is applied. -
setUpdated
Time at which the object was last updated. Measured in seconds since the Unix epoch. -
equals
-
canEqual
-
hashCode
public int hashCode() -
getId
Unique identifier for the object. -
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<Margin>
-