> ## Documentation Index
> Fetch the complete documentation index at: https://docs.niobi.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Make Payments

This section explains how to execute payouts using Niobi's Payment API, covering various payment channels and the payout process.

To start making payments using these methods, ensure that your Niobi account is set up and verified. Refer to the ‘Setting up a Niobi Account’ section in the [Getting Started](/quickstartv2) section for detailed steps on account creation and setup.

### Using the API

The unified-payments api endpoint is used for making payments across the supported countries. Please find the full API reference [here](/api-reference/payment/niobi-unified-payment-version-3).
You will be required to pass in the following parameters.

| Parameter                 | Type   | Required    | Description                                                                                                                                   |
| ------------------------- | ------ | ----------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| **Amount**                | Number | Yes         | The amount to be paid from your account. This is in absolute form (e.g. 100 KES to be passed as 100).                                         |
| **Currency**              | String | Yes         | The currency in which the payment will be made.                                                                                               |
| **Payment Reference**     | String | Yes         | Information you will use to refer to the transaction later.                                                                                   |
| **First Name**            | String | Yes         | The first name of the recipient.                                                                                                              |
| **Last Name**             | String | Yes         | The last name of the recipient.                                                                                                               |
| **Mobile**                | String | Yes         | The phone number of the recipient.                                                                                                            |
| **Email**                 | String | Yes         | The email of the recipient.                                                                                                                   |
| **Country ID**            | String | Yes         | The ID of the country the payment will be made to. The full list can be found [here](/api-reference/payment/niobi-unified-payment-version-3). |
| **City**                  | String | Yes         | The city of the recipient.                                                                                                                    |
| **Postal Code**           | String | Yes         | The postal code of the recipient.                                                                                                             |
| **Address Line 1**        | String | Yes         | The address line of the recipient.                                                                                                            |
| **Description**           | String | No          | A description or message from the payer who is making the payment.                                                                            |
| **Client Callback URL**   | String | Yes         | The callback URL for payment confirmation response.                                                                                           |
| **Third Party Reference** | String | No          | Information you'd like to use to refer to the deposit later.                                                                                  |
| **Payment Method Type**   | String | Yes         | The payment channel that will be used for the payment.                                                                                        |
| **Payment Method Object** | Object | Yes         | An object containing the phone number of the recipient, associated with the selected payment method type.                                     |
| **Sender First Name**     | String | Conditional | First name of the sender. Required for XAF (Cameroon) payouts.                                                                                |
| **Sender Last Name**      | String | Conditional | Last name of the sender. Required for XAF (Cameroon) payouts.                                                                                 |
| **Sender Phone Number**   | String | Conditional | Phone number of the sender in international format. Required for XAF (Cameroon) payouts.                                                      |

You will then generate a signature using the parameters above and proceed to make an api request using the payload. Refer to [Signature Generation](/signaturegeneration) for signing requests.
On successful payment, you will receive a callback response with the transaction details. Please find a detailed description of the callback response under [Callback URL Section.](/callback-urls)

<Note>Please note that all live transactions made through our API are subject to a transaction fee.</Note>

## High-Level Integration

This section provides a high-level overview of how to integrate with the Disbursements API.

<Steps>
  <Step title="Initiating the Unified Disbursements API Request">
    To begin, generate a signature for your api request using the generate signature api endpoint and initiate a payout transaction by making an API request.

    #### Sample API Request

    ```json theme={null}
    {
            "client_id": "client_id",
            "params": {
                "amount": "500",
                "city": "CustomerCity",
                "client_callback_url": "https://webhook.site/url",
                "country_id": "2",
                "currency": "XOF",
                "email": "john.doe@example.com",
                "first_name": "John",
                "last_name": "Doe",
                "line1": "CustomerStreet",
                "mobile": "22991600649",
                "mtn": [
                    {
                        "phone_number": "22991600649"
                    }
                ],
                "payment_method_type": "mtn",
                "payment_reference": "",
                "postal_code": "12345",
                "third_party_reference_1": ""
            },
            "salt": "mySalt123",
            "sender": "Integration name",
            "timestamp": "Timestamp value",
            "signature":"XxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxX"
        }
    ```

    #### Sample API Request for Cameroon (XAF Payouts)

    For XAF Payouts, the sender's details are required as part of local regulatory requirements.

    ```json theme={null}
    {
            "client_id": "client_id",
            "params": {
                "amount": "1000",
                "city": "Yaounde",
                "client_callback_url": "https://webhook.site/url",
                "country_id": "4",
                "currency": "XAF",
                "email": "jane.doe@example.com",
                "first_name": "Jane",
                "last_name": "Doe",
                "line1": "CustomerStreet",
                "mobile": "237612345678",
                "sender_firstname":"Harvey",
                "sender_lastname":"Mike",
                "sender_phone_number":"2371xxxx6789",
                "orange": [
                    {
                        "phone_number": "2376xxxxx678"
                    }
                ],
                "payment_method_type": "orange",
                "payment_reference": "XAF_PAYOUT_001",
                "postal_code": "12345",
                "third_party_reference_1": ""
            },
            "salt": "mySalt456",
            "sender": "Integration name",
            "timestamp": "Timestamp value",
            "signature":"YyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyY"
        }
    ```
  </Step>

  <Step title="Handling Transaction Status">
    Once the transaction has been processed, you have two options for managing the transaction status:

    <ol>
      <li>
        **Receiving a Callback.**
        A callback response containing the transaction details will be sent to your configured URL. You can set up an endpoint on your front end to handle this callback and update the user interface accordingly, such as displaying success or failure messages based on the transaction outcome. See more about callback responses [here](/callback-urls)

        #### Sample Callback Response

        ```json theme={null}
        "client_id": "Your client id",
        "params": {
        "account": "80xxxxx3",
        "account_number": "",
        "amount": 10,
        "currency" : "KES",
        "fee": 5,
        "message": "Payment was transferred successfully.",
        "mobile": "254123456789",
        "paybill_number": "",
        "payee": "JohnDoe 123",
        "payment_channel": "Send Money",
        "payment_reference": "OID51",
        "payoutId": "bd8f51a2-xxxx-xxxx-xxxx-xxxxx9a",
        "ref": "SII6ZH9PU0",
        "statusCode": "000000",
        "third_party_reference_1": "TRANS1",
        "third_party_reference_2": null,
        "transaction_date": "2024-09-18 00:00:00",
        "transaction_detail": "Disbursement made through M-Pesa Send Money",
        "type": "Pay out"
        },
        "salt": "salt value",
        "sender": "Integration name",
        "timestamp": 123,
        "signature": "7xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxb"
        }
        ```
      </li>

      <li>
        **Periodically Querying Transaction Status.**
        Alternatively, you can query the [transaction status endpoint](/api-reference/payment/niobi-get-transaction-status-v3) periodically (recommended for 2 minutes) to check for updates on the transaction status.
      </li>
    </ol>
  </Step>
</Steps>

## Conditional SMS Notifications for External Beneficiaries (KES Payouts)

For payout transactions in Kenyan Shillings (KES), you can request conditional SMS notifications to be sent to external beneficiaries. This feature allows you to opt-in for SMS alerts to recipients outside your organization.

To enable this feature, contact our support team via email at [support@niobi.co](mailto:support@niobi.co) to request activation.
