Search discount coupons

GET https://app.ecwid.com/api/v3/{storeId}/discount_coupons

Request and response example

Request:

GET /api/v3/1003/discount_coupons HTTP/1.1
Authorization: Bearer secret_token
Host: app.ecwid.com

Response:

{
  "total": 2,
  "count": 2,
  "offset": 0,
  "limit": 100,
  "items": [
    {
      "id": 162428889,
      "name": "10% OFF",
      "code": "DISC",
      "discountType": "ABS",
      "status": "ACTIVE",
      "discount": 10,
      "launchDate": "2022-07-28 23:00:00 +0000",
      "usesLimit": "UNLIMITED",
      "repeatCustomerOnly": false,
      "applicationLimit": "UNLIMITED",
      "creationDate": "2022-07-29 15:22:35 +0000",
      "updateDate": "2024-05-01 05:26:28 +0000",
      "orderCount": 1
    },
    {
      "id": 224219782,
      "name": "Test Coupon",
      "code": "DISC2",
      "discountType": "PERCENT",
      "status": "ACTIVE",
      "discount": 10,
      "launchDate": "2024-09-01 23:00:00 +0000",
      "usesLimit": "UNLIMITED",
      "repeatCustomerOnly": false,
      "applicationLimit": "UNLIMITED",
      "creationDate": "2024-09-02 07:55:21 +0000",
      "updateDate": "2024-09-02 08:33:26 +0000",
      "orderCount": 3
    }
  ]
}

Required access scopes

Your app must have the following access scopes to make this request: read_discount_coupons

Path params

All path params are required.

Param
Type
Description

storeId

number

Ecwid store ID.

Query params

All query params are optional.

Name
Type
Description

offset

number

Offset from the beginning of the returned items list. Used when the response contains more items than limit allows to receive in one request. Usually used to receive all items in several requests with multiple of a hundred, for example: ?offset=0 for the first request, ?offset=100, for the second request, ?offset=200, for the third request, etc.

limit

number

Limit to the number of returned items. Maximum and default value (if not specified) is 100.

code

string

Search term for the discount coupon code.

discount_type

string

Search term for the discount coupon type.

One of: ABS PERCENT SHIPPING ABS_AND_SHIPPING PERCENT_AND_SHIPPING

availability

string

Search term for the current state of the discount coupon. One of: ACTIVE PAUSED EXPIRED USEDUP

createdFrom

number/string

Coupon creation date/time (lower bound). Supported formats: UNIX timestamp, date/time. Examples: 1447804800, 2023-01-15 19:27:50.

createdTo

number/string

Coupon creation date/time (upper bound). Supported formats: UNIX timestamp, date/time. Examples: 1447804800, 2023-01-15 19:27:50.

updatedFrom

number/string

Coupon last update date/time (lower bound). Supported formats: UNIX timestamp, date/time. Examples: 1447804800, 2023-01-15 19:27:50.

updatedTo

number/string

Coupon last update date/time (upper bound). Supported formats: UNIX timestamp, date/time. Examples: 1447804800, 2023-01-15 19:27:50.

responseFields

string

Specify the exact fields to receive in response JSON. If not specified, the response JSON will have all available fields for the entity. For example: ?responseFields=items(id,name,status)

Example of using responseFields param:

curl --location 'https://app.ecwid.com/api/v3/1003/discount_coupons?responseFields=items(id,name,status)' \
--header 'Authorization: Bearer secret_ab***cd'

Headers

The Authorization header is required.

Header
Format
Description

Authorization

Bearer secret_ab***cd

Access token of the application.

Response JSON

A JSON object with the following fields:

Field
Type
Description

total

number

Total number of found items (might be more than the number of returned items).

count

number

Total number of items returned in the response.

offset

number

Offset from the beginning of the returned items list specified in the request.

limit

number

Maximum number of returned items specified in the request. Maximum and default value: 100.

items

array of objects items

Detailed information about returned discount coupons.

items

Field
Type
Description

id

number

Internal unique coupon ID.

name

string

Discount coupon name visible on the storefront.

code

string

Discount coupon code used for its activation at the checkout.

discountType

string

Discount type One of: ABS PERCENT SHIPPING ABS_AND_SHIPPING PERCENT_AND_SHIPPING

status

string

Current state of the discount coupon. One of: ACTIVE PAUSED EXPIRED USEDUP

discount

number

Discount coupon value.

launchDate

string

The date of coupon launch, for example, 2014-06-06 08:00:00 +0400. Any date provided will be corrected to the UTC +0 timezone.

expirationDate

string

Coupon expiration date, e.g. 2014-06-06 08:00:00 +0400. Any date provided will be corrected to the UTC +0 timezone.

totalLimit

number

Minimum order subtotal for the discount coupon to be applied.

usesLimit

string

Number of uses limitation. One of: UNLIMITED ONCEPERCUSTOMER SINGLE

applicationLimit

string

User application limit for the discount coupon.

One of: UNLIMITED - no user application limits. NEW_CUSTOMER_ONLY - discount coupon can be applied only by customers without placed orders. REPEAT_CUSTOMER_ONLY - discount coupon can be applied only by customers who placed orders in the store before.

creationDate

string

Coupon creation date. Format example: 2023-06-29 11:36:55 +0000

updateDate

string

Coupon update date. Format example: 2023-06-29 11:36:55 +0000

orderCount

number

Count of orders where the discount coupon was used.

catalogLimit

Product and category limitations for the discount coupon. If empty, discount coupon can be applied to all products and categories available on the storefront.

shippingLimit

Shipping method limitations for the discount coupon. If empty, discount coupon can be applied to any shipping method available at the checkout.

catalogLimit

Field
Type
Description

products

array of numbers

List of product IDs the discount coupon can be applied to, for example, [123456,234567]

categories

array of numbers

List of category IDs the discount coupon can be applied to, for example, [0,87253552,765257901]

shippingLimit

Field
Type
Description

shippingMethods

array of strings

List of shipping method IDs the discount coupon can be applied to, for example, ["18765-8651899366181"]

Last updated

Was this helpful?