# API: Add Order Draft discount

# addOrderDraftDiscount

Add coupon or a custom discount to draft order.

# Required parameters

Parameter Description
id Draft ID
coupon Use promotion code ID to apply coupons, client for personal or client group discount, or custom for custom discount

# Optional parameters

Parameter Description
validate When set to 1 it will validate coupon code against client usage. Only available when using coupon ID
target Custom discount target, either all or items
type Type of the discount, percent or fixed. Only available for custom coupon with target set to all
value Discount value. Only available for custom coupon with target set to all
items Array with item specific discounts. Only available for custom coupon with target set to items
cycle Discount cycle, once or recurring. Only available for custom coupon

# Request

GET /admin/api.php?api_id=API_ID&api_key=API_KEY&call=addOrderDraftDiscount&id=ID&coupon=COUPON

# PHP Samples

# PHP Samples: 10% discount to all items

# PHP Samples: 5% discount only to first service in draft

# PHP Samples: Mixed discount for service and form component

# Response

{
    "success": true,
    "draft": [],
    "call": "addOrderDraftDiscount",
    "server_time": 1344000642
}
Last Updated: 1/27/2025, 5:03:46 PM