> For the complete documentation index, see [llms.txt](https://convexity-tech-team.gitbook.io/chats-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://convexity-tech-team.gitbook.io/chats-documentation/technical-documentation/api-documentation/donor.md).

# Donor

Donor Management

## Donor Invitation

<mark style="color:green;">`POST`</mark> `https://staging-api.chats.cash/v1/auth/:organisation_id/invite/:campaign_id`

Endpoint to invite donors into a particular campaign.

Authorization Header takes in the Bearer token generated from the login of the NGO&#x20;

#### Path Parameters

| Name                                               | Type   | Description        |
| -------------------------------------------------- | ------ | ------------------ |
| organisation\_id<mark style="color:red;">\*</mark> | String | ID of organisation |
| campaign\_id<mark style="color:red;">\*</mark>     | String | ID of campaign     |

#### Headers

| Name                                            | Type   | Description     |
| ----------------------------------------------- | ------ | --------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer \<token> |

#### Request Body

| Name                                           | Type   | Description                    |
| ---------------------------------------------- | ------ | ------------------------------ |
| inviteeEmail<mark style="color:red;">\*</mark> | String | Email of Donors for invitation |
| link                                           | String | URL of Donor                   |
| message                                        | String | Extra message to Donor         |

{% tabs %}
{% tab title="201: Created Invite sent to donor" %}

{% endtab %}

{% tab title="500: Internal Server Error Internal Server Error. Please try again" %}

{% endtab %}
{% endtabs %}

## Donor Invitation Confirmation

<mark style="color:green;">`POST`</mark> `https://staging-api.chats.cash/v1/auth/:campaignId/confirm-campaign-invite/:token`

Endpoint to confirm the invitation sent to donor(s)

#### Path Parameters

| Name                                         | Type   | Description                               |
| -------------------------------------------- | ------ | ----------------------------------------- |
| campaignId<mark style="color:red;">\*</mark> | String | ID of campaign for donor to join          |
| token<mark style="color:red;">\*</mark>      | String | Unique token for each invite confirmation |

{% tabs %}
{% tab title="200: OK campaign invitation has been confirmed" %}

{% endtab %}

{% tab title="500: Internal Server Error Internal Server Error. Please try again" %}

{% endtab %}
{% endtabs %}

## Campaign Funding by Donor (Crypto)

<mark style="color:green;">`POST`</mark> `https://staging-api.chats.cash/v1/organisations/:organisation_id/campaigns/:campaign_id/crypto_pay`

This is the crypto option endpoint that allows a donor to fund a campaign.

Authorization Header takes in the Bearer token generated from the login of the Donor

#### Path Parameters

| Name                                               | Type   | Description        |
| -------------------------------------------------- | ------ | ------------------ |
| organisation\_id<mark style="color:red;">\*</mark> | String | ID of organisation |
| campaign\_id<mark style="color:red;">\*</mark>     | String | ID of campaign     |

#### Request Body

| Name                                       | Type   | Description                                     |
| ------------------------------------------ | ------ | ----------------------------------------------- |
| currency<mark style="color:red;">\*</mark> | String | <p>Crypto type</p><p>\[USDT, BTC, XRP, XDP]</p> |

{% tabs %}
{% tab title="200: OK Wallet info received" %}

{% endtab %}

{% tab title="500: Internal Server Error Internal Server Error. Contact Support" %}

{% endtab %}
{% endtabs %}

## Donor Withdrawal Request

<mark style="color:green;">`POST`</mark> `https://staging-api.chats.cash/v1/organisations/request-withdrawal/:organisation_id`

This is the endpoint that allows a donor to make a withdrawal request. This request is sent to the Admin, who approves or rejects the request.

Authorization Header takes in the Bearer token generated from the login of the Donor&#x20;

#### Path Parameters

| Name                                               | Type   | Description        |
| -------------------------------------------------- | ------ | ------------------ |
| organisation\_id<mark style="color:red;">\*</mark> | String | ID of organisation |

#### Request Body

| Name                                                      | Type   | Description                       |
| --------------------------------------------------------- | ------ | --------------------------------- |
| campaign\_id<mark style="color:red;">\*</mark>            | String | ID of campaign                    |
| donor\_organisation\_id<mark style="color:red;">\*</mark> | String | Donor's organisation ID           |
| reason                                                    | String | Reason for the withdrawal request |

{% tabs %}
{% tab title="200: OK Request sent" %}

{% endtab %}

{% tab title="500: Internal Server Error Internal server error. Contact support" %}

{% endtab %}
{% endtabs %}

## Get all campaign vendors

<mark style="color:blue;">`GET`</mark> `https://staging-api.chats.cash/v1/organisations/:organisation_id/campaigns/:campaign_id/vendors`

This endpoint is used to get all the vendors in a campaign.

Authorization Header takes in the Bearer token generated from the login of the Donor&#x20;

#### Path Parameters

| Name                                               | Type   | Description        |
| -------------------------------------------------- | ------ | ------------------ |
| organisation\_id<mark style="color:red;">\*</mark> | String | ID of organisation |
| campaign\_id<mark style="color:red;">\*</mark>     | String | ID of campaign     |

#### Headers

| Name                                            | Type | Description     |
| ----------------------------------------------- | ---- | --------------- |
| Authorization<mark style="color:red;">\*</mark> |      | Bearer \<token> |

{% tabs %}
{% tab title="200: OK Campaign Vendors" %}

{% endtab %}

{% tab title="500: Internal Server Error Server Error. Unexpected error occurred" %}

{% endtab %}
{% endtabs %}

## Get all campaign beneficiaries

<mark style="color:blue;">`GET`</mark> `https://staging-api.chats.cash/v1/organisations/:organisation_id/campaigns/:campaign_id/beneficiaries`

This endpoint is used to get all the beneficiaries in a campaign.

Authorization Header takes in the Bearer token generated from the login of the Donor&#x20;

#### Path Parameters

| Name                                               | Type   | Description        |
| -------------------------------------------------- | ------ | ------------------ |
| organisation\_id<mark style="color:red;">\*</mark> | String | ID of organisation |
| campaign\_id<mark style="color:red;">\*</mark>     | String | ID of campaign     |

#### Headers

| Name                                            | Type   | Description     |
| ----------------------------------------------- | ------ | --------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer \<token> |

{% tabs %}
{% tab title="200: OK Campaign Beneficiaries" %}

{% endtab %}

{% tab title="500: Internal Server Error Server Error. Unexpected error occurred" %}

{% endtab %}
{% endtabs %}

## Get all campaign beneficiaries by age group

<mark style="color:blue;">`GET`</mark> `https://staging-api.chats.cash/v1/organisation/:organisation_id/campaigns/:campaign_id/beneficiary_age`

This endpoint is used to get all campaign beneficiaries by age group.

Authorization Header takes in the Bearer token generated from the login of the Donor&#x20;

#### Path Parameters

| Name                                               | Type   | Description        |
| -------------------------------------------------- | ------ | ------------------ |
| organisation\_id<mark style="color:red;">\*</mark> | String | ID of organisation |
| campaign\_id<mark style="color:red;">\*</mark>     | String | ID of campaign     |

#### Headers

| Name                                            | Type   | Description     |
| ----------------------------------------------- | ------ | --------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer \<token> |

{% tabs %}
{% tab title="200: OK Campaign Beneficiaries" %}

{% endtab %}

{% tab title="500: Internal Server Error Server Error. Unexpected error. Please retry" %}

{% endtab %}
{% endtabs %}

## Get all campaign beneficiaries by marital status

<mark style="color:blue;">`GET`</mark> `https://staging-api.chats.cash/v1/organisation/:organisation_id/campaigns/:campaign_id/beneficiary_mstatus`

This endpoint is used to get all campaign beneficiaries by age group.

Authorization Header takes in the Bearer token generated from the login of the Donor&#x20;

#### Path Parameters

| Name                                               | Type   | Description        |
| -------------------------------------------------- | ------ | ------------------ |
| organisation\_id<mark style="color:red;">\*</mark> | String | ID of organisation |
| campaign\_id<mark style="color:red;">\*</mark>     | String | ID of campaign     |

#### Headers

| Name                                            | Type   | Description     |
| ----------------------------------------------- | ------ | --------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer \<token> |

{% tabs %}
{% tab title="200: OK Campaign Beneficiaries" %}

{% endtab %}

{% tab title="500: Internal Server Error Server Error. Unexpected error. Please retry" %}

{% endtab %}
{% endtabs %}

## Get all campaign beneficiaries by location

<mark style="color:blue;">`GET`</mark> `https://staging-api.chats.cash/v1/organisation/:organisation_id/campaigns/:campaign_id/beneficiary_location`

This endpoint is used to get all campaign beneficiaries by location.

Authorization Header takes in the Bearer token generated from the login of the Donor&#x20;

#### Path Parameters

| Name                                               | Type   | Description        |
| -------------------------------------------------- | ------ | ------------------ |
| organisation\_id<mark style="color:red;">\*</mark> | String | ID of organisation |
| campaign\_id<mark style="color:red;">\*</mark>     | String | ID of campaign     |

#### Headers

| Name                                            | Type   | Description     |
| ----------------------------------------------- | ------ | --------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer \<token> |

{% tabs %}
{% tab title="200: OK Campaign Beneficiaries" %}

{% endtab %}

{% tab title="500: Internal Server Error Server Error. Unexpected error. Please retry" %}

{% endtab %}
{% endtabs %}

## Get all campaign beneficiaries balances

<mark style="color:blue;">`GET`</mark> `https://staging-api.chats.cash/v1/organisation/:organisation_id/campaigns/:campaign_id/beneficiary_balance`

This endpoint is used to get all campaign beneficiaries' balances.

Authorization Header takes in the Bearer token generated from the login of the Donor&#x20;

#### Path Parameters

| Name                                               | Type   | Description        |
| -------------------------------------------------- | ------ | ------------------ |
| organisation\_id<mark style="color:red;">\*</mark> | String | ID of organisation |
| campaign\_id<mark style="color:red;">\*</mark>     | String | ID of campaign     |

#### Headers

| Name                                            | Type   | Description     |
| ----------------------------------------------- | ------ | --------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer \<token> |

{% tabs %}
{% tab title="200: OK " %}

{% endtab %}

{% tab title="500: Internal Server Error Server Error. Unexpected error. Please retry" %}

{% endtab %}
{% endtabs %}

## Get all campaigns

<mark style="color:blue;">`GET`</mark> `https://staging-api.chats.cash/v1/organisations/donations/private_donor/campaigns/all`

This endpoint is used to get all campaigns.

Authorization Header takes in the Bearer token generated from the login of the Donor&#x20;

#### Query Parameters

| Name                                             | Type   | Description        |
| ------------------------------------------------ | ------ | ------------------ |
| type<mark style="color:red;">\*</mark>           | String | Type of campaign   |
| OrganisationId<mark style="color:red;">\*</mark> | String | ID of organisation |

#### Headers

| Name                                            | Type   | Description     |
| ----------------------------------------------- | ------ | --------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer \<token> |

{% tabs %}
{% tab title="200: OK " %}

{% endtab %}

{% tab title="500: Internal Server Error Request failed. Please try again." %}

{% endtab %}
{% endtabs %}

## Get a single campaign

<mark style="color:blue;">`GET`</mark> `https://staging-api.chats.cash/v1/organisations/:organisation_id/private/campaigns/:campaign_id`

This endpoint is used to get a campaign by ID.

Authorization Header takes in the Bearer token generated from the login of the Donor

#### Path Parameters

| Name                                               | Type   | Description        |
| -------------------------------------------------- | ------ | ------------------ |
| organisation\_id<mark style="color:red;">\*</mark> | String | ID of organisation |
| campaign\_id<mark style="color:red;">\*</mark>     | String | ID of campaign     |

#### Headers

| Name                                            | Type   | Description     |
| ----------------------------------------------- | ------ | --------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer \<token> |

{% tabs %}
{% tab title="200: OK " %}

{% endtab %}

{% tab title="500: Internal Server Error Internal server error. Contact support" %}

{% endtab %}
{% endtabs %}
