Retrieve coupons

Retrieves a list of coupons.

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

Limits the number of collection items to be returned.

offset
integer >= 0

Specifies the starting point within the collection of items to be returned.

filter
string

Filters the collection items. This field requires a special format. Use , for multiple allowed values. Use ; for multiple fields.

For more information, see Using filter with collections.

q
string

Use this field to perform a partial search of text fields.

sort
Array of strings

Sorts and orders the collection of items. To sort in descending order, prefix with -.

Responses
200

List of coupons retrieved.

Response Headers
Pagination-Total
integer

Total number of items.

Example: 332
Pagination-Limit
integer

Maximum number of items per page.

Example: 100
Pagination-Offset
integer

Specifies the starting point within the collection of resource results. For example, a request with limit=20 retrieves and displays the first 20 results on a page. A following request with limit=20 and offset=20, retrieves the next page of 20 results.

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

Discount amount.

currency
required
string = 3 characters

Currency code in ISO 4217 format.

type
string

Discount type.

context
string (DiscountContext)
Default: "items"

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>

Date and time when the coupon is issued. This value may also be described as start time of the coupon.

id
string <= 50 characters

ID of the coupon. This value is also known as the coupon redemption code.

Array of objects (CouponRestriction)

Coupon restrictions.

Array
type
required
string

Coupon restriction type.

quantity
required
integer

Restriction quantity.

redemptionsCount
integer >= 0

Total number of times that a coupon is redeemed.

status
string

Specifies the current status of the coupon.

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

Description of the coupon. Use this field to provide an invoice discount item description.

If this field is empty, the invoice discount item description uses the related coupon ID, in the following format: Coupon "COUPON-ID".

expiredTime
string <date-time>

Date and time when the coupon expires.

createdTime
string <date-time> (CreatedTime)

Date and time which is set automatically when the resource is created.

updatedTime
string <date-time> (UpdatedTime)

Date and time which updates automatically when the resource is updated.

Array of objects (SelfLink)

Related links.

Array
href
string

Link URL.

rel
string

Type of link.

Value: "self"
401

Unauthorized access. Invalid credentials used.

403

Access forbidden.

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