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

Update Coupon

POST
https://api.zid.sa/v1/managers/store/coupons/{coupon-id}/update
This endpoint allows merchants to update details of an existing coupon. Merchants can modify attributes such as discount value, expiration date, and usage limits.
๐Ÿ”‘Scopes
coupons.read_write - Coupons Read & Write

Request

Path Params
coupon-id
stringย 
required
Unique identifier of the coupon
Example:
123
Header Params
Accept
stringย 
required
Specifies the Media Types acceptable for the client. In this case, it signals that the client expects a response in the JSON format.
Example:
application/json
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:
eyJpdiI6IlA3WTFZbWk1YVBTQnNrYkRtOFBGZGc9PSIsInZhbHVlIjoiL3QvVmtuMHFQdGNMdkNwZ0FCZkh3Y1l4aEs5NDhGVnFXbWVZYlFJb2kucdcNrekppN09CVTlnYlducjRLbjhXNzhFTFhhZDZTSXdRbUphSEYyUkZJWTJFZ0h3Ymlzb1RVNmxlaEkjgftrmpIZ1RmZXVFYUszZG5DZDZjbTRqNzByNVBMTktzYkQ3WGQ5MDhqbWo2NWFkT3MvRExmYVY4YXBCakkwSjR1L2pTbUR4dWZvd2h5K2tTQlAvRlN2TnZuOVFROW42WTRqZmtkWUZWem4rRXFLVU00aGJtQT0iLCJtYWMiOiJjM2U2ZGRmMjY1ZjFmMmI5YjZlMzFkMGFhNmMzYjM5ZjhiOWE0YjVhMzU2ZTRhYTkxOTVlYmFiMTVkY2I1NWQ2IiwidGFnIjoiIn0=
Accept-Language
stringย 
required
Preferred language for the response. Defaults to en if not specified.
Example:
en
User-Agent
stringย 
required
The User-Agent header contains information about the user agent (browser or app) making the request. It allows the server to provide a tailored response depending on the user agent's capabilities and preferences.
Example:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.82 Safari/537.36
Body Params multipart/form-data
name
stringย 
required
The name of the coupon usually for internal reference.
Example:
osama
code
stringย 
required
The unique coupon code that customers will enter to avail the discount.
Example:
osama
discount_type
stringย 
required
The type of discount applied. Possible values are p for percentage-based discount and f for fixed amount discount.
Example:
f
discount
stringย 
required
The discount value applied by the coupon. If discount_type is p this represents a percentage if f it represents a fixed amount.
Example:
155
total
stringย 
optional
The minimum order total required for the coupon to be applicable. If 0 no minimum order total is required.
Example:
0
date_start
stringย 
optional
The start date of the coupon validity in YYYY-MM-DD format.
Example:
2021-02-10
date_end
stringย 
optional
The end date of the coupon validity in YYYY-MM-DD format.
Example:
2021-02-28
uses_total
stringย 
optional
The total number of times the coupon can be used across all customers.
Example:
1000
uses_customer
stringย 
optional
The number of times a single customer can use the coupon.
Example:
1000
free_shipping
stringย 
optional
Indicates if the coupon provides free shipping. 1 for enabled 0 for disabled.
Example:
1
coupon_status
stringย 
optional
The status of the coupon. 1 for active 0 for inactive.
Example:
1
shipping
stringย 
optional
Determines whether the coupon applies to shipping costs. 1 for enabled 0 for disabled.
Example:
1
products[]
stringย 
optional
A list of product IDs that the coupon is applicable to.
Example:
92cbba07-fe84-49f5-96ba-ab5308d781b9
is_pos_active
stringย 
optional
Determines whether the coupon is active for Point of Sale (POS) transactions. 1 for active 0 for inactive.
Example:
1

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/123/update' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxMTciLCJqdGkiOiJhMTg5ZTg3MmYxMzhkMWVhYjU5MjVkMDkyMGE5NmI0YjliNjg0Y2E2ZTdmM2M2MjljZWYxNmQ4NDJjMmJlYmVhMjI4YTdmMTA0ZWQ4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VFYUszZG5DZDZjbTRqNzByNVBMTktzYkQ3WGQ5MDhqbWo2NWFkT3MvRExmYVY4YXBCakkwSjR1L2pTbUR4dWZvd2h5K2tTQlAvRlN2TnZuOVFROW42WTRqZmtkWUZWem4rRXFLVU00aGJtQT0iLCJtYWMiOiJjM2U2ZGRmMjY1ZjFmMmI5YjZlMzFkMGFhNmMzYjM5ZjhiOWE0YjVhMzU2ZTRhYTkxOTVlYmFiMTVkY2I1NWQ2IiwidGFnIjoiIn0=' \
--header 'Accept-Language: en' \
--header 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.82 Safari/537.36' \
--form 'name="osama";type=text' \
--form 'code="osama";type=text' \
--form 'discount_type="f";type=text' \
--form 'discount="155";type=number' \
--form 'total="0";type=number' \
--form 'date_start="2021-02-10";type=date' \
--form 'date_end="2021-02-28";type=date' \
--form 'uses_total="1000";type=number' \
--form 'uses_customer="1000";type=number' \
--form 'free_shipping="1";type=boolean' \
--form 'coupon_status="1";type=boolean' \
--form 'shipping="1";type=boolean' \
--form 'products[]="92cbba07-fe84-49f5-96ba-ab5308d781b9";type=text' \
--form 'is_pos_active="1";type=boolean'

