Zid Docs
Merchant APIApp APIThemes
Merchant APIApp APIThemes
Help Center
Slack
  1. Coupons
  • Start Here ๐Ÿš€
  • Overview to Zid Apps
  • Authorization
  • Responses
  • Webhooks
  • Rate Limiting
  • APIs
    • Orders
      • Update Order by ID
      • Get Order Credit Notes
      • Get Order by ID
      • List of Orders
    • Reverse Orders
      • Reverse Order Reasons
      • Create Reverse Orders
      • Create Reverse Orders Waybill
      • Add Reverse Order Reasons
    • Carts
      • Get Abandoned Cart Details
      • List Abandoned Carts
    • Products
      • Managing Products
        • Get a Product by ID
        • Retrieve a list of products
        • Create a new product
        • Update an existing product.
        • Bulk update of products using their IDs or SKUs
        • Delete a product.
        • Product Setting
      • Digital Vouchers
        • Product Vouchers
        • Order Voucher
        • Add Product Voucher
        • Import Vouchers
        • Export Vouchers
        • Update Product Voucher
        • Remove Product Voucher
      • Product Categories
        • Get Single Category Details
        • Get all categories
        • Create Store Category
        • Update a Store Category
        • Add a product to a certain category
        • Publish/Unpublish a Category
        • Detach Category from All Products
        • Remove Category from Product
      • Product Badge
        • Product Badge
      • Product Attributes
        • Get Product Attributes
        • Get Product Attributes
        • Retrieve a product attribute
        • Add a New Product Attribute
        • Add a New Product Attribute
        • Update a product attribute
        • Delete a product attribute
      • Product Attribute Presets
        • Get attribute presets
        • Create Attribute Preset
        • Update Attribute Preset
        • Delete an attribute preset
      • Product Customizations
        • Add Product Variants
        • Insert Custom Options to a Product
        • Insert Custom User-Input Fields to a Product
      • Product Manual Sorting
        • Set Custom Product Order
        • Reset the manual sorting of all products
      • Product Images
        • Get List of images of a product.
        • Add an image to a product
        • Update a product Image Order
        • Delete a product image
      • Product Notifications
        • Availability Notification Stats
        • Availability Notifications Settings
        • List Availability Notifications
        • Add Availability Notification
        • Save Availability Notifications Settings
        • Manually Send Availability Notification Email
        • Export Availability Notifications
      • Product Import
        • Email All Products to Store Owner
        • Import Products via CSV or xlsx File
      • Product Stock (Multi-Inventory)
        • Get Product Stock by ID
        • List Product Stocks
        • Add Product Stock
        • Update Single Product Stock
        • Bulk Update Product Stocks
      • Product Questions & Answers
        • Get Question
        • Get Answer
        • Get All Questions
        • List Question Answers
        • Create Question
        • Create Answer
        • Update Question
        • Update Answer
        • Delete Question
        • Delete Answer
      • Product Reviews
        • List Reviews
        • New Reviews Total
      • Digital Products
        • Create Downloadable Product
        • Generate an Upload URL
        • Upload File to S3
        • Create Product Downloadables
        • Get Product Downloadables
        • Delete Product Downloadables
        • Get Store Downloadables
        • Create Store Downloadables
        • Delete Store Downloadables
    • Inventories
      • Get Store Location by ID
      • List Store Locations
      • Add a New Location
      • Update a Location by ID
      • Update Products Stock by Location ID
    • Shipping
      • List Store Delivery Options
      • Add Shipping Option
    • Marketing
      • Gift Cards
        • Get Store Settings
        • Add gift card to the cart
        • Update Store Settings
        • Upload gift card designs
        • Remove gift card from the cart
      • Coupons
        • Create a New Coupon
          POST
        • List Coupons
          GET
        • Get Coupon Details
          GET
        • Update Coupon
          POST
        • Delete Coupon
          DELETE
      • Bundle Offers
        • Retrieve all Bundle Offers
      • Loyalty Program
        • Loyalty Program Points per Order
        • Store Loyalty Status
        • Info Page
        • Loyalty Program Activation
        • Loyalty Status
        • Set Points Expiration
        • Cashback Rule Method Update
        • Cashback Rule Method Update Status
        • Add Points Redemption Method
        • Update Points Redemption Method
        • Delete Points Redemption Method
        • Toggle Redemption Method Status
        • Show Loyalty Points Info for Specific Customer
        • Customer Profile
        • List Data
        • Customer Points History
        • Info Page - Managers
        • Update Info Page
        • Adjust Customer Points
    • Customers
      • List of Customers
      • Get Customer by ID
    • Store Settings
      • ๐Ÿ“„ User Roles and Permissions
      • Get Manager's Profile
      • Get VAT Settings
      • List of Payment Method
    • Countries and Cities
      • Retrieve Store Operating Countries
      • Retrieve Cities by Country ID
      • Countries List
    • Webhook
      • List of Webhooks
      • Create a Webhook
      • Delete a Webhook by OriginalId
      • Delete a Webhook by Subscriber
  • Store Events
    • Order
    • Product
    • Abandoned Cart
    • Customer
    • Product Category
  1. Coupons

