curl --request POST \
--url https://api.loopreturns.com/api/v1/products/{productId}/product-variants \
--header 'Content-Type: application/json' \
--header 'X-Authorization: <api-key>' \
--data '
{
"name": "<string>",
"external_id": "<string>",
"sku": "<string>",
"weight_grams": 123,
"barcode": "<string>",
"price": {
"amount": 50000,
"currency_code": "USD"
},
"images": [
"<string>"
],
"options": [
{
"position": 123,
"value": "<string>"
}
],
"logistics_information": {
"origin_country_code": "<string>",
"origin_region_code": "<string>",
"default_hs_code": "<string>",
"requires_shipping": true,
"cost": {
"amount": 50000,
"currency_code": "USD"
},
"destination_country_hs_codes": [
{
"destination_country_code": "<string>",
"hs_code": "<string>"
}
]
},
"dimensions": {
"depth": 123,
"width": 123,
"height": 123
}
}
'import requests
url = "https://api.loopreturns.com/api/v1/products/{productId}/product-variants"
payload = {
"name": "<string>",
"external_id": "<string>",
"sku": "<string>",
"weight_grams": 123,
"barcode": "<string>",
"price": {
"amount": 50000,
"currency_code": "USD"
},
"images": ["<string>"],
"options": [
{
"position": 123,
"value": "<string>"
}
],
"logistics_information": {
"origin_country_code": "<string>",
"origin_region_code": "<string>",
"default_hs_code": "<string>",
"requires_shipping": True,
"cost": {
"amount": 50000,
"currency_code": "USD"
},
"destination_country_hs_codes": [
{
"destination_country_code": "<string>",
"hs_code": "<string>"
}
]
},
"dimensions": {
"depth": 123,
"width": 123,
"height": 123
}
}
headers = {
"X-Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Authorization': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
external_id: '<string>',
sku: '<string>',
weight_grams: 123,
barcode: '<string>',
price: {amount: 50000, currency_code: 'USD'},
images: ['<string>'],
options: [{position: 123, value: '<string>'}],
logistics_information: {
origin_country_code: '<string>',
origin_region_code: '<string>',
default_hs_code: '<string>',
requires_shipping: true,
cost: {amount: 50000, currency_code: 'USD'},
destination_country_hs_codes: [{destination_country_code: '<string>', hs_code: '<string>'}]
},
dimensions: {depth: 123, width: 123, height: 123}
})
};
fetch('https://api.loopreturns.com/api/v1/products/{productId}/product-variants', 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.loopreturns.com/api/v1/products/{productId}/product-variants",
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([
'name' => '<string>',
'external_id' => '<string>',
'sku' => '<string>',
'weight_grams' => 123,
'barcode' => '<string>',
'price' => [
'amount' => 50000,
'currency_code' => 'USD'
],
'images' => [
'<string>'
],
'options' => [
[
'position' => 123,
'value' => '<string>'
]
],
'logistics_information' => [
'origin_country_code' => '<string>',
'origin_region_code' => '<string>',
'default_hs_code' => '<string>',
'requires_shipping' => true,
'cost' => [
'amount' => 50000,
'currency_code' => 'USD'
],
'destination_country_hs_codes' => [
[
'destination_country_code' => '<string>',
'hs_code' => '<string>'
]
]
],
'dimensions' => [
'depth' => 123,
'width' => 123,
'height' => 123
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Authorization: <api-key>"
],
]);
$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.loopreturns.com/api/v1/products/{productId}/product-variants"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"external_id\": \"<string>\",\n \"sku\": \"<string>\",\n \"weight_grams\": 123,\n \"barcode\": \"<string>\",\n \"price\": {\n \"amount\": 50000,\n \"currency_code\": \"USD\"\n },\n \"images\": [\n \"<string>\"\n ],\n \"options\": [\n {\n \"position\": 123,\n \"value\": \"<string>\"\n }\n ],\n \"logistics_information\": {\n \"origin_country_code\": \"<string>\",\n \"origin_region_code\": \"<string>\",\n \"default_hs_code\": \"<string>\",\n \"requires_shipping\": true,\n \"cost\": {\n \"amount\": 50000,\n \"currency_code\": \"USD\"\n },\n \"destination_country_hs_codes\": [\n {\n \"destination_country_code\": \"<string>\",\n \"hs_code\": \"<string>\"\n }\n ]\n },\n \"dimensions\": {\n \"depth\": 123,\n \"width\": 123,\n \"height\": 123\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Authorization", "<api-key>")
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.loopreturns.com/api/v1/products/{productId}/product-variants")
.header("X-Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"external_id\": \"<string>\",\n \"sku\": \"<string>\",\n \"weight_grams\": 123,\n \"barcode\": \"<string>\",\n \"price\": {\n \"amount\": 50000,\n \"currency_code\": \"USD\"\n },\n \"images\": [\n \"<string>\"\n ],\n \"options\": [\n {\n \"position\": 123,\n \"value\": \"<string>\"\n }\n ],\n \"logistics_information\": {\n \"origin_country_code\": \"<string>\",\n \"origin_region_code\": \"<string>\",\n \"default_hs_code\": \"<string>\",\n \"requires_shipping\": true,\n \"cost\": {\n \"amount\": 50000,\n \"currency_code\": \"USD\"\n },\n \"destination_country_hs_codes\": [\n {\n \"destination_country_code\": \"<string>\",\n \"hs_code\": \"<string>\"\n }\n ]\n },\n \"dimensions\": {\n \"depth\": 123,\n \"width\": 123,\n \"height\": 123\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.loopreturns.com/api/v1/products/{productId}/product-variants")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"external_id\": \"<string>\",\n \"sku\": \"<string>\",\n \"weight_grams\": 123,\n \"barcode\": \"<string>\",\n \"price\": {\n \"amount\": 50000,\n \"currency_code\": \"USD\"\n },\n \"images\": [\n \"<string>\"\n ],\n \"options\": [\n {\n \"position\": 123,\n \"value\": \"<string>\"\n }\n ],\n \"logistics_information\": {\n \"origin_country_code\": \"<string>\",\n \"origin_region_code\": \"<string>\",\n \"default_hs_code\": \"<string>\",\n \"requires_shipping\": true,\n \"cost\": {\n \"amount\": 50000,\n \"currency_code\": \"USD\"\n },\n \"destination_country_hs_codes\": [\n {\n \"destination_country_code\": \"<string>\",\n \"hs_code\": \"<string>\"\n }\n ]\n },\n \"dimensions\": {\n \"depth\": 123,\n \"width\": 123,\n \"height\": 123\n }\n}"
response = http.request(request)
puts response.read_body{
"product_variant": {
"id": 2,
"external_id": "<string>",
"sku": "<string>",
"name": "<string>",
"weight_grams": 123,
"barcode": "<string>",
"product": {
"id": 2,
"external_id": "<string>",
"sku": "<string>",
"name": "<string>"
},
"price": {
"amount": 50000,
"currency_code": "USD"
},
"images": [
"<string>"
],
"inventories": [
{
"id": 2,
"available_count": 123,
"location": {
"id": 2,
"external_id": "<string>",
"name": "<string>"
}
}
],
"options": [
{
"position": 123,
"value": "<string>"
}
],
"logistics_information": {
"origin_country_code": "<string>",
"origin_region_code": "<string>",
"default_hs_code": "<string>",
"requires_shipping": true,
"cost": {
"amount": 50000,
"currency_code": "USD"
},
"destination_country_hs_codes": [
{
"destination_country_code": "<string>",
"hs_code": "<string>"
}
]
},
"dimensions": {
"depth": 123,
"width": 123,
"height": 123
}
}
}"<unknown>"Create Product Variant
Create a new product variant.
curl --request POST \
--url https://api.loopreturns.com/api/v1/products/{productId}/product-variants \
--header 'Content-Type: application/json' \
--header 'X-Authorization: <api-key>' \
--data '
{
"name": "<string>",
"external_id": "<string>",
"sku": "<string>",
"weight_grams": 123,
"barcode": "<string>",
"price": {
"amount": 50000,
"currency_code": "USD"
},
"images": [
"<string>"
],
"options": [
{
"position": 123,
"value": "<string>"
}
],
"logistics_information": {
"origin_country_code": "<string>",
"origin_region_code": "<string>",
"default_hs_code": "<string>",
"requires_shipping": true,
"cost": {
"amount": 50000,
"currency_code": "USD"
},
"destination_country_hs_codes": [
{
"destination_country_code": "<string>",
"hs_code": "<string>"
}
]
},
"dimensions": {
"depth": 123,
"width": 123,
"height": 123
}
}
'import requests
url = "https://api.loopreturns.com/api/v1/products/{productId}/product-variants"
payload = {
"name": "<string>",
"external_id": "<string>",
"sku": "<string>",
"weight_grams": 123,
"barcode": "<string>",
"price": {
"amount": 50000,
"currency_code": "USD"
},
"images": ["<string>"],
"options": [
{
"position": 123,
"value": "<string>"
}
],
"logistics_information": {
"origin_country_code": "<string>",
"origin_region_code": "<string>",
"default_hs_code": "<string>",
"requires_shipping": True,
"cost": {
"amount": 50000,
"currency_code": "USD"
},
"destination_country_hs_codes": [
{
"destination_country_code": "<string>",
"hs_code": "<string>"
}
]
},
"dimensions": {
"depth": 123,
"width": 123,
"height": 123
}
}
headers = {
"X-Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Authorization': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
external_id: '<string>',
sku: '<string>',
weight_grams: 123,
barcode: '<string>',
price: {amount: 50000, currency_code: 'USD'},
images: ['<string>'],
options: [{position: 123, value: '<string>'}],
logistics_information: {
origin_country_code: '<string>',
origin_region_code: '<string>',
default_hs_code: '<string>',
requires_shipping: true,
cost: {amount: 50000, currency_code: 'USD'},
destination_country_hs_codes: [{destination_country_code: '<string>', hs_code: '<string>'}]
},
dimensions: {depth: 123, width: 123, height: 123}
})
};
fetch('https://api.loopreturns.com/api/v1/products/{productId}/product-variants', 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.loopreturns.com/api/v1/products/{productId}/product-variants",
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([
'name' => '<string>',
'external_id' => '<string>',
'sku' => '<string>',
'weight_grams' => 123,
'barcode' => '<string>',
'price' => [
'amount' => 50000,
'currency_code' => 'USD'
],
'images' => [
'<string>'
],
'options' => [
[
'position' => 123,
'value' => '<string>'
]
],
'logistics_information' => [
'origin_country_code' => '<string>',
'origin_region_code' => '<string>',
'default_hs_code' => '<string>',
'requires_shipping' => true,
'cost' => [
'amount' => 50000,
'currency_code' => 'USD'
],
'destination_country_hs_codes' => [
[
'destination_country_code' => '<string>',
'hs_code' => '<string>'
]
]
],
'dimensions' => [
'depth' => 123,
'width' => 123,
'height' => 123
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Authorization: <api-key>"
],
]);
$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.loopreturns.com/api/v1/products/{productId}/product-variants"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"external_id\": \"<string>\",\n \"sku\": \"<string>\",\n \"weight_grams\": 123,\n \"barcode\": \"<string>\",\n \"price\": {\n \"amount\": 50000,\n \"currency_code\": \"USD\"\n },\n \"images\": [\n \"<string>\"\n ],\n \"options\": [\n {\n \"position\": 123,\n \"value\": \"<string>\"\n }\n ],\n \"logistics_information\": {\n \"origin_country_code\": \"<string>\",\n \"origin_region_code\": \"<string>\",\n \"default_hs_code\": \"<string>\",\n \"requires_shipping\": true,\n \"cost\": {\n \"amount\": 50000,\n \"currency_code\": \"USD\"\n },\n \"destination_country_hs_codes\": [\n {\n \"destination_country_code\": \"<string>\",\n \"hs_code\": \"<string>\"\n }\n ]\n },\n \"dimensions\": {\n \"depth\": 123,\n \"width\": 123,\n \"height\": 123\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Authorization", "<api-key>")
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.loopreturns.com/api/v1/products/{productId}/product-variants")
.header("X-Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"external_id\": \"<string>\",\n \"sku\": \"<string>\",\n \"weight_grams\": 123,\n \"barcode\": \"<string>\",\n \"price\": {\n \"amount\": 50000,\n \"currency_code\": \"USD\"\n },\n \"images\": [\n \"<string>\"\n ],\n \"options\": [\n {\n \"position\": 123,\n \"value\": \"<string>\"\n }\n ],\n \"logistics_information\": {\n \"origin_country_code\": \"<string>\",\n \"origin_region_code\": \"<string>\",\n \"default_hs_code\": \"<string>\",\n \"requires_shipping\": true,\n \"cost\": {\n \"amount\": 50000,\n \"currency_code\": \"USD\"\n },\n \"destination_country_hs_codes\": [\n {\n \"destination_country_code\": \"<string>\",\n \"hs_code\": \"<string>\"\n }\n ]\n },\n \"dimensions\": {\n \"depth\": 123,\n \"width\": 123,\n \"height\": 123\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.loopreturns.com/api/v1/products/{productId}/product-variants")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"external_id\": \"<string>\",\n \"sku\": \"<string>\",\n \"weight_grams\": 123,\n \"barcode\": \"<string>\",\n \"price\": {\n \"amount\": 50000,\n \"currency_code\": \"USD\"\n },\n \"images\": [\n \"<string>\"\n ],\n \"options\": [\n {\n \"position\": 123,\n \"value\": \"<string>\"\n }\n ],\n \"logistics_information\": {\n \"origin_country_code\": \"<string>\",\n \"origin_region_code\": \"<string>\",\n \"default_hs_code\": \"<string>\",\n \"requires_shipping\": true,\n \"cost\": {\n \"amount\": 50000,\n \"currency_code\": \"USD\"\n },\n \"destination_country_hs_codes\": [\n {\n \"destination_country_code\": \"<string>\",\n \"hs_code\": \"<string>\"\n }\n ]\n },\n \"dimensions\": {\n \"depth\": 123,\n \"width\": 123,\n \"height\": 123\n }\n}"
response = http.request(request)
puts response.read_body{
"product_variant": {
"id": 2,
"external_id": "<string>",
"sku": "<string>",
"name": "<string>",
"weight_grams": 123,
"barcode": "<string>",
"product": {
"id": 2,
"external_id": "<string>",
"sku": "<string>",
"name": "<string>"
},
"price": {
"amount": 50000,
"currency_code": "USD"
},
"images": [
"<string>"
],
"inventories": [
{
"id": 2,
"available_count": 123,
"location": {
"id": 2,
"external_id": "<string>",
"name": "<string>"
}
}
],
"options": [
{
"position": 123,
"value": "<string>"
}
],
"logistics_information": {
"origin_country_code": "<string>",
"origin_region_code": "<string>",
"default_hs_code": "<string>",
"requires_shipping": true,
"cost": {
"amount": 50000,
"currency_code": "USD"
},
"destination_country_hs_codes": [
{
"destination_country_code": "<string>",
"hs_code": "<string>"
}
]
},
"dimensions": {
"depth": 123,
"width": 123,
"height": 123
}
}
}"<unknown>"Authorizations
API Scope: "Product (write)"
Path Parameters
The unique Loop identifier of the parent product.
Body
The name of the product variant.
255"Classic Brown Dress Shoes - Size 12"
The provided external_id must be unique. If a non-unique external_id is provided, the API will respond with an error.
64"564400c7-7a6b-4f29-b6a5-7bb580b2992c"
The SKU of the product variant.
255"SHOES-US44-M-Brwn"
The weight of the product variant in grams.
440
The barcode of the product variant.
255712345000019
The price of the product variant in minor units, such as cents, with its corresponding currency.
Show child attributes
Show child attributes
{ "amount": 50000, "currency_code": "USD" }
1An array of optional features or characteristics of the product variant that can be selected by the customer.
Show child attributes
Show child attributes
The logistics information for the product variant such as code classification, shipping, and cost.
Show child attributes
Show child attributes
The dimensions of the product variant, interpreted as inches. Optional and nullable. When provided, depth, width, and height are all required.
Show child attributes
Show child attributes
Response
Success
Show child attributes
Show child attributes