Class Order
- All Implemented Interfaces:
HasId
,MetadataStore<Order>
,StripeActiveObject
,StripeObjectInterface
Related guide: Orders overview
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static class
static class
static class
The token of the gift card applied to the order.static class
Get expandeddestination
.static class
The amount on which tax is calculated, in cents (or local equivalent).static class
static class
The value of the tax ID.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 TypeMethodDescriptioncancel()
Cancels the order as well as the payment intent if one is attached.cancel
(RequestOptions options) Cancels the order as well as the payment intent if one is attached.cancel
(OrderCancelParams params) Cancels the order as well as the payment intent if one is attached.cancel
(OrderCancelParams params, RequestOptions options) Cancels the order as well as the payment intent if one is attached.Cancels the order as well as the payment intent if one is attached.cancel
(Map<String, Object> params, RequestOptions options) Cancels the order as well as the payment intent if one is attached.protected boolean
static Order
create
(OrderCreateParams params) Creates a newopen
order object.static Order
create
(OrderCreateParams params, RequestOptions options) Creates a newopen
order object.static Order
Creates a newopen
order object.static Order
create
(Map<String, Object> params, RequestOptions options) Creates a newopen
order object.boolean
Order cost before any discounts or taxes are applied.Total order cost after discounts and taxes are applied.Get ID of expandableapplication
object.Get expandedapplication
.Customer billing details associated with the order.The client secret of this Order.Time at which the object was created.The credits applied to the Order.Three-letter ISO currency code, in lowercase.Get ID of expandablecustomer
object.Get expandedcustomer
.An arbitrary string attached to the object.Get expandeddiscounts
.Get IDs of expandablediscounts
object list.getId()
Unique identifier for the object.A recent IP address of the purchaser used for tax reporting and tax location inference.A list of line items the customer is ordering.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.String representing the object's type.The details of the customer cost of shipping, including the customer chosen ShippingRate.Customer shipping information associated with the order.The overall status of the order.int
hashCode()
static OrderCollection
list
(OrderListParams params) Returns a list of your orders.static OrderCollection
list
(OrderListParams params, RequestOptions options) Returns a list of your orders.static OrderCollection
Returns a list of your orders.static OrderCollection
list
(Map<String, Object> params, RequestOptions options) Returns a list of your orders.When retrieving an order, there is an includable line_items property containing the first handful of those items.When retrieving an order, there is an includable line_items property containing the first handful of those items.listLineItems
(OrderListLineItemsParams params, RequestOptions options) When retrieving an order, there is an includable line_items property containing the first handful of those items.listLineItems
(Map<String, Object> params) When retrieving an order, there is an includable line_items property containing the first handful of those items.listLineItems
(Map<String, Object> params, RequestOptions options) When retrieving an order, there is an includable line_items property containing the first handful of those items.reopen()
Reopens asubmitted
order.reopen
(RequestOptions options) Reopens asubmitted
order.reopen
(OrderReopenParams params) Reopens asubmitted
order.reopen
(OrderReopenParams params, RequestOptions options) Reopens asubmitted
order.Reopens asubmitted
order.reopen
(Map<String, Object> params, RequestOptions options) Reopens asubmitted
order.static Order
Retrieves the details of an existing order.static Order
retrieve
(String id, RequestOptions options) Retrieves the details of an existing order.static Order
retrieve
(String id, OrderRetrieveParams params, RequestOptions options) Retrieves the details of an existing order.static Order
Retrieves the details of an existing order.void
setAmountRemaining
(Long amountRemaining) void
setAmountSubtotal
(Long amountSubtotal) Order cost before any discounts or taxes are applied.void
setAmountTotal
(Long amountTotal) Total order cost after discounts and taxes are applied.void
setApplication
(String id) void
setApplicationObject
(Application expandableObject) void
setAutomaticTax
(Order.AutomaticTax automaticTax) void
setBillingDetails
(Order.BillingDetails billingDetails) Customer billing details associated with the order.void
setClientSecret
(String clientSecret) The client secret of this Order.void
setCreated
(Long created) Time at which the object was created.void
setCredits
(List<Order.Credit> credits) The credits applied to the Order.void
setCurrency
(String currency) Three-letter ISO currency code, in lowercase.void
setCustomer
(String id) void
setCustomerObject
(Customer expandableObject) void
setDescription
(String description) An arbitrary string attached to the object.void
setDiscountObjects
(List<Discount> objs) void
setDiscounts
(List<String> ids) void
Unique identifier for the object.void
setIpAddress
(String ipAddress) A recent IP address of the purchaser used for tax reporting and tax location inference.void
setLineItems
(LineItemCollection lineItems) A list of line items the customer is ordering.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
String representing the object's type.void
setPayment
(Order.Payment payment) void
setResponseGetter
(StripeResponseGetter responseGetter) The amount on which tax is calculated, in cents (or local equivalent).void
setShippingCost
(Order.ShippingCost shippingCost) The details of the customer cost of shipping, including the customer chosen ShippingRate.void
setShippingDetails
(Order.ShippingDetails shippingDetails) Customer shipping information associated with the order.void
The overall status of the order.void
setTaxDetails
(Order.TaxDetails taxDetails) void
setTotalDetails
(Order.TotalDetails totalDetails) submit
(OrderSubmitParams params) Submitting an Order transitions the status toprocessing
and creates a PaymentIntent object so the order can be paid.submit
(OrderSubmitParams params, RequestOptions options) Submitting an Order transitions the status toprocessing
and creates a PaymentIntent object so the order can be paid.Submitting an Order transitions the status toprocessing
and creates a PaymentIntent object so the order can be paid.submit
(Map<String, Object> params, RequestOptions options) Submitting an Order transitions the status toprocessing
and creates a PaymentIntent object so the order can be paid.update
(OrderUpdateParams params) Updates the specific order by setting the values of the parameters passed.update
(OrderUpdateParams params, RequestOptions options) Updates the specific order by setting the values of the parameters passed.Updates the specific order by setting the values of the parameters passed.update
(Map<String, Object> params, RequestOptions options) Updates the specific order by setting the values of the parameters passed.Methods inherited from class com.stripe.net.ApiResource
checkNullTypedParams, getGlobalResponseGetter, getResponseGetter, rawRequest, setExpandableFieldId, setStripeResponseGetter, urlEncode, urlEncodeId
Methods inherited from class com.stripe.model.StripeObject
deserializeStripeObject, 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
-
Order
public Order()
-
-
Method Details
-
getApplication
Get ID of expandableapplication
object. -
setApplication
-
getApplicationObject
Get expandedapplication
. -
setApplicationObject
-
getCustomer
Get ID of expandablecustomer
object. -
setCustomer
-
getCustomerObject
Get expandedcustomer
. -
setCustomerObject
-
getDiscounts
Get IDs of expandablediscounts
object list. -
setDiscounts
-
getDiscountObjects
Get expandeddiscounts
. -
setDiscountObjects
-
cancel
Cancels the order as well as the payment intent if one is attached.- Throws:
StripeException
-
cancel
Cancels the order as well as the payment intent if one is attached.- Throws:
StripeException
-
cancel
Cancels the order as well as the payment intent if one is attached.- Throws:
StripeException
-
cancel
Cancels the order as well as the payment intent if one is attached.- Throws:
StripeException
-
cancel
Cancels the order as well as the payment intent if one is attached.- Throws:
StripeException
-
cancel
Cancels the order as well as the payment intent if one is attached.- Throws:
StripeException
-
create
Creates a newopen
order object.- Throws:
StripeException
-
create
public static Order create(Map<String, Object> params, RequestOptions options) throws StripeExceptionCreates a newopen
order object.- Throws:
StripeException
-
create
Creates a newopen
order object.- Throws:
StripeException
-
create
Creates a newopen
order object.- Throws:
StripeException
-
list
Returns a list of your orders. The orders are returned sorted by creation date, with the most recently created orders appearing first.- Throws:
StripeException
-
list
public static OrderCollection list(Map<String, Object> params, RequestOptions options) throws StripeExceptionReturns a list of your orders. The orders are returned sorted by creation date, with the most recently created orders appearing first.- Throws:
StripeException
-
list
Returns a list of your orders. The orders are returned sorted by creation date, with the most recently created orders appearing first.- Throws:
StripeException
-
list
public static OrderCollection list(OrderListParams params, RequestOptions options) throws StripeException Returns a list of your orders. The orders are returned sorted by creation date, with the most recently created orders appearing first.- Throws:
StripeException
-
listLineItems
When retrieving an order, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.- Throws:
StripeException
-
listLineItems
When retrieving an order, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.- Throws:
StripeException
-
listLineItems
public LineItemCollection listLineItems(Map<String, Object> params, RequestOptions options) throws StripeExceptionWhen retrieving an order, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.- Throws:
StripeException
-
listLineItems
When retrieving an order, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.- Throws:
StripeException
-
listLineItems
public LineItemCollection listLineItems(OrderListLineItemsParams params, RequestOptions options) throws StripeException When retrieving an order, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.- Throws:
StripeException
-
reopen
Reopens asubmitted
order.- Throws:
StripeException
-
reopen
Reopens asubmitted
order.- Throws:
StripeException
-
reopen
Reopens asubmitted
order.- Throws:
StripeException
-
reopen
Reopens asubmitted
order.- Throws:
StripeException
-
reopen
Reopens asubmitted
order.- Throws:
StripeException
-
reopen
Reopens asubmitted
order.- Throws:
StripeException
-
retrieve
Retrieves the details of an existing order. Supply the unique order ID from either an order creation request or the order list, and Stripe will return the corresponding order information.- Throws:
StripeException
-
retrieve
Retrieves the details of an existing order. Supply the unique order ID from either an order creation request or the order list, and Stripe will return the corresponding order information.- Throws:
StripeException
-
retrieve
public static Order retrieve(String id, Map<String, Object> params, RequestOptions options) throws StripeExceptionRetrieves the details of an existing order. Supply the unique order ID from either an order creation request or the order list, and Stripe will return the corresponding order information.- Throws:
StripeException
-
retrieve
public static Order retrieve(String id, OrderRetrieveParams params, RequestOptions options) throws StripeException Retrieves the details of an existing order. Supply the unique order ID from either an order creation request or the order list, and Stripe will return the corresponding order information.- Throws:
StripeException
-
submit
Submitting an Order transitions the status toprocessing
and creates a PaymentIntent object so the order can be paid. If the Order has anamount_total
of 0, no PaymentIntent object will be created. Once the order is submitted, its contents cannot be changed, unless the reopen method is called.- Throws:
StripeException
-
submit
Submitting an Order transitions the status toprocessing
and creates a PaymentIntent object so the order can be paid. If the Order has anamount_total
of 0, no PaymentIntent object will be created. Once the order is submitted, its contents cannot be changed, unless the reopen method is called.- Throws:
StripeException
-
submit
Submitting an Order transitions the status toprocessing
and creates a PaymentIntent object so the order can be paid. If the Order has anamount_total
of 0, no PaymentIntent object will be created. Once the order is submitted, its contents cannot be changed, unless the reopen method is called.- Throws:
StripeException
-
submit
Submitting an Order transitions the status toprocessing
and creates a PaymentIntent object so the order can be paid. If the Order has anamount_total
of 0, no PaymentIntent object will be created. Once the order is submitted, its contents cannot be changed, unless the reopen method is called.- Throws:
StripeException
-
update
Updates the specific order by setting the values of the parameters passed. Any parameters not provided will be left unchanged.- Specified by:
update
in interfaceMetadataStore<Order>
- Throws:
StripeException
-
update
Updates the specific order by setting the values of the parameters passed. Any parameters not provided will be left unchanged.- Specified by:
update
in interfaceMetadataStore<Order>
- Throws:
StripeException
-
update
Updates the specific order by setting the values of the parameters passed. Any parameters not provided will be left unchanged.- Throws:
StripeException
-
update
Updates the specific order by setting the values of the parameters passed. Any parameters not provided will be left unchanged.- Throws:
StripeException
-
setResponseGetter
The amount on which tax is calculated, in cents (or local equivalent).- Specified by:
setResponseGetter
in interfaceStripeActiveObject
- Overrides:
setResponseGetter
in classApiResource
- Parameters:
responseGetter
- theStripeResponseGetter
instance to use for making further requests.
-
getAmountRemaining
-
getAmountSubtotal
Order cost before any discounts or taxes are applied. A positive integer representing the subtotal of the order in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). -
getAmountTotal
Total order cost after discounts and taxes are applied. A positive integer representing the cost of the order in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). To submit an order, the total must be either 0 or at least $0.50 USD or equivalent in charge currency. -
getAutomaticTax
-
getBillingDetails
Customer billing details associated with the order. -
getClientSecret
The client secret of this Order. Used for client-side retrieval using a publishable key.The client secret can be used to complete a payment for an Order from your frontend. It should not be stored, logged, embedded in URLs, or exposed to anyone other than the customer. Make sure that you have TLS enabled on any page that includes the client secret.
Refer to our docs for creating and processing an order to learn about how client_secret should be handled.
-
getCreated
Time at which the object was created. Measured in seconds since the Unix epoch. -
getCredits
The credits applied to the Order. At most 10 credits can be applied to an Order. -
getCurrency
Three-letter ISO currency code, in lowercase. Must be a supported currency. -
getDescription
An arbitrary string attached to the object. Often useful for displaying to users. -
getIpAddress
A recent IP address of the purchaser used for tax reporting and tax location inference. -
getLineItems
A list of line items the customer is ordering. Each line item includes information about the product, the quantity, and the resulting cost. There is a maximum of 100 line items. -
getLivemode
Has the valuetrue
if the object exists in live mode or the valuefalse
if the object exists in test mode. -
getObject
String representing the object's type. Objects of the same type share the same value.Equal to
order
. -
getPayment
-
getShippingCost
The details of the customer cost of shipping, including the customer chosen ShippingRate. -
getShippingDetails
Customer shipping information associated with the order. -
getStatus
The overall status of the order.One of
canceled
,complete
,open
,processing
, orsubmitted
. -
getTaxDetails
-
getTotalDetails
-
setAmountRemaining
-
setAmountSubtotal
Order cost before any discounts or taxes are applied. A positive integer representing the subtotal of the order in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). -
setAmountTotal
Total order cost after discounts and taxes are applied. A positive integer representing the cost of the order in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). To submit an order, the total must be either 0 or at least $0.50 USD or equivalent in charge currency. -
setAutomaticTax
-
setBillingDetails
Customer billing details associated with the order. -
setClientSecret
The client secret of this Order. Used for client-side retrieval using a publishable key.The client secret can be used to complete a payment for an Order from your frontend. It should not be stored, logged, embedded in URLs, or exposed to anyone other than the customer. Make sure that you have TLS enabled on any page that includes the client secret.
Refer to our docs for creating and processing an order to learn about how client_secret should be handled.
-
setCreated
Time at which the object was created. Measured in seconds since the Unix epoch. -
setCredits
The credits applied to the Order. At most 10 credits can be applied to an Order. -
setCurrency
Three-letter ISO currency code, in lowercase. Must be a supported currency. -
setDescription
An arbitrary string attached to the object. Often useful for displaying to users. -
setId
Unique identifier for the object. -
setIpAddress
A recent IP address of the purchaser used for tax reporting and tax location inference. -
setLineItems
A list of line items the customer is ordering. Each line item includes information about the product, the quantity, and the resulting cost. There is a maximum of 100 line items. -
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. -
setObject
String representing the object's type. Objects of the same type share the same value.Equal to
order
. -
setPayment
-
setShippingCost
The details of the customer cost of shipping, including the customer chosen ShippingRate. -
setShippingDetails
Customer shipping information associated with the order. -
setStatus
The overall status of the order.One of
canceled
,complete
,open
,processing
, orsubmitted
. -
setTaxDetails
-
setTotalDetails
-
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<Order>
-