POST /v1/public/storefronts/{slug}/promotions/validate
POST
/v1/public/storefronts/{slug}/promotions/validatePath parameters
slugstringrequiredRequest body
requiredapplication/jsoncodestringrequireditemsStorefrontCheckoutItemInput[] | nullrequiredShow propertiesHide properties
Array of
StorefrontCheckoutItemInputproduct_slugstringrequiredquantityinteger<int32>requiredselected_optionsobjectvariant_idstringResponses
200OK
codestringrequireddiscount_amountinteger<int64>requireddiscount_typestringrequireddiscount_valueinteger<int64>requiredmin_subtotal_amountinteger<int64>namestringrequiredsubtotal_amountinteger<int64>requireddefaultError
errorErrorBodyrequiredShow propertiesHide properties
codestringrequireddetailsErrorDetail[] | nullShow propertiesHide properties
Array of
ErrorDetailcodestringfieldstringlocationstringmessagestringrequiredmessagestringrequiredrequest_idstringRequest
curl -X POST "/v1/public/storefronts/string/promotions/validate" \
-H "Content-Type: application/json" \
-d '{
"code": "string",
"items": [
{
"product_slug": "string",
"quantity": 0,
"selected_options": {},
"variant_id": "string"
}
]
}'const response = await fetch("/v1/public/storefronts/string/promotions/validate", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
"code": "string",
"items": [
{
"product_slug": "string",
"quantity": 0,
"selected_options": {},
"variant_id": "string"
}
]
})
});import requests
response = requests.post(
"/v1/public/storefronts/string/promotions/validate",
headers={
"Content-Type": "application/json"
},
json={
"code": "string",
"items": [
{
"product_slug": "string",
"quantity": 0,
"selected_options": {},
"variant_id": "string"
}
]
},
)Response
{
"code": "string",
"discount_amount": 0,
"discount_type": "string",
"discount_value": 0,
"min_subtotal_amount": 0,
"name": "string",
"subtotal_amount": 0
}{
"error": {
"code": "string",
"details": [
{
"code": "string",
"field": "string",
"location": "string",
"message": "string"
}
],
"message": "string",
"request_id": "string"
}
}