Create fixed-amount discount for entire pricing plans
1 min
POST
https://app.amberflo.io/payments/pricing/amberflo/account-pricing/promotions/unconditioned_absolute_plan_promotion
Body Parameters
- bodypayment.pricing.promotions.pre_created.AbsolutePlanPromotion.inDescription
- idstringrequiredDescription
- typestringDescriptionDefaultunconditioned_absolute_plan_promotion
- promotionNamestringrequiredDescription
- descriptionstringDescription
- lockingStatuscommon.LockingStatus.inDescription
- targetPlanIdstringDescription
- discountnumberDescription
- promotionTypepayment.pricing.promotions.attributes.PromotionType.inDescription
Responses
200
- payment.pricing.promotions.pre_created.AbsolutePlanPromotion.outDescription
- idstringrequiredDescription
- typestringDescriptionDefaultunconditioned_absolute_plan_promotion
- promotionNamestringrequiredDescription
- descriptionstringDescription
- lockingStatuscommon.LockingStatus.inDescription
- lastUpdateTimeInMillisinteger<int64>Description
- targetPlanIdstringDescription
- discountnumberDescription
- promotionTypepayment.pricing.promotions.attributes.PromotionType.inDescription
400
401
500
curl
curl --request POST \
--url https://app.amberflo.io/payments/pricing/amberflo/account-pricing/promotions/unconditioned_absolute_plan_promotion \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{
"id": "",
"type": "unconditioned_absolute_plan_promotion",
"promotionName": ""
}'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
var raw = JSON.stringify({
"id": "",
"type": "unconditioned_absolute_plan_promotion",
"promotionName": ""
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://app.amberflo.io/payments/pricing/amberflo/account-pricing/promotions/unconditioned_absolute_plan_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/unconditioned_absolute_plan_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": "unconditioned_absolute_plan_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/unconditioned_absolute_plan_promotion"
payload = json.dumps({
"id": "",
"type": "unconditioned_absolute_plan_promotion",
"promotionName": ""
})
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
200
// Plan-level promotion created with fixed discount amount and coverage details
{
"id": "",
"type": "",
"promotionName": "",
"description": "",
"lockingStatus": "",
"lastUpdateTimeInMillis": "",
"targetPlanId": "",
"discount": 0,
"promotionType": ""
}400
// Invalid discount amount or pricing plan configuration parameters
401
// Authentication required or invalid API key provided
500
// Internal server error occurred while creating plan promotion