> For the complete documentation index, see [llms.txt](https://docs.udara360.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.udara360.io/udara360-docs-1/bills-payments/bill-payments/vend.md).

# Vend

The "Vend" endpoint allows customers to pay for or purchase a package from a biller, for example, airtime, electricity, or a subscription.

<mark style="color:yellow;">`POST`</mark> `/api/bills/v1/vend`

To vend a bill, you need to provide the necessary body parameters, such as `accountNumber`, `paymentReference`, `amount`, `packageIdentifier`, `billerIdentifier`, and `customerId`.

**Headers**

| Name                                            | Value                |
| ----------------------------------------------- | -------------------- |
| Content-Type<mark style="color:red;">\*</mark>  | `application/json`   |
| Authorization<mark style="color:red;">\*</mark> | `Bearer`             |
| Request-Reference                               | `{unique_reference}` |

**Body**

<table><thead><tr><th>Name</th><th>Data Type (Length)</th><th data-type="checkbox">Required</th><th>Description</th></tr></thead><tbody><tr><td><code>accountNumber</code></td><td>string (10)</td><td>true</td><td>The account number to be debited.</td></tr><tr><td><code>paymentReference</code></td><td>string (50)</td><td>true</td><td>A unique instrument reference for this payment.</td></tr><tr><td><code>amount</code></td><td>number</td><td>true</td><td>The amount to be debited.<br><br><em><mark style="color:red;">Amount should be sent in the base unit of the currency. For example, 500 naira should be sent as 50,000 kobo</mark>.</em></td></tr><tr><td><code>packageIdentifier</code></td><td>string (50)</td><td>true</td><td>The package identifier, obtained from the Get All Billers endpoint.</td></tr><tr><td><code>billerIdentifier</code></td><td>string (50)</td><td>true</td><td>The biller identifier, obtained from the Get All Billers endpoint.</td></tr><tr><td><code>customerId</code></td><td>string (50)</td><td>true</td><td>The customer's unique ID to be recharged or reloaded.<br><br><em><mark style="color:red;">This can be the Phone Number or DSTV smart number, or a Bet account User ID, depending on the biller.</mark></em></td></tr><tr><td><code>customerName</code></td><td>string (250)</td><td>false</td><td>For billers that require a name inquiry, pass the name obtained from the Get Customer (User ID) Information endpoint.</td></tr><tr><td><code>phoneNumber</code></td><td>string (50)</td><td>false</td><td>Some billers, like IBEDC, validate the phone number on the biller account.<br><br><em><mark style="color:red;">You're advised to pass the PhoneNumber from the Get Customer Information response. If not passed, the system will use the Phone Number already on the account.</mark></em></td></tr><tr><td><code>transactionChannel</code></td><td>integer</td><td>true</td><td>The channel through which this transaction is being initiated.</td></tr></tbody></table>

Here is an example request and response with a sample payload sent to the endpoint in Curl format.

<details>

<summary>Sample Request</summary>

```json
curl --location -g '{{baseurl}}/api/bills/v1/vend' \
--header 'Authorization: bearer {token}' \
--header 'request-reference: {unique_reference}' \
--header 'Content-Type: application/json' \
--data '{
  "paymentReference": "",
  "customerId": "09132058051",
  "phoneNumber": "",
  "packageIdentifier": "MTN_VTU",
  "billerIdentifier": "MTN",
  "amount": 10,
  "accountNumber": "1000002105",
  "transactionChannel": 1,
  "customerName": "John Doe"
}'
```

</details>

<details>

<summary>Response: <code>200</code></summary>

```json
{
  "status": true,
  "message": "string",
  "data": {
    "isSuccessful": true,
    "responseCode": "string",
    "responseMessage": "string"
  }
}
```

</details>
