Create Coupon

POST {{baseUrl}}/coupons

This endpoint allows you to create Single Coupon, and Group Coupons.

:::note Although the response payload you will be receiving of the two coupon types at once, each has its own required Body Requests. :::

When creating a Single Coupon, ensure that you are sending the following required variables:

| Attribute               | Type    | Is Required |
| ----------------------- | ------- | ----------- |
| `code`                  | string  | Yes         |
| `type`                  | string  | Yes         |
| `amount`                | number  | Yes         |
| `free_shipping`         | boolean | Yes         |
| `expiry_date`           | string  | Yes         |
| `exclude_sale_products` | boolean | Yes         |

If `marketing_active` is valued as `true`, then when creating `Marketing Coupons`, ensure that you are sending the
following required variables:

| Attribute          | Type    | Is Required |
| ------------------ | ------- | ----------- |
| `marketing_active` | boolean | Yes         |
| `marketing_name`   | string  | Yes         |
| `marketing_type`   | string  | Yes         |
| `marketing_amount` | number  | Yes         |

If is_group is valued as true, then when creating Group Coupons, ensure that you are sending the following required variables:

| Attribute               | Type    | Is Required |
| ----------------------- | ------- | ----------- |
| `is_group`              | boolean | Yes         |
| `group_coupons_count`   | number  | Yes         |
| `group_suffix`          | string  | Yes         |
| `group_name`            | string  | Yes         |
| `type`                  | string  | Yes         |
| `amount`                | number  | Yes         |
| `free_shipping`         | boolean | Yes         |
| `expiry_date`           | string  | Yes         |
| `exclude_sale_products` | boolean | Yes         |

If `marketing_active` is valued as `true`, then when creating `Marketing Coupons`, ensure that you are sending the following required variables:

| Attribute          | Type    | Is Required |
| ------------------ | ------- | ----------- |
| `marketing_active` | boolean | Yes         |
| `marketing_name`   | string  | Yes         |
| `marketing_type`   | string  | Yes         |
| `marketing_amount` | number  | Yes         |

marketing.read_write- Marketing Read & Write

Request Body

{"code"=>"<string>", "type"=>"Percentage", "amount"=>"<number>", "status"=>"<string>", "start_date"=>"<dateTime>", "expiry_date"=>"<dateTime>", "applied_in"=>"all", "is_group"=>true, "group_name"=>"<string>", "group_coupons_count"=>"<integer>", "group_suffix"=>"<string>", "usage_limit"=>"<number>", "usage_limit_per_user"=>"<number>", "minimum_amount"=>"<number>", "maximum_amount"=>"<number>", "free_shipping"=>true, "exclude_sale_products"=>true, "show_maximum_amount"=>true, "marketing_show_maximum_amount"=>true, "marketing_active"=>true, "marketing_name"=>"<string>", "marketing_type"=>"F", "marketing_amount"=>"<number>", "marketing_hide_total_sales"=>true, "marketing_maximum_amount"=>"<number>", "marketing_info"=>"<string>", "beneficiary_domain"=>"<string>", "products_include"=>["<string>", "<string>"], "list_include_categories"=>["<string>", "<string>"], "products_exclude"=>["<string>", "<string>"], "list_exclude_categories"=>["<string>", "<string>"], "list_exclude_brands"=>["<string>", "<string>"], "list_include_groups"=>["<string>", "<string>"], "list_exclude_groups"=>["<string>", "<string>"], "list_exclude_shipping"=>["<string>", "<string>"], "payment_methods"=>["bank", "all"]}

HEADERS

KeyDatatypeRequiredDescription
Content-Typestring
Acceptstring

RESPONSES

status: OK

