Update product
curl --request PATCH \
--url http://staging.qshop.ng/apiv2/{shopId}/products/62e05dacbadea08abf03d158 \
--header 'Content-Type: application/json' \
--data '
{
"digital_download": {
"name": "sample.pdf",
"type": "application/pdf",
"url": "https://ucarecdn.com/92aaca76-e073-4a62-8244-5ea8c3c521b8/",
"uuid": "92aaca76-e073-4a62-8244-5ea8c3c521b8"
},
"tags": [
"625017fbe9920c42fbc8bf9d"
],
"typeAttributes": {
"packaging": {
"height": 5.24,
"length": 5.72,
"weight": "5",
"width": 5.56
}
},
"weight": {
"unit": "lb",
"value": 3
}
}
'import requests
url = "http://staging.qshop.ng/apiv2/{shopId}/products/62e05dacbadea08abf03d158"
payload = {
"digital_download": {
"name": "sample.pdf",
"type": "application/pdf",
"url": "https://ucarecdn.com/92aaca76-e073-4a62-8244-5ea8c3c521b8/",
"uuid": "92aaca76-e073-4a62-8244-5ea8c3c521b8"
},
"tags": ["625017fbe9920c42fbc8bf9d"],
"typeAttributes": { "packaging": {
"height": 5.24,
"length": 5.72,
"weight": "5",
"width": 5.56
} },
"weight": {
"unit": "lb",
"value": 3
}
}
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({
digital_download: {
name: 'sample.pdf',
type: 'application/pdf',
url: 'https://ucarecdn.com/92aaca76-e073-4a62-8244-5ea8c3c521b8/',
uuid: '92aaca76-e073-4a62-8244-5ea8c3c521b8'
},
tags: ['625017fbe9920c42fbc8bf9d'],
typeAttributes: {packaging: {height: 5.24, length: 5.72, weight: '5', width: 5.56}},
weight: {unit: 'lb', value: 3}
})
};
fetch('http://staging.qshop.ng/apiv2/{shopId}/products/62e05dacbadea08abf03d158', 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}/products/62e05dacbadea08abf03d158",
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([
'digital_download' => [
'name' => 'sample.pdf',
'type' => 'application/pdf',
'url' => 'https://ucarecdn.com/92aaca76-e073-4a62-8244-5ea8c3c521b8/',
'uuid' => '92aaca76-e073-4a62-8244-5ea8c3c521b8'
],
'tags' => [
'625017fbe9920c42fbc8bf9d'
],
'typeAttributes' => [
'packaging' => [
'height' => 5.24,
'length' => 5.72,
'weight' => '5',
'width' => 5.56
]
],
'weight' => [
'unit' => 'lb',
'value' => 3
]
]),
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}/products/62e05dacbadea08abf03d158"
payload := strings.NewReader("{\n \"digital_download\": {\n \"name\": \"sample.pdf\",\n \"type\": \"application/pdf\",\n \"url\": \"https://ucarecdn.com/92aaca76-e073-4a62-8244-5ea8c3c521b8/\",\n \"uuid\": \"92aaca76-e073-4a62-8244-5ea8c3c521b8\"\n },\n \"tags\": [\n \"625017fbe9920c42fbc8bf9d\"\n ],\n \"typeAttributes\": {\n \"packaging\": {\n \"height\": 5.24,\n \"length\": 5.72,\n \"weight\": \"5\",\n \"width\": 5.56\n }\n },\n \"weight\": {\n \"unit\": \"lb\",\n \"value\": 3\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}/products/62e05dacbadea08abf03d158")
.header("Content-Type", "application/json")
.body("{\n \"digital_download\": {\n \"name\": \"sample.pdf\",\n \"type\": \"application/pdf\",\n \"url\": \"https://ucarecdn.com/92aaca76-e073-4a62-8244-5ea8c3c521b8/\",\n \"uuid\": \"92aaca76-e073-4a62-8244-5ea8c3c521b8\"\n },\n \"tags\": [\n \"625017fbe9920c42fbc8bf9d\"\n ],\n \"typeAttributes\": {\n \"packaging\": {\n \"height\": 5.24,\n \"length\": 5.72,\n \"weight\": \"5\",\n \"width\": 5.56\n }\n },\n \"weight\": {\n \"unit\": \"lb\",\n \"value\": 3\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://staging.qshop.ng/apiv2/{shopId}/products/62e05dacbadea08abf03d158")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"digital_download\": {\n \"name\": \"sample.pdf\",\n \"type\": \"application/pdf\",\n \"url\": \"https://ucarecdn.com/92aaca76-e073-4a62-8244-5ea8c3c521b8/\",\n \"uuid\": \"92aaca76-e073-4a62-8244-5ea8c3c521b8\"\n },\n \"tags\": [\n \"625017fbe9920c42fbc8bf9d\"\n ],\n \"typeAttributes\": {\n \"packaging\": {\n \"height\": 5.24,\n \"length\": 5.72,\n \"weight\": \"5\",\n \"width\": 5.56\n }\n },\n \"weight\": {\n \"unit\": \"lb\",\n \"value\": 3\n }\n}"
response = http.request(request)
puts response.read_bodyProducts
Update product
PATCH
/
{shopId}
/
products
/
62e05dacbadea08abf03d158
Update product
curl --request PATCH \
--url http://staging.qshop.ng/apiv2/{shopId}/products/62e05dacbadea08abf03d158 \
--header 'Content-Type: application/json' \
--data '
{
"digital_download": {
"name": "sample.pdf",
"type": "application/pdf",
"url": "https://ucarecdn.com/92aaca76-e073-4a62-8244-5ea8c3c521b8/",
"uuid": "92aaca76-e073-4a62-8244-5ea8c3c521b8"
},
"tags": [
"625017fbe9920c42fbc8bf9d"
],
"typeAttributes": {
"packaging": {
"height": 5.24,
"length": 5.72,
"weight": "5",
"width": 5.56
}
},
"weight": {
"unit": "lb",
"value": 3
}
}
'import requests
url = "http://staging.qshop.ng/apiv2/{shopId}/products/62e05dacbadea08abf03d158"
payload = {
"digital_download": {
"name": "sample.pdf",
"type": "application/pdf",
"url": "https://ucarecdn.com/92aaca76-e073-4a62-8244-5ea8c3c521b8/",
"uuid": "92aaca76-e073-4a62-8244-5ea8c3c521b8"
},
"tags": ["625017fbe9920c42fbc8bf9d"],
"typeAttributes": { "packaging": {
"height": 5.24,
"length": 5.72,
"weight": "5",
"width": 5.56
} },
"weight": {
"unit": "lb",
"value": 3
}
}
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({
digital_download: {
name: 'sample.pdf',
type: 'application/pdf',
url: 'https://ucarecdn.com/92aaca76-e073-4a62-8244-5ea8c3c521b8/',
uuid: '92aaca76-e073-4a62-8244-5ea8c3c521b8'
},
tags: ['625017fbe9920c42fbc8bf9d'],
typeAttributes: {packaging: {height: 5.24, length: 5.72, weight: '5', width: 5.56}},
weight: {unit: 'lb', value: 3}
})
};
fetch('http://staging.qshop.ng/apiv2/{shopId}/products/62e05dacbadea08abf03d158', 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}/products/62e05dacbadea08abf03d158",
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([
'digital_download' => [
'name' => 'sample.pdf',
'type' => 'application/pdf',
'url' => 'https://ucarecdn.com/92aaca76-e073-4a62-8244-5ea8c3c521b8/',
'uuid' => '92aaca76-e073-4a62-8244-5ea8c3c521b8'
],
'tags' => [
'625017fbe9920c42fbc8bf9d'
],
'typeAttributes' => [
'packaging' => [
'height' => 5.24,
'length' => 5.72,
'weight' => '5',
'width' => 5.56
]
],
'weight' => [
'unit' => 'lb',
'value' => 3
]
]),
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}/products/62e05dacbadea08abf03d158"
payload := strings.NewReader("{\n \"digital_download\": {\n \"name\": \"sample.pdf\",\n \"type\": \"application/pdf\",\n \"url\": \"https://ucarecdn.com/92aaca76-e073-4a62-8244-5ea8c3c521b8/\",\n \"uuid\": \"92aaca76-e073-4a62-8244-5ea8c3c521b8\"\n },\n \"tags\": [\n \"625017fbe9920c42fbc8bf9d\"\n ],\n \"typeAttributes\": {\n \"packaging\": {\n \"height\": 5.24,\n \"length\": 5.72,\n \"weight\": \"5\",\n \"width\": 5.56\n }\n },\n \"weight\": {\n \"unit\": \"lb\",\n \"value\": 3\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}/products/62e05dacbadea08abf03d158")
.header("Content-Type", "application/json")
.body("{\n \"digital_download\": {\n \"name\": \"sample.pdf\",\n \"type\": \"application/pdf\",\n \"url\": \"https://ucarecdn.com/92aaca76-e073-4a62-8244-5ea8c3c521b8/\",\n \"uuid\": \"92aaca76-e073-4a62-8244-5ea8c3c521b8\"\n },\n \"tags\": [\n \"625017fbe9920c42fbc8bf9d\"\n ],\n \"typeAttributes\": {\n \"packaging\": {\n \"height\": 5.24,\n \"length\": 5.72,\n \"weight\": \"5\",\n \"width\": 5.56\n }\n },\n \"weight\": {\n \"unit\": \"lb\",\n \"value\": 3\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://staging.qshop.ng/apiv2/{shopId}/products/62e05dacbadea08abf03d158")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"digital_download\": {\n \"name\": \"sample.pdf\",\n \"type\": \"application/pdf\",\n \"url\": \"https://ucarecdn.com/92aaca76-e073-4a62-8244-5ea8c3c521b8/\",\n \"uuid\": \"92aaca76-e073-4a62-8244-5ea8c3c521b8\"\n },\n \"tags\": [\n \"625017fbe9920c42fbc8bf9d\"\n ],\n \"typeAttributes\": {\n \"packaging\": {\n \"height\": 5.24,\n \"length\": 5.72,\n \"weight\": \"5\",\n \"width\": 5.56\n }\n },\n \"weight\": {\n \"unit\": \"lb\",\n \"value\": 3\n }\n}"
response = http.request(request)
puts response.read_bodyWas this page helpful?
⌘I