변형 생성
curl --request POST \
--url https://api.headlesscommerce.io/v1/admin/products/{id}/variants \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"price": {
"amount": 123,
"currency": "<string>"
},
"sku": "<string>",
"barcode": "<string>",
"weight": 123,
"options": {},
"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"
}Admin - 상품
변형 생성
POST
/
admin
/
products
/
{id}
/
variants
변형 생성
curl --request POST \
--url https://api.headlesscommerce.io/v1/admin/products/{id}/variants \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"price": {
"amount": 123,
"currency": "<string>"
},
"sku": "<string>",
"barcode": "<string>",
"weight": 123,
"options": {},
"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"
}인증
API Key. Example: sk_live_xxxxx or pk_live_xxxxx
경로 매개변수
Resource ID
본문
application/json
응답
201 - application/json
생성됨
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
그램 (g)
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
⌘I