curl --request POST \
--url https://{defaultHost}/v1/saved_items \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"saved_item": {
"saved_list": "30dcf5c1-6ee1-433c-994c-48c2ad843d9d",
"product": "2359857b-e3cc-4c4b-81f5-1e2de38a76f5",
"price": "5c076be5-bf8c-4be8-b460-6d918e125b9b",
"quantity": 2
}
}
'import requests
url = "https://{defaultHost}/v1/saved_items"
payload = { "saved_item": {
"saved_list": "30dcf5c1-6ee1-433c-994c-48c2ad843d9d",
"product": "2359857b-e3cc-4c4b-81f5-1e2de38a76f5",
"price": "5c076be5-bf8c-4be8-b460-6d918e125b9b",
"quantity": 2
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
saved_item: {
saved_list: '30dcf5c1-6ee1-433c-994c-48c2ad843d9d',
product: '2359857b-e3cc-4c4b-81f5-1e2de38a76f5',
price: '5c076be5-bf8c-4be8-b460-6d918e125b9b',
quantity: 2
}
})
};
fetch('https://{defaultHost}/v1/saved_items', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{defaultHost}/v1/saved_items",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'saved_item' => [
'saved_list' => '30dcf5c1-6ee1-433c-994c-48c2ad843d9d',
'product' => '2359857b-e3cc-4c4b-81f5-1e2de38a76f5',
'price' => '5c076be5-bf8c-4be8-b460-6d918e125b9b',
'quantity' => 2
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{defaultHost}/v1/saved_items"
payload := strings.NewReader("{\n \"saved_item\": {\n \"saved_list\": \"30dcf5c1-6ee1-433c-994c-48c2ad843d9d\",\n \"product\": \"2359857b-e3cc-4c4b-81f5-1e2de38a76f5\",\n \"price\": \"5c076be5-bf8c-4be8-b460-6d918e125b9b\",\n \"quantity\": 2\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{defaultHost}/v1/saved_items")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"saved_item\": {\n \"saved_list\": \"30dcf5c1-6ee1-433c-994c-48c2ad843d9d\",\n \"product\": \"2359857b-e3cc-4c4b-81f5-1e2de38a76f5\",\n \"price\": \"5c076be5-bf8c-4be8-b460-6d918e125b9b\",\n \"quantity\": 2\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{defaultHost}/v1/saved_items")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"saved_item\": {\n \"saved_list\": \"30dcf5c1-6ee1-433c-994c-48c2ad843d9d\",\n \"product\": \"2359857b-e3cc-4c4b-81f5-1e2de38a76f5\",\n \"price\": \"5c076be5-bf8c-4be8-b460-6d918e125b9b\",\n \"quantity\": 2\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "da4a6faa-3515-48b5-85a0-7b05b694dc61",
"object": "saved_item",
"ad_hoc_amount": null,
"bundle_component_variants": {},
"live_mode": true,
"note": null,
"price_changed": false,
"purchasable_status": "purchasable",
"quantity": 2,
"variant_changed": false,
"saved_list": "30dcf5c1-6ee1-433c-994c-48c2ad843d9d",
"product": "2359857b-e3cc-4c4b-81f5-1e2de38a76f5",
"price": "5c076be5-bf8c-4be8-b460-6d918e125b9b",
"variant": null,
"created_at": 1792401378,
"updated_at": 1792401378
}Create
Saves an item to a saved list. Saving the same item again adds to its quantity.
curl --request POST \
--url https://{defaultHost}/v1/saved_items \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"saved_item": {
"saved_list": "30dcf5c1-6ee1-433c-994c-48c2ad843d9d",
"product": "2359857b-e3cc-4c4b-81f5-1e2de38a76f5",
"price": "5c076be5-bf8c-4be8-b460-6d918e125b9b",
"quantity": 2
}
}
'import requests
url = "https://{defaultHost}/v1/saved_items"
payload = { "saved_item": {
"saved_list": "30dcf5c1-6ee1-433c-994c-48c2ad843d9d",
"product": "2359857b-e3cc-4c4b-81f5-1e2de38a76f5",
"price": "5c076be5-bf8c-4be8-b460-6d918e125b9b",
"quantity": 2
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
saved_item: {
saved_list: '30dcf5c1-6ee1-433c-994c-48c2ad843d9d',
product: '2359857b-e3cc-4c4b-81f5-1e2de38a76f5',
price: '5c076be5-bf8c-4be8-b460-6d918e125b9b',
quantity: 2
}
})
};
fetch('https://{defaultHost}/v1/saved_items', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{defaultHost}/v1/saved_items",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'saved_item' => [
'saved_list' => '30dcf5c1-6ee1-433c-994c-48c2ad843d9d',
'product' => '2359857b-e3cc-4c4b-81f5-1e2de38a76f5',
'price' => '5c076be5-bf8c-4be8-b460-6d918e125b9b',
'quantity' => 2
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{defaultHost}/v1/saved_items"
payload := strings.NewReader("{\n \"saved_item\": {\n \"saved_list\": \"30dcf5c1-6ee1-433c-994c-48c2ad843d9d\",\n \"product\": \"2359857b-e3cc-4c4b-81f5-1e2de38a76f5\",\n \"price\": \"5c076be5-bf8c-4be8-b460-6d918e125b9b\",\n \"quantity\": 2\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{defaultHost}/v1/saved_items")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"saved_item\": {\n \"saved_list\": \"30dcf5c1-6ee1-433c-994c-48c2ad843d9d\",\n \"product\": \"2359857b-e3cc-4c4b-81f5-1e2de38a76f5\",\n \"price\": \"5c076be5-bf8c-4be8-b460-6d918e125b9b\",\n \"quantity\": 2\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{defaultHost}/v1/saved_items")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"saved_item\": {\n \"saved_list\": \"30dcf5c1-6ee1-433c-994c-48c2ad843d9d\",\n \"product\": \"2359857b-e3cc-4c4b-81f5-1e2de38a76f5\",\n \"price\": \"5c076be5-bf8c-4be8-b460-6d918e125b9b\",\n \"quantity\": 2\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "da4a6faa-3515-48b5-85a0-7b05b694dc61",
"object": "saved_item",
"ad_hoc_amount": null,
"bundle_component_variants": {},
"live_mode": true,
"note": null,
"price_changed": false,
"purchasable_status": "purchasable",
"quantity": 2,
"variant_changed": false,
"saved_list": "30dcf5c1-6ee1-433c-994c-48c2ad843d9d",
"product": "2359857b-e3cc-4c4b-81f5-1e2de38a76f5",
"price": "5c076be5-bf8c-4be8-b460-6d918e125b9b",
"variant": null,
"created_at": 1792401378,
"updated_at": 1792401378
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Show child attributes
Show child attributes
Response
Success
The UUID of the specific object.
A string describing the object type returned.
The amount to use for this item when the associated price is ad_hoc=true.
A hash mapping bundle component product UUIDs (keys) to the selected variant UUIDs (values). Picks may be incomplete while saved; every component with variants needs one when the item moves into a checkout.
A custom note for this item.
The quantity saved. Saving the same product, price, variant and bundle picks again adds to this quantity.
Set to true if this item belongs to a live mode customer.
Expandable – The associated price ID.
Set to true when the price has a newer version than the one pinned when the item was saved.
Expandable – The associated product ID.
Whether this item can move into a checkout and, if not, why. Possible values are price_missing, price_gone, price_old_version, variant_missing, variant_gone, variant_old_version, out_of_stock, exceeds_purchase_limit, or purchasable. For a bundle, the status of the first blocking component is reported.
Expandable – The associated saved list ID.
Expandable – The associated variant ID.
Set to true when the variant has a newer version than the one pinned when the item was saved.
Time at which the object was created. Measured in seconds since the Unix epoch.
Time at which the object was last updated. Measured in seconds since the Unix epoch.
Was this page helpful?