Create time-limited relative item discount
1 min
POST
https://app.amberflo.io/payments/pricing/amberflo/account-pricing/promotions/time_limited_relative_item_discount
Body Parameters
- bodypayment.pricing.promotions.pre_created.TimeLimitedRelativeProductItemDiscount.inrequiredDescription
- idstringrequiredDescription
- typestringDescriptionDefaulttime_limited_relative_item_discount
- promotionNamestringrequiredDescription
- descriptionstringDescription
- lockingStatuscommon.LockingStatus.inDescription
- targetProductItemIdstringDescription
- promotionTimeLimitpayment.pricing.promotions.attributes.HistoryRequirements.inDescription
- cyclesinteger<int32>Description
- monthsinteger<int32>Description
- discountRationumberDescription
- totalMaxDiscountnumberDescription
- cycleMaxDiscountnumberDescription
- dimensionConstraintMapmap<string, string>Description
- isRegExbooleanDescription
Responses
200
- payment.pricing.promotions.pre_created.TimeLimitedRelativeProductItemDiscount.outDescription
- idstringrequiredDescription
- typestringDescriptionDefaulttime_limited_relative_item_discount
- promotionNamestringrequiredDescription
- descriptionstringDescription
- lockingStatuscommon.LockingStatus.inDescription
- lastUpdateTimeInMillisinteger<int64>Description
- targetProductItemIdstringDescription
- promotionTimeLimitpayment.pricing.promotions.attributes.HistoryRequirements.inDescription
- cyclesinteger<int32>Description
- monthsinteger<int32>Description
- discountRationumberDescription
- totalMaxDiscountnumberDescription
- cycleMaxDiscountnumberDescription
- dimensionConstraintMapmap<string, string>Description
- isRegExbooleanDescription
400
404
409
curl
curl --request POST \
--url https://app.amberflo.io/payments/pricing/amberflo/account-pricing/promotions/time_limited_relative_item_discount \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{
"id": "",
"type": "time_limited_relative_item_discount",
"promotionName": ""
}'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
var raw = JSON.stringify({
"id": "",
"type": "time_limited_relative_item_discount",
"promotionName": ""
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://app.amberflo.io/payments/pricing/amberflo/account-pricing/promotions/time_limited_relative_item_discount", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));ruby
require "uri"
require "json"
require "net/http"
url = URI("https://app.amberflo.io/payments/pricing/amberflo/account-pricing/promotions/time_limited_relative_item_discount")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["accept"] = "application/json"
request["content-type"] = "application/json"
request.body = JSON.dump({
"id": "",
"type": "time_limited_relative_item_discount",
"promotionName": ""
})
response = https.request(request)
puts response.read_body
python
import requests
import json
url = "https://app.amberflo.io/payments/pricing/amberflo/account-pricing/promotions/time_limited_relative_item_discount"
payload = json.dumps({
"id": "",
"type": "time_limited_relative_item_discount",
"promotionName": ""
})
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
200
// Time-limited promotion successfully created
{
"id": "",
"type": "",
"promotionName": "",
"description": "",
"lockingStatus": "",
"lastUpdateTimeInMillis": "",
"targetProductItemId": "",
"promotionTimeLimit": {
"cycles": "",
"months": ""
},
"discountRatio": 0,
"totalMaxDiscount": 0,
"cycleMaxDiscount": 0,
"dimensionConstraintMap": "",
"isRegEx": false
}400
// Bad request - invalid promotion configuration
404
// Product item not found
409
// Conflict with existing promotion