Skip to main content
GET
/
discount-codes
List discount codes
curl --request GET \
  --url https://api.sprucecollective.co.uk/discount-codes
{
  "discount_codes": [
    {
      "active": true,
      "allow_multiple_claims": true,
      "alphanumeric": true,
      "category": "<string>",
      "claimed_by_user": true,
      "claimed_codes": [
        "<string>"
      ],
      "code": "<string>",
      "code_display": "<string>",
      "code_length": 123,
      "code_pattern": "<string>",
      "code_required": true,
      "created_at": "<string>",
      "current_uses": 123,
      "description": "<string>",
      "discount_brand": {
        "archived": true,
        "collection_id": "<string>",
        "created_at": "<string>",
        "description": "<string>",
        "discount_codes": [
          {
            "active": true,
            "allow_multiple_claims": true,
            "alphanumeric": true,
            "category": "<string>",
            "claimed_codes": [
              "<string>"
            ],
            "code": "<string>",
            "code_display": "<string>",
            "code_length": 123,
            "code_pattern": "<string>",
            "code_required": true,
            "created_at": "<string>",
            "current_uses": 123,
            "description": "<string>",
            "discount_brand": "<unknown>",
            "discount_brand_id": "<string>",
            "discount_percentage": 123,
            "featured": true,
            "has_claimed_code": true,
            "id": "<string>",
            "is_bulk_code": true,
            "is_valid": true,
            "max_uses": 123,
            "partner_logo": "<string>",
            "partner_url": "<string>",
            "points_required": 123,
            "site_id": "<string>",
            "tags": [
              {
                "active": true,
                "color": "<string>",
                "created_at": "<string>",
                "description": "<string>",
                "id": "<string>",
                "name": "<string>",
                "site_id": "<string>",
                "slug": "<string>",
                "updated_at": "<string>"
              }
            ],
            "terms": "<string>",
            "third_party_id": "<string>",
            "thumbnail": "<string>",
            "title": "<string>",
            "updated_at": "<string>",
            "valid_from": "<string>",
            "valid_until": "<string>"
          }
        ],
        "draft": true,
        "id": "<string>",
        "item_id": "<string>",
        "locale_id": "<string>",
        "logo": "<string>",
        "logo_black_and_white": "<string>",
        "max_discount": "<string>",
        "name": "<string>",
        "published_on": "<string>",
        "site_id": "<string>",
        "slug": "<string>",
        "thumbnail": "<string>",
        "updated_at": "<string>"
      },
      "discount_brand_id": "<string>",
      "discount_percentage": 123,
      "featured": true,
      "has_claimed_code": true,
      "id": "<string>",
      "is_bulk_code": true,
      "is_valid": true,
      "max_uses": 123,
      "partner_logo": "<string>",
      "partner_url": "<string>",
      "points_required": 123,
      "site_id": "<string>",
      "tags": [
        {
          "active": true,
          "color": "<string>",
          "created_at": "<string>",
          "description": "<string>",
          "id": "<string>",
          "name": "<string>",
          "site_id": "<string>",
          "slug": "<string>",
          "updated_at": "<string>"
        }
      ],
      "terms": "<string>",
      "third_party_id": "<string>",
      "thumbnail": "<string>",
      "title": "<string>",
      "updated_at": "<string>",
      "valid_from": "<string>",
      "valid_until": "<string>"
    }
  ],
  "has_more": true,
  "page": 123,
  "page_size": 123,
  "total": 123
}

Query Parameters

page
integer
default:1

Page number

page_size
integer
default:50

Page size

Search term (code, title, category, description)

sort_by
string

Sort by field (code, title, created_at, updated_at, discount_percentage, points_required, active, featured)

order
string

Sort order (asc or desc)

status
string

Status filter: 'all' to return all discount codes (admin only), otherwise only active and valid codes are returned by default

tags
string

Comma-separated list of tag slugs to filter by

tag_ids
string

Comma-separated list of tag IDs to filter by

Filter by featured status (true or false)

Response

200 - application/json

OK

List of discount codes with claim status for the current user

discount_codes
object[]
has_more
boolean
page
integer
page_size
integer
total
integer