Create a New Coupon
POST
https://api.zid.sa/v1v1/managers/store/coupons/add
Coupons and Bundle Offers
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.zid.sa/v1v1/managers/store/coupons/add' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxMTciLCJqdGkiOiJhMTg5ZTg3MmYxMzhkMWVhYjU5MjVkMDkyMGE5NmI0YjliNjg0Y2E2ZTdmM2M2MjljZWYxNmQ4NDJjMmJlYmVhMjI4YTdmMTA0ZWQ4NWE5NCIsImlhdCI6MTY3OTU3Njk5OS41NjY4NzcsIm5iZiI6MTY3OTU3Njk5OS41NjY4OCwiZXhwIjoxNzExMTk5Mzk5LjQ4NjE1Mywic3ViIjoiMTgyNDc1Iiwic2NvcGVzIjpbInRoaXJkLXBhcnRpZXMtYXBpcyJdfQ.i07ef09nVNXGZF-g-QXpNoS2vlFQK_zntAqAMS4Az2XD2EyMLhxLZZRL-QlR11zUPqMmXjMAl_4ooKa3M3zkfZQ6Ga6qStvamk8RnC_39VUx0lfN2A4k65ERZpqwrMy6-t3dE99zay3aicIdNvbgi0zeuMSE5Tn99u-2AtSRa8ffbfAcYPPXacHrhdmlYzdiZS_x_skovFEow1E-nDjdL1WHqO92XdZ7RfNLkiYFTjZlZmM_UruvioaR3q6TXJbqRK_ZrziivezL8ohIQ2SBosUp58I29rlKzvlw_R2j0rKKYZbdxYDaxAHOISmOFKAlO66k7dNevAHI3s4uGIjoGA6ZXHknccWPLLLiaAQ0r64HV8GowW5dg2rhZNurJGDTnLlBQ6F-ql42ptHzSAfzzi576CEoN3gMVpgXcbntUY3reETkFsTBPUjeSuMpANMioXAA0GRp3Ut-84fTnrWxqsCW1WVUIx33HvmfCGPXIdkaCCWoA6G6KXo04MtFbKXQmXkK9esQWI-rqdVnMD3zSR3g3yFHZSL1U-mZeNja03706Rav1ordsRNOtRwtLuoRRbk9KasbUpEwqq4Ao9lqZZwRIjdEw-pQtnUT8V53fhmuuRIefCLFO7eGEtGUnh9o6Uh_pgi6AB6uSlnN9GEMGgI1alqvMmTjxvC-HHt0V-Y' \
--header 'X-Manager-Token: eyJpdiI6Imh3L2dGbmJmRnVCOUY4WW5WQ2s3RFE9PSIsInZhbHVlIjoiZklpRnJyVGV1OWcrZUJBNk44bVp5SjZzSS92V3czcTJjbnJ2dFYvenZ3SFBtWHNSMFU3ZEMzZ0ZJNnpucVE4Ui9rNFdicUduOGpKUlg1VXdGOFFIaVUzZjZyUUZybWx3R0tNY3orUmxoUUUxQ29wSkEyVDZTVnVYb2dlUXJSVzBYVkdESjBpS0xiN05Hbndzc2wzV2N0YitGM1NEdkk4ckZZOTZsTFdEL1ZQRlJJTE5FQmttZng2elpwL1RCeXFRdUd1U3JTc0FHV1kySS80RFJaWlIyZ3gwM2FsQVRFbkt3VWtFOUQyKzdGOD0iLCJtYWMiOiJmZDQ0YzM4ODE0OWQxOWRhYWU0NDhhYmIzYzQ1MDAxMDAzODZjZGM3ZGM4NGJhMGNkMDEyYWZlM2UzYjAxMTI4IiwidGFnIjoiIn0=' \
--header 'Accept-Language;' \
--form 'name="Summer Sale - July 2023"' \
--form 'code="SUMMER2023"' \
--form 'discount_type="p"' \
--form 'discount="20"' \
--form 'free_shipping="1"' \
--form 'free_cod="0"' \
--form 'total="100"' \
--form 'date_start="2023-07-01"' \
--form 'date_end="2023-07-31"' \
--form 'uses_total="100"' \
--form 'uses_customer="3"' \
--form 'apply_to="all"' \
--form 'apply_to_array="UID1"' \
--form 'apply_to_array="UID2"' \
--form 'is_mazeed_active=""' \
--form 'is_pos_active=""' \
--form 'is_mobile_app_active=""' \
--form 'status="1"' \
--form 'applying_method=""' \
--form 'conditions=""' \
--form 'max_total=""'
Response Response Example
{
"status": "object",
"coupon": {
"coupon_id": 3311,
"id": 3311,
"store_id": 23363,
"store_name": "MohamedSamir",
"store_logo": null,
"code": "mAcWL4NNNNNNNNNNN",
"uses_total": 0,
"created_at": "2025-02-02T10:36:58.000000Z",
"name": "ffee",
"total_usage": null,
"discount_type": "f",
"applying_method": "CODE",
"conditions": null,
"discount": 10,
"logged": false,
"free_shipping": true,
"free_cod": true,
"apply_to": "products",
"total": 0,
"max_total": 0,
"date_start": "2024-11-24",
"date_end": "2024-12-24",
"uses_customer": 0,
"coupon_status": true,
"enabled": true,
"status_code": "coupon_expired",
"maximum_discount_value": null,
"orders": [],
"total_sales": 0,
"total_customers": 0,
"note": null,
"is_mazeed_active": true,
"is_pos_active": true,
"is_shown_in_pos": true,
"is_mobile_app_active": true,
"apply_to_data": []
},
"message": {
"type": "object",
"code": null,
"name": null,
"description": null
}
}
Request
Header Params
Authorization
stringÂ
required
Example:
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxMTciLCJqdGkiOiJhMTg5ZTg3MmYxMzhkMWVhYjU5MjVkMDkyMGE5NmI0YjliNjg0Y2E2ZTdmM2M2MjljZWYxNmQ4NDJjMmJlYmVhMjI4YTdmMTA0ZWQ4NWE5NCIsImlhdCI6MTY3OTU3Njk5OS41NjY4NzcsIm5iZiI6MTY3OTU3Njk5OS41NjY4OCwiZXhwIjoxNzExMTk5Mzk5LjQ4NjE1Mywic3ViIjoiMTgyNDc1Iiwic2NvcGVzIjpbInRoaXJkLXBhcnRpZXMtYXBpcyJdfQ.i07ef09nVNXGZF-g-QXpNoS2vlFQK_zntAqAMS4Az2XD2EyMLhxLZZRL-QlR11zUPqMmXjMAl_4ooKa3M3zkfZQ6Ga6qStvamk8RnC_39VUx0lfN2A4k65ERZpqwrMy6-t3dE99zay3aicIdNvbgi0zeuMSE5Tn99u-2AtSRa8ffbfAcYPPXacHrhdmlYzdiZS_x_skovFEow1E-nDjdL1WHqO92XdZ7RfNLkiYFTjZlZmM_UruvioaR3q6TXJbqRK_ZrziivezL8ohIQ2SBosUp58I29rlKzvlw_R2j0rKKYZbdxYDaxAHOISmOFKAlO66k7dNevAHI3s4uGIjoGA6ZXHknccWPLLLiaAQ0r64HV8GowW5dg2rhZNurJGDTnLlBQ6F-ql42ptHzSAfzzi576CEoN3gMVpgXcbntUY3reETkFsTBPUjeSuMpANMioXAA0GRp3Ut-84fTnrWxqsCW1WVUIx33HvmfCGPXIdkaCCWoA6G6KXo04MtFbKXQmXkK9esQWI-rqdVnMD3zSR3g3yFHZSL1U-mZeNja03706Rav1ordsRNOtRwtLuoRRbk9KasbUpEwqq4Ao9lqZZwRIjdEw-pQtnUT8V53fhmuuRIefCLFO7eGEtGUnh9o6Uh_pgi6AB6uSlnN9GEMGgI1alqvMmTjxvC-HHt0V-Y
X-Manager-Token
stringÂ
required
X-Manager-Token
should be included in the header of API requests that require store-related information.Example:
eyJpdiI6Imh3L2dGbmJmRnVCOUY4WW5WQ2s3RFE9PSIsInZhbHVlIjoiZklpRnJyVGV1OWcrZUJBNk44bVp5SjZzSS92V3czcTJjbnJ2dFYvenZ3SFBtWHNSMFU3ZEMzZ0ZJNnpucVE4Ui9rNFdicUduOGpKUlg1VXdGOFFIaVUzZjZyUUZybWx3R0tNY3orUmxoUUUxQ29wSkEyVDZTVnVYb2dlUXJSVzBYVkdESjBpS0xiN05Hbndzc2wzV2N0YitGM1NEdkk4ckZZOTZsTFdEL1ZQRlJJTE5FQmttZng2elpwL1RCeXFRdUd1U3JTc0FHV1kySS80RFJaWlIyZ3gwM2FsQVRFbkt3VWtFOUQyKzdGOD0iLCJtYWMiOiJmZDQ0YzM4ODE0OWQxOWRhYWU0NDhhYmIzYzQ1MDAxMDAzODZjZGM3ZGM4NGJhMGNkMDEyYWZlM2UzYjAxMTI4IiwidGFnIjoiIn0=
Accept-Language
enum<string>Â
optional
en
if not specified.Allowed values:
enar
Example:
en
Body Params multipart/form-data
name
stringÂ
required
Example:
Summer Sale - July 2023
code
stringÂ
required
Example:
SUMMER2023
discount_type
enum<string>Â
required
Allowed values:
fp
Example:
p
discount
stringÂ
required
Example:
20
free_shipping
stringÂ
required
1
to enable free shipping, 0
to disable it.Example:
1
free_cod
stringÂ
required
1
to enable free Cash On Delivery (COD), 0
to disable it.Example:
0
total
stringÂ
required
Example:
100
date_start
stringÂ
required
Example:
2023-07-01
date_end
stringÂ
required
Example:
2023-07-31
uses_total
integerÂ
required
Example:
100
uses_customer
integerÂ
required
Example:
3
apply_to
enum<string>Â
required
Allowed values:
allnon_discounted_productsdiscounted_productsproductscategoriesexcluded_products
Example:
all
apply_to_array
array[string]
optional
apply_to
is set to products
, categories
, or excluded_products
.apply_to
is set to products
or categories
, the coupon will apply only to the items or categories specified in this array.apply_to
is set to excluded_products
, the coupon will apply to all items except those specified in this array.Example:
["UID1","UID2"]
is_mazeed_active
enum<integer>Â
optional
Allowed values:
01
Default:
0
Example:
0
is_pos_active
enum<integer>Â
optional
Allowed values:
01
Default:
0
Example:
0
is_mobile_app_active
enum<integer>Â
optional
Allowed values:
01
Default:
0
Example:
0
status
stringÂ
required
1
to activate the coupon, 0
to deactivate it.Example:
1
applying_method
stringÂ
required
conditions
stringÂ
required
max_total
stringÂ
required
Responses
Modified at 2025-02-02 11:28:39