Docs home

Get Unique Code Details

Returns one unique code with its settings and the courses and organizations it applies to. This is the same endpoint as "Get Promo Code Details", called with the ID of a unique code.

GET/promocode/{promo_code_id}
Get Unique Code Details
curl --request GET \
  --url 'https://<your-api-host>/nuSource/api/v1/promocode/{promo_code_id}' \
  --header 'APIKEY: <your-api-key>' \
  --header 'ORGID: <your-org-id>'
{
  "code": 200,
  "message": "Success",
  "promo_code": {
    "promo_code_id": 105,
    "promo_code_type": "unique_code",
    "promo_code_text": "CODE794607",
    "discount": "10.00",
    "max_discount_amount": "100.00",
    "promo_code_description": "UNIQUE ONES",
    "promo_code_creation_time": 1566290107,
    "promo_code_start_time": "20 Aug 2019",
    "promo_code_end_time": "08 Apr 2021",
    "usd_discount": "10.00",
    "max_usd_discount_amount": "0.00",
    "mapping_details": [
      {
        "organization_ids": "212,213",
        "package_id": 1369,
        "promo_code_used": 1
      },
      {
        "organization_ids": "212",
        "package_id": 1370,
        "promo_code_used": 0
      },
      {
        "organization_ids": "216",
        "package_id": 1383,
        "promo_code_used": 0
      },
      {
        "organization_ids": "216",
        "package_id": 1385,
        "promo_code_used": 0
      },
      {
        "organization_ids": "214",
        "package_id": 1396,
        "promo_code_used": 0
      },
      {
        "organization_ids": "214",
        "package_id": 1397,
        "promo_code_used": 0
      },
      {
        "organization_ids": "215",
        "package_id": 1399,
        "promo_code_used": 0
      }
    ]
  }
}

Access: Institute admins, plus custom roles that can view promo codes.

Path parameters
promo_code_idintegerrequired
ID of the unique code, e.g. promocode/105.
Response200application/json
codeinteger
Example: 200
messagestring
Example: Success
Show child attributesHide child attributes
Example: 105
unique_code
Example: unique_code
The full code, e.g. CODE794607
Example: CODE794607
Example: 10.00
Example: 100.00
Example: UNIQUE ONES
Example: 1566290107
Example: 20 Aug 2019
Example: 08 Apr 2021
Example: 10.00
One entry per course with package_id, organization_ids and promo_code_used, which is 1 once the code has been used for that course
Show child attributesHide child attributes

Notes: Amounts come back as strings with two decimals. Rate limit: 30 requests per minute; going over locks you out for 30 minutes.

Updated yesterday

Ask AI