Create Coupon

POST https://api.salla.dev/admin/v2/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:

AttributeTypeIs Required
codestringYes
typestringYes
amountnumberYes
free_shippingbooleanYes
expiry_datestringYes
exclude_sale_productsbooleanYes

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

AttributeTypeIs Required
marketing_activebooleanYes
marketing_namestringYes
marketing_typestringYes
marketing_amountnumberYes

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

AttributeTypeIs Required
is_groupbooleanYes
group_coupons_countnumberYes
group_suffixstringYes
group_namestringYes
typestringYes
amountnumberYes
free_shippingbooleanYes
expiry_datestringYes
exclude_sale_productsbooleanYes

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

AttributeTypeIs Required
marketing_activebooleanYes
marketing_namestringYes
marketing_typestringYes
marketing_amountnumberYes

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"=>"p", "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", "apple_pay"]}

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;fixed&quot;,&quot;status&quot;:&quot;deleted&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;start_date&quot;:&quot;\u003cstring\u003e&quot;,&quot;expiry_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;stc_pay&quot;,&quot;bank&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;Fixed&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;}}