> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dancity.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Education pins

> Purchase exam scratch cards and result-checker PINs

## Overview

The education PIN endpoint lets you purchase result-checker and exam registration scratch cards (WAEC, NECO, JAMB, etc.) in bulk or one at a time.

Fetch exam product names from [Get products](https://docs.dancity.app/api-reference/catalog/get-api-products.md) (`service=EXAM PIN` or the matching service name from your catalog), then call purchase directly.

## Authentication

Requires your merchant API key and the `channel: API` header.

```http theme={null}
Authorization: Bearer dcy_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
channel: API
```

***

## Purchase education PIN

```
POST /api/v1/education-pin/purchase
```

### Request body

| Field | Type | Required | Description |
| - | - | - | - |
| `exam_name` | string | ✓ | Exam product name from catalog |
| `quantity` | number | ✓ | Number of PINs (1–5; JAMB must be 1) |
| `examNumber` | string | | Required for JAMB purchases |
| `customerRef` | string | | Your internal reference ID |
| `promocode` | string | | Discount promo code |

```bash cURL theme={null}
curl -sS -X POST "https://api.dancity.app/api/v1/education-pin/purchase" \
  -H "Authorization: Bearer $DANCITY_API_KEY" \
  -H "Content-Type: application/json" \
  -H "channel: API" \
  -d '{
    "exam_name": "WAEC Result Checker",
    "quantity": 1,
    "customerRef": "EDU-REF-001"
  }'
```

```javascript Node.js theme={null}
const res = await fetch(
  "https://api.dancity.app/api/v1/education-pin/purchase",
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${process.env.DANCITY_API_KEY}`,
      "Content-Type": "application/json",
      channel: "API",
    },
    body: JSON.stringify({
      exam_name: "WAEC Result Checker",
      quantity: 1,
      customerRef: "EDU-REF-001",
    }),
  }
);
const { data } = await res.json();
```

```python Python theme={null}
import requests, os

res = requests.post(
    "https://api.dancity.app/api/v1/education-pin/purchase",
    headers={
        "Authorization": f"Bearer {os.environ['DANCITY_API_KEY']}",
        "Content-Type": "application/json",
        "channel": "API",
    },
    json={
        "exam_name": "WAEC Result Checker",
        "quantity": 1,
        "customerRef": "EDU-REF-001",
    },
)
print(res.json()["data"])
```

***

## Full purchase flow

```
1. GET /api/v1/products?service=EXAM PIN
   → pick exam_name and note unit price

2. POST /api/v1/education-pin/purchase
   { exam_name, quantity }
   → receive PIN details in the transaction response
```

> [!WARNING]
>
> Education PINs are delivered immediately. Store them securely — they cannot be re-fetched from the API after the transaction response is received.

## Next steps

* [Transactions: requery a purchase](https://docs.dancity.app/guides/transactions.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.