# order

From **Stripe API**.

Order objects are created to handle end customers' purchases of previously
defined [products](https://stripe.com/docs/api#products). You can create, retrieve, and pay individual orders, as well
as list all orders. Orders are identified by a unique, random ID.

Related guide: [Tax, Shipping, and Inventory](https://stripe.com/docs/orders).

- Type: `object`

## Properties

### `amount`

- Required: true
- Type: `integer`

A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the total amount for the order.

### `amount_returned`

- Required: false
- Type: `integer`
- Nullable: true

The total amount that was returned to the customer.

### `application`

- Required: false
- Type: `string`
- Nullable: true
- maxLength: `5000`

ID of the Connect Application that created the order.

### `application_fee`

- Required: false
- Type: `integer`
- Nullable: true

A fee in cents that will be applied to the order and transferred to the application owner’s Stripe account. The request must be made with an OAuth key or the Stripe-Account header in order to take an application fee. For more information, see the application fees documentation.

### `charge`

- Required: false
- Nullable: true

The ID of the payment used to pay for the order. Present if the order status is `paid`, `fulfilled`, or `refunded`.

### `created`

- Required: true
- Type: `integer`
- Format: `unix-time`

Time at which the object was created. Measured in seconds since the Unix epoch.

### `currency`

- Required: true
- Type: `string`

Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).

### `customer`

- Required: false
- Nullable: true

The customer used for the order.

### `email`

- Required: false
- Type: `string`
- Nullable: true
- maxLength: `5000`

The email address of the customer placing the order.

### `external_coupon_code`

- Required: false
- Type: `string`
- maxLength: `5000`

External coupon code to load for this order.

### `id`

- Required: true
- Type: `string`
- maxLength: `5000`

Unique identifier for the object.

### `items`

- Required: true
- Type: `array`

List of items constituting the order. An order can have up to 25 items.

### `livemode`

- Required: true
- Type: `boolean`

Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.

### `metadata`

- Required: false
- Type: `object`
- Nullable: true

Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.

### `object`

- Required: true
- Type: `string`
- Allowed values: `"order"`

String representing the object's type. Objects of the same type share the same value.

### `returns`

- Required: false
- Type: `object`
- Nullable: true

A list of returns that have taken place for this order.

### `selected_shipping_method`

- Required: false
- Type: `string`
- Nullable: true
- maxLength: `5000`

The shipping method that is currently selected for this order, if any. If present, it is equal to one of the `id`s of shipping methods in the `shipping_methods` array. At order creation time, if there are multiple shipping methods, Stripe will automatically selected the first method.

### `shipping`

- Required: false
- Nullable: true

The shipping address for the order. Present if the order is for goods to be shipped.

### `shipping_methods`

- Required: false
- Type: `array`
- Nullable: true

A list of supported shipping methods for this order. The desired shipping method can be specified either by updating the order, or when paying it.

### `status`

- Required: true
- Type: `string`
- maxLength: `5000`

Current order status. One of `created`, `paid`, `canceled`, `fulfilled`, or `returned`. More details in the [Orders Guide](https://stripe.com/docs/orders/guide#understanding-order-statuses).

### `status_transitions`

- Required: false
- Nullable: true

The timestamps at which the order status was updated.

### `updated`

- Required: false
- Type: `integer`
- Format: `unix-time`
- Nullable: true

Time at which the object was last updated. Measured in seconds since the Unix epoch.

### `upstream_id`

- Required: false
- Type: `string`
- maxLength: `5000`

The user's order ID if it is different from the Stripe order ID.

## JSON Schema

```json
{"description":"Order objects are created to handle end customers' purchases of previously\ndefined [products](https://stripe.com/docs/api#products). You can create, retrieve, and pay individual orders, as well\nas list all orders. Orders are identified by a unique, random ID.\n\nRelated guide: [Tax, Shipping, and Inventory](https://stripe.com/docs/orders).","properties":{"amount":{"description":"A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the total amount for the order.","type":"integer"},"amount_returned":{"description":"The total amount that was returned to the customer.","nullable":true,"type":"integer"},"application":{"description":"ID of the Connect Application that created the order.","maxLength":5000,"nullable":true,"type":"string"},"application_fee":{"description":"A fee in cents that will be applied to the order and transferred to the application owner’s Stripe account. The request must be made with an OAuth key or the Stripe-Account header in order to take an application fee. For more information, see the application fees documentation.","nullable":true,"type":"integer"},"charge":{"anyOf":[{"maxLength":5000,"type":"string"},{"$ref":"#/components/schemas/charge"}],"description":"The ID of the payment used to pay for the order. Present if the order status is `paid`, `fulfilled`, or `refunded`.","nullable":true,"x-expansionResources":{"oneOf":[{"$ref":"#/components/schemas/charge"}]}},"created":{"description":"Time at which the object was created. Measured in seconds since the Unix epoch.","format":"unix-time","type":"integer"},"currency":{"description":"Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).","type":"string"},"customer":{"anyOf":[{"maxLength":5000,"type":"string"},{"$ref":"#/components/schemas/customer"},{"$ref":"#/components/schemas/deleted_customer"}],"description":"The customer used for the order.","nullable":true,"x-expansionResources":{"oneOf":[{"$ref":"#/components/schemas/customer"},{"$ref":"#/components/schemas/deleted_customer"}]}},"email":{"description":"The email address of the customer placing the order.","maxLength":5000,"nullable":true,"type":"string"},"external_coupon_code":{"description":"External coupon code to load for this order.","maxLength":5000,"type":"string"},"id":{"description":"Unique identifier for the object.","maxLength":5000,"type":"string"},"items":{"description":"List of items constituting the order. An order can have up to 25 items.","items":{"$ref":"#/components/schemas/order_item"},"type":"array"},"livemode":{"description":"Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.","type":"boolean"},"metadata":{"additionalProperties":{"maxLength":500,"type":"string"},"description":"Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.","nullable":true,"type":"object"},"object":{"description":"String representing the object's type. Objects of the same type share the same value.","enum":["order"],"type":"string"},"returns":{"description":"A list of returns that have taken place for this order.","nullable":true,"properties":{"data":{"description":"Details about each object.","items":{"$ref":"#/components/schemas/order_return"},"type":"array"},"has_more":{"description":"True if this list has another page of items after this one that can be fetched.","type":"boolean"},"object":{"description":"String representing the object's type. Objects of the same type share the same value. Always has the value `list`.","enum":["list"],"type":"string"},"url":{"description":"The URL where this list can be accessed.","maxLength":5000,"type":"string"}},"required":["data","has_more","object","url"],"title":"OrdersResourceOrderReturnList","type":"object","x-expandableFields":["data"]},"selected_shipping_method":{"description":"The shipping method that is currently selected for this order, if any. If present, it is equal to one of the `id`s of shipping methods in the `shipping_methods` array. At order creation time, if there are multiple shipping methods, Stripe will automatically selected the first method.","maxLength":5000,"nullable":true,"type":"string"},"shipping":{"anyOf":[{"$ref":"#/components/schemas/shipping"}],"description":"The shipping address for the order. Present if the order is for goods to be shipped.","nullable":true},"shipping_methods":{"description":"A list of supported shipping methods for this order. The desired shipping method can be specified either by updating the order, or when paying it.","items":{"$ref":"#/components/schemas/shipping_method"},"nullable":true,"type":"array"},"status":{"description":"Current order status. One of `created`, `paid`, `canceled`, `fulfilled`, or `returned`. More details in the [Orders Guide](https://stripe.com/docs/orders/guide#understanding-order-statuses).","maxLength":5000,"type":"string"},"status_transitions":{"anyOf":[{"$ref":"#/components/schemas/status_transitions"}],"description":"The timestamps at which the order status was updated.","nullable":true},"updated":{"description":"Time at which the object was last updated. Measured in seconds since the Unix epoch.","format":"unix-time","nullable":true,"type":"integer"},"upstream_id":{"description":"The user's order ID if it is different from the Stripe order ID.","maxLength":5000,"type":"string"}},"required":["amount","created","currency","id","items","livemode","object","status"],"title":"Order","type":"object","x-expandableFields":["charge","customer","items","returns","shipping","shipping_methods","status_transitions"],"x-resourceId":"order"}
```
