Search coupons

Search or filter discount coupons in an Ecwid store. Filters include: discount coupon code, type, availability.

Headers

NameTypeDescription
AuthorizationstringoAuth token with mandatory Bearer before it. Example: Bearer e***s0, where e***s0 should be replaced with your oAuth token.

All query params

NameTypeDescription
storeIdnumberEcwid store ID
offsetnumberOffset from the beginning of the returned items list (for paging)
limitnumberMaximum number of returned items in one batch. Maximum allowed value: 100. Default value: 100
codestringCoupon code
discount_typestringComma separated list of discount types. Supported values: ABS, PERCENT, SHIPPING, ABS_AND_SHIPPING, PERCENT_AND_SHIPPING
availabilitystringComma separated list of coupon states. Supported values: ACTIVE, PAUSED, EXPIRED, USEDUP
createdFromstringCoupon creation date/time (lower bound). Supported formats:
  • UNIX timestamp
Examples:
  • 1447804800
createdTostringCoupon creation date/time (upper bound). Supported formats:
  • UNIX timestamp
updatedFromstringCoupon last update date/time (lower bound). Supported formats:
  • UNIX timestamp
updatedTostringCoupon last update date/time (upper bound). Supported formats:
  • UNIX timestamp

Response

A JSON object of type 'DiscountCouponSearchResults' with the following fields:

DiscountCouponSearchResults

FieldTypeDescription
totalnumberThe total number of found items (might be more than the number of returned items)
countnumberThe number of returned items
offsetnumberOffset from the beginning of the returned items list (for paging)
limitnumberMaximum number of returned items. Maximum allowed value: 100. Default value: 100
itemsArray<CouponSearchEntry>The items list

CouponSearchEntry

FieldTypeDescription
idnumberInternal unique coupon ID
namestringCoupon title
codestringUnique coupon code
discountTypestringDiscount type: ABS, PERCENT, SHIPPING, ABS_AND_SHIPPING, PERCENT_AND_SHIPPING
statusstringDiscount coupon state: ACTIVE, PAUSED, EXPIRED or USEDUP
discountnumberDiscount amount
launchDatestringThe date of coupon launch, e.g. 2014-06-06 08:00:00 +0400. Any date provided will be corrected to the UTC timezone
expirationDatestringCoupon expiration date, e.g. 2014-06-06 08:00:00 +0400. Any date provided will be corrected to the UTC timezone
totalLimitnumberThe minimum order subtotal the coupon applies to
usesLimitstringNumber of uses limitation: UNLIMITED, ONCEPERCUSTOMER, SINGLE
repeatCustomerOnlybooleanDeprecated. Use applicationLimit instead. Coupon usage limitation flag identifying whether the coupon works for all customers or only repeat customers
applicationLimitstringApplication limit for discount coupons. Possible values: "UNLIMITED", "NEW_CUSTOMER_ONLY", "REPEAT_CUSTOMER_ONLY". If you are creating or updating a discount coupon, make sure to use the old repeatCustomerOnly field or the new applicationLimit field only. When both these fields are sent, the priority will be given to the new field – applicationLimit
creationDatestringCoupon creation date. Format example: 2016-06-29 11:36:55 +0000
updateDatestringCoupon update date. Format example: 2016-06-29 11:36:55 +0000
orderCountnumberNumber of uses
catalogLimit<DiscountCouponCatalogLimit>The products and categories the coupon can be applied to
shippingLimit<DiscountCouponShippingLimit>Shipping methods, the cost of which will be free after applying the coupon (for 'Free shipping' coupons).

DiscountCouponCatalogLimit

FieldTypeDescription
productsArrayThe list of product IDs the coupon can be applied to
categoriesArrayThe list of category IDs the coupon can be applied to

DiscountCouponShippingLimit

FieldTypeDescription
shippingMethodsArrayThe list of shipping method IDs, the cost of which will be free after applying the coupon

Errors

In case of error, Ecwid responds with an error HTTP status code and, optionally, JSON-formatted body containing error description

HTTP codes

HTTP StatusMeaning
400Request parameters are malformed
403Access token doesn't have read_discount_coupons scope
415Unsupported content-type: expected application/json or text/json
500Cannot retrieve the coupon info because of an error on the server

Error response body (optional)

FieldTypeDescription
errorMessagestringError message
Language
Authorization
Query