{"method":"POST","path":"https://api.revcent.com/v2/coupon_profiles","summary":"Create A Coupon Profile","description":"Create a Coupon Profile, which will issue a unique Coupon Profile ID.","operationId":"CreateCouponProfile","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"name":{"description":"The coupon profile name. Must be unique across all coupon profiles.","type":"string"},"description":{"description":"The coupon profile description.","type":"string"},"enabled":{"description":"Whether the coupon profile is currently enabled.","type":"boolean"},"num_use_max":{"type":"integer","description":"Maximum number of global uses for a coupon using this profile. Trial expiration or subscription renewals are not considered uses. 0 = no maximum. Default is 0."},"proceed_rejected":{"type":"boolean","description":"Continue processing a sale without any discount if a submitted coupon is rejected. If false, an error will be returned and the sale will not be processed. Set to false if you want the customer to know the coupon is rejected before charging. Set to true if you want to proceed with the sale regardless. Default is true."},"allow_multi_coupon":{"type":"boolean","description":"Allow a coupon to be applied with other coupons using this or any other coupon profile. If allowing multiple coupons, percentage coupons are applied one at a time, not combined as a percentage sum. Default is false."},"allowed_campaign":{"type":"array","description":"An array of one or more campaign ID's which are allowed to use the coupon. If a sale, trial or subscription renewal is not within a selected campaign, the coupon will not be applied. Leave empty to allow all campaigns.","items":{"type":"string","title":"Campaign ID","description":"A 20 character campaign ID.","minLength":20,"maxLength":20}},"apply_to_settings":{"type":"object","description":"Set rules and restrictions as to the application of coupons and discount amounts for a customer purchase.","additionalProperties":false,"properties":{"apply_to_product":{"type":"boolean","description":"Apply the discount for a coupon to initial sale product amounts charged at time of purchase. Not applicable to trial expirations or subscription renewals which are charged at a future date. Default is true."},"apply_to_shipping":{"type":"boolean","description":"Apply the discount for a coupon to shipping for initial sales regardless of the apply_to_product setting. Applies to subscription renewal shipping if apply_to_subscription_renewal is enabled and applies to trial expiration shipping if apply_to_trial is enabled. Default is true."},"apply_to_trial":{"type":"boolean","description":"Apply the discount for a coupon to trial product amounts charged when they expire. Default is false."},"apply_to_subscription_renewal":{"type":"boolean","description":"Apply the discount for a coupon to subscriptions that are created during initial sales using this coupon. Upon renewal, coupon discounts will be applied to the subscription renewal product amounts and shipping if apply_to_product and apply_to_shipping are enabled. If apply_to_subscription_renewal is disabled, coupon discounts will not be applied to subscriptions created during initial sales using this coupon. Default is false."},"apply_to_subscription_renewal_num_max":{"type":"integer","description":"The maximum number of subscription renewals to apply the coupon discount, if apply_to_subscription_renewal is enabled. 0 = no maximum. Default is 0."}}},"customer_settings":{"type":"object","description":"Apply rules and restrictions on an individual customer who uses a coupon associated with the coupon profile.","additionalProperties":false,"properties":{"num_use_max":{"type":"integer","description":"The maximum number of sales the same customer can use a specific coupon for initial purchases. Trial expiration or subscription renewals are not considered uses. 0 = no maximum. Default is 0."},"apply_to_future_sale":{"type":"boolean","description":"Auto apply the coupon used by a customer to future sales for the same customer. When auto applied, max uses per customer are not taken into consideration. Limit the number of future sales auto applied below. Default is false."},"apply_to_future_sale_num_max":{"type":"integer","description":"The maximum number of sales to auto apply if apply_to_future_sale is enabled. 0 = no maximum. Default is 0."}}},"product_settings":{"type":"object","description":"Apply rules and restrictions as to products being purchased by the customer and coupons being used.","additionalProperties":false,"properties":{"apply_to_product_group":{"type":"array","description":"An array of one or more product group ID's which contain product(s) that will only be applied a discount. If a product being purchased is not within a product group provided, the discount will not apply to the product. I.e. only products within a product group(s) provided will receive a discount from an accepted coupon.","items":{"type":"string","description":"A 20 character product group ID.","minLength":20,"maxLength":20}},"allowed_product_group":{"type":"array","description":"An array of one or more product group ID's which contain product(s) that are allowed for purchase when using a coupon associated with this profile. If a product being purchased is not within a product group provided, the coupon will be rejected entirely.","items":{"type":"string","description":"A 20 character product group ID.","minLength":20,"maxLength":20}},"disallowed_product_group":{"type":"array","description":"An array of one or more product group ID's which contain product(s) that are not allowed for purchase when using a coupon associated with this profile. If a product being purchased is within a product group provided, the coupon will be rejected entirely.","items":{"type":"string","description":"A 20 character product group ID.","minLength":20,"maxLength":20}},"required_product_group":{"type":"array","description":"An array of one or more product group ID's which contain product(s), at least one of which is required during purchase when using a coupon associated with this profile. If at least one of the product(s) being purchased is within a product group selected the coupon will be accepted, otherwise the coupon will be rejected entirely.","items":{"type":"string","description":"A 20 character product group ID.","minLength":20,"maxLength":20}}}},"revenue_settings":{"type":"object","description":"Set rules based on the customer purchase and discount amounts.","additionalProperties":false,"properties":{"min_purchase_amount":{"type":"integer","description":"The minimum amount the customer must be charged during initial purchase (and any future trial expiration if Apply To Trial = true) in order for the coupon to be applied. 0 = no minimum. Default is 0."},"max_discount_amount":{"type":"integer","description":"The maximum discount amount to be applied. 0 = no maximum. Default is 0."}}},"shop_settings":{"type":"object","description":"Link codes submitted from third party shops with coupons created in RevCent using this coupon profile, where both shop and RevCent coupon codes match. This will not re-apply the discount a coupon code already applied to an initial sale on your third party shop. Instead, this is for applying coupons originating from a third party shop, via coupon code entered by a customer on your shop, to a RevCent subscription or trial created as a result of a successful sale.","additionalProperties":false,"properties":{"link_codes_enabled":{"type":"boolean","description":"Whether link codes are enabled. Default is false."},"allowed_third_party_shop":{"type":"array","description":"Array of allowed third party shops to link third party shop coupon codes with coupons created in RevCent.","items":{"type":"string","description":"A 20 character user shop ID.","minLength":20,"maxLength":20}}}}},"required":["name"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"description":"","properties":{"api_call_id":{"type":"string","description":"A 20 character API call ID.","minLength":20,"maxLength":20},"api_call_unix":{"description":"Unix timestamp of when the API call was initiated.","type":"integer","format":"unix-time"},"code":{"description":"API call response code.","type":"integer","format":"int32","enum":[1]},"coupon_profile_id":{"type":"string","description":"A 20 character coupon profile ID.","minLength":20,"maxLength":20},"result":{"type":"string"}},"type":"object","additionalProperties":false}}},"description":"Successful response."},"default":{"content":{"application/json":{"schema":{"description":"","properties":{"api_call_id":{"type":"string","description":"A 20 character API call ID.","minLength":20,"maxLength":20},"api_call_unix":{"description":"Unix timestamp of when the API call was initiated.","type":"integer","format":"unix-time"},"code":{"description":"This value indicates that there is an error. Will always be 0.","type":"integer","enum":[0]},"error_code":{"description":"The specific error code.","type":"string"},"message":{"description":"A human readable description of the error.","type":"string"},"result":{"description":"A description of the API call result.","type":"string"}},"title":"APIStandardErrors","type":"object","additionalProperties":false}}},"description":"Error response."}}}