Update cart
curl --request PATCH \
--url http://staging.qshop.ng/apiv2/{shopId}/cart/62bcfdf2be73c47f81b25f91 \
--header 'Content-Type: application/json' \
--data '
{
"items": [
{
"_id": "620230690d148855678615aa",
"qty": 1,
"variant": {
"options": [
{
"id": "620230e20d148855678615cb",
"label": "Color",
"name": "LetStayHome"
}
]
}
}
]
}
'import requests
url = "http://staging.qshop.ng/apiv2/{shopId}/cart/62bcfdf2be73c47f81b25f91"
payload = { "items": [
{
"_id": "620230690d148855678615aa",
"qty": 1,
"variant": { "options": [
{
"id": "620230e20d148855678615cb",
"label": "Color",
"name": "LetStayHome"
}
] }
}
] }
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
items: [
{
_id: '620230690d148855678615aa',
qty: 1,
variant: {
options: [{id: '620230e20d148855678615cb', label: 'Color', name: 'LetStayHome'}]
}
}
]
})
};
fetch('http://staging.qshop.ng/apiv2/{shopId}/cart/62bcfdf2be73c47f81b25f91', 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 => "http://staging.qshop.ng/apiv2/{shopId}/cart/62bcfdf2be73c47f81b25f91",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'items' => [
[
'_id' => '620230690d148855678615aa',
'qty' => 1,
'variant' => [
'options' => [
[
'id' => '620230e20d148855678615cb',
'label' => 'Color',
'name' => 'LetStayHome'
]
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"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 := "http://staging.qshop.ng/apiv2/{shopId}/cart/62bcfdf2be73c47f81b25f91"
payload := strings.NewReader("{\n \"items\": [\n {\n \"_id\": \"620230690d148855678615aa\",\n \"qty\": 1,\n \"variant\": {\n \"options\": [\n {\n \"id\": \"620230e20d148855678615cb\",\n \"label\": \"Color\",\n \"name\": \"LetStayHome\"\n }\n ]\n }\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
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.patch("http://staging.qshop.ng/apiv2/{shopId}/cart/62bcfdf2be73c47f81b25f91")
.header("Content-Type", "application/json")
.body("{\n \"items\": [\n {\n \"_id\": \"620230690d148855678615aa\",\n \"qty\": 1,\n \"variant\": {\n \"options\": [\n {\n \"id\": \"620230e20d148855678615cb\",\n \"label\": \"Color\",\n \"name\": \"LetStayHome\"\n }\n ]\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://staging.qshop.ng/apiv2/{shopId}/cart/62bcfdf2be73c47f81b25f91")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"items\": [\n {\n \"_id\": \"620230690d148855678615aa\",\n \"qty\": 1,\n \"variant\": {\n \"options\": [\n {\n \"id\": \"620230e20d148855678615cb\",\n \"label\": \"Color\",\n \"name\": \"LetStayHome\"\n }\n ]\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_bodyCart management
Update cart
PATCH
/
{shopId}
/
cart
/
62bcfdf2be73c47f81b25f91
Update cart
curl --request PATCH \
--url http://staging.qshop.ng/apiv2/{shopId}/cart/62bcfdf2be73c47f81b25f91 \
--header 'Content-Type: application/json' \
--data '
{
"items": [
{
"_id": "620230690d148855678615aa",
"qty": 1,
"variant": {
"options": [
{
"id": "620230e20d148855678615cb",
"label": "Color",
"name": "LetStayHome"
}
]
}
}
]
}
'import requests
url = "http://staging.qshop.ng/apiv2/{shopId}/cart/62bcfdf2be73c47f81b25f91"
payload = { "items": [
{
"_id": "620230690d148855678615aa",
"qty": 1,
"variant": { "options": [
{
"id": "620230e20d148855678615cb",
"label": "Color",
"name": "LetStayHome"
}
] }
}
] }
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
items: [
{
_id: '620230690d148855678615aa',
qty: 1,
variant: {
options: [{id: '620230e20d148855678615cb', label: 'Color', name: 'LetStayHome'}]
}
}
]
})
};
fetch('http://staging.qshop.ng/apiv2/{shopId}/cart/62bcfdf2be73c47f81b25f91', 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 => "http://staging.qshop.ng/apiv2/{shopId}/cart/62bcfdf2be73c47f81b25f91",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'items' => [
[
'_id' => '620230690d148855678615aa',
'qty' => 1,
'variant' => [
'options' => [
[
'id' => '620230e20d148855678615cb',
'label' => 'Color',
'name' => 'LetStayHome'
]
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"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 := "http://staging.qshop.ng/apiv2/{shopId}/cart/62bcfdf2be73c47f81b25f91"
payload := strings.NewReader("{\n \"items\": [\n {\n \"_id\": \"620230690d148855678615aa\",\n \"qty\": 1,\n \"variant\": {\n \"options\": [\n {\n \"id\": \"620230e20d148855678615cb\",\n \"label\": \"Color\",\n \"name\": \"LetStayHome\"\n }\n ]\n }\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
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.patch("http://staging.qshop.ng/apiv2/{shopId}/cart/62bcfdf2be73c47f81b25f91")
.header("Content-Type", "application/json")
.body("{\n \"items\": [\n {\n \"_id\": \"620230690d148855678615aa\",\n \"qty\": 1,\n \"variant\": {\n \"options\": [\n {\n \"id\": \"620230e20d148855678615cb\",\n \"label\": \"Color\",\n \"name\": \"LetStayHome\"\n }\n ]\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://staging.qshop.ng/apiv2/{shopId}/cart/62bcfdf2be73c47f81b25f91")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"items\": [\n {\n \"_id\": \"620230690d148855678615aa\",\n \"qty\": 1,\n \"variant\": {\n \"options\": [\n {\n \"id\": \"620230e20d148855678615cb\",\n \"label\": \"Color\",\n \"name\": \"LetStayHome\"\n }\n ]\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_bodyBody
application/json
Show child attributes
Show child attributes
Example:
[
{
"_id": "620230690d148855678615aa",
"qty": 1,
"variant": {
"options": [
{
"id": "620230e20d148855678615cb",
"label": "Color",
"name": "LetStayHome"
}
]
}
}
]
Response
200 - undefined
Was this page helpful?
⌘I