# PostSkus

From **Stripe API**.

`POST /v1/skus`

<p>Creates a new SKU associated with a product.</p>

## Request body

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

- Type: `object`

```json
{"additionalProperties":false,"properties":{"active":{"description":"Whether the SKU is available for purchase. Default to `true`.","type":"boolean"},"attributes":{"additionalProperties":{"maxLength":500,"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"},"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"},"id":{"description":"The identifier for the SKU. Must be unique. If not provided, an identifier will be randomly generated.","type":"string"},"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"}},"required":["type"],"title":"inventory_create_specs","type":"object"},"metadata":{"additionalProperties":{"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`.","type":"object"},"package_dimensions":{"description":"The dimensions of this SKU for shipping purposes.","properties":{"height":{"type":"number"},"length":{"type":"number"},"weight":{"type":"number"},"width":{"type":"number"}},"required":["height","length","weight","width"],"title":"package_dimensions_specs","type":"object"},"price":{"description":"The cost of the item as a nonnegative 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 this SKU is associated with. Must be a product with type `good`.","maxLength":5000,"type":"string"}},"required":["currency","inventory","price","product"],"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 \
  --header 'content-type: application/x-www-form-urlencoded' \
  --data '{
  "active": true,
  "attributes": {},
  "currency": "string",
  "expand": [
    "string"
  ],
  "id": "string",
  "image": "string",
  "inventory": {
    "quantity": 1,
    "type": "string",
    "value": "string"
  },
  "metadata": {},
  "package_dimensions": {
    "height": 1,
    "length": 1,
    "weight": 1,
    "width": 1
  },
  "price": 1,
  "product": "string"
}'
```
