Skip to main content
POST
/
v1
/
products
/
{productId}
/
skus
Create SKU
curl --request POST \
  --url https://{cluster}.voucherify.io/v1/products/{productId}/skus \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'X-App-Id: <api-key>' \
  --header 'X-App-Token: <api-key>' \
  --data '{
  "source_id": "first_product_sku_1",
  "sku": "Samsung phone 256GB",
  "price": 1300,
  "currency": "USD",
  "attributes": {
    "color": "vintage-black",
    "memory": "256",
    "processor": "Intel"
  },
  "image_url": "{{internalVoucherifyURL}}",
  "metadata": {
    "imported": true
  }
}'
{
  "id": "sku_0bae3b28f610fd0da1",
  "source_id": "first_product_sku_1",
  "product_id": "prod_0bae2dc5a090fd0184",
  "sku": "Samsung phone 256GB",
  "price": 1300,
  "currency": "USD",
  "attributes": {
    "color": "vintage-black",
    "memory": "256",
    "processor": "Intel"
  },
  "image_url": "{{internalVoucherifyURL}}",
  "metadata": {
    "imported": true
  },
  "created_at": "2022-09-12T13:56:51.828Z",
  "updated_at": null,
  "object": "sku"
}

Authorizations

X-App-Id
string
header
required
X-App-Token
string
header
required
Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Path Parameters

productId
string
required

A Voucherify <!-- [product](OpenAPI.json/components/schemas/Product) -->product ID or product source ID.

Example:

"prod_3ttSkdxGuAfcv3"

Body

application/json

Specify the SKU parameters to be created.

Request body schema for POST `v1/products/{productId}/skus

id
string

Unique SKU ID.

Example:

"sku_0c0c0012a9029bccef"

source_id
string

A unique SKU identifier from your inventory system.

Example:

"sku_source_id_4"

sku
string

Unique user-defined SKU name.

Example:

"Large Pink Shirt"

price
integer

SKU unit price. The value is multiplied by 100 to represent 2 decimal places. For example 10000 cents for $100.00.

currency
string

SKU price currency.

Example:

"USD"

attributes
object

The attributes object stores values for all custom attributes inherited by the SKU from the parent product. A set of key/value pairs that are attached to a SKU object and are unique to each SKU within a product family.

image_url
string

The HTTPS URL pointing to the .png or .jpg file that will be used to render the SKU image.

metadata
object

The metadata object stores all custom attributes assigned to the SKU. A set of key/value pairs that you can attach to a SKU object. It can be useful for storing additional information about the SKU in a structured format.

Response

200 - application/json

Returns the created SKU object.

Response body schema for PUT v1/products/{productId}/skus. This is an object representing a product SKU.

id
string
required

A unique identifier that represents the SKU and is assigned by Voucherify.

Example:

"sku_0b1621b319d248b79f"

source_id
string | null
required

A unique SKU identifier from your inventory system.

Example:

"sku_source_id_4"

product_id
string
required

The parent product's unique ID.

Example:

"prod_0b15f6b9f650c16990"

sku
string | null
required

Unique user-defined SKU name.

Example:

"Large Pink Shirt"

price
integer | null
required

Unit price. It is represented by a value multiplied by 100 to accurately reflect 2 decimal places, such as $100.00 being expressed as 10000.

attributes
object
required

The attributes object stores values for all custom attributes inherited by the SKU from the parent product. A set of key/value pairs that are attached to a SKU object and are unique to each SKU within a product family.

image_url
string | null
required

The HTTPS URL pointing to the .png or .jpg file that will be used to render the SKU image.

metadata
object
required

The metadata object stores all custom attributes assigned to the SKU. A set of key/value pairs that you can attach to a SKU object. It can be useful for storing additional information about the SKU in a structured format. It can be used to create product collections.

created_at
string<date-time>
required

Timestamp representing the date and time when the SKU was created. The value is shown in the ISO 8601 format.

Example:

"2022-05-17T10:36:30.187Z"

updated_at
string<date-time> | null
required

Timestamp representing the date and time when the SKU was updated. The value is shown in the ISO 8601 format.

Example:

"2022-05-17T10:55:09.137Z"

object
enum<string>
default:sku
required

The type of the object represented by JSON. This object stores information about the SKU.

Available options:
sku
currency
string | null

SKU price currency.

Example:

"USD"

I