Create a New Coupon

POST
https://api.zid.sa/v1/managers/store/coupons/add
Coupons and Bundle Offers
Create a new coupon with various options such as discount type, validity period, usage limits, and application conditions.
๐Ÿ”‘Scopes
coupons.read_write - Coupons Read & Write

Request

Header Params
Authorization
stringย 
required
The Authorization token is a unique key given to the third-party application (Partner) by Zid. It is used to authenticate the API requests made by the Partner application. The token verifies the partner's identity and ensures they have permission to access Zid's API but does not provide any specific user or store information. It should be included in the header of API requests when the partner application needs to access Zid's API.
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
This token is used to authenticate and access information related to the store. It is obtained through an OAuth mechanism and is required to perform operations on the store's data. The X-Manager-Token should be included in the header of API requests that require store-related information.
Example:
eyJpdiI6Imh3L2dGbmJmRnVCOUY4WW5WQ2s3RFE9PSIsInZhbHVlIjoiZklpRnJyVGV1OWcrZUJBNk44bVp5SjZzSS92V3czcTJjbnJ2dFYvenZ3SFBtWHNSMFU3ZEMzZ0ZJNnpucVE4Ui9rNFdicUduOGpKUlg1VXdGOFFIaVUzZjZyUUZybWx3R0tNY3orUmxoUUUxQ29wSkEyVDZTVnVYb2dlUXJSVzBYVkdESjBpS0xiN05Hbndzc2wzV2N0YitGM1NEdkk4ckZZOTZsTFdEL1ZQRlJJTE5FQmttZng2elpwL1RCeXFRdUd1U3JTc0FHV1kySS80RFJaWlIyZ3gwM2FsQVRFbkt3VWtFOUQyKzdGOD0iLCJtYWMiOiJmZDQ0YzM4ODE0OWQxOWRhYWU0NDhhYmIzYzQ1MDAxMDAzODZjZGM3ZGM4NGJhMGNkMDEyYWZlM2UzYjAxMTI4IiwidGFnIjoiIn0=
Accept-Language
enum<string>ย 
optional
Preferred language for the response. Defaults to en if not specified.
Allowed values:
enar
Example:
en
Body Params multipart/form-data
name
stringย 
required
The name of the coupon for the merchant's own reference. This name will appear on the merchant dashboard and is not visible to the customer.
Example:
Summer Sale - July 2023
code
stringย 
required
The unique code for the coupon.
Example:
SUMMER2023
discount_type
enum<string>ย 
required
The type of discount to be applied. Use 'f' for a fixed amount and 'p' for a percentage.
Allowed values:
fp
Example:
p
discount
stringย 
required
The value of the discount.
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
The minimum total amount of items in the cart, before shipping, VAT, and other fees, required to apply the coupon. The currency considered is the store's default currency.
Example:
100
date_start
stringย 
required
The start date for the coupon validity.
Example:
2023-07-01
date_end
stringย 
required
The end date for the coupon validity.
Example:
2023-07-31
uses_total
integerย 
required
The maximum number of times the coupon can be used.
Example:
100
uses_customer
integerย 
required
The maximum number of times a single customer can use the coupon.
Example:
3
apply_to
enum<string>ย 
required
Specifies where the coupon can be applied.
Allowed values:
allnon_discounted_productsdiscounted_productsproductscategoriesexcluded_products
Example:
all
apply_to_array
array[string]
optional
An array of product UIDs or category IDs on which the coupon will be applied. This field is relevant only if apply_to is set to products, categories, or excluded_products.
When apply_to is set to products or categories, the coupon will apply only to the items or categories specified in this array.
When 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
Indicates whether the coupon is active in Mazeed.
Allowed values:
01
Default:
0
Example:
0
is_pos_active
enum<integer>ย 
optional
Indicates whether the coupon is active in the Point of Sale (POS) system.
Allowed values:
01
Default:
0
Example:
0
is_mobile_app_active
enum<integer>ย 
optional
Indicates whether the coupon is valid in the mobile application.
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
To indication the way the coupon should be applied (default to CODE)
conditions
stringย 
required
Represents the coupon conditions.
max_total
stringย 
required
To indicate the maximum limit for the cart total to apply the coupon, if the cart total exceeds this value the coupon won't be applied

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.zid.sa/v1/managers/store/coupons/add' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiL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lIjoiZklpRnJyVGV1OWcrZUJBNk44bVp5SjZzSS92V3czcTJjbnJ2dFYvenZ3SFBtWHNSMFU3ZEMzZ0ZJNnpucVE4Ui9rNFdicUduOGpKUlg1VXdGOFFIaVUzZjZyUUZybWx3R0tNY3orUmxoUUUxQ29wSkEyVDZTVnVYb2dlUXJSVzBYVkdESjBpS0xiN05Hbndzc2wzV2N0YitGM1NEdkk4ckZZOTZsTFdEL1ZQRlJJTE5FQmttZng2elpwL1RCeXFRdUd1U3JTc0FHV1kySS80RFJaWlIyZ3gwM2FsQVRFbkt3VWtFOUQyKzdGOD0iLCJtYWMiOiJmZDQ0YzM4ODE0OWQxOWRhYWU0NDhhYmIzYzQ1MDAxMDAzODZjZGM3ZGM4NGJhMGNkMDEyYWZlM2UzYjAxMTI4IiwidGFnIjoiIn0=' \
--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=""'

