Schema Documentation

Coupon

Description

A coupon object

Fields
Field NameDescription
amount - Float Amount off provided by the coupon
code - String Coupon code
databaseId - Int The ID of the coupon in the database
date - String Date coupon created
dateExpiry - String Date coupon expires
description - String Explanation of what the coupon does
discountType - DiscountTypeEnum Type of discount
emailRestrictions - [String] Only customers with a matching email address can use the coupon
excludeSaleItems - Boolean Excluding sale items mean this coupon cannot be used on items that are on sale (or carts that contain on sale items)
excludedProductCategories - CouponToExcludedProductCategoriesConnection Connection between the Coupon type and the productCategory type
Arguments
first - Int

The number of items to return after the referenced "after" cursor

last - Int

The number of items to return before the referenced "before" cursor

after - String

Cursor used along with the "first" argument to reference where in the dataset to get data

before - String

Cursor used along with the "last" argument to reference where in the dataset to get data

where - CouponToExcludedProductCategoriesConnectionWhereArgs

Arguments for filtering the connection

excludedProducts - CouponToExcludedProductsConnection Connection between the Coupon type and the Product type
Arguments
first - Int

The number of items to return after the referenced "after" cursor

last - Int

The number of items to return before the referenced "before" cursor

after - String

Cursor used along with the "first" argument to reference where in the dataset to get data

before - String

Cursor used along with the "last" argument to reference where in the dataset to get data

where - CouponToExcludedProductsConnectionWhereArgs

Arguments for filtering the connection

freeShipping - Boolean Does this coupon grant free shipping?
id - ID! The globally unique identifier for the coupon
individualUse - Boolean Individual use means this coupon cannot be used in conjunction with other coupons
limitUsageToXItems - Int The number of products in your cart this coupon can apply to (for product discounts)
maximumAmount - Float Maximum spend amount that must be met before this coupon can be used
metaData - [MetaData] Object meta data
Arguments
key - String

Retrieve meta by key

keysIn - [String]

Retrieve multiple metas by key

multiple - Boolean

Retrieve meta with matching keys

minimumAmount - Float Minimum spend amount that must be met before this coupon can be used
modified - String Date coupon modified
productCategories - CouponToProductCategoryConnection Connection between the Coupon type and the productCategory type
Arguments
first - Int

The number of items to return after the referenced "after" cursor

last - Int

The number of items to return before the referenced "before" cursor

after - String

Cursor used along with the "first" argument to reference where in the dataset to get data

before - String

Cursor used along with the "last" argument to reference where in the dataset to get data

where - CouponToProductCategoryConnectionWhereArgs

Arguments for filtering the connection

products - CouponToProductConnection Connection between the Coupon type and the Product type
Arguments
first - Int

The number of items to return after the referenced "after" cursor

last - Int

The number of items to return before the referenced "before" cursor

after - String

Cursor used along with the "first" argument to reference where in the dataset to get data

before - String

Cursor used along with the "last" argument to reference where in the dataset to get data

where - CouponToProductConnectionWhereArgs

Arguments for filtering the connection

usageCount - Int How many times the coupon has been used
usageLimit - Int Amount of times this coupon can be used globally
usageLimitPerUser - Int Amount of times this coupon can be used by a customer
usedBy - CouponToCustomerConnection Connection between the Coupon type and the Customer type
Arguments
first - Int

The number of items to return after the referenced "after" cursor

last - Int

The number of items to return before the referenced "before" cursor

after - String

Cursor used along with the "first" argument to reference where in the dataset to get data

before - String

Cursor used along with the "last" argument to reference where in the dataset to get data

where - CouponToCustomerConnectionWhereArgs

Arguments for filtering the connection

Example
{"amount":987.65,"code":"xyz789","databaseId":123,"date":"xyz789","dateExpiry":"abc123","description":"abc123","discountType":"FIXED_CART","emailRestrictions":["xyz789"],"excludeSaleItems":true,"excludedProductCategories":CouponToExcludedProductCategoriesConnection,"excludedProducts":CouponToExcludedProductsConnection,"freeShipping":true,"id":4,"individualUse":true,"limitUsageToXItems":123,"maximumAmount":123.45,"metaData":[MetaData],"minimumAmount":123.45,"modified":"xyz789","productCategories":CouponToProductCategoryConnection,"products":CouponToProductConnection,"usageCount":987,"usageLimit":987,"usageLimitPerUser":123,"usedBy":CouponToCustomerConnection}