Skip to main content
PUT
/
products
/
{productId}
/
product-variants
Upsert Product Variant
curl --request PUT \
  --url https://api.loopreturns.com/api/v1/products/{productId}/product-variants \
  --header 'Content-Type: application/json' \
  --header 'X-Authorization: <api-key>' \
  --data '
{
  "external_id": "<string>",
  "name": "<string>",
  "taxable": true,
  "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>"
      }
    ]
  }
}
'
{
  "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>"
      }
    ]
  }
}

Authorizations

X-Authorization
string
header
required

API Scope: "Product (write)"

Path Parameters

productId
integer
required

The unique Loop identifier of the parent product.

Example:

1234567890

Body

application/json
external_id
string
required

The identifier used by an external source to identify the product variant.

Maximum string length: 64
Example:

"564400c7-7a6b-4f29-b6a5-7bb580b2992c"

name
string
required

The name of the product variant.

Example:

"Classic Brown Dress Shoes - Size 12"

taxable
boolean
required

Whether or not the product variant is taxable.

sku
string | null

:The SKU of the product variant."

Maximum string length: 255
Example:

"SHOES-US44-M-Brwn"

weight_grams
integer | null

The weight of the product variant in grams.

Example:

440

barcode
string | null

The barcode of the product variant.

Maximum string length: 255
Example:

712345000019

price
object

The price of the product variant in minor units, such as cents, with its corresponding currency.

Example:
{ "amount": 50000, "currency_code": "USD" }
images
string<uri>[] | null

An array of URLs which reference images of the product variant.

Minimum string length: 1
options
ProductVariantOption · object[] | null

An array of optional features or characteristics of the product variant that can be selected by the customer.

logistics_information
ProductVariantLogisticsInformation · object

The logistics information for the product variant such as code classification, shipping, and cost.

Response

Success

id
integer<int64>

The unique integer identifier for the product variant, created by Loop.

Required range: x >= 1
Example:

810772

external_id
string | null

The identifier used by an external source to identify the product variant.

Example:

"564400c7-7a6b-4f29-b6a5-7bb580b2992c"

sku
string | null

The SKU of the product variant.

Example:

"SHOES-US44-M-Brwn"

name
string

The name of the product variant.

Example:

"Classic Brown Dress Shoes - Size 12"

weight_grams
integer<int32> | null

The weight of the product variant in grams.

Example:

500

barcode
string | null

The barcode of the product variant.

Example:

"1234asdf324"

product
object

The details associated with the parent product.

price
object

The price of the product variant in minor units, such as cents, with its corresponding currency.

Example:
{ "amount": 50000, "currency_code": "USD" }
images
string<uri>[] | null

An array of links to images of the product variant.

inventories
object

The record of available count and location by product variant.

options
ProductVariantOption · object[] | null

An array of optional features or characteristics of the product variant that can be selected by the customer.

logistics_information
ProductVariantLogisticsInformation · object

The logistics information for the product variant such as code classification, shipping, and cost.