API reference
Update a SKU list
How to update an existing SKU list via API
To update an existing SKU list, send a PATCH request to the /api/sku_lists/:id endpoint, where id is the ID of the resource that you want to update.
Here below the list of all the possible arguments that you can pass with the request body.

Request

PATCH https://yourdomain.commercelayer.io/api/sku_lists/:id

Arguments

Body Parameter
Type
Required
type
string
Required
id
string
Required
attributes.name
string
Optional
attributes.description
string
Optional
attributes.image_url
string
Optional
attributes.manual
boolean
Optional
attributes.sku_code_regex
string
Optional
attributes.reference
string
Optional
attributes.reference_origin
string
Optional
attributes.metadata
object
Optional

Example

Request
Response
The following request updates the SKU list identified by the ID "xYZkjABcde":
1
curl -g -X PATCH \
2
'https://yourdomain.commercelayer.io/api/sku_lists/xYZkjABcde' \
3
-H 'Accept: application/vnd.api+json' \
4
-H 'Authorization: Bearer your-access-token' \
5
-H 'Content-Type: application/vnd.api+json' \
6
-d '{
7
"data": {
8
"type": "sku_lists",
9
"id": "xYZkjABcde",
10
"attributes": {
11
"description": "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
12
}
13
}
14
}'
Copied!
On success, the API responds with a 200 OK status code, returning the updated resource object:
1
{
2
"data": {
3
"id": "xYZkjABcde",
4
"type": "sku_lists",
5
"links": {
6
"self": "https://yourdomain.commercelayer.io/api/sku_lists/xYZkjABcde"
7
},
8
"attributes": {
9
"name": "Personal list",
10
"slug": "personal-list-1",
11
"description": "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
12
"image_url": "https://img.yourdomain.com/skus/xYZkjABcde.png",
13
"manual": false,
14
"sku_code_regex": "^(A|B).*quot;,
15
"created_at": "2018-01-01T12:00:00.000Z",
16
"updated_at": "2018-01-01T12:00:00.000Z",
17
"reference": "ANY-EXTERNAL-REFEFERNCE",
18
"reference_origin": "ANY-EXTERNAL-REFEFERNCE-ORIGIN",
19
"metadata": {
20
"foo": "bar"
21
}
22
},
23
"relationships": {
24
"skus": {
25
"links": {
26
"self": "https://yourdomain.commercelayer.io/api/sku_lists/xYZkjABcde/relationships/skus",
27
"related": "https://yourdomain.commercelayer.io/api/sku_lists/xYZkjABcde/skus"
28
}
29
},
30
"sku_list_items": {
31
"links": {
32
"self": "https://yourdomain.commercelayer.io/api/sku_lists/xYZkjABcde/relationships/sku_list_items",
33
"related": "https://yourdomain.commercelayer.io/api/sku_lists/xYZkjABcde/sku_list_items"
34
}
35
},
36
"bundles": {
37
"links": {
38
"self": "https://yourdomain.commercelayer.io/api/sku_lists/xYZkjABcde/relationships/bundles",
39
"related": "https://yourdomain.commercelayer.io/api/sku_lists/xYZkjABcde/bundles"
40
}
41
}
42
},
43
"meta": {
44
"mode": "test"
45
}
46
}
47
}
Copied!
Copy link