> For the complete documentation index, see [llms.txt](https://osigla.gitbook.io/collecta/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://osigla.gitbook.io/collecta/master.md).

# v1: Collection API

## Initialize Payment

<mark style="color:green;">`POST`</mark> `https://www.collecta.com.ng/pay/?i=Handle`

Add the form data parameters as hidden fields within a form whose action is set to the endpoint above.

#### Path Parameters

| Name | Type   | Description                                            |
| ---- | ------ | ------------------------------------------------------ |
| i    | string | Handle of your collection account as setup on Collecta |

#### Request Body

| Name          | Type   | Description                                                                                                          |
| ------------- | ------ | -------------------------------------------------------------------------------------------------------------------- |
| PhoneNumber   | string | Phone number of the user making payment                                                                              |
| Email         | string | Email of the user making payment                                                                                     |
| PayerName     | string | Name of the user making payment                                                                                      |
| Hash          | string | The secure Hash value for this transaction which is your URL + TransactionId + Amount + SecretKey hashed with SHA512 |
| TransactionId | string | The reference ID for this transaction on your system                                                                 |
| Amount        | string | Amount in Naira                                                                                                      |
| URL           | string | Your payment collection Handle. Has to be the same as the i parameter in the endpoint URL                            |
| ReturnURL     | string | URL of the path in your application that Collecta will send payment response to                                      |

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

```
Collecta payment page loads successfully
```

{% endtab %}
{% endtabs %}

{% hint style="warning" %}
After transaction is complete at Collecta. Collecta will redirect the user to your ReturnURL passed above with your TransactionId. You will then need to query Collecta securely to get the transaction status.
{% endhint %}

## Query Transaction Status

<mark style="color:green;">`POST`</mark> `https://www.collecta.com.ng/confirm`

Call this endpoint to query Collecta for transaction status

#### Path Parameters

| Name          | Type   | Description                                                                                                    |
| ------------- | ------ | -------------------------------------------------------------------------------------------------------------- |
| Hash          | string | The secure Hash for this transaction which is your URL + TransactionId + Amount + SecretKey Hashed with SHA512 |
| TransactionId | string | The unique transaction ID for this transaction on your system                                                  |
| URL           | string | Your collection account handle as configured in your Collecta dashboard                                        |

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

```
status: success / error
data: {
Id: 0, ResponseCode: '', TransactionId: '', Status: '', Message: ''
}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
You will know that your transaction is successful when status = success and data.Status = 1
{% endhint %}
