POST /v1/commerce/promotions
POST
/v1/commerce/promotionsAuthorization
bearerAuthbearerAuthrequiredor
apiKeyAuthapiKeyAuthrequiredRequest body
requiredapplication/jsonauto_applybooleanbundle_product_idsstring[] | nullcategory_idsstring[] | nullcodestringrequiredcollection_idsstring[] | nulldiscount_typestringrequiredAllowed:
percentfixed_amountdiscount_valueinteger<int64>requiredmin 1
ends_atstringmax_usesinteger<int64>min_subtotal_amountinteger<int64>namestringrequiredproduct_idsstring[] | nullstarts_atstringResponses
201Created
auto_applybooleanbundle_product_idsstring[] | nullcategory_idsstring[] | nullcodestringcollection_idsstring[] | nulldiscount_typestringrequireddiscount_valueinteger<int64>requiredends_atstring<date-time>idstringrequiredmax_usesinteger<int64>min_subtotal_amountinteger<int64>namestringproduct_idsstring[] | nullstarts_atstring<date-time>defaultError
errorErrorBodyrequiredShow propertiesHide properties
codestringrequireddetailsErrorDetail[] | nullShow propertiesHide properties
Array of
ErrorDetailcodestringfieldstringlocationstringmessagestringrequiredmessagestringrequiredrequest_idstringRequest
curl -X POST "/v1/commerce/promotions" \
-H "Content-Type: application/json" \
-d '{
"auto_apply": true,
"bundle_product_ids": [
"string"
],
"category_ids": [
"string"
],
"code": "string",
"collection_ids": [
"string"
],
"discount_type": "percent",
"discount_value": 0,
"ends_at": "string",
"max_uses": 0,
"min_subtotal_amount": 0,
"name": "string",
"product_ids": [
"string"
],
"starts_at": "string"
}'const response = await fetch("/v1/commerce/promotions", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
"auto_apply": true,
"bundle_product_ids": [
"string"
],
"category_ids": [
"string"
],
"code": "string",
"collection_ids": [
"string"
],
"discount_type": "percent",
"discount_value": 0,
"ends_at": "string",
"max_uses": 0,
"min_subtotal_amount": 0,
"name": "string",
"product_ids": [
"string"
],
"starts_at": "string"
})
});import requests
response = requests.post(
"/v1/commerce/promotions",
headers={
"Content-Type": "application/json"
},
json={
"auto_apply": True,
"bundle_product_ids": [
"string"
],
"category_ids": [
"string"
],
"code": "string",
"collection_ids": [
"string"
],
"discount_type": "percent",
"discount_value": 0,
"ends_at": "string",
"max_uses": 0,
"min_subtotal_amount": 0,
"name": "string",
"product_ids": [
"string"
],
"starts_at": "string"
},
)Response
{
"auto_apply": true,
"bundle_product_ids": [
"string"
],
"category_ids": [
"string"
],
"code": "string",
"collection_ids": [
"string"
],
"discount_type": "string",
"discount_value": 0,
"ends_at": "2024-01-01T00:00:00Z",
"id": "string",
"max_uses": 0,
"min_subtotal_amount": 0,
"name": "string",
"product_ids": [
"string"
],
"starts_at": "2024-01-01T00:00:00Z"
}{
"error": {
"code": "string",
"details": [
{
"code": "string",
"field": "string",
"location": "string",
"message": "string"
}
],
"message": "string",
"request_id": "string"
}
}