Create a SKU option
How to create a SKU option via API
To create a new SKU option, send a POST
request to the /api/sku_options
endpoint, passing the resource arguments in the request body.
Request
POST https://yourdomain.commercelayer.io/api/sku_options
Arguments
type
string
Required
attributes.name
string
Required
attributes.currency_code
string
Required, unless inherited by market
attributes.description
string
Optional
attributes.price_amount_cents
integer
Optional, default is '0'
attributes.delay_hours
integer
Optional, default is '0'
attributes.sku_code_regex
string
Optional
attributes.reference
string
Optional
attributes.reference_origin
string
Optional
attributes.metadata
object
Optional
relationships.market
object
Optional
relationships.tags
array
Optional
Example
The following request creates a new SKU option:
curl -g -X POST \
'https://yourdomain.commercelayer.io/api/sku_options' \
-H 'Accept: application/vnd.api+json' \
-H 'Authorization: Bearer your-access-token' \
-H 'Content-Type: application/vnd.api+json' \
-d '{
"data": {
"type": "sku_options",
"attributes": {
"name": "Embossing",
"currency_code": "EUR"
}
}
}'
Last updated