Create Product children
curl --request POST \
--url https://api.production.orderprotection.com/v2/products \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"productId": "123456",
"status": "ACTIVE",
"name": "123456",
"price": 22.22,
"inventoryQuantity": "123456",
"productType": "This is the type of product. Can be SIMPLE or GROUPED",
"variantId": "123456",
"description": "This product is super awesome and will solve all of your problems",
"sku": "123456",
"tax": "123456",
"inventoryType": "FULL",
"productImage": "https://somedomain.com/image.png",
"inStock": true,
"bundleProductIds": [
"product-id-1",
"product-id-2"
]
}
'import requests
url = "https://api.production.orderprotection.com/v2/products"
payload = {
"productId": "123456",
"status": "ACTIVE",
"name": "123456",
"price": 22.22,
"inventoryQuantity": "123456",
"productType": "This is the type of product. Can be SIMPLE or GROUPED",
"variantId": "123456",
"description": "This product is super awesome and will solve all of your problems",
"sku": "123456",
"tax": "123456",
"inventoryType": "FULL",
"productImage": "https://somedomain.com/image.png",
"inStock": True,
"bundleProductIds": ["product-id-1", "product-id-2"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
productId: '123456',
status: 'ACTIVE',
name: '123456',
price: 22.22,
inventoryQuantity: '123456',
productType: 'This is the type of product. Can be SIMPLE or GROUPED',
variantId: '123456',
description: 'This product is super awesome and will solve all of your problems',
sku: '123456',
tax: '123456',
inventoryType: 'FULL',
productImage: 'https://somedomain.com/image.png',
inStock: true,
bundleProductIds: ['product-id-1', 'product-id-2']
})
};
fetch('https://api.production.orderprotection.com/v2/products', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'productId' => '123456',
'status' => 'ACTIVE',
'name' => '123456',
'price' => 22.22,
'inventoryQuantity' => '123456',
'productType' => 'This is the type of product. Can be SIMPLE or GROUPED',
'variantId' => '123456',
'description' => 'This product is super awesome and will solve all of your problems',
'sku' => '123456',
'tax' => '123456',
'inventoryType' => 'FULL',
'productImage' => 'https://somedomain.com/image.png',
'inStock' => true,
'bundleProductIds' => [
'product-id-1',
'product-id-2'
]
]),
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"
payload := strings.NewReader("{\n \"productId\": \"123456\",\n \"status\": \"ACTIVE\",\n \"name\": \"123456\",\n \"price\": 22.22,\n \"inventoryQuantity\": \"123456\",\n \"productType\": \"This is the type of product. Can be SIMPLE or GROUPED\",\n \"variantId\": \"123456\",\n \"description\": \"This product is super awesome and will solve all of your problems\",\n \"sku\": \"123456\",\n \"tax\": \"123456\",\n \"inventoryType\": \"FULL\",\n \"productImage\": \"https://somedomain.com/image.png\",\n \"inStock\": true,\n \"bundleProductIds\": [\n \"product-id-1\",\n \"product-id-2\"\n ]\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.production.orderprotection.com/v2/products")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"productId\": \"123456\",\n \"status\": \"ACTIVE\",\n \"name\": \"123456\",\n \"price\": 22.22,\n \"inventoryQuantity\": \"123456\",\n \"productType\": \"This is the type of product. Can be SIMPLE or GROUPED\",\n \"variantId\": \"123456\",\n \"description\": \"This product is super awesome and will solve all of your problems\",\n \"sku\": \"123456\",\n \"tax\": \"123456\",\n \"inventoryType\": \"FULL\",\n \"productImage\": \"https://somedomain.com/image.png\",\n \"inStock\": true,\n \"bundleProductIds\": [\n \"product-id-1\",\n \"product-id-2\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.production.orderprotection.com/v2/products")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"productId\": \"123456\",\n \"status\": \"ACTIVE\",\n \"name\": \"123456\",\n \"price\": 22.22,\n \"inventoryQuantity\": \"123456\",\n \"productType\": \"This is the type of product. Can be SIMPLE or GROUPED\",\n \"variantId\": \"123456\",\n \"description\": \"This product is super awesome and will solve all of your problems\",\n \"sku\": \"123456\",\n \"tax\": \"123456\",\n \"inventoryType\": \"FULL\",\n \"productImage\": \"https://somedomain.com/image.png\",\n \"inStock\": true,\n \"bundleProductIds\": [\n \"product-id-1\",\n \"product-id-2\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": "ok"
}{
"message": "Unauthorized",
"statusCode": 401
}{
"message": "order not found",
"error": "Not Found",
"statusCode": 404
}Products
Create Product
Create a new product
POST
/
v2
/
products
Create Product children
curl --request POST \
--url https://api.production.orderprotection.com/v2/products \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"productId": "123456",
"status": "ACTIVE",
"name": "123456",
"price": 22.22,
"inventoryQuantity": "123456",
"productType": "This is the type of product. Can be SIMPLE or GROUPED",
"variantId": "123456",
"description": "This product is super awesome and will solve all of your problems",
"sku": "123456",
"tax": "123456",
"inventoryType": "FULL",
"productImage": "https://somedomain.com/image.png",
"inStock": true,
"bundleProductIds": [
"product-id-1",
"product-id-2"
]
}
'import requests
url = "https://api.production.orderprotection.com/v2/products"
payload = {
"productId": "123456",
"status": "ACTIVE",
"name": "123456",
"price": 22.22,
"inventoryQuantity": "123456",
"productType": "This is the type of product. Can be SIMPLE or GROUPED",
"variantId": "123456",
"description": "This product is super awesome and will solve all of your problems",
"sku": "123456",
"tax": "123456",
"inventoryType": "FULL",
"productImage": "https://somedomain.com/image.png",
"inStock": True,
"bundleProductIds": ["product-id-1", "product-id-2"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
productId: '123456',
status: 'ACTIVE',
name: '123456',
price: 22.22,
inventoryQuantity: '123456',
productType: 'This is the type of product. Can be SIMPLE or GROUPED',
variantId: '123456',
description: 'This product is super awesome and will solve all of your problems',
sku: '123456',
tax: '123456',
inventoryType: 'FULL',
productImage: 'https://somedomain.com/image.png',
inStock: true,
bundleProductIds: ['product-id-1', 'product-id-2']
})
};
fetch('https://api.production.orderprotection.com/v2/products', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'productId' => '123456',
'status' => 'ACTIVE',
'name' => '123456',
'price' => 22.22,
'inventoryQuantity' => '123456',
'productType' => 'This is the type of product. Can be SIMPLE or GROUPED',
'variantId' => '123456',
'description' => 'This product is super awesome and will solve all of your problems',
'sku' => '123456',
'tax' => '123456',
'inventoryType' => 'FULL',
'productImage' => 'https://somedomain.com/image.png',
'inStock' => true,
'bundleProductIds' => [
'product-id-1',
'product-id-2'
]
]),
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"
payload := strings.NewReader("{\n \"productId\": \"123456\",\n \"status\": \"ACTIVE\",\n \"name\": \"123456\",\n \"price\": 22.22,\n \"inventoryQuantity\": \"123456\",\n \"productType\": \"This is the type of product. Can be SIMPLE or GROUPED\",\n \"variantId\": \"123456\",\n \"description\": \"This product is super awesome and will solve all of your problems\",\n \"sku\": \"123456\",\n \"tax\": \"123456\",\n \"inventoryType\": \"FULL\",\n \"productImage\": \"https://somedomain.com/image.png\",\n \"inStock\": true,\n \"bundleProductIds\": [\n \"product-id-1\",\n \"product-id-2\"\n ]\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.production.orderprotection.com/v2/products")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"productId\": \"123456\",\n \"status\": \"ACTIVE\",\n \"name\": \"123456\",\n \"price\": 22.22,\n \"inventoryQuantity\": \"123456\",\n \"productType\": \"This is the type of product. Can be SIMPLE or GROUPED\",\n \"variantId\": \"123456\",\n \"description\": \"This product is super awesome and will solve all of your problems\",\n \"sku\": \"123456\",\n \"tax\": \"123456\",\n \"inventoryType\": \"FULL\",\n \"productImage\": \"https://somedomain.com/image.png\",\n \"inStock\": true,\n \"bundleProductIds\": [\n \"product-id-1\",\n \"product-id-2\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.production.orderprotection.com/v2/products")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"productId\": \"123456\",\n \"status\": \"ACTIVE\",\n \"name\": \"123456\",\n \"price\": 22.22,\n \"inventoryQuantity\": \"123456\",\n \"productType\": \"This is the type of product. Can be SIMPLE or GROUPED\",\n \"variantId\": \"123456\",\n \"description\": \"This product is super awesome and will solve all of your problems\",\n \"sku\": \"123456\",\n \"tax\": \"123456\",\n \"inventoryType\": \"FULL\",\n \"productImage\": \"https://somedomain.com/image.png\",\n \"inStock\": true,\n \"bundleProductIds\": [\n \"product-id-1\",\n \"product-id-2\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": "ok"
}{
"message": "Unauthorized",
"statusCode": 401
}{
"message": "order not found",
"error": "Not Found",
"statusCode": 404
}Authorizations
Body
application/json

