Retrieve a list of coupons

Retrieve a list of coupons.

SecuritySecretApiKey or JWT
Request
query Parameters
limit
integer [ 0 .. 1000 ]

The collection items limit.

offset
integer >= 0

The collection items offset.

filter
string

The collection items filter requires a special format. Use "," for multiple allowed values. Use ";" for multiple fields. See the filter guide for more options and examples about this format.

q
string

The partial search of the text fields.

sort
Array of strings

The collection items sort field and order (prefix with "-" for descending sort).

Responses
200

A list of coupons was retrieved successfully.

Response Headers
Pagination-Total
integer

Total items count.

Example: 332
Pagination-Limit
integer

Items per page limit.

Example: 100
Pagination-Offset
integer

Pagination offset.

Example: 2
Response Schema: application/json
Array
required
object (Discount)
amount
required
number <double> > 0

Discount amount.

currency
required
string = 3 characters

ISO 4217 alphabetic currency code.

type
string

Discount type.

context
string (DiscountContext)
Default: "items"

The context in which the discount applies.

Enum: Description
items

items (less discounts)

shipping

shipping (less discounts)

items-and-shipping

items and shipping (less discounts)

issuedTime
required
string <date-time>

Coupon's issued time (start time).

id
string <= 50 characters

Coupon's ID a.k.a redemption code.

Array of objects (CouponRestriction)

Coupon restrictions.

Array
type
required
string

Coupon's restriction type.

quantity
required
integer

Restriction quantity.

redemptionsCount
integer >= 0

Coupon's redemptions count.

status
string

If coupon enabled.

Enum: "draft" "issued" "expired"
description
string

Your coupon description. When it is not empty this is used for invoice discount item description, otherwise the item's description uses coupon's ID like 'Coupon "COUPON-ID"'.

expiredTime
string <date-time>

Coupon's expire time (end time).

createdTime
string <date-time>

Coupon created time.

updatedTime
string <date-time>

Read-only timestamp updates when the resource is updated.

Array of objects (Self) non-empty

The links related to resource.

Array (non-empty)
href
required
string

The link URL.

rel
required
string

The link type.

Value: "self"
401

Unauthorized access, invalid credentials were used.

403

Access forbidden.

get/coupons
Request samples
$coupons = $client->coupons()->search([
    'filter' => 'status:issued',
]);
Response samples
application/json
[
  • {
    }
]