{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"status": {
"type": "string",
"description": "Status of the API response",
"example": "success"
},
"coupons": {
"type": "array",
"description": "List of available coupons",
"items": {
"type": "object",
"properties": {
"coupon_id": { "type": "integer", "description": "Unique coupon identifier", "example": 3250 },
"id": { "type": "integer", "description": "Coupon ID (same as coupon_id)", "example": 3250 },
"store_id": { "type": "integer", "description": "ID of the store offering the coupon", "example": 550 },
"store_name": { "type": "string", "description": "Name of the store", "example": "MBasideq Store" },
"store_logo": { "type": "string", "format": "uri", "description": "URL of the store logo", "example": "https://example.com/logo.png" },
"code": { "type": "string", "description": "Coupon code", "example": "1234" },
"uses_total": { "type": "integer", "description": "Total times the coupon has been used", "example": 0 },
"created_at": { "type": "string", "format": "date-time", "description": "Timestamp when the coupon was created", "example": "2025-01-19T09:11:59.000000Z" },
"name": { "type": "string", "description": "Coupon name", "example": "خصم اختباري" },
"discount_type": { "type": "string", "description": "Type of discount (p = percentage, f = fixed amount)", "example": "p" },
"applying_method": { "type": "string", "description": "Method of coupon application", "example": "CODE" },
"conditions": { "type": ["array", "null"], "description": "Conditions for coupon application", "example": null },
"discount": { "type": "number", "description": "Discount value", "example": 10 },
"free_shipping": { "type": "boolean", "description": "Whether the coupon offers free shipping", "example": true },
"free_cod": { "type": "boolean", "description": "Whether the coupon offers free cash-on-delivery", "example": false },
"apply_to": { "type": "string", "description": "Applicable scope of the coupon", "example": "all" },
"date_start": { "type": "string", "format": "date", "description": "Coupon start date", "example": "2025-01-19" },
"date_end": { "type": "string", "format": "date", "description": "Coupon end date", "example": "2025-02-19" },
"coupon_status": { "type": "boolean", "description": "Indicates if the coupon is currently active", "example": true }
}
}
},
"count": { "type": "integer", "description": "Total number of coupons", "example": 111 },
"active_coupons_count": { "type": "integer", "description": "Number of active coupons", "example": 1 },
"inactive_coupons_count": { "type": "integer", "description": "Number of inactive coupons", "example": 0 },
"expired_coupons_count": { "type": "integer", "description": "Number of expired coupons", "example": 110 },
"pagination": {
"type": "object",
"description": "Pagination details",
"properties": {
"page": { "type": "integer", "description": "Current page number", "example": 1 },
"page_size": { "type": "integer", "description": "Number of items per page", "example": 15 },
"next_page": { "type": "integer", "description": "Next page number", "example": 2 },
"last_page": { "type": "integer", "description": "Last available page", "example": 8 },
"result_count": { "type": "integer", "description": "Total results count", "example": 111 }
}
},
"message": {
"type": "object",
"description": "Message details",
"properties": {
"code": { "type": ["string", "null"], "description": "Message code", "example": null },
"name": { "type": ["string", "null"], "description": "Message name", "example": null },
"description": { "type": ["string", "null"], "description": "Message description", "example": null }
}
}
}
}