할인 생성
curl --request POST \
--url https://api.headlesscommerce.io/v1/admin/discounts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"value": 123,
"description": "<string>",
"code": "<string>",
"target": "order",
"usage_limit": 123,
"per_customer_limit": 123,
"minimum_amount": 123,
"maximum_discount": 123,
"starts_at": "2023-11-07T05:31:56Z",
"ends_at": "2023-11-07T05:31:56Z",
"conditions": [
{
"values": [
"<string>"
],
"operator": "in"
}
],
"metadata": {}
}
'{
"id": "<string>",
"name": "<string>",
"description": "<string>",
"code": "<string>",
"value": 123,
"usage_limit": 123,
"usage_count": 123,
"per_customer_limit": 123,
"minimum_amount": {
"amount": 123,
"currency": "<string>"
},
"maximum_discount": {
"amount": 123,
"currency": "<string>"
},
"starts_at": "2023-11-07T05:31:56Z",
"ends_at": "2023-11-07T05:31:56Z",
"is_active": true,
"conditions": [
{
"id": "<string>",
"values": [
"<string>"
]
}
],
"metadata": {},
"created_at": "2023-11-07T05:31:56Z"
}Admin - 할인
할인 생성
POST
/
admin
/
discounts
할인 생성
curl --request POST \
--url https://api.headlesscommerce.io/v1/admin/discounts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"value": 123,
"description": "<string>",
"code": "<string>",
"target": "order",
"usage_limit": 123,
"per_customer_limit": 123,
"minimum_amount": 123,
"maximum_discount": 123,
"starts_at": "2023-11-07T05:31:56Z",
"ends_at": "2023-11-07T05:31:56Z",
"conditions": [
{
"values": [
"<string>"
],
"operator": "in"
}
],
"metadata": {}
}
'{
"id": "<string>",
"name": "<string>",
"description": "<string>",
"code": "<string>",
"value": 123,
"usage_limit": 123,
"usage_count": 123,
"per_customer_limit": 123,
"minimum_amount": {
"amount": 123,
"currency": "<string>"
},
"maximum_discount": {
"amount": 123,
"currency": "<string>"
},
"starts_at": "2023-11-07T05:31:56Z",
"ends_at": "2023-11-07T05:31:56Z",
"is_active": true,
"conditions": [
{
"id": "<string>",
"values": [
"<string>"
]
}
],
"metadata": {},
"created_at": "2023-11-07T05:31:56Z"
}인증
API Key. Example: sk_live_xxxxx or pk_live_xxxxx
본문
application/json
사용 가능한 옵션:
code, automatic 사용 가능한 옵션:
fixed, percentage, free_shipping 사용 가능한 옵션:
order, line_item, shipping Show child attributes
Show child attributes
응답
201 - application/json
생성됨
사용 가능한 옵션:
code, automatic 사용 가능한 옵션:
fixed, percentage, free_shipping 사용 가능한 옵션:
order, line_item, shipping Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
⌘I