Update Discount
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,
"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": [
{
"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 - Discounts
Update Discount
PATCH
/
admin
/
discounts
/
{id}
Update Discount
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,
"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": [
{
"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"
}Authorizations
API Key. Example: sk_live_xxxxx or pk_live_xxxxx
Path Parameters
Resource ID
Body
application/json
Discount amount (fixed) or rate (percentage)
Available options:
fixed, percentage, free_shipping Minimum order amount (smallest currency unit)
Maximum discount amount cap (smallest currency unit)
Show child attributes
Show child attributes
Response
200 - application/json
Success
Available options:
code, automatic Available options:
fixed, percentage, free_shipping Available options:
order, line_item, shipping Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
⌘I