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_GSON
Fields inherited from class com.stripe.model.StripeObject
PRETTY_PRINT_GSON
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
static Margin
create
(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.A margin has apercent_off
which is the percent that will be taken off the subtotal after all items and other discounts and promotions) of any invoices for a customer.static Margin
create
(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.A margin has apercent_off
which is the percent that will be taken off the subtotal after all items and other discounts and promotions) of any invoices for a customer.static Margin
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_off
which is the percent that will be taken off the subtotal after all items and other discounts and promotions) of any invoices for a customer.static Margin
create
(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.A margin has apercent_off
which is the percent that will be taken off the subtotal after all items and other discounts and promotions) of any invoices for a customer.boolean
Whether 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 valuetrue
if the object exists in live mode or the valuefalse
if 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.int
hashCode()
static MarginCollection
list
(MarginListParams params) Retrieve a list of your margins.static MarginCollection
list
(MarginListParams params, RequestOptions options) Retrieve a list of your margins.static MarginCollection
Retrieve a list of your margins.static MarginCollection
list
(Map<String, Object> params, RequestOptions options) Retrieve a list of your margins.static Margin
Retrieve a margin object with the given ID.static Margin
retrieve
(String margin, RequestOptions options) Retrieve a margin object with the given ID.static Margin
retrieve
(String margin, MarginRetrieveParams params, RequestOptions options) Retrieve a margin object with the given ID.static Margin
Retrieve a margin object with the given ID.void
Whether the margin can be applied to invoices, invoice items, or invoice line items.void
setCreated
(Long created) Time at which the object was created.void
Unique identifier for the object.void
setLivemode
(Boolean livemode) Has the valuetrue
if the object exists in live mode or the valuefalse
if the object exists in test mode.void
setMetadata
(Map<String, String> metadata) Set of key-value pairs that you can attach to an object.void
Name of the margin that's displayed on, for example, invoices.void
String representing the object's type.void
setPercentOff
(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.void
setUpdated
(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, rawRequest, setExpandableFieldId, setResponseGetter, setStripeResponseGetter, urlEncode, urlEncodeId
Methods inherited from class com.stripe.model.StripeObject
deserializeStripeObject, deserializeStripeObject, deserializeStripeObject, deserializeStripeObject, equals, getLastResponse, getRawJsonObject, setLastResponse, toJson, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods 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_off
which 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_off
which 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_off
which 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_off
which 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:
update
in interfaceMetadataStore<Margin>
- Throws:
StripeException
-
update
Update the specified margin object. Certain fields of the margin object are not editable.- Specified by:
update
in 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 valuetrue
if the object exists in live mode or the valuefalse
if 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 valuetrue
if the object exists in live mode or the valuefalse
if 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:
getMetadata
in interfaceMetadataStore<Margin>
-