Responses

๐ŸŸข200OK
application/json
Body
Schema for the 'update coupon' response.
status
stringย 
optional
Status of the API response.
Example:
success
coupon
objectย 
optional
Details of the updated coupon.
coupon_id
integerย 
optional
Unique coupon identifier.
Example:
3292
id
integerย 
optional
Coupon ID (same as coupon_id).
Example:
3292
store_id
integerย 
optional
ID of the store offering the coupon.
Example:
1
store_name
stringย 
optional
Name of the store.
Example:
Osama's Testing Store
store_logo
stringย <uri>
optional
URL of the store logo.
Example:
https://example.com/logo.jpg
code
stringย 
optional
Coupon code.
Example:
osama
uses_total
integerย 
optional
Total times the coupon has been used.
Example:
0
created_at
stringย <date-time>
optional
Timestamp when the coupon was created.
Example:
2025-01-28T07:35:50.000000Z
name
stringย 
optional
Coupon name.
Example:
osama
total_usage
integerย ย |ย nullย 
optional
Total times the coupon has been used, can be null.
Example:
null
discount_type
stringย 
optional
Type of discount (p = percentage, f = fixed amount).
Example:
f
applying_method
stringย 
optional
Method of coupon application.
Example:
CODE
conditions
array[string]ย |ย nullย 
optional
Conditions for coupon application.
Example:
null
discount
numberย 
optional
Discount value.
Example:
155
logged
booleanย 
optional
Indicates if the coupon is logged.
Example:
false
free_shipping
booleanย 
optional
Whether the coupon offers free shipping.
Example:
false
free_cod
booleanย 
optional
Whether the coupon offers free cash-on-delivery.
Example:
false
apply_to
stringย 
optional
Applicable scope of the coupon.
Example:
all
total
integerย 
optional
Total discount amount.
Example:
0
max_total
integerย 
optional
Maximum total discount allowed.
Example:
0
date_start
stringย <date>
optional
Coupon start date.
Example:
2025-02-12
date_end
stringย <date>
optional
Coupon end date.
Example:
2025-03-12
uses_customer
integerย 
optional
Number of times a customer can use the coupon.
Example:
0
coupon_status
booleanย 
optional
Indicates if the coupon is currently active.
Example:
false
enabled
booleanย 
optional
Indicates if the coupon is enabled.
Example:
false
status_code
stringย 
optional
Status code of the coupon.
Example:
coupon_inactive
maximum_discount_value
numberย ย |ย nullย 
optional
Maximum discount value allowed, can be null.
Example:
null
orders
array[string]
optional
List of orders associated with the coupon.
Example:
[]
total_sales
integerย 
optional
Total sales generated by the coupon.
Example:
0
total_customers
integerย 
optional
Total number of customers who used the coupon.
Example:
0
note
stringย ย |ย nullย 
optional
Additional note about the coupon, can be null.
Example:
null
is_mazeed_active
booleanย 
optional
Indicates if the coupon is active in Mazeed.
Example:
false
is_pos_active
booleanย 
optional
Indicates if the coupon is active in POS.
Example:
false
is_shown_in_pos
booleanย 
optional
Indicates if the coupon is visible in POS.
Example:
false
is_mobile_app_active
booleanย 
optional
Indicates if the coupon is active in the mobile app.
Example:
false
apply_to_data
array[string]
optional
Data related to where the coupon is applied.
Example:
[]
message
objectย 
optional
Message details.
code
stringย ย |ย nullย 
optional
Message code, can be null.
Example:
null
name
stringย ย |ย nullย 
optional
Message name, can be null.
Example:
null
description
stringย ย |ย nullย 
optional
Message description, can be null.
Example:
null
Example
{
  "status": "object",
  "coupon": {
    "coupon_id": 3292,
    "id": 3292,
    "store_id": 1,
    "store_name": "Osama's Testing Store",
    "store_logo": "https://zid-testing-907587157081.s3.eu-west-1.amazonaws.com/3dfc16e6-ad19-4126-9c2a-5e4a7fb73051/4cf56c8d-22ad-46d9-a5f4-4d46a47da1aa-200x.jpg",
    "code": "osama",
    "uses_total": 0,
    "created_at": "2025-01-28T07:35:50.000000Z",
    "name": "osama",
    "total_usage": null,
    "discount_type": "f",
    "applying_method": "CODE",
    "conditions": null,
    "discount": 155,
    "logged": false,
    "free_shipping": false,
    "free_cod": false,
    "apply_to": "all",
    "total": 0,
    "max_total": 0,
    "date_start": "2025-02-12",
    "date_end": "2025-03-12",
    "uses_customer": 0,
    "coupon_status": false,
    "enabled": false,
    "status_code": "coupon_inactive",
    "maximum_discount_value": null,
    "orders": [],
    "total_sales": 0,
    "total_customers": 0,
    "note": null,
    "is_mazeed_active": false,
    "is_pos_active": false,
    "is_shown_in_pos": false,
    "is_mobile_app_active": false,
    "apply_to_data": []
  },
  "message": {
    "type": "object",
    "code": null,
    "name": null,
    "description": null
  }
}
Modified atย 2025-02-13 06:00:12
Previous
Get Coupon Details
Next
Delete Coupon
Built with