coupon_codes

Resource: coupon_code

This link relationship returns a collection of coupon codes. 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_code

Actions

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

Properties (5)

_embedded Object · Read-only

Contains fx:coupon_codes[] — array of coupon_code 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/coupons/{coupon_id}/codes
Available via fx:coupon_codes on coupon

Example Representation

{
  "_links": {
    "curies": [
      {
        "name": "fx",
        "href": "https://api.foxycart.com/rels/{rel}",
        "templated": true
      }
    ],
    "self": {
      "href": "https://api.foxycart.com/stores/123/coupon_codes",
      "title": "This Collection"
    },
    "first": {
      "href": "https://api.foxycart.com/stores/123/coupon_codes?offset=0",
      "title": "First Page of this Collection"
    },
    "prev": {
      "href": "https://api.foxycart.com/stores/123/coupon_codes?offset=0",
      "title": "Previous Page of this Collection"
    },
    "next": {
      "href": "https://api.foxycart.com/stores/123/coupon_codes?offset=20",
      "title": "Next Page of this Collection"
    },
    "last": {
      "href": "https://api.foxycart.com/stores/123/coupon_codes?offset=20",
      "title": "Last Page of this Collection"
    }
  },
  "_embedded": {
    "fx:coupon_codes": [
      {
        "_links": {
          "curies": [
            {
              "name": "fx",
              "href": "https://api.foxycart.com/rels/{rel}",
              "templated": true
            }
          ],
          "self": {
            "href": "https://api.foxycart.com/coupon_codes/456",
            "title": "This Coupon Code"
          },
          "fx:store": {
            "href": "https://api.foxycart.com/stores/456",
            "title": "This Store"
          },
          "fx:coupon": {
            "href": "https://api.foxycart.com/coupons/999",
            "title": "This Coupon"
          },
          "fx:coupon_code_transactions": {
            "href": "https://api.foxycart.com/coupon_codes/123/transactions",
            "title": "Transactions using this Coupon Code"
          }
        },
        "code": "test",
        "number_of_uses_to_date": 31,
        "date_created": null,
        "date_modified": null
      }
    ]
  },
  "total_items": 1,
  "returned_items": 1,
  "limit": 20,
  "offset": 0
}