Skip to main content
PATCH
/
admin
/
variants
/
{id}
Variant 수정
curl --request PATCH \
  --url https://api.headlesscommerce.io/v1/admin/variants/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "sku": "<string>",
  "barcode": "<string>",
  "price": {
    "amount": 123,
    "currency": "<string>"
  },
  "compare_at_price": {
    "amount": 123,
    "currency": "<string>"
  },
  "cost_price": {
    "amount": 123,
    "currency": "<string>"
  },
  "weight": 123,
  "is_active": true,
  "metadata": {}
}
'
{
  "id": "<string>",
  "product_id": "<string>",
  "sku": "<string>",
  "barcode": "<string>",
  "price": {
    "amount": 123,
    "currency": "<string>"
  },
  "compare_at_price": {
    "amount": 123,
    "currency": "<string>"
  },
  "cost_price": {
    "amount": 123,
    "currency": "<string>"
  },
  "weight": 123,
  "is_active": true,
  "option_values": [
    {
      "id": "<string>",
      "value": "<string>",
      "position": 123
    }
  ],
  "images": [
    {
      "id": "<string>",
      "url": "<string>",
      "alt_text": "<string>",
      "position": 123,
      "width": 123,
      "height": 123
    }
  ],
  "inventory": {
    "id": "<string>",
    "variant_id": "<string>",
    "track_inventory": true,
    "allow_backorder": true,
    "safety_stock": 123,
    "on_hand": 123,
    "reserved": 123,
    "available": 123,
    "metadata": {}
  },
  "metadata": {},
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

API Key. 예: sk_live_xxxxx 또는 pk_live_xxxxx

Path Parameters

id
string
required

리소스 ID

Body

application/json
sku
string
barcode
string
price
object
compare_at_price
object
cost_price
object
weight
integer
is_active
boolean
metadata
object

Response

200 - application/json

Success

id
string
product_id
string
sku
string
barcode
string
price
object
compare_at_price
object
cost_price
object
weight
integer

grams

is_active
boolean
option_values
object[]
images
object[]
inventory
object
metadata
object
created_at
string<date-time>
updated_at
string<date-time>