Create flexible promotion for entire products
1 min
POST
https://app.amberflo.io/payments/pricing/amberflo/account-pricing/promotions/generic_product_promotion
Body Parameters
- bodypayment.pricing.promotions.pre_created.GenericProductPromotion.inDescription
- idstringrequiredDescription
- typestringDescriptionDefaultgeneric_product_promotion
- promotionNamestringrequiredDescription
- descriptionstringDescription
- lockingStatuscommon.LockingStatus.inDescription
- targetProductIdstringDescription
- promotionTypepayment.pricing.promotions.attributes.PromotionType.inDescription
- conditionpayment.pricing.promotions.conditions.PromotionCondition.inDescription
- payment.pricing.promotions.conditions.AfterItemPriceThreshold.in
- requiredHistorypayment.pricing.promotions.attributes.HistoryRequirements.inDescription
- cyclesinteger<int32>Description
- monthsinteger<int32>Description
- minThresholdnumberDescription
- typestringDescriptionDefaultafter_item_price_threshold
- itemIdstringDescription
- payment.pricing.promotions.conditions.AfterProductPriceThreshold.in
- requiredHistorypayment.pricing.promotions.attributes.HistoryRequirements.inDescription
- cyclesinteger<int32>Description
- monthsinteger<int32>Description
- minThresholdnumberDescription
- typestringDescriptionDefaultafter_product_price_threshold
- payment.pricing.promotions.conditions.CompositeAndCondition.in
- typestringDescriptionDefaultand_condition
- conditionspayment.pricing.promotions.conditions.PromotionCondition.in[]Description
- payment.pricing.promotions.conditions.AfterItemPriceThreshold.in
- Circular-Reference
- payment.pricing.promotions.conditions.AfterProductPriceThreshold.in
- Circular-Reference
- payment.pricing.promotions.conditions.CompositeAndCondition.in
- Circular-Reference
- payment.pricing.promotions.conditions.CustomerTagsCondition.in
- typestringDescriptionDefaultcustomer_tag_condition
- customerTagsToFindmap<string, string>Description
- granularitypayment.pricing.promotions.attributes.granularity.Granularity.inDescription
- payment.pricing.promotions.attributes.granularity.ItemVariantGranularity.in
- Max depth limit reached
- payment.pricing.promotions.attributes.granularity.ProductGranularity.in
- Max depth limit reached
- payment.pricing.promotions.conditions.NextBillingCycle.in
- Max depth limit reached
- payment.pricing.promotions.conditions.NoCondition.in
- Max depth limit reached
- payment.pricing.promotions.conditions.SamePlan.in
- Max depth limit reached
- payment.pricing.promotions.conditions.TimeLimited.in
- Max depth limit reached
- payment.pricing.promotions.conditions.CustomerTagsCondition.in
- typestringDescriptionDefaultcustomer_tag_condition
- customerTagsToFindmap<string, string>Description
- granularitypayment.pricing.promotions.attributes.granularity.Granularity.inDescription
- payment.pricing.promotions.attributes.granularity.ItemVariantGranularity.in
- Max depth limit reached
- payment.pricing.promotions.attributes.granularity.ProductGranularity.in
- Max depth limit reached
- payment.pricing.promotions.conditions.NextBillingCycle.in
- Max depth limit reached
- payment.pricing.promotions.conditions.NoCondition.in
- Max depth limit reached
- payment.pricing.promotions.conditions.SamePlan.in
- Max depth limit reached
- payment.pricing.promotions.conditions.TimeLimited.in
- Max depth limit reached
- promotionModelpayment.pricing.promotions.promotion_model.PromotionModel.inDescription
- payment.pricing.promotions.promotion_model.Absolute.in
- typestringDescriptionDefaultabsolute
- measurepayment.pricing.promotions.attributes.measure.Measure.inDescription
- payment.pricing.promotions.attributes.measure.PerUnitBatch.in
- typestringDescriptionDefaultper_batch
- batchSizeinteger<int64>Description
- payment.pricing.promotions.attributes.measure.PerUnit.in
- typestringDescriptionDefaultper_unit
- payment.pricing.promotions.attributes.measure.TotalPrice.in
- Max depth limit reached
- requiredHistorypayment.pricing.promotions.attributes.HistoryRequirements.inDescription
- cyclesinteger<int32>Description
- monthsinteger<int32>Description
- totalMaxDiscountnumberDescription
- cycleMaxDiscountnumberDescription
- discountnumberDescription
- payment.pricing.promotions.promotion_model.PriceTieredRelative.in
- typestringDescriptionDefaultprice_tiered_relative
- measurepayment.pricing.promotions.attributes.measure.Measure.inDescription
- payment.pricing.promotions.attributes.measure.PerUnitBatch.in
- typestringDescriptionDefaultper_batch
- batchSizeinteger<int64>Description
- payment.pricing.promotions.attributes.measure.PerUnit.in
- Max depth limit reached
- payment.pricing.promotions.attributes.measure.TotalPrice.in
- Max depth limit reached
- requiredHistorypayment.pricing.promotions.attributes.HistoryRequirements.inDescription
- cyclesinteger<int32>Description
- monthsinteger<int32>Description
- totalMaxDiscountnumberDescription
- cycleMaxDiscountnumberDescription
- discountRatioMapmap<string, number>Description
- discountCalculationStrategypayment.pricing.prepaid.OfferCalculationStrategy.outDescription
- acrossBillingPeriodsbooleanDescription
- payment.pricing.promotions.promotion_model.Relative.in
- typestringDescriptionDefaultrelative
- measurepayment.pricing.promotions.attributes.measure.Measure.inDescription
- payment.pricing.promotions.attributes.measure.PerUnitBatch.in
- Max depth limit reached
- payment.pricing.promotions.attributes.measure.PerUnit.in
- Max depth limit reached
- payment.pricing.promotions.attributes.measure.TotalPrice.in
- Max depth limit reached
- requiredHistorypayment.pricing.promotions.attributes.HistoryRequirements.inDescription
- cyclesinteger<int32>Description
- monthsinteger<int32>Description
- totalMaxDiscountnumberDescription
- cycleMaxDiscountnumberDescription
- discountRationumberDescription
Responses
200
- payment.pricing.promotions.pre_created.GenericProductPromotion.outDescription
- idstringrequiredDescription
- typestringDescriptionDefaultgeneric_product_promotion
- promotionNamestringrequiredDescription
- descriptionstringDescription
- lockingStatuscommon.LockingStatus.inDescription
- lastUpdateTimeInMillisinteger<int64>Description
- targetProductIdstringDescription
- promotionTypepayment.pricing.promotions.attributes.PromotionType.inDescription
- conditionpayment.pricing.promotions.conditions.PromotionCondition.outDescription
- payment.pricing.promotions.conditions.AfterItemPriceThreshold.out
- requiredHistorypayment.pricing.promotions.attributes.HistoryRequirements.inDescription
- cyclesinteger<int32>Description
- monthsinteger<int32>Description
- minThresholdnumberDescription
- typestringDescriptionDefaultafter_item_price_threshold
- itemIdstringDescription
- payment.pricing.promotions.conditions.AfterProductPriceThreshold.out
- requiredHistorypayment.pricing.promotions.attributes.HistoryRequirements.inDescription
- cyclesinteger<int32>Description
- monthsinteger<int32>Description
- minThresholdnumberDescription
- typestringDescriptionDefaultafter_product_price_threshold
- payment.pricing.promotions.conditions.CompositeAndCondition.out
- typestringDescriptionDefaultand_condition
- conditionspayment.pricing.promotions.conditions.PromotionCondition.out[]Description
- payment.pricing.promotions.conditions.AfterItemPriceThreshold.out
- Circular-Reference
- payment.pricing.promotions.conditions.AfterProductPriceThreshold.out
- Circular-Reference
- payment.pricing.promotions.conditions.CompositeAndCondition.out
- Circular-Reference
- payment.pricing.promotions.conditions.CustomerTagsCondition.out
- typestringDescriptionDefaultcustomer_tag_condition
- customerTagsToFindmap<string, string>Description
- granularitypayment.pricing.promotions.attributes.granularity.Granularity.outDescription
- payment.pricing.promotions.attributes.granularity.ItemVariantGranularity.in
- Max depth limit reached
- payment.pricing.promotions.attributes.granularity.ProductGranularity.in
- Max depth limit reached
- payment.pricing.promotions.conditions.NextBillingCycle.in
- Max depth limit reached
- payment.pricing.promotions.conditions.NoCondition.in
- Max depth limit reached
- payment.pricing.promotions.conditions.SamePlan.in
- Max depth limit reached
- payment.pricing.promotions.conditions.TimeLimited.out
- Max depth limit reached
- payment.pricing.promotions.conditions.CustomerTagsCondition.out
- typestringDescriptionDefaultcustomer_tag_condition
- customerTagsToFindmap<string, string>Description
- granularitypayment.pricing.promotions.attributes.granularity.Granularity.outDescription
- payment.pricing.promotions.attributes.granularity.ItemVariantGranularity.in
- Max depth limit reached
- payment.pricing.promotions.attributes.granularity.ProductGranularity.in
- Max depth limit reached
- payment.pricing.promotions.conditions.NextBillingCycle.in
- Max depth limit reached
- payment.pricing.promotions.conditions.NoCondition.in
- Max depth limit reached
- payment.pricing.promotions.conditions.SamePlan.in
- Max depth limit reached
- payment.pricing.promotions.conditions.TimeLimited.out
- Max depth limit reached
- promotionModelpayment.pricing.promotions.promotion_model.PromotionModel.outDescription
- payment.pricing.promotions.promotion_model.Absolute.out
- typestringDescriptionDefaultabsolute
- measurepayment.pricing.promotions.attributes.measure.Measure.outDescription
- payment.pricing.promotions.attributes.measure.PerUnitBatch.in
- typestringDescriptionDefaultper_batch
- batchSizeinteger<int64>Description
- payment.pricing.promotions.attributes.measure.PerUnit.in
- typestringDescriptionDefaultper_unit
- payment.pricing.promotions.attributes.measure.TotalPrice.in
- Max depth limit reached
- requiredHistorypayment.pricing.promotions.attributes.HistoryRequirements.inDescription
- cyclesinteger<int32>Description
- monthsinteger<int32>Description
- totalMaxDiscountnumberDescription
- cycleMaxDiscountnumberDescription
- discountnumberDescription
- payment.pricing.promotions.promotion_model.PriceTieredRelative.out
- typestringDescriptionDefaultprice_tiered_relative
- measurepayment.pricing.promotions.attributes.measure.Measure.outDescription
- payment.pricing.promotions.attributes.measure.PerUnitBatch.in
- typestringDescriptionDefaultper_batch
- batchSizeinteger<int64>Description
- payment.pricing.promotions.attributes.measure.PerUnit.in
- Max depth limit reached
- payment.pricing.promotions.attributes.measure.TotalPrice.in
- Max depth limit reached
- requiredHistorypayment.pricing.promotions.attributes.HistoryRequirements.inDescription
- cyclesinteger<int32>Description
- monthsinteger<int32>Description
- totalMaxDiscountnumberDescription
- cycleMaxDiscountnumberDescription
- discountRatioMapmap<string, number>Description
- discountCalculationStrategypayment.pricing.prepaid.OfferCalculationStrategy.outDescription
- acrossBillingPeriodsbooleanDescription
- payment.pricing.promotions.promotion_model.Relative.out
- typestringDescriptionDefaultrelative
- measurepayment.pricing.promotions.attributes.measure.Measure.outDescription
- payment.pricing.promotions.attributes.measure.PerUnitBatch.in
- Max depth limit reached
- payment.pricing.promotions.attributes.measure.PerUnit.in
- Max depth limit reached
- payment.pricing.promotions.attributes.measure.TotalPrice.in
- Max depth limit reached
- requiredHistorypayment.pricing.promotions.attributes.HistoryRequirements.inDescription
- cyclesinteger<int32>Description
- monthsinteger<int32>Description
- totalMaxDiscountnumberDescription
- cycleMaxDiscountnumberDescription
- discountRationumberDescription
400
401
500
curl
curl --request POST \
--url https://app.amberflo.io/payments/pricing/amberflo/account-pricing/promotions/generic_product_promotion \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{
"id": "",
"type": "generic_product_promotion",
"promotionName": "",
"condition": {
"type": "after_item_price_threshold"
},
"promotionModel": {
"type": "absolute",
"measure": {
"type": "per_batch"
}
}
}'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
var raw = JSON.stringify({
"id": "",
"type": "generic_product_promotion",
"promotionName": "",
"condition": {
"type": "after_item_price_threshold"
},
"promotionModel": {
"type": "absolute",
"measure": {
"type": "per_batch"
}
}
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://app.amberflo.io/payments/pricing/amberflo/account-pricing/promotions/generic_product_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/generic_product_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": "generic_product_promotion",
"promotionName": "",
"condition": {
"type": "after_item_price_threshold"
},
"promotionModel": {
"type": "absolute",
"measure": {
"type": "per_batch"
}
}
})
response = https.request(request)
puts response.read_body
python
import requests
import json
url = "https://app.amberflo.io/payments/pricing/amberflo/account-pricing/promotions/generic_product_promotion"
payload = json.dumps({
"id": "",
"type": "generic_product_promotion",
"promotionName": "",
"condition": {
"type": "after_item_price_threshold"
},
"promotionModel": {
"type": "absolute",
"measure": {
"type": "per_batch"
}
}
})
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
200
// Product promotion created with custom discount configuration and scope details
{
"id": "",
"type": "",
"promotionName": "",
"description": "",
"lockingStatus": "",
"lastUpdateTimeInMillis": "",
"targetProductId": "",
"promotionType": "",
"condition": {},
"promotionModel": {}
}400
// Invalid promotion configuration or unsupported product scope
401
// Authentication required or invalid API key provided
500
// Internal server error occurred while creating promotion