{&quot;status&quot;:&quot;\u003cnumber\u003e&quot;,&quot;success&quot;:&quot;\u003cboolean\u003e&quot;,&quot;data&quot;:{&quot;id&quot;:&quot;\u003cnumber\u003e&quot;,&quot;code&quot;:&quot;\u003cstring\u003e&quot;,&quot;type&quot;:&quot;f&quot;,&quot;status&quot;:&quot;active&quot;,&quot;amount&quot;:{&quot;amount&quot;:&quot;\u003cnumber\u003e&quot;,&quot;currency&quot;:&quot;\u003cstring\u003e&quot;},&quot;minimum_amount&quot;:{&quot;amount&quot;:&quot;\u003cnumber\u003e&quot;,&quot;currency&quot;:&quot;\u003cstring\u003e&quot;},&quot;maximum_amount&quot;:{&quot;amount&quot;:&quot;\u003cnumber\u003e&quot;,&quot;currency&quot;:&quot;\u003cstring\u003e&quot;},&quot;show_maximum_amount&quot;:false,&quot;expiry_date&quot;:&quot;\u003cstring\u003e&quot;,&quot;start_date&quot;:&quot;\u003cstring\u003e&quot;,&quot;free_shipping&quot;:true,&quot;usage_limit&quot;:&quot;\u003cnumber\u003e&quot;,&quot;usage_limit_per_user&quot;:&quot;\u003cnumber\u003e&quot;,&quot;include_product_ids&quot;:[&quot;\u003cstring\u003e&quot;,&quot;\u003cstring\u003e&quot;],&quot;exclude_product_ids&quot;:[&quot;\u003cstring\u003e&quot;,&quot;\u003cstring\u003e&quot;],&quot;is_sale_products_exclude&quot;:true,&quot;include_category_ids&quot;:[&quot;\u003cstring\u003e&quot;,&quot;\u003cstring\u003e&quot;],&quot;exclude_category_ids&quot;:[&quot;\u003cstring\u003e&quot;,&quot;\u003cstring\u003e&quot;],&quot;include_customer_group_ids&quot;:[&quot;\u003cstring\u003e&quot;,&quot;\u003cstring\u003e&quot;],&quot;exclude_customer_group_ids&quot;:[&quot;\u003cstring\u003e&quot;,&quot;\u003cstring\u003e&quot;],&quot;exclude_brands_ids&quot;:[&quot;\u003cstring\u003e&quot;,&quot;\u003cstring\u003e&quot;],&quot;exclude_shipping_ids&quot;:[&quot;\u003cstring\u003e&quot;,&quot;\u003cstring\u003e&quot;],&quot;include_customer_ids&quot;:[&quot;\u003cstring\u003e&quot;,&quot;\u003cstring\u003e&quot;],&quot;include_payment_methods&quot;:[&quot;knet&quot;,&quot;stc_pay&quot;],&quot;applied_in&quot;:&quot;app&quot;,&quot;is_group&quot;:true,&quot;group_name&quot;:&quot;\u003cstring\u003e&quot;,&quot;group_coupons_count&quot;:&quot;\u003cnumber\u003e&quot;,&quot;group_coupon_suffix&quot;:&quot;\u003cstring\u003e&quot;,&quot;group_coupons&quot;:[{&quot;code&quot;:&quot;\u003cstring\u003e&quot;},{&quot;code&quot;:&quot;\u003cstring\u003e&quot;}],&quot;beneficiary_domain&quot;:&quot;\u003cstring\u003e&quot;,&quot;statistics&quot;:{&quot;num_of_usage&quot;:&quot;\u003cnumber\u003e&quot;,&quot;num_of_customers&quot;:&quot;\u003cnumber\u003e&quot;,&quot;coupon_sales&quot;:{&quot;amount&quot;:&quot;\u003cnumber\u003e&quot;,&quot;currency&quot;:&quot;\u003cstring\u003e&quot;}},&quot;created_at&quot;:{&quot;date&quot;:&quot;\u003cstring\u003e&quot;,&quot;timezone_type&quot;:&quot;\u003cnumber\u003e&quot;,&quot;timezone&quot;:&quot;\u003cstring\u003e&quot;},&quot;updated_at&quot;:{&quot;date&quot;:&quot;\u003cstring\u003e&quot;,&quot;timezone_type&quot;:&quot;\u003cnumber\u003e&quot;,&quot;timezone&quot;:&quot;\u003cstring\u003e&quot;},&quot;marketing_active&quot;:true,&quot;marketing_name&quot;:&quot;\u003cstring\u003e&quot;,&quot;marketing_email&quot;:&quot;\u003cstring\u003e&quot;,&quot;marketing_type&quot;:&quot;Percentage&quot;,&quot;marketing_amount&quot;:{&quot;amount&quot;:&quot;\u003cnumber\u003e&quot;,&quot;currency&quot;:&quot;\u003cstring\u003e&quot;},&quot;marketing_hide_total_sales&quot;:false,&quot;marketing_show_maximum_amount&quot;:true,&quot;marketing_maximum_amount&quot;:0,&quot;marketing_info&quot;:&quot;\u003cstring\u003e&quot;,&quot;marketing_visits_count&quot;:&quot;\u003cnumber\u003e&quot;,&quot;marketing_url&quot;:&quot;\u003cstring\u003e&quot;,&quot;marketing_statistics_url&quot;:&quot;\u003cstring\u003e&quot;}}