Skip to main content
POST
/
admin
/
products
상품 생성
curl --request POST \
  --url https://api.headlesscommerce.io/v1/admin/products \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "type": "physical",
  "status": "draft",
  "description": "<string>",
  "tags": [
    "<string>"
  ],
  "attributes": {},
  "options": [
    {
      "name": "<string>",
      "values": [
        "<string>"
      ]
    }
  ],
  "variants": [
    {
      "price": {
        "amount": 123,
        "currency": "<string>"
      },
      "sku": "<string>",
      "barcode": "<string>",
      "compare_at_price": {
        "amount": 123,
        "currency": "<string>"
      },
      "cost_price": {
        "amount": 123,
        "currency": "<string>"
      },
      "weight": 123,
      "options": {},
      "metadata": {}
    }
  ],
  "price": {
    "amount": 123,
    "currency": "<string>"
  },
  "images": [
    {
      "url": "<string>",
      "alt_text": "<string>"
    }
  ],
  "metadata": {}
}
'
{
  "id": "<string>",
  "name": "<string>",
  "slug": "<string>",
  "description": "<string>",
  "type": "physical",
  "status": "draft",
  "tags": [
    "<string>"
  ],
  "attributes": {},
  "images": [
    {
      "id": "<string>",
      "url": "<string>",
      "alt_text": "<string>",
      "position": 123,
      "width": 123,
      "height": 123
    }
  ],
  "options": [
    {
      "id": "<string>",
      "name": "<string>",
      "position": 123,
      "values": [
        {
          "id": "<string>",
          "value": "<string>",
          "position": 123
        }
      ]
    }
  ],
  "variants": [
    {
      "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"
    }
  ],
  "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

Body

application/json
name
string
required
type
enum<string>
default:physical
Available options:
physical,
digital,
service,
bundle
status
enum<string>
default:draft
Available options:
draft,
active
description
string
tags
string[]
attributes
object
options
object[]
variants
object[]
price
object

단일 Variant 상품용 (옵션 없을 때)

images
object[]
metadata
object

Response

201 - application/json

Created

id
string
name
string
slug
string
description
string
type
enum<string>
Available options:
physical,
digital,
service,
bundle
status
enum<string>
Available options:
draft,
active,
archived
tags
string[]
attributes
object
images
object[]
options
object[]
variants
object[]
metadata
object
created_at
string<date-time>
updated_at
string<date-time>