# API Reference

***

### ✅ Prerequisites

Before you start, make sure you have:

* An **Akowe Issuance account.**
* Your **API key** (available in the Akowe issuance profile section).
* Basic knowledge of **JavaScript** (for SDK) or **HTTP requests** (for REST API).

***

### 🧩 How the API is Structured

* **Interactive Widget (SDK)** – Embed the certificate editor in your web app for drag-and-drop template design.
* **REST API Endpoints** – Programmatically manage organizations, templates, balances, and certificate issuance.
* **Event Callbacks** – Get real-time events like `onLoad`, `onSuccess`, `onClose`, and `onError`.

***

### 🔑 Authentication & Credentials

Every request requires authentication headers:

* **x-api-key** *(required)* – Your unique API key.
* **x-subaccount-email** *(optional)* – Identifies a specific sub-account. Useful for scoping templates or certificates to a user.

👉 Always include these credentials making API requests.

***

### ⚡ Example: Initializing the SDK

```html
<script src="https://issuance.akowe.app/sdk"></script>

<script>
  const certApp = new CertificateSDK({
    onLoad: (res) => {
      console.log("SDK Loaded:", res);
    },
    onCreateCompleted: (data) => {
      console.log("New template created:", data);
      // Send this `data` to your Template Create API
    },
    onEditCompleted: (data) => {
      console.log("Template edited:", data);
      // Send this `data` to your Template Edit API
    },
    onClose: () => {
      console.log("Modal closed");
      // Call this when after a successful request to template Create or Edit endpoint
    },
    onError: (err) => {
      console.error("SDK error:", err);
    }
  });
</script>
```

***

### 🚀 Getting Started Steps

1. **Obtain API credentials** from your Akowe issuance dashboard.
2. **Embed the SDK** in your frontend or call API endpoints directly.
3. **Test integration** in development before moving to production.

With clear endpoints, event callbacks, and a ready-to-use SDK, you can integrate **Akowe Issuance in minutes—not hours**.

<br>
