# PostOrdersId

From **Stripe API**.

`POST /v1/orders/{id}`

<p>Updates the specific order by setting the values of the parameters passed. Any parameters not provided will be left unchanged.</p>

## Parameters

### `id`

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

## Request body

- Required: false
### `application/x-www-form-urlencoded`

- Type: `object`

```json
{"additionalProperties":false,"properties":{"coupon":{"description":"A coupon code that represents a discount to be applied to this order. Must be one-time duration and in same currency as the order. An order can have multiple coupons.","maxLength":5000,"type":"string"},"expand":{"description":"Specifies which fields in the response should be expanded.","items":{"maxLength":5000,"type":"string"},"type":"array"},"metadata":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"enum":[""],"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. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`."},"selected_shipping_method":{"description":"The shipping method to select for fulfilling this order. If specified, must be one of the `id`s of a shipping method in the `shipping_methods` array. If specified, will overwrite the existing selected shipping method, updating `items` as necessary.","maxLength":5000,"type":"string"},"shipping":{"description":"Tracking information once the order has been fulfilled.","properties":{"carrier":{"maxLength":5000,"type":"string"},"tracking_number":{"maxLength":5000,"type":"string"}},"required":["carrier","tracking_number"],"title":"shipping_tracking_params","type":"object"},"status":{"description":"Current order status. One of `created`, `paid`, `canceled`, `fulfilled`, or `returned`. More detail in the [Orders Guide](https://stripe.com/docs/orders/guide#understanding-order-statuses).","enum":["canceled","created","fulfilled","paid","returned"],"maxLength":5000,"type":"string"}},"type":"object"}
```

## Security

### `basicAuth`

- Type: `http`
- Request header: `Authorization`
- Scheme: `basic`
Send credentials in the `Authorization` request header using the `Basic` scheme.

Basic HTTP authentication. Allowed headers-- Authorization: Basic <api_key> | Authorization: Basic <base64 hash of `api_key:`>

### `bearerAuth`

- Type: `http`
- Request header: `Authorization`
- Scheme: `bearer`
- Bearer format: `auth-scheme`
Send the token in the `Authorization` request header using the `Bearer` scheme.

Bearer HTTP authentication. Allowed headers-- Authorization: Bearer <api_key>

## Responses

### `200`

Successful response.

### `application/json`

- Type: `object`

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).

```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"}
```

### `default`

Error response.

### `application/json`

- Type: `object`

An error response from the Stripe API

```json
{"description":"An error response from the Stripe API","properties":{"error":{"$ref":"#/components/schemas/api_errors"}},"required":["error"],"type":"object"}
```

## Request examples

### cURL

```shell
curl --request POST \
  --url https://api.stripe.com/v1/orders/{id} \
  --header 'content-type: application/x-www-form-urlencoded' \
  --data '{
  "coupon": "string",
  "expand": [
    "string"
  ],
  "metadata": "string",
  "selected_shipping_method": "string",
  "shipping": {
    "carrier": "string",
    "tracking_number": "string"
  },
  "status": "string"
}'
```
