Variable | Type | Description |
---|---|---|
list_id | int|string | The ID of the list to which the coupon will be added |
name | string | The name of the coupon which will be added |
status | int|string | The status of the coupon (1 for active, 0 for inactive) |
type | string | The type of the coupon. It can be import or api |
type_data | struct|array | Array containing parameters related to the coupon type. If the type is import, the allowed keys are: notify_drops_below (int, when the number of codes drops below this limit, a notification will be sent), notify_drops_email (when there aren't enough codes available, the notification will be sent to these emails. It can be array or string - comma separated emails). If the type is api, the allowed keys are: api_url (the webhook url), api_prefix (the prefix for the codes, may be empty), discount_type (percent, fixed or free_shipping), discount_percent (the discount percentage value if the discount type is percent), discount_fixed (the value of the fixed discount if the type is fixed), minimum_purchase_amount (the minimum purchase amount for which the codes may be applied), regen_min_count_below (when the number of codes drops below this limit, new codes will be generated), regen_codes_count (the number of codes to be generated when there are not enough available codes), regen_codes_batch_size (how many codes should be generated per call), api_currency (RON or EUR or empty / null) |
expire | struct|array|boolean|string | When should the codes of this coupon expire (after import or API generate). You may send an empty string, or null, or false for no expiration. If the codes should expire, send an array with the following keys: expire_type (days, hours or date) and expire_value (int or string). If expire_type is days or hours, expire_value should be the number of days or hours at which the code expires after generation (int). If expire_type is date, expire_value should be a date in YYYY-MM-DD format. |
Parameter | Description |
---|---|
array | Array containing the data of the inserted coupon |
{ "list_id": "my_list_id", "name": "MYTESTCOUPON", "api": { "api_url": "my_webhook_url", "currency": "RON", "discount_percent": 20, "discount_type": "percent", "minimum_purchase_amount": 150, "prefix": "PRFX", "regen_batch_size": 125, "regen_codes_count": 500, "regen_min_count_below": 100 }, "expire_type": "add", "status": 1, "type": "api", "id": "my_coupon_id" }
Code | Message | Description |
---|---|---|
407 | Missing required param list_id | list_id param is required |
407 | Missing required param name | name param is required |
407 | Missing required param status | status param is required |
407 | Missing required param type | type param is required |
407 | Missing required param type_data | type_data param is required |
407 | Missing required param expire | expire param is required |
{ "err": true, "message": "Missing required param list_id", "code": 407 }
{ "err": true, "message": "Missing required param name", "code": 407 }
{ "err": true, "message": "Missing required param status", "code": 407 }
{ "err": true, "message": "Missing required param type", "code": 407 }
{ "err": true, "message": "Missing required param type_data", "code": 407 }
{ "err": true, "message": "Missing required param expire", "code": 407 }