Update a product
curl --request PUT \
--url https://api.spacebring.com/shop/products/v1/{productId} \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"product": {
"categoryRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"options": [
{
"price": {
"credits": {
"amount": 0,
"enabled": false
},
"money": {
"amount": 0,
"enabled": false
}
},
"title": "<string>",
"available": false,
"customTax": {
"enabled": false,
"rate": 0
},
"description": "",
"stock": {
"enabled": false,
"quantity": 0
},
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"title": "<string>",
"description": "",
"featured": false,
"media": [
{
"key": "<string>"
}
],
"order": {
"enabled": false
},
"refundPolicy": "noRefund",
"visibility": "public"
}
}
'import requests
url = "https://api.spacebring.com/shop/products/v1/{productId}"
payload = { "product": {
"categoryRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"options": [
{
"price": {
"credits": {
"amount": 0,
"enabled": False
},
"money": {
"amount": 0,
"enabled": False
}
},
"title": "<string>",
"available": False,
"customTax": {
"enabled": False,
"rate": 0
},
"description": "",
"stock": {
"enabled": False,
"quantity": 0
},
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"title": "<string>",
"description": "",
"featured": False,
"media": [{ "key": "<string>" }],
"order": { "enabled": False },
"refundPolicy": "noRefund",
"visibility": "public"
} }
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
product: {
categoryRef: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
options: [
{
price: {credits: {amount: 0, enabled: false}, money: {amount: 0, enabled: false}},
title: '<string>',
available: false,
customTax: {enabled: false, rate: 0},
description: '',
stock: {enabled: false, quantity: 0},
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
}
],
title: '<string>',
description: '',
featured: false,
media: [{key: '<string>'}],
order: {enabled: false},
refundPolicy: 'noRefund',
visibility: 'public'
}
})
};
fetch('https://api.spacebring.com/shop/products/v1/{productId}', 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://api.spacebring.com/shop/products/v1/{productId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'product' => [
'categoryRef' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'options' => [
[
'price' => [
'credits' => [
'amount' => 0,
'enabled' => false
],
'money' => [
'amount' => 0,
'enabled' => false
]
],
'title' => '<string>',
'available' => false,
'customTax' => [
'enabled' => false,
'rate' => 0
],
'description' => '',
'stock' => [
'enabled' => false,
'quantity' => 0
],
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
],
'title' => '<string>',
'description' => '',
'featured' => false,
'media' => [
[
'key' => '<string>'
]
],
'order' => [
'enabled' => false
],
'refundPolicy' => 'noRefund',
'visibility' => 'public'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"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://api.spacebring.com/shop/products/v1/{productId}"
payload := strings.NewReader("{\n \"product\": {\n \"categoryRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"options\": [\n {\n \"price\": {\n \"credits\": {\n \"amount\": 0,\n \"enabled\": false\n },\n \"money\": {\n \"amount\": 0,\n \"enabled\": false\n }\n },\n \"title\": \"<string>\",\n \"available\": false,\n \"customTax\": {\n \"enabled\": false,\n \"rate\": 0\n },\n \"description\": \"\",\n \"stock\": {\n \"enabled\": false,\n \"quantity\": 0\n },\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ],\n \"title\": \"<string>\",\n \"description\": \"\",\n \"featured\": false,\n \"media\": [\n {\n \"key\": \"<string>\"\n }\n ],\n \"order\": {\n \"enabled\": false\n },\n \"refundPolicy\": \"noRefund\",\n \"visibility\": \"public\"\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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.put("https://api.spacebring.com/shop/products/v1/{productId}")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"product\": {\n \"categoryRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"options\": [\n {\n \"price\": {\n \"credits\": {\n \"amount\": 0,\n \"enabled\": false\n },\n \"money\": {\n \"amount\": 0,\n \"enabled\": false\n }\n },\n \"title\": \"<string>\",\n \"available\": false,\n \"customTax\": {\n \"enabled\": false,\n \"rate\": 0\n },\n \"description\": \"\",\n \"stock\": {\n \"enabled\": false,\n \"quantity\": 0\n },\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ],\n \"title\": \"<string>\",\n \"description\": \"\",\n \"featured\": false,\n \"media\": [\n {\n \"key\": \"<string>\"\n }\n ],\n \"order\": {\n \"enabled\": false\n },\n \"refundPolicy\": \"noRefund\",\n \"visibility\": \"public\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spacebring.com/shop/products/v1/{productId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"product\": {\n \"categoryRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"options\": [\n {\n \"price\": {\n \"credits\": {\n \"amount\": 0,\n \"enabled\": false\n },\n \"money\": {\n \"amount\": 0,\n \"enabled\": false\n }\n },\n \"title\": \"<string>\",\n \"available\": false,\n \"customTax\": {\n \"enabled\": false,\n \"rate\": 0\n },\n \"description\": \"\",\n \"stock\": {\n \"enabled\": false,\n \"quantity\": 0\n },\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ],\n \"title\": \"<string>\",\n \"description\": \"\",\n \"featured\": false,\n \"media\": [\n {\n \"key\": \"<string>\"\n }\n ],\n \"order\": {\n \"enabled\": false\n },\n \"refundPolicy\": \"noRefund\",\n \"visibility\": \"public\"\n }\n}"
response = http.request(request)
puts response.read_body{
"product": {
"categoryRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"createDate": "2023-11-07T05:31:56Z",
"description": "<string>",
"featured": true,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"imageUrl": "<string>",
"locale": "<string>",
"locationRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"media": [
{
"key": "<string>",
"url": "<string>"
}
],
"networkRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"options": [
{
"available": true,
"createDate": "2023-11-07T05:31:56Z",
"customTax": {
"enabled": true,
"rate": 123
},
"description": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"price": {
"credits": {
"amount": 123,
"enabled": true,
"amountDiscounted": 123
},
"money": {
"amount": 123,
"currencyCode": "<string>",
"enabled": true,
"amountDiscounted": 123
}
},
"stock": {
"enabled": true,
"quantity": 123
},
"title": "<string>"
}
],
"order": {
"enabled": true
},
"title": "<string>",
"updateDate": "2023-11-07T05:31:56Z"
}
}{
"message": "<string>",
"type": "<string>"
}Shop
Update a product
Update a certain product.
OAuth
Required scopes:shopPUT
/
shop
/
products
/
v1
/
{productId}
Update a product
curl --request PUT \
--url https://api.spacebring.com/shop/products/v1/{productId} \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"product": {
"categoryRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"options": [
{
"price": {
"credits": {
"amount": 0,
"enabled": false
},
"money": {
"amount": 0,
"enabled": false
}
},
"title": "<string>",
"available": false,
"customTax": {
"enabled": false,
"rate": 0
},
"description": "",
"stock": {
"enabled": false,
"quantity": 0
},
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"title": "<string>",
"description": "",
"featured": false,
"media": [
{
"key": "<string>"
}
],
"order": {
"enabled": false
},
"refundPolicy": "noRefund",
"visibility": "public"
}
}
'import requests
url = "https://api.spacebring.com/shop/products/v1/{productId}"
payload = { "product": {
"categoryRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"options": [
{
"price": {
"credits": {
"amount": 0,
"enabled": False
},
"money": {
"amount": 0,
"enabled": False
}
},
"title": "<string>",
"available": False,
"customTax": {
"enabled": False,
"rate": 0
},
"description": "",
"stock": {
"enabled": False,
"quantity": 0
},
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"title": "<string>",
"description": "",
"featured": False,
"media": [{ "key": "<string>" }],
"order": { "enabled": False },
"refundPolicy": "noRefund",
"visibility": "public"
} }
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
product: {
categoryRef: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
options: [
{
price: {credits: {amount: 0, enabled: false}, money: {amount: 0, enabled: false}},
title: '<string>',
available: false,
customTax: {enabled: false, rate: 0},
description: '',
stock: {enabled: false, quantity: 0},
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
}
],
title: '<string>',
description: '',
featured: false,
media: [{key: '<string>'}],
order: {enabled: false},
refundPolicy: 'noRefund',
visibility: 'public'
}
})
};
fetch('https://api.spacebring.com/shop/products/v1/{productId}', 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://api.spacebring.com/shop/products/v1/{productId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'product' => [
'categoryRef' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'options' => [
[
'price' => [
'credits' => [
'amount' => 0,
'enabled' => false
],
'money' => [
'amount' => 0,
'enabled' => false
]
],
'title' => '<string>',
'available' => false,
'customTax' => [
'enabled' => false,
'rate' => 0
],
'description' => '',
'stock' => [
'enabled' => false,
'quantity' => 0
],
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
],
'title' => '<string>',
'description' => '',
'featured' => false,
'media' => [
[
'key' => '<string>'
]
],
'order' => [
'enabled' => false
],
'refundPolicy' => 'noRefund',
'visibility' => 'public'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"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://api.spacebring.com/shop/products/v1/{productId}"
payload := strings.NewReader("{\n \"product\": {\n \"categoryRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"options\": [\n {\n \"price\": {\n \"credits\": {\n \"amount\": 0,\n \"enabled\": false\n },\n \"money\": {\n \"amount\": 0,\n \"enabled\": false\n }\n },\n \"title\": \"<string>\",\n \"available\": false,\n \"customTax\": {\n \"enabled\": false,\n \"rate\": 0\n },\n \"description\": \"\",\n \"stock\": {\n \"enabled\": false,\n \"quantity\": 0\n },\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ],\n \"title\": \"<string>\",\n \"description\": \"\",\n \"featured\": false,\n \"media\": [\n {\n \"key\": \"<string>\"\n }\n ],\n \"order\": {\n \"enabled\": false\n },\n \"refundPolicy\": \"noRefund\",\n \"visibility\": \"public\"\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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.put("https://api.spacebring.com/shop/products/v1/{productId}")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"product\": {\n \"categoryRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"options\": [\n {\n \"price\": {\n \"credits\": {\n \"amount\": 0,\n \"enabled\": false\n },\n \"money\": {\n \"amount\": 0,\n \"enabled\": false\n }\n },\n \"title\": \"<string>\",\n \"available\": false,\n \"customTax\": {\n \"enabled\": false,\n \"rate\": 0\n },\n \"description\": \"\",\n \"stock\": {\n \"enabled\": false,\n \"quantity\": 0\n },\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ],\n \"title\": \"<string>\",\n \"description\": \"\",\n \"featured\": false,\n \"media\": [\n {\n \"key\": \"<string>\"\n }\n ],\n \"order\": {\n \"enabled\": false\n },\n \"refundPolicy\": \"noRefund\",\n \"visibility\": \"public\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spacebring.com/shop/products/v1/{productId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"product\": {\n \"categoryRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"options\": [\n {\n \"price\": {\n \"credits\": {\n \"amount\": 0,\n \"enabled\": false\n },\n \"money\": {\n \"amount\": 0,\n \"enabled\": false\n }\n },\n \"title\": \"<string>\",\n \"available\": false,\n \"customTax\": {\n \"enabled\": false,\n \"rate\": 0\n },\n \"description\": \"\",\n \"stock\": {\n \"enabled\": false,\n \"quantity\": 0\n },\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ],\n \"title\": \"<string>\",\n \"description\": \"\",\n \"featured\": false,\n \"media\": [\n {\n \"key\": \"<string>\"\n }\n ],\n \"order\": {\n \"enabled\": false\n },\n \"refundPolicy\": \"noRefund\",\n \"visibility\": \"public\"\n }\n}"
response = http.request(request)
puts response.read_body{
"product": {
"categoryRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"createDate": "2023-11-07T05:31:56Z",
"description": "<string>",
"featured": true,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"imageUrl": "<string>",
"locale": "<string>",
"locationRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"media": [
{
"key": "<string>",
"url": "<string>"
}
],
"networkRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"options": [
{
"available": true,
"createDate": "2023-11-07T05:31:56Z",
"customTax": {
"enabled": true,
"rate": 123
},
"description": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"price": {
"credits": {
"amount": 123,
"enabled": true,
"amountDiscounted": 123
},
"money": {
"amount": 123,
"currencyCode": "<string>",
"enabled": true,
"amountDiscounted": 123
}
},
"stock": {
"enabled": true,
"quantity": 123
},
"title": "<string>"
}
],
"order": {
"enabled": true
},
"title": "<string>",
"updateDate": "2023-11-07T05:31:56Z"
}
}{
"message": "<string>",
"type": "<string>"
}Authorizations
BasicAuthOAuth2
See our authentication documentation for how to authorize your requests
Headers
The id of the network. Required when using bearer token authentication
Path Parameters
The id of the product.
Body
application/json
Product to update.
Show child attributes
Show child attributes
Response
OK
Show child attributes
Show child attributes
Was this page helpful?
⌘I