Skip to main content
PATCH
/
admin
/
discounts
/
{id}
할인 수정
curl --request PATCH \
  --url https://api.headlesscommerce.io/v1/admin/discounts/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "description": "<string>",
  "value": 123,
  "value_type": "fixed",
  "is_active": true,
  "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": [
    {
      "type": "product",
      "values": [
        "<string>"
      ],
      "operator": "in"
    }
  ],
  "metadata": {}
}
'
{
  "id": "<string>",
  "name": "<string>",
  "description": "<string>",
  "code": "<string>",
  "type": "code",
  "value_type": "fixed",
  "value": 123,
  "target": "order",
  "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>",
      "type": "product",
      "operator": "in",
      "values": [
        "<string>"
      ]
    }
  ],
  "metadata": {},
  "created_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
name
string
description
string
value
number

할인 금액(fixed) 또는 비율(percentage)

value_type
enum<string>
Available options:
fixed,
percentage,
free_shipping
is_active
boolean
usage_limit
integer
per_customer_limit
integer
minimum_amount
integer

최소 주문 금액 (최소 통화 단위)

maximum_discount
integer

최대 할인 금액 cap (최소 통화 단위)

starts_at
string<date-time>
ends_at
string<date-time>
conditions
object[]
metadata
object

Response

200 - application/json

Success

id
string
name
string
description
string
code
string | null
type
enum<string>
Available options:
code,
automatic
value_type
enum<string>
Available options:
fixed,
percentage,
free_shipping
value
number
target
enum<string>
Available options:
order,
line_item,
shipping
usage_limit
integer | null
usage_count
integer
per_customer_limit
integer | null
minimum_amount
object
maximum_discount
object
starts_at
string<date-time>
ends_at
string<date-time> | null
is_active
boolean
conditions
object[]
metadata
object
created_at
string<date-time>