Create tiered relative product automatic promotion
1 min
POST
https://app.amberflo.io/payments/pricing/amberflo/account-pricing/promotions/tiered_relative_product_automatic_promotion
Body Parameters
- bodypayment.pricing.promotions.pre_created.TieredRelativeProductAutomaticPromotion.inrequiredDescription
- idstringrequiredDescription
- typestringDescriptionDefaulttiered_relative_product_automatic_promotion
- promotionNamestringrequiredDescription
- descriptionstringDescription
- lockingStatuscommon.LockingStatus.inDescription
- dimensionConstraintMapmap<string, string>Description
- customerTagsmap<string, string>Description
- isHiddenbooleanDescription
- priceToDiscountMapmap<string, number>Description
- discountCalculationStrategypayment.pricing.prepaid.OfferCalculationStrategy.outDescription
- totalMaxDiscountnumberDescription
- cycleMaxDiscountnumberDescription
- targetProductIdstringDescription
Responses
200
- payment.pricing.promotions.pre_created.TieredRelativeProductAutomaticPromotion.outDescription
- idstringrequiredDescription
- typestringDescriptionDefaulttiered_relative_product_automatic_promotion
- promotionNamestringrequiredDescription
- descriptionstringDescription
- lockingStatuscommon.LockingStatus.inDescription
- lastUpdateTimeInMillisinteger<int64>Description
- dimensionConstraintMapmap<string, string>Description
- customerTagsmap<string, string>Description
- isHiddenbooleanDescription
- priceToDiscountMapmap<string, number>Description
- discountCalculationStrategypayment.pricing.prepaid.OfferCalculationStrategy.outDescription
- totalMaxDiscountnumberDescription
- cycleMaxDiscountnumberDescription
- targetProductIdstringDescription
400
404
409
curl
curl --request POST \
--url https://app.amberflo.io/payments/pricing/amberflo/account-pricing/promotions/tiered_relative_product_automatic_promotion \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{
"id": "",
"type": "tiered_relative_product_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_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_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_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_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_automatic_promotion"
payload = json.dumps({
"id": "",
"type": "tiered_relative_product_automatic_promotion",
"promotionName": ""
})
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
200
// Tiered promotion successfully created
{
"id": "",
"type": "",
"promotionName": "",
"description": "",
"lockingStatus": "",
"lastUpdateTimeInMillis": "",
"dimensionConstraintMap": "",
"customerTags": "",
"isHidden": false,
"priceToDiscountMap": "",
"discountCalculationStrategy": "",
"totalMaxDiscount": 0,
"cycleMaxDiscount": 0,
"targetProductId": ""
}400
// Bad request - invalid tier configuration
404
// Product not found
409
// Conflict with existing promotion