Whishlist
Manage wishlist

get
https://<domain>/<api prefix>/<version>/commerce/wishlist-items/

var request = require("request");
​
var options = { method: 'GET',
url: 'https://<domain>/<api prefix>/<version>/commerce/wishlist-items/',
headers:
{ authorization: 'Bearer <access-token>',
apikey: '<apikey>',
'content-type': 'multipart/form-data' },
formData: { order_id: '9558', pk: '' } };
​
request(options, function (error, response, body) {
if (error) throw new Error(error);
​
console.log(body);
});

<?php
​
$curl = curl_init();
​
curl_setopt_array($curl, array(
CURLOPT_PORT => "8000",
CURLOPT_URL => "https://<domain>/<api prefix>/<version>/commerce/wishlist-items/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => "------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"order_id\"\r\n\r\n9558\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"pk\"\r\n\r\n\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW--",
CURLOPT_HTTPHEADER => array(
"apikey: <apikey>",
"authorization: Bearer <access-token>",
"content-type: multipart/form-data;",
),
));
​
$response = curl_exec($curl);
$err = curl_error($curl);
​
curl_close($curl);
​
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}

post
https://<domain>/<api prefix>/<version>/commerce/wishlist-add/

var request = require('request');
var options = {
'method': 'POST',
'url': 'https://<domain>/<api prefix>/<version>/commerce/wishlist-add/',
'headers': {
'apikey': '<api key>',
'Authorization': 'Bearer <access-token>',
},
formData: {
'product_id': '<product_id>'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});

<?php
​
$curl = curl_init();
​
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://<domain>/<api prefix>/<version>/commerce/wishlist-add/',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => array('product_id' => '<product_id>'),
CURLOPT_HTTPHEADER => array(
'apikey: <api key>',
'Authorization: Bearer <access-token>',
),
));
​
$response = curl_exec($curl);
​
curl_close($curl);
echo $response;
​

Status code
Error Type
Field
Description
400
Validation Error
product_id
This field is required.
400
Validation Error
product_id
Invalid product_id.
​

post
https://<domain>/<api prefix>/<version>/commerce/wishlist-remove/

var request = require("request");
​
var options = { method: 'POST',
url: 'https://<domain>/<api prefix>/<version>/commerce/wishlist-remove/',
headers:
{ authorization: 'Bearer <access-token>',
apikey: '<apikey>',
'content-type': 'multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' },
formData: { product_id: '<product_id>' } };
​
request(options, function (error, response, body) {
if (error) throw new Error(error);
​
console.log(body);
});

<?php
​
$curl = curl_init();
​
curl_setopt_array($curl, array(
CURLOPT_PORT => "8000",
CURLOPT_URL => "https://<domain>/<api prefix>/<version>/commerce/wishlist-remove/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"product_id\"\r\n\r\n<product_id>\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW--",
CURLOPT_HTTPHEADER => array(
"apikey: <apikey>",
"authorization: Bearer <access-token>",
"content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW",
),
));
​
$response = curl_exec($curl);
$err = curl_error($curl);
​
curl_close($curl);
​
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}

Status Code
Error Type
Field
Description
400
Validation Error
product_id
This field may not be blank.
400
Not Found
product not found
Product not found
​
Last modified 10mo ago
Copy link
On this page
Get wishlist items
get
Add to wishlist
post
Remove item from the wishlist
post