coupons

Resource: coupon

This link relationship returns a collection of coupons. You can paginate through this collection using the hypermedia links provided and the link relationships of first, prev, next, and last.

Required Scopes

Full store_full_access
Read coupons_read
Write coupons_write

Collection Resource

coupon

Actions

GET View a list of coupons
POST Create a new coupon
HEAD Get just the header response
OPTIONS Get a response explaining which HTTP methods are supported

Properties (5)

_embedded Object · Read-only

Contains fx:coupons[] — array of coupon resources

total_items String · Read-only

Total number of resources in this collection.

returned_items Number · Read-only

Number of resources returned in this page.

limit Number · Read-only

Maximum number of resources per page.

offset Number · Read-only

Number of resources skipped.

Link Relations (5)

self This Collection
first First Page of this Collection
prev Previous Page of this Collection
next Next Page of this Collection
last Last Page of this Collection
https://api.foxycart.com/stores/{store_id}/coupons
Available via fx:coupons on store

Example Representation

{
  "_links": {
    "curies": [
      {
        "name": "fx",
        "href": "https://api.foxycart.com/rels/{rel}",
        "templated": true
      }
    ],
    "self": {
      "href": "https://api.foxycart.com/stores/123/coupons",
      "title": "This Collection"
    },
    "first": {
      "href": "https://api.foxycart.com/stores/123/coupons?offset=0",
      "title": "First Page of this Collection"
    },
    "prev": {
      "href": "https://api.foxycart.com/stores/123/coupons?offset=0",
      "title": "Previous Page of this Collection"
    },
    "next": {
      "href": "https://api.foxycart.com/stores/123/coupons?offset=20",
      "title": "Next Page of this Collection"
    },
    "last": {
      "href": "https://api.foxycart.com/stores/123/coupons?offset=20",
      "title": "Last Page of this Collection"
    }
  },
  "_embedded": {
    "fx:coupons": [
      {
        "_links": {
          "curies": [
            {
              "name": "fx",
              "href": "https://api.foxycart.com/rels/{rel}",
              "templated": true
            }
          ],
          "self": {
            "href": "https://api.foxycart.com/coupons/456",
            "title": "This Coupon"
          },
          "fx:attributes": {
            "href": "https://api.foxycart.com/coupons/123/attributes",
            "title": "Attributes for This Coupon"
          },
          "fx:store": {
            "href": "https://api.foxycart.com/stores/456",
            "title": "This Store"
          },
          "fx:generate_codes": {
            "href": "https://api.foxycart.com/coupons/123/generate_codes",
            "title": "Generate random Coupon Codes"
          },
          "fx:coupon_codes": {
            "href": "https://api.foxycart.com/coupons/123/codes",
            "title": "Coupon Codes"
          },
          "fx:coupon_item_categories": {
            "href": "https://api.foxycart.com/coupons/123/item_categories",
            "title": "Valid Item Categories for this Coupon"
          }
        },
        "name": "test",
        "start_date": null,
        "end_date": null,
        "number_of_uses_allowed": 0,
        "number_of_uses_to_date": 31,
        "number_of_uses_allowed_per_customer": 0,
        "number_of_uses_allowed_per_code": 0,
        "product_code_restrictions": "",
        "item_option_restrictions": null,
        "coupon_discount_type": "quantity_amount",
        "coupon_discount_details": "2-1",
        "combinable": true,
        "shared_codes_allowed": false,
        "multiple_codes_allowed": true,
        "exclude_category_discounts": false,
        "exclude_line_item_discounts": false,
        "is_taxable": true,
        "customer_auto_apply": false,
        "customer_attribute_restrictions": "",
        "customer_subscription_restrictions": "",
        "inclusive_tax_rate": 0,
        "date_created": "2014-04-21T13:40:45-0700",
        "date_modified": "2015-03-16T12:30:58-0700"
      }
    ]
  },
  "total_items": 1,
  "returned_items": 1,
  "limit": 20,
  "offset": 0
}