# PostSkusId

From **Stripe API**.

`POST /v1/skus/{id}`

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

<p>Note that a SKU’s <code>attributes</code> are not editable. Instead, you would need to deactivate the existing SKU and create a new one with the new attribute values.</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":{"active":{"description":"Whether this SKU is available for purchase.","type":"boolean"},"attributes":{"additionalProperties":{"maxLength":500,"type":"string"},"description":"A dictionary of attributes and values for the attributes defined by the product. When specified, `attributes` will partially update the existing attributes dictionary on the product, with the postcondition that a value must be present for each attribute key on the product.","type":"object"},"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"},"expand":{"description":"Specifies which fields in the response should be expanded.","items":{"maxLength":5000,"type":"string"},"type":"array"},"image":{"description":"The URL of an image for this SKU, meant to be displayable to the customer.","maxLength":5000,"type":"string"},"inventory":{"description":"Description of the SKU's inventory.","properties":{"quantity":{"type":"integer"},"type":{"enum":["bucket","finite","infinite"],"type":"string"},"value":{"enum":["","in_stock","limited","out_of_stock"],"type":"string"}},"title":"inventory_update_specs","type":"object"},"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`."},"package_dimensions":{"anyOf":[{"properties":{"height":{"type":"number"},"length":{"type":"number"},"weight":{"type":"number"},"width":{"type":"number"}},"required":["height","length","weight","width"],"title":"package_dimensions_specs","type":"object"},{"enum":[""],"type":"string"}],"description":"The dimensions of this SKU for shipping purposes."},"price":{"description":"The cost of the item as a positive integer in the smallest currency unit (that is, 100 cents to charge $1.00, or 100 to charge ¥100, Japanese Yen being a zero-decimal currency).","type":"integer"},"product":{"description":"The ID of the product that this SKU should belong to. The product must exist, have the same set of attribute names as the SKU's current product, and be of type `good`.","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`

Stores representations of [stock keeping units](http://en.wikipedia.org/wiki/Stock_keeping_unit).
SKUs describe specific product variations, taking into account any combination of: attributes,
currency, and cost. For example, a product may be a T-shirt, whereas a specific SKU represents
the `size: large`, `color: red` version of that shirt.

Can also be used to manage inventory.

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

```json
{"description":"Stores representations of [stock keeping units](http://en.wikipedia.org/wiki/Stock_keeping_unit).\nSKUs describe specific product variations, taking into account any combination of: attributes,\ncurrency, and cost. For example, a product may be a T-shirt, whereas a specific SKU represents\nthe `size: large`, `color: red` version of that shirt.\n\nCan also be used to manage inventory.\n\nRelated guide: [Tax, Shipping, and Inventory](https://stripe.com/docs/orders).","properties":{"active":{"description":"Whether the SKU is available for purchase.","type":"boolean"},"attributes":{"additionalProperties":{"maxLength":5000,"type":"string"},"description":"A dictionary of attributes and values for the attributes defined by the product. If, for example, a product's attributes are `[\"size\", \"gender\"]`, a valid SKU has the following dictionary of attributes: `{\"size\": \"Medium\", \"gender\": \"Unisex\"}`.","type":"object"},"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"},"id":{"description":"Unique identifier for the object.","maxLength":5000,"type":"string"},"image":{"description":"The URL of an image for this SKU, meant to be displayable to the customer.","maxLength":2048,"nullable":true,"type":"string"},"inventory":{"$ref":"#/components/schemas/sku_inventory"},"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.","type":"object"},"object":{"description":"String representing the object's type. Objects of the same type share the same value.","enum":["sku"],"type":"string"},"package_dimensions":{"anyOf":[{"$ref":"#/components/schemas/package_dimensions"}],"description":"The dimensions of this SKU for shipping purposes.","nullable":true},"price":{"description":"The cost of the item as a positive integer in the smallest currency unit (that is, 100 cents to charge $1.00, or 100 to charge ¥100, Japanese Yen being a zero-decimal currency).","type":"integer"},"product":{"anyOf":[{"maxLength":5000,"type":"string"},{"$ref":"#/components/schemas/product"}],"description":"The ID of the product this SKU is associated with. The product must be currently active.","x-expansionResources":{"oneOf":[{"$ref":"#/components/schemas/product"}]}},"updated":{"description":"Time at which the object was last updated. Measured in seconds since the Unix epoch.","format":"unix-time","type":"integer"}},"required":["active","attributes","created","currency","id","inventory","livemode","metadata","object","price","product","updated"],"title":"Sku","type":"object","x-expandableFields":["inventory","package_dimensions","product"],"x-resourceId":"sku"}
```

### `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/skus/{id} \
  --header 'content-type: application/x-www-form-urlencoded' \
  --data '{
  "active": true,
  "attributes": {},
  "currency": "string",
  "expand": [
    "string"
  ],
  "image": "string",
  "inventory": {
    "quantity": 1,
    "type": "string",
    "value": "string"
  },
  "metadata": "string",
  "package_dimensions": "string",
  "price": 1,
  "product": "string"
}'
```