Responses

๐ŸŸข200Coupon successfully created.
application/json
Body
status
stringย 
required
Indicates the response type. Default is object.
coupon
objectย 
required
Contains the details of the coupon.
coupon_id
integerย 
required
Unique identifier for the coupon.
Example:
3311
id
integerย 
required
Duplicate of coupon_id.
Example:
3311
store_id
integerย 
required
ID of the store issuing the coupon.
Example:
23363
store_name
stringย 
required
Name of the store issuing the coupon.
Example:
MohamedSamir
store_logo
nullย 
required
URL of the store logo (if available).
code
stringย 
required
The coupon code.
Example:
mAcWL4NNNNNNNNNNN
uses_total
integerย 
required
Number of times the coupon can be used overall.
Example:
0
created_at
stringย 
required
Date and time when the coupon was created.
Example:
2025-02-02T10:36:58.000000
name
stringย 
required
Name of the coupon.
Example:
ffee
total_usage
nullย 
required
Total times the coupon has been used.
discount_type
stringย 
required
Type of discount (p for percentage, f for fixed amount).
Example:
f
applying_method
stringย 
required
How the coupon is applied (CODE by default).
Example:
CODE
conditions
nullย 
required
Conditions required for the coupon to be applied.
discount
integerย 
required
Discount value applied when the coupon is used.
Example:
10
logged
booleanย 
required
Indicates if logging is required for the coupon.
Default:
false
free_shipping
booleanย 
required
Indicates if the coupon provides free shipping.
Default:
true
free_cod
booleanย 
required
Indicates if the coupon allows free Cash on Delivery.
Default:
true
apply_to
stringย 
required
Determines what the coupon applies to (products, all, etc.).
Example:
products
total
integerย 
required
Minimum cart total required to apply the coupon.
Example:
0
max_total
integerย 
required
Maximum cart total allowed for the coupon to be applied.
Example:
0
date_start
stringย 
required
Start date of the coupon.
Example:
2024-11-24
date_end
stringย 
required
Expiry date of the coupon.
Example:
2024-12-24
uses_customer
integerย 
required
Number of times a customer can use the coupon.
Example:
0
coupon_status
booleanย 
required
Indicates if the coupon is currently active.
Default:
true
enabled
booleanย 
required
Determines if the coupon is enabled.
Default:
true
status_code
stringย 
required
Status of the coupon (coupon_active, coupon_expired, etc.).
Example:
coupon_expired
maximum_discount_value
nullย 
required
Maximum discount value allowed for the coupon.
orders
array[string]
required
List of orders associated with the coupon.
total_sales
integerย 
required
Total sales generated from the coupon.
Example:
0
total_customers
integerย 
required
Number of customers who used the coupon.
Example:
0
note
nullย 
required
Additional notes regarding the coupon.
is_mazeed_active
booleanย 
required
Indicates if the coupon is active in the Mazeed system.
Default:
true
is_pos_active
booleanย 
required
Indicates if the coupon is available in Point of Sale (POS).
Default:
true
is_shown_in_pos
booleanย 
required
Indicates if the coupon is visible in the POS system.
Default:
true
is_mobile_app_active
booleanย 
required
Indicates if the coupon is available on mobile apps.
Default:
true
apply_to_data
array[string]
required
List of product or category IDs the coupon applies to.
message
objectย 
required
Contains additional information, such as error messages.
type
stringย 
required
Type of message response.
code
nullย 
required
Code associated with the message.
name
nullย 
required
Name associated with the message.
description
nullย 
required
Detailed description of the message.
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
  }
}
Modified atย 2025-02-02 11:28:39
Previous
Coupons
Next
List Coupons
Built with