Create or update a promotion
1 min
POST
https://app.amberflo.io/payments/pricing/amberflo/account-pricing/promotions/generic_item_promotion
Body Parameters
- bodypayment.pricing.promotions.pre_created.GenericItemPromotion.in
- idstringrequiredDescription
- typestringDescriptionDefaultgeneric_item_promotion
- promotionNamestringrequiredDescription
- descriptionstring
- lockingStatuscom.amberflo.service.common.LockingStatus.in
- targetItemIdstring
- promotionTypepayment.pricing.promotions.attributes.PromotionType.in
- conditionpayment.pricing.promotions.conditions.PromotionCondition.in
- payment.pricing.promotions.conditions.AfterItemPriceThreshold.in
- requiredHistorypayment.pricing.promotions.attributes.HistoryRequirements.in
- cyclesinteger<int32>
- monthsinteger<int32>
- minThresholdnumber
- typestringDefaultafter_item_price_threshold
- itemIdstring
- payment.pricing.promotions.conditions.AfterProductPriceThreshold.in
- requiredHistorypayment.pricing.promotions.attributes.HistoryRequirements.in
- cyclesinteger<int32>
- monthsinteger<int32>
- minThresholdnumber
- typestringDefaultafter_product_price_threshold
- payment.pricing.promotions.conditions.CompositeAndCondition.in
- typestringDefaultand_condition
- conditionspayment.pricing.promotions.conditions.PromotionCondition.in[]
- 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
- typestringDefaultcustomer_tag_condition
- customerTagsToFindmap<string, string>
- granularitypayment.pricing.promotions.attributes.granularity.Granularity.in
- 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
- typestringDefaultcustomer_tag_condition
- customerTagsToFindmap<string, string>
- granularitypayment.pricing.promotions.attributes.granularity.Granularity.in
- 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.in
- payment.pricing.promotions.promotion_model.Absolute.in
- typestringDefaultabsolute
- measurepayment.pricing.promotions.attributes.measure.Measure.in
- payment.pricing.promotions.attributes.measure.PerUnitBatch.in
- typestringDefaultper_batch
- batchSizeinteger<int64>
- payment.pricing.promotions.attributes.measure.PerUnit.in
- typestringDefaultper_unit
- payment.pricing.promotions.attributes.measure.TotalPrice.in
- Max depth limit reached
- requiredHistorypayment.pricing.promotions.attributes.HistoryRequirements.in
- cyclesinteger<int32>
- monthsinteger<int32>
- totalMaxDiscountnumber
- cycleMaxDiscountnumber
- discountnumber
- payment.pricing.promotions.promotion_model.PriceTieredRelative.in
- typestringDefaultprice_tiered_relative
- measurepayment.pricing.promotions.attributes.measure.Measure.in
- payment.pricing.promotions.attributes.measure.PerUnitBatch.in
- typestringDefaultper_batch
- batchSizeinteger<int64>
- 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.in
- cyclesinteger<int32>
- monthsinteger<int32>
- totalMaxDiscountnumber
- cycleMaxDiscountnumber
- discountRatioMapmap<string, number>
- discountCalculationStrategypayment.pricing.promotions.promotion_model.PriceTieredRelative.DiscountCalculationStrategy.in
- acrossBillingPeriodsboolean
- payment.pricing.promotions.promotion_model.Relative.in
- typestringDefaultrelative
- measurepayment.pricing.promotions.attributes.measure.Measure.in
- 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.in
- cyclesinteger<int32>
- monthsinteger<int32>
- totalMaxDiscountnumber
- cycleMaxDiscountnumber
- discountRationumber
- dimensionConstraintMapmap<string, string>
- isRegExbooleanDescription
Responses
200
- payment.pricing.promotions.pre_created.GenericItemPromotion.out
- idstringrequiredDescription
- typestringDescriptionDefaultgeneric_item_promotion
- promotionNamestringrequiredDescription
- descriptionstring
- lockingStatuscom.amberflo.service.common.LockingStatus.out
- lastUpdateTimeInMillisinteger<int64>Description
- targetItemIdstring
- promotionTypepayment.pricing.promotions.attributes.PromotionType.out
- conditionpayment.pricing.promotions.conditions.PromotionCondition.out
- payment.pricing.promotions.conditions.AfterItemPriceThreshold.out
- requiredHistorypayment.pricing.promotions.attributes.HistoryRequirements.out
- cyclesinteger<int32>
- monthsinteger<int32>
- minThresholdnumber
- typestringDefaultafter_item_price_threshold
- itemIdstring
- payment.pricing.promotions.conditions.AfterProductPriceThreshold.out
- requiredHistorypayment.pricing.promotions.attributes.HistoryRequirements.out
- cyclesinteger<int32>
- monthsinteger<int32>
- minThresholdnumber
- typestringDefaultafter_product_price_threshold
- payment.pricing.promotions.conditions.CompositeAndCondition.out
- typestringDefaultand_condition
- conditionspayment.pricing.promotions.conditions.PromotionCondition.out[]
- 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
- typestringDefaultcustomer_tag_condition
- customerTagsToFindmap<string, string>
- granularitypayment.pricing.promotions.attributes.granularity.Granularity.out
- payment.pricing.promotions.attributes.granularity.ItemVariantGranularity.out
- Max depth limit reached
- payment.pricing.promotions.attributes.granularity.ProductGranularity.out
- Max depth limit reached
- payment.pricing.promotions.conditions.NextBillingCycle.out
- Max depth limit reached
- payment.pricing.promotions.conditions.NoCondition.out
- Max depth limit reached
- payment.pricing.promotions.conditions.SamePlan.out
- Max depth limit reached
- payment.pricing.promotions.conditions.TimeLimited.out
- Max depth limit reached
- payment.pricing.promotions.conditions.CustomerTagsCondition.out
- typestringDefaultcustomer_tag_condition
- customerTagsToFindmap<string, string>
- granularitypayment.pricing.promotions.attributes.granularity.Granularity.out
- payment.pricing.promotions.attributes.granularity.ItemVariantGranularity.out
- Max depth limit reached
- payment.pricing.promotions.attributes.granularity.ProductGranularity.out
- Max depth limit reached
- payment.pricing.promotions.conditions.NextBillingCycle.out
- Max depth limit reached
- payment.pricing.promotions.conditions.NoCondition.out
- Max depth limit reached
- payment.pricing.promotions.conditions.SamePlan.out
- Max depth limit reached
- payment.pricing.promotions.conditions.TimeLimited.out
- Max depth limit reached
- promotionModelpayment.pricing.promotions.promotion_model.PromotionModel.out
- payment.pricing.promotions.promotion_model.Absolute.out
- typestringDefaultabsolute
- measurepayment.pricing.promotions.attributes.measure.Measure.out
- payment.pricing.promotions.attributes.measure.PerUnitBatch.out
- typestringDefaultper_batch
- batchSizeinteger<int64>
- payment.pricing.promotions.attributes.measure.PerUnit.out
- typestringDefaultper_unit
- payment.pricing.promotions.attributes.measure.TotalPrice.out
- Max depth limit reached
- requiredHistorypayment.pricing.promotions.attributes.HistoryRequirements.out
- cyclesinteger<int32>
- monthsinteger<int32>
- totalMaxDiscountnumber
- cycleMaxDiscountnumber
- discountnumber
- payment.pricing.promotions.promotion_model.PriceTieredRelative.out
- typestringDefaultprice_tiered_relative
- measurepayment.pricing.promotions.attributes.measure.Measure.out
- payment.pricing.promotions.attributes.measure.PerUnitBatch.out
- typestringDefaultper_batch
- batchSizeinteger<int64>
- payment.pricing.promotions.attributes.measure.PerUnit.out
- Max depth limit reached
- payment.pricing.promotions.attributes.measure.TotalPrice.out
- Max depth limit reached
- requiredHistorypayment.pricing.promotions.attributes.HistoryRequirements.out
- cyclesinteger<int32>
- monthsinteger<int32>
- totalMaxDiscountnumber
- cycleMaxDiscountnumber
- discountRatioMapmap<string, number>
- discountCalculationStrategypayment.pricing.promotions.promotion_model.PriceTieredRelative.DiscountCalculationStrategy.out
- acrossBillingPeriodsboolean
- payment.pricing.promotions.promotion_model.Relative.out
- typestringDefaultrelative
- measurepayment.pricing.promotions.attributes.measure.Measure.out
- payment.pricing.promotions.attributes.measure.PerUnitBatch.out
- Max depth limit reached
- payment.pricing.promotions.attributes.measure.PerUnit.out
- Max depth limit reached
- payment.pricing.promotions.attributes.measure.TotalPrice.out
- Max depth limit reached
- requiredHistorypayment.pricing.promotions.attributes.HistoryRequirements.out
- cyclesinteger<int32>
- monthsinteger<int32>
- totalMaxDiscountnumber
- cycleMaxDiscountnumber
- discountRationumber
- dimensionConstraintMapmap<string, string>
- isRegExbooleanDescription
curl
curl --request POST \
--url https://app.amberflo.io/payments/pricing/amberflo/account-pricing/promotions/generic_item_promotion \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{
"id": "",
"type": "generic_item_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_item_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_item_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_item_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_item_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_item_promotion"
payload = json.dumps({
"id": "",
"type": "generic_item_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
// Successful request
{
"id": "",
"type": "",
"promotionName": "",
"description": "",
"lockingStatus": "",
"lastUpdateTimeInMillis": "",
"targetItemId": "",
"promotionType": "",
"condition": {},
"promotionModel": {},
"dimensionConstraintMap": "",
"isRegEx": false
}