> For the complete documentation index, see [llms.txt](https://docs.qwaap.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.qwaap.com/receiving-money/initiate-invoice-payment.md).

# Initiate Invoice Payment

### Invoice Generation

For every request made to the Invoice Payment API, an invoice is automatically generated by Qwaap whose invoice number is shared in the response as invoice\_number.

## Invoice Payment Request API

<mark style="color:green;">`POST`</mark> `https://apisdbx.qwaap.com/v1/request-payment`

#### Headers

| Name                                           | Type   | Description                             |
| ---------------------------------------------- | ------ | --------------------------------------- |
| Content-Type<mark style="color:red;">\*</mark> | String | application/json                        |
| public-key<mark style="color:red;">\*</mark>   | String | Obtained from merchant account settings |

#### Request Body

| Name                                                    | Type       | Description                                                                                                                                                              |
| ------------------------------------------------------- | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| transaction\_currency<mark style="color:red;">\*</mark> | String     | Currency in which transactions will be made                                                                                                                              |
| request\_amount<mark style="color:red;">\*</mark>       | Int/Double | At most 2 decimal places allowed for double.                                                                                                                             |
| merchant\_reference<mark style="color:red;">\*</mark>   | String     | <p>The UNIQUE reference for this transaction generated by your system. A unique string value should be sent for every attempt.</p><p> <code>4 to 36 character</code></p> |
| narration<mark style="color:red;">\*</mark>             | String     | <p>Use this to add a brief description or comment on the transaction.</p><p><code>4 to 64 character</code></p>                                                           |
| redirect\_url<mark style="color:red;">\*</mark>         | String     | Url e.g <https://yourdomain.com>  that we redirect to.                                                                                                                   |
| customer\_email<mark style="color:red;">\*</mark>       | String     | Customer Email to which one time password(OTP) will be sent. Your customer will use this to login instantly.                                                             |

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

```javascript
{
    "code": 200,
    "status": "success",
    "message": "Payment Initiated Successfully.",
    "data": {
        "invoice_number": "QINVMNTVMRGJ4TWK72PN",
        "merchant_reference": "ERYDTS234",
        "amount": 1000000,
        "currency": "NGN",
        "payment_status": "PENDING",
        "payment_url": "https://qwaap-quick.web.app/pay/QINVMNTVMRGJ4TWK72PN"
    }
}
```

{% endtab %}

{% tab title="401: Unauthorized " %}

```javascript
{
    "code": 401,
    "status": "error",
    "message": "public-key is required",
    "data": {}
}
```

{% endtab %}
{% endtabs %}

\
The Invoice Payment Request API responds with the parameters below.

| Parameter           | Type           | Description                                                   |
| ------------------- | -------------- | ------------------------------------------------------------- |
| currency            | string         | currency in which the payment is to be made.                  |
| amount              | integer/double | Amount to be paid by the customer.                            |
| merchant\_reference | string         | Merchant transaction reference                                |
| invoice\_number     | string         | Reference to the generated invoice.                           |
| payment\_status     | string         | Current status of  invoice payment                            |
| payment\_url        | string         | Url to which you redirect your customers to complete payment. |
|                     |                |                                                               |
