Skip to main content
GET
/
discount-codes
Retrieve Discount Codes
curl --request GET \
  --url https://api.nuwebgroup.com/v1/discount-codes \
  --header 'Authorization: Bearer <token>'
{
  "data": [
    {
      "type": "discountCodes",
      "id": 1,
      "attributes": {
        "type": "fixed",
        "code": "FIXED10",
        "amount": 1000,
        "applyToNetPrice": false,
        "maxUsesPerOrder": 2,
        "maximumUses": 100,
        "maxUsesPerCustomer": 2,
        "minimumSpend": 1000,
        "maximumDiscount": {
          "GBP": 2500,
          "EUR": 3000
        },
        "validFrom": "2021-11-22T11:59:00.000000Z",
        "validTo": "2021-02-01 00:00:00",
        "boxOfficeOnly": false,
        "disabledAt": null,
        "createdAt": "2021-11-22T11:59:00.000000Z",
        "updatedAt": "2021-11-22T11:59:00.000000Z"
      },
      "relationships": {
        "currencies": {
          "type": "currencies",
          "id": 1
        },
        "saleItems": {
          "data": [
            {
              "type": "saleItems",
              "id": 1
            }
          ]
        }
      },
      "links": {
        "self": "http://api.willms.com/v1/discount-codes?id=1"
      }
    }
  ],
  "links": {
    "first": "http://api.willms.com/v1/discount-codes?page=1",
    "last": "http://api.willms.com/v1/discount-codes?page=1",
    "prev": null,
    "next": null,
    "self": "http://api.willms.com/v1/discount-codes?page=1"
  },
  "meta": {
    "total": 1
  },
  "included": [
    {
      "type": "currencies",
      "id": 1,
      "attributes": {
        "name": "Pounds",
        "code": "GBP",
        "symbol": "Ā£"
      }
    }
  ]
}

Authorizations

Authorization
string
header
required

The 'Bearer' token can be obtained from the token management interface or via the login endpoint using your admin user credentials.

Query Parameters

offset
integer

The offset - e.g 10 for listing discount codes starting with the 10th discount code.

page
integer

The page for which you wish to retrieve discount codes. You will only be able to paginate by page if you do not specify an offset.

limit
integer

The number of discount codes to retrieve per page. The maximum (and default) is 100 per page.

types
enum<string>[]

An array or comma separated list allowing you to filter discount codes by type.

Available options:
fixed,
percentage,
bxgy
only
string

A list of attributes that you wish to be returned in the payload. When empty or omitted, all fields will be included by default. Use dot-notation for both top-level resources and child resources, i.e. discountCodes.code. Can be used in conjunction with except providing both parameters don't reference the same resource.

except
string

A list of attributes that you wish to exclude from the payload. When empty or omitted, all fields will be included by default. Use dot-notation for both top-level resources and child resources, i.e. discountCodes.code. Can be used in conjunction with only providing both parameters don't reference the same resource.

withTrashed
enum<string>

Controls records returned depending on their deletedAt status. This is a global flag, so will apply to all resources, including relationships such as resources returned under the included attribute.

  • true to include deleted records
  • false to exclude deleted records (or leave blank)

Available options:
true,
false

Response

Successfully retrieved the discount codes.

data
object[]
meta
object
included
object[]