---
title: "Inspect a discount code (site admin)"
method: GET
path: "/discount-codes/{code}"
tags: ["Discount codes"]
---

# Inspect a discount code (site admin)

`GET /discount-codes/{code}`

## Request

- Base URL: `https://app.pencil.ink/api/v1`
- URL: `https://app.pencil.ink/api/v1/discount-codes/{code}`
- Auth: HTTP bearer

Requires an explicitly enabled discount-management key and current site-admin creator. Includes redemption and up to ten recent audit events.

## Response `200`

The resource.

- object
  - `data` DiscountCodeDetail
    - `code` string: Unique code, 6–64 letters, digits, dashes or underscores; normalized to uppercase.
    - `label` string
    - `percentOff` integer
    - `duration` 'once' | 'repeating' | 'forever'
    - `months` integer: Required for repeating duration.
    - `planKey` 'pro' | 'team': USD monthly base subscription only; excludes AI usage.
    - `targetOrgId` string: Optional recipient organization. Recipient-targeted codes are single-use.
    - `targetUserId` string: Optional recipient user; mutually exclusive with targetOrgId.
    - `maxRedemptions` integer, nullable: Maximum distinct organization redemptions. Null means unlimited. Defaults to 1 and must be 1 for recipient-targeted codes.
    - `redeemFrom` number: Optional redemption start, Unix milliseconds.
    - `redeemBy` number: Optional future redemption deadline, Unix milliseconds.
    - `_id` string
    - `_creationTime` number
    - `active` boolean
    - `createdBy` string
    - `createdAt` number
    - `redemption` object, nullable
    - `audit` object[]

## Other responses

- `401`: Missing or invalid API key (`unauthorized`).
- `403`: The key is read-only and may not write (`forbidden`).
- `404`: Resource not found in this org (`not_found`).
- `429`: Rate limit exceeded (`rate_limited`).

---

[API](https://skmtc.dev/pencil/apis/pencil-public-api.md) · [All operations](https://skmtc.dev/pencil/apis/pencil-public-api/llms.txt) · [OpenAPI document](https://skmtc.dev/pencil/apis/pencil-public-api/revisions/2b842698b76d?raw)
