# Get Transaction Type(s)

<mark style="color:blue;">`GET`</mark> `/v2/finplus/debtmanagement/transactiontypes` `(/{id})`

Use this endpoint to retrieve the list of all the possible **transaction types** for the specified school (see [Financial Transactions Report](/v2/reference/finance+/debt-management/financial-transactions-report.md)).

{% hint style="info" %}
By default, this endpoint returns a **collection of records**, wrapped in a `data` array. To retrieve a **single record**, provide its **ID in the URL**, which will return a **single object** instead of a collection.
{% endhint %}

### Path Parameters

<table><thead><tr><th width="247">Name</th><th width="102">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>{id}</code></td><td>Integer</td><td>Optionally provide the <strong>Transaction Type ID</strong> for retrieving a single record.</td></tr></tbody></table>

### Request Headers

<table><thead><tr><th width="182.7427978515625">Name</th><th width="119.77142333984375">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>HTTP-X-USERNAME</code><mark style="color:red;">*</mark></td><td>String</td><td>As provided by d6</td></tr><tr><td><code>HTTP-X-PASSWORD</code><mark style="color:red;">*</mark></td><td>String</td><td>As provided by d6</td></tr><tr><td><code>HTTP-X-SCHOOLID</code><mark style="color:red;">*</mark></td><td>Integer</td><td>The unique identifier of the school for which the data is being queried.</td></tr></tbody></table>

### Response Examples

{% tabs %}
{% tab title="Success - Collection (200 OK) " %}
**Status:** <mark style="color:green;">`200 OK`</mark>

```json
{
    "data": [
        {
            "id": "1",
            "name": "General Journal"
        },
        {
            "id": "2",
            "name": "Receipt"
        },
        {
            "id": "3",
            "name": "Payment"
        },
        {
            "id": "4",
            "name": "Deposit"
        },
        ...
    ]
}
```

{% endtab %}

{% tab title="Success - Resource (200 OK)" %}
**Status:** <mark style="color:green;">`200 OK`</mark>

```json
{
    "id": 2,
    "name": "Receipt"
}
```

{% endtab %}

{% tab title="ID Not Found Error (404 Not Found)" %}
**Description:** The requested ID does not exist in the system.

**Status:** <mark style="color:red;">`404 Not Found`</mark>

```json
{
    "success": false,
    "message": "The transaction type does not exist"
}
```

{% endtab %}
{% endtabs %}

### Code Samples

{% tabs %}
{% tab title="PHP" %}

```php
<?php

// API Credentials
$api_username = 'your_username';
$api_password = 'your_password';
$school_id = 'the_school_id';

// Base API endpoint
define('BASE_URL', 'https://integrate.d6plus.co.za/api/v2/finplus/debtmanagement/transactiontypes');

// Optional: Set an ID to fetch a specific type (or leave empty for all)
$id = '';

$url = BASE_URL;
if (!empty($id)) {
    $url .= '/' . $id;
}


// Initialize cURL
$curl = curl_init();

// Set cURL options
curl_setopt_array($curl, [
    CURLOPT_URL            => $url,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_TIMEOUT        => 30,  // Set timeout to prevent hanging requests
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_HTTP_VERSION   => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST  => 'GET',
    CURLOPT_HTTPHEADER     => [
        "HTTP-X-USERNAME: $api_username",
        "HTTP-X-PASSWORD: $api_password",
        "HTTP-X-SCHOOLID: $school_id"
    ],
]);

// Execute request
$response = curl_exec($curl);

// Check for errors
$error = curl_error($curl);
if ($error) {
    curl_close($curl);
    throw new Exception("cURL Error: $error");
}

// Close cURL and output response
curl_close($curl);
echo $response;

```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --request GET 'https://integrate.d6plus.co.za/api/v2/finplus/debtmanagement/transactiontypes' \
     --header 'HTTP-X-USERNAME: your_username' \
     --header 'HTTP-X-PASSWORD: your_password' \
     --header 'HTTP-X-SCHOOLID: the_school_id'
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://apidocs.d6plus.co.za/v2/reference/finance+/debt-management/get-transaction-type-s.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
