Create relative product sales event promotion
1 min
POST
https://app.amberflo.io/payments/pricing/amberflo/account-pricing/promotions/relative_product_sales_event_promotion
Body Parameters
- bodypayment.pricing.promotions.pre_created.RelativeProductSalesEventPromotion.inrequiredDescription
- idstringrequiredDescription
- typestringDescriptionDefaultrelative_product_sales_event_promotion
- promotionNamestringrequiredDescription
- descriptionstringDescription
- lockingStatuscommon.LockingStatus.inDescription
- dimensionConstraintMapmap<string, string>Description
- customerTagsmap<string, string>Description
- acceptablePromotionTimeRangepayment.common.TimeRange.inDescription
- startTimeInSecondsinteger<int64>Description
- endTimeInSecondsinteger<int64>Description
- recurrenceIntervalpayment.pricing.promotions.PromotionRecurrenceInterval.inDescription
- intervalLengthpayment.pricing.promotions.PromotionRecurringIntervalLength.inDescription
- intervalLengthCountinteger<int32>Description
- maxRecurrenceinteger<int32>Description
- discountRationumberDescription
- totalMaxDiscountnumberDescription
- cycleMaxDiscountnumberDescription
- targetProductIdstringDescription
Responses
200
- payment.pricing.promotions.pre_created.RelativeProductSalesEventPromotion.outDescription
- idstringrequiredDescription
- typestringDescriptionDefaultrelative_product_sales_event_promotion
- promotionNamestringrequiredDescription
- descriptionstringDescription
- lockingStatuscommon.LockingStatus.inDescription
- lastUpdateTimeInMillisinteger<int64>Description
- dimensionConstraintMapmap<string, string>Description
- customerTagsmap<string, string>Description
- acceptablePromotionTimeRangepayment.common.TimeRange.inDescription
- startTimeInSecondsinteger<int64>Description
- endTimeInSecondsinteger<int64>Description
- recurrenceIntervalpayment.pricing.promotions.PromotionRecurrenceInterval.outDescription
- intervalLengthpayment.pricing.promotions.PromotionRecurringIntervalLength.inDescription
- intervalLengthCountinteger<int32>Description
- maxRecurrenceinteger<int32>Description
- discountRationumberDescription
- totalMaxDiscountnumberDescription
- cycleMaxDiscountnumberDescription
- targetProductIdstringDescription
400
404
409
curl
curl --request POST \
--url https://app.amberflo.io/payments/pricing/amberflo/account-pricing/promotions/relative_product_sales_event_promotion \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{
"id": "",
"type": "relative_product_sales_event_promotion",
"promotionName": ""
}'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
var raw = JSON.stringify({
"id": "",
"type": "relative_product_sales_event_promotion",
"promotionName": ""
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://app.amberflo.io/payments/pricing/amberflo/account-pricing/promotions/relative_product_sales_event_promotion", 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/relative_product_sales_event_promotion")
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": "relative_product_sales_event_promotion",
"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/relative_product_sales_event_promotion"
payload = json.dumps({
"id": "",
"type": "relative_product_sales_event_promotion",
"promotionName": ""
})
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
200
// Promotion successfully created
{
"id": "",
"type": "",
"promotionName": "",
"description": "",
"lockingStatus": "",
"lastUpdateTimeInMillis": "",
"dimensionConstraintMap": "",
"customerTags": "",
"acceptablePromotionTimeRange": {
"startTimeInSeconds": "",
"endTimeInSeconds": ""
},
"recurrenceInterval": {
"intervalLength": "",
"intervalLengthCount": "",
"maxRecurrence": ""
},
"discountRatio": 0,
"totalMaxDiscount": 0,
"cycleMaxDiscount": 0,
"targetProductId": ""
}400
// Bad request - invalid promotion configuration
404
// Product not found
409
// Conflict with existing promotion