Promotional coupon code that customers can apply for discounts. Tracks coupon code, discount rules, usage limits, validity period, and redemption statistics.
https://api.mockly.codes/coupons?page=1&limit=10&count=10Configure your request and click Send Request to see the response here.
/couponsGet a collection of coupons
/commerce/coupons/coupons/:idGet a single coupon by ID
/commerce/coupons/:id/coupons/metaGet resource metadata and schema
/commerce/coupons/metaThe search feature allows you to filter results by searching for text across all or specific fields. Choose between ?q= or ?search= parameter names.
Search across all text fields:
GET https://api.mockly.codes/coupons?q=laptopGET https://api.mockly.codes/coupons?q=laptop&search_fields=name,descriptionsearch_fields, all text fields are searched// Get 10 coupons
fetch('https://api.mockly.codes/coupons?count=10')
.then(res => res.json())
.then(data => console.log(data));import requests
response = requests.get(
'https://api.mockly.codes/coupons?count=10'
)
data = response.json()curl "https://api.mockly.codes/coupons?count=10"fetch('https://api.mockly.codes/coupons?nocache=true')idintegerUnique identifier for the coupon
random_intcodestringUnique alphanumeric coupon code that customers enter at checkout (e.g., SAVE20, WELCOME10)
coupon_codedescriptionstringMarketing description explaining what the coupon offers
sentencediscount_typestringType of discount (e.g., percentage, fixed_amount, free_shipping)
discount_typediscount_valuenumberDiscount amount - percentage (e.g., 20) or fixed amount depending on discount_type
pricemin_purchasenumberMinimum purchase amount required to use this coupon
pricemax_discountnumberMaximum discount amount that can be applied, used to cap percentage discounts
pricecurrencystringISO currency code for monetary values (e.g., USD, EUR, GBP)
currencyusage_limitintegerMaximum number of times this coupon can be used across all customers
random_intused_countintegerNumber of times this coupon has been successfully applied
random_intvalid_fromstringDate when the coupon becomes active and can be used
past_datedatevalid_untilstringExpiration date after which the coupon is no longer valid
future_datedateactivebooleanWhether the coupon is currently active and available for use
booleancountintegerNumber of items to return (default: 10, max: 100)
seedintegerSeed for reproducible data generation
nocachebooleanBypass cache and generate fresh data on every request