action api2cart_cart_coupon_add { label: "CartCouponAdd" description: "Create new coupon" provider: api2cart method: POST path: "/cart.coupon.add.json" encoding: json input: { type: "object" required: ["action_amount", "action_apply_to", "action_scope", "action_type", "code"] properties: { action_amount: { type: "number" description: "Defines the discount amount value." } action_apply_to: { type: "string" description: "Defines where discount should be applied" enum: ["order_total", "item_price", "shipping"] } action_condition_entity: { type: "string" description: "Defines entity for action condition." } action_condition_key: { type: "string" description: "Defines entity attribute code for action condition." } action_condition_operator: { type: "string" description: "Defines condition operator." } action_condition_value: { type: "string" description: "Defines condition attribute value/s. Can be comma separated string." } action_scope: { type: "string" description: "Specify how discount should be applied. If scope=matching_items, then discount will be applied to each of the items that match action conditions. Scope order means that discount will be applied once." enum: ["order", "matching_items"] } action_type: { type: "string" description: "Coupon discount type" enum: ["percent", "fixed"] } code: { type: "string" description: "Coupon code" } codes: { type: "array" description: "Entity codes" items: { type: "string" } } date_end: { type: "string" description: "Defines when discount code will be expired." } date_start: { type: "string" description: "Defines when discount code will be available." } name: { type: "string" description: "Coupon name" } store_id: { type: "string" description: "Store Id" } usage_limit: { type: "integer" description: "Usage limit for coupon." } usage_limit_per_customer: { type: "integer" description: "Usage limit per customer." } } } output: { type: "object" properties: { result: { type: "object" properties: { coupon_id: { type: "string" } } } return_code: { type: "integer" } return_message: { type: "string" } } } }