Create Coupon
POST
/couponsThis endpoint allows you to create Single Coupon, and Group Coupons.
:::info[Information]
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 |
Request
Coupon Type.
Coupon Amount.
Coupon Status.
Coupon Start Date. Supports two formats, either YYYY-MM-DD
or YYYY-MM-DD HH:MM:SS
Coupon Expiry Date. Value MUST be at least one day later than today. Supports two formats, either YYYY-MM-DD
or YYYY-MM-DD HH:MM:SS
Coupon to be applied at. Value can either all
or web
or app
Whether or not the Coupon is of type Group
.
Group Name. requiredif
is_group
value is true
Group Coupons Count. requiredif
is_group
value is true
Group Name Suffix. requiredif
is_group
value is true
. No spaces/numbers are allowed
Coupon Usage Limit
Coupon Usage Limit Per User
Coupon Minimum Amount
Coupon Maximum Amount. requiredif
type is set to percentage
Whether or not the coupon include free shipping
Whether or not the coupon exclude on-sale products
Whether or not to show the maximum amount of the coupon
Whether or not to show the marketing maximum amount of the coupon to the marketer
Whether or not the coupon include a marketer
Marketer Name.
Marketer Type.
Marketing Amount.
Whether or not hide total sales.
Marketing Maximum Amount Value
Marketing Additional Info
Beneficiary Email Domain
List of Included Products in the Coupon. List of products can be found here.
List of Included Categories in the Coupon. List of categories can be found here.
List of Excluded Products in the Coupon. List of products can be found here.
List of Excluded Categories. List of categories can be found here.
List of Excluded Brands. List of brands can be found here.
List of Included Customer Groups. List of customers can be found here.
List of Excluded Customer Groups. List of customers can be found here.
List of Excluded Shipping Companies. List of shipping companies can be found here
List of Included Payment Methods. List of available payment methods can be found here.
{
"code": "discount10",
"type": "percentage",
"amount": 10,
"maximum_amount": 50,
"free_shipping": true,
"start_date": "2022-08-02",
"expiry_date": "2022-12-12",
"exclude_sale_products": false
}
Request samples
Responses
{
"status": 200,
"success": true,
"data": {
"id": 1622617640,
"code": "QAZCVS",
"type": "fixed",
"status": "active",
"amount": {
"amount": 30,
"currency": "SAR"
},
"minimum_amount": null,
"maximum_amount": {
"amount": 0,
"currency": "SAR"
},
"show_maximum_amount": false,
"expiry_date": "2023-03-17 00:00:00",
"start_date": null,
"free_shipping": true,
"usage_limit": null,
"usage_limit_per_user": null,
"include_product_ids": [
"1626467363"
],
"exclude_product_ids": [
"213592621"
],
"is_sale_products_exclude": true,
"include_category_ids": [
"676928739"
],
"exclude_category_ids": [
"1585249762"
],
"include_customer_group_ids": [
"322729604"
],
"exclude_customer_group_ids": [
"1830458757"
],
"exclude_brands_ids": [
"1939592358"
],
"exclude_shipping_ids": [
"1345871747"
],
"include_customer_ids": [],
"include_payment_methods": [
"bank",
"cod",
"credit_card",
"knet",
"mada",
"paypal",
"spotii_pay",
"stc_pay",
"tabby_installment",
"tamara_installment"
],
"applied_in": "all",
"is_group": false,
"group_name": null,
"group_coupons_count": null,
"group_coupon_suffix": null,
"group_coupons": null,
"beneficiary_domain": null,
"statistics": {
"num_of_usage": 0,
"num_of_customers": 0,
"coupon_sales": {
"amount": 0,
"currency": "SAR"
}
},
"created_at": {
"date": "2022-04-06 12:45:13.000000",
"timezone_type": 3,
"timezone": "Asia/Riyadh"
},
"updated_at": {
"date": "2022-04-06 12:45:13.000000",
"timezone_type": 3,
"timezone": "Asia/Riyadh"
},
"marketing_active": true,
"marketing_name": "Nabil",
"marketing_type": "percentage",
"marketing_amount": {
"amount": 10,
"currency": "SAR"
},
"marketing_hide_total_sales": false,
"marketing_show_maximum_amount": false,
"marketing_maximum_amount": 4000,
"marketing_info": "",
"marketing_visits_count": 0,
"marketing_url": "https://salla.sa/dev-wofftr4xsra5xtlv?utm_source=ref&utm_campaign=QAZCVS",
"marketing_statistics_url": "https://mtjr.coupons/w172T"
}
}