curl --request PUT \
--url https://api.production.orderprotection.com/v2/products/{productId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "123456",
"status": "ACTIVE",
"description": "This product is super awesome and will solve all of your problems",
"sku": "123456",
"price": 22.22,
"tax": "123456",
"inventoryType": "FULL",
"inventoryQuantity": "123456",
"productImage": "https://somedomain.com/image.png",
"productType": "SIMPLE",
"inStock": true
}
'import requests
url = "https://api.production.orderprotection.com/v2/products/{productId}"
payload = {
"name": "123456",
"status": "ACTIVE",
"description": "This product is super awesome and will solve all of your problems",
"sku": "123456",
"price": 22.22,
"tax": "123456",
"inventoryType": "FULL",
"inventoryQuantity": "123456",
"productImage": "https://somedomain.com/image.png",
"productType": "SIMPLE",
"inStock": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '123456',
status: 'ACTIVE',
description: 'This product is super awesome and will solve all of your problems',
sku: '123456',
price: 22.22,
tax: '123456',
inventoryType: 'FULL',
inventoryQuantity: '123456',
productImage: 'https://somedomain.com/image.png',
productType: 'SIMPLE',
inStock: true
})
};
fetch('https://api.production.orderprotection.com/v2/products/{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.production.orderprotection.com/v2/products/{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([
'name' => '123456',
'status' => 'ACTIVE',
'description' => 'This product is super awesome and will solve all of your problems',
'sku' => '123456',
'price' => 22.22,
'tax' => '123456',
'inventoryType' => 'FULL',
'inventoryQuantity' => '123456',
'productImage' => 'https://somedomain.com/image.png',
'productType' => 'SIMPLE',
'inStock' => true
]),
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://api.production.orderprotection.com/v2/products/{productId}"
payload := strings.NewReader("{\n \"name\": \"123456\",\n \"status\": \"ACTIVE\",\n \"description\": \"This product is super awesome and will solve all of your problems\",\n \"sku\": \"123456\",\n \"price\": 22.22,\n \"tax\": \"123456\",\n \"inventoryType\": \"FULL\",\n \"inventoryQuantity\": \"123456\",\n \"productImage\": \"https://somedomain.com/image.png\",\n \"productType\": \"SIMPLE\",\n \"inStock\": true\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.production.orderprotection.com/v2/products/{productId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"123456\",\n \"status\": \"ACTIVE\",\n \"description\": \"This product is super awesome and will solve all of your problems\",\n \"sku\": \"123456\",\n \"price\": 22.22,\n \"tax\": \"123456\",\n \"inventoryType\": \"FULL\",\n \"inventoryQuantity\": \"123456\",\n \"productImage\": \"https://somedomain.com/image.png\",\n \"productType\": \"SIMPLE\",\n \"inStock\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.production.orderprotection.com/v2/products/{productId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"123456\",\n \"status\": \"ACTIVE\",\n \"description\": \"This product is super awesome and will solve all of your problems\",\n \"sku\": \"123456\",\n \"price\": 22.22,\n \"tax\": \"123456\",\n \"inventoryType\": \"FULL\",\n \"inventoryQuantity\": \"123456\",\n \"productImage\": \"https://somedomain.com/image.png\",\n \"productType\": \"SIMPLE\",\n \"inStock\": true\n}"
response = http.request(request)
puts response.read_body{
"status": "ok"
}{
"message": "'sourceOrderId' is required",
"statusCode": 400
}{
"message": "Unauthorized",
"statusCode": 401
}{
"message": "Not Found",
"error": "Not Found",
"statusCode": 404
}Update Product
Updates a products attributes
curl --request PUT \
--url https://api.production.orderprotection.com/v2/products/{productId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "123456",
"status": "ACTIVE",
"description": "This product is super awesome and will solve all of your problems",
"sku": "123456",
"price": 22.22,
"tax": "123456",
"inventoryType": "FULL",
"inventoryQuantity": "123456",
"productImage": "https://somedomain.com/image.png",
"productType": "SIMPLE",
"inStock": true
}
'import requests
url = "https://api.production.orderprotection.com/v2/products/{productId}"
payload = {
"name": "123456",
"status": "ACTIVE",
"description": "This product is super awesome and will solve all of your problems",
"sku": "123456",
"price": 22.22,
"tax": "123456",
"inventoryType": "FULL",
"inventoryQuantity": "123456",
"productImage": "https://somedomain.com/image.png",
"productType": "SIMPLE",
"inStock": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '123456',
status: 'ACTIVE',
description: 'This product is super awesome and will solve all of your problems',
sku: '123456',
price: 22.22,
tax: '123456',
inventoryType: 'FULL',
inventoryQuantity: '123456',
productImage: 'https://somedomain.com/image.png',
productType: 'SIMPLE',
inStock: true
})
};
fetch('https://api.production.orderprotection.com/v2/products/{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.production.orderprotection.com/v2/products/{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([
'name' => '123456',
'status' => 'ACTIVE',
'description' => 'This product is super awesome and will solve all of your problems',
'sku' => '123456',
'price' => 22.22,
'tax' => '123456',
'inventoryType' => 'FULL',
'inventoryQuantity' => '123456',
'productImage' => 'https://somedomain.com/image.png',
'productType' => 'SIMPLE',
'inStock' => true
]),
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://api.production.orderprotection.com/v2/products/{productId}"
payload := strings.NewReader("{\n \"name\": \"123456\",\n \"status\": \"ACTIVE\",\n \"description\": \"This product is super awesome and will solve all of your problems\",\n \"sku\": \"123456\",\n \"price\": 22.22,\n \"tax\": \"123456\",\n \"inventoryType\": \"FULL\",\n \"inventoryQuantity\": \"123456\",\n \"productImage\": \"https://somedomain.com/image.png\",\n \"productType\": \"SIMPLE\",\n \"inStock\": true\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.production.orderprotection.com/v2/products/{productId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"123456\",\n \"status\": \"ACTIVE\",\n \"description\": \"This product is super awesome and will solve all of your problems\",\n \"sku\": \"123456\",\n \"price\": 22.22,\n \"tax\": \"123456\",\n \"inventoryType\": \"FULL\",\n \"inventoryQuantity\": \"123456\",\n \"productImage\": \"https://somedomain.com/image.png\",\n \"productType\": \"SIMPLE\",\n \"inStock\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.production.orderprotection.com/v2/products/{productId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"123456\",\n \"status\": \"ACTIVE\",\n \"description\": \"This product is super awesome and will solve all of your problems\",\n \"sku\": \"123456\",\n \"price\": 22.22,\n \"tax\": \"123456\",\n \"inventoryType\": \"FULL\",\n \"inventoryQuantity\": \"123456\",\n \"productImage\": \"https://somedomain.com/image.png\",\n \"productType\": \"SIMPLE\",\n \"inStock\": true\n}"
response = http.request(request)
puts response.read_body{
"status": "ok"
}{
"message": "'sourceOrderId' is required",
"statusCode": 400
}{
"message": "Unauthorized",
"statusCode": 401
}{
"message": "Not Found",
"error": "Not Found",
"statusCode": 404
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
This is the name of the product.
"123456"
Status of the variant
"ACTIVE"
This is the description of the product. This will help with making sure the correct product is chosen
"This product is super awesome and will solve all of your problems"
SKU of the product
"123456"
Price of the product
22.22
Unique ID for the product
"123456"
What kind of inventory tracking we will do
FULL, SIMPLE "FULL"
This is the amount remaining in stock. This is used if you are using the FULL inventory type
"123456"
This is the url to show a product image.
"https://somedomain.com/image.png"
This tells us if this product is a bundle or a simple product with variants
FULL, SIMPLE "SIMPLE"
If using the SIMPLE mode you just simply tell us if the product is in stock or not
true
Response
The product has been successfully updated.
"ok"

