Create or update a promotion
1 min
POST
https://app.amberflo.io/payments/pricing/amberflo/account-pricing/promotions/tiered_relative_product_item_automatic_promotion
Body Parameters
- bodypayment.pricing.promotions.pre_created.TieredRelativeProductItemAutomaticPromotion.in
- idstringrequiredDescription
- typestringDescriptionDefaulttiered_relative_product_item_automatic_promotion
- promotionNamestringrequiredDescription
- descriptionstring
- lockingStatuscom.amberflo.service.common.LockingStatus.in
- dimensionConstraintMapmap<string, string>
- customerTagsmap<string, string>
- isHiddenboolean
- priceToDiscountMapmap<string, number>
- discountCalculationStrategypayment.pricing.promotions.promotion_model.PriceTieredRelative.DiscountCalculationStrategy.in
- totalMaxDiscountnumber
- cycleMaxDiscountnumber
- targetProductItemIdstring
- isRegExbooleanDescription
Responses
200
- payment.pricing.promotions.pre_created.TieredRelativeProductItemAutomaticPromotion.out
- idstringrequiredDescription
- typestringDescriptionDefaulttiered_relative_product_item_automatic_promotion
- promotionNamestringrequiredDescription
- descriptionstring
- lockingStatuscom.amberflo.service.common.LockingStatus.out
- lastUpdateTimeInMillisinteger<int64>Description
- dimensionConstraintMapmap<string, string>
- customerTagsmap<string, string>
- isHiddenboolean
- priceToDiscountMapmap<string, number>
- discountCalculationStrategypayment.pricing.promotions.promotion_model.PriceTieredRelative.DiscountCalculationStrategy.out
- totalMaxDiscountnumber
- cycleMaxDiscountnumber
- targetProductItemIdstring
- isRegExbooleanDescription
curl
curl --request POST \
--url https://app.amberflo.io/payments/pricing/amberflo/account-pricing/promotions/tiered_relative_product_item_automatic_promotion \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{
"id": "",
"type": "tiered_relative_product_item_automatic_promotion",
"promotionName": ""
}'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
var raw = JSON.stringify({
"id": "",
"type": "tiered_relative_product_item_automatic_promotion",
"promotionName": ""
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://app.amberflo.io/payments/pricing/amberflo/account-pricing/promotions/tiered_relative_product_item_automatic_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/tiered_relative_product_item_automatic_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": "tiered_relative_product_item_automatic_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/tiered_relative_product_item_automatic_promotion"
payload = json.dumps({
"id": "",
"type": "tiered_relative_product_item_automatic_promotion",
"promotionName": ""
})
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
200
// Successful request
{
"id": "",
"type": "",
"promotionName": "",
"description": "",
"lockingStatus": "",
"lastUpdateTimeInMillis": "",
"dimensionConstraintMap": "",
"customerTags": "",
"isHidden": false,
"priceToDiscountMap": "",
"discountCalculationStrategy": "",
"totalMaxDiscount": 0,
"cycleMaxDiscount": 0,
"targetProductItemId": "",
"isRegEx": false
}