> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://apidocs.sare.africa/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://apidocs.sare.africa/_mcp/server.

# Create Bill Account

POST http://localhost:8080/api/v3/bill-accounts
Content-Type: application/json

Reference: https://apidocs.sare.africa/sare-core-api/wallet/bills-accounts-providers/create-bill-account

## Request

### Body (application/json)

This endpoint expects an object.

- `isActive` (boolean, required)
- `nickname` (string, required)
- `isFavorite` (boolean, required)
- `billProvider` (string, required)
- `accountNumber` (string, required)
- `defaultAmount` (integer, required)
- `paymentMethod` (string, required)
- `businessNumber` (string, required)

## Response

### 201

Created

- `code` (integer, required)
- `data` (object, required)
  - `id` (string, required)
  - `isActive` (boolean, required)
  - `nickname` (string, required)
  - `isFavorite` (boolean, required)
  - `billProvider` (string, required)
  - `accountNumber` (string, required)
  - `defaultAmount` (integer, required)
  - `paymentMethod` (string, required)
  - `businessNumber` (string, required)
- `message` (string, required)

## Examples

**Request**

```json
{
  "isActive": true,
  "nickname": "Electricity",
  "isFavorite": true,
  "billProvider": "5c6d7e8f-9a0b-4c1d-8e2f-3a4b5c6d7e8f",
  "accountNumber": "12345678",
  "defaultAmount": 500,
  "paymentMethod": "MPESA_PAYBILL",
  "businessNumber": "88880"
}
```

**Response**

```json
{
  "code": 201,
  "data": {
    "id": "6d7e8f9a-0b1c-4d2e-8f3a-4b5c6d7e8f9a",
    "isActive": true,
    "nickname": "Electricity",
    "isFavorite": true,
    "billProvider": "5c6d7e8f-9a0b-4c1d-8e2f-3a4b5c6d7e8f",
    "accountNumber": "12345678",
    "defaultAmount": 500,
    "paymentMethod": "MPESA_PAYBILL",
    "businessNumber": "88880"
  },
  "message": "Bill account created successfully"
}
```

**SDK Code**

```python Wallet_Bills - Accounts & Providers_Create Bill Account_example
import requests

url = "http://localhost:8080/api/v3/bill-accounts"

payload = {
    "isActive": True,
    "nickname": "Electricity",
    "isFavorite": True,
    "billProvider": "5c6d7e8f-9a0b-4c1d-8e2f-3a4b5c6d7e8f",
    "accountNumber": "12345678",
    "defaultAmount": 500,
    "paymentMethod": "MPESA_PAYBILL",
    "businessNumber": "88880"
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Wallet_Bills - Accounts & Providers_Create Bill Account_example
const url = 'http://localhost:8080/api/v3/bill-accounts';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '{"isActive":true,"nickname":"Electricity","isFavorite":true,"billProvider":"5c6d7e8f-9a0b-4c1d-8e2f-3a4b5c6d7e8f","accountNumber":"12345678","defaultAmount":500,"paymentMethod":"MPESA_PAYBILL","businessNumber":"88880"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Wallet_Bills - Accounts & Providers_Create Bill Account_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "http://localhost:8080/api/v3/bill-accounts"

	payload := strings.NewReader("{\n  \"isActive\": true,\n  \"nickname\": \"Electricity\",\n  \"isFavorite\": true,\n  \"billProvider\": \"5c6d7e8f-9a0b-4c1d-8e2f-3a4b5c6d7e8f\",\n  \"accountNumber\": \"12345678\",\n  \"defaultAmount\": 500,\n  \"paymentMethod\": \"MPESA_PAYBILL\",\n  \"businessNumber\": \"88880\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Wallet_Bills - Accounts & Providers_Create Bill Account_example
require 'uri'
require 'net/http'

url = URI("http://localhost:8080/api/v3/bill-accounts")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"isActive\": true,\n  \"nickname\": \"Electricity\",\n  \"isFavorite\": true,\n  \"billProvider\": \"5c6d7e8f-9a0b-4c1d-8e2f-3a4b5c6d7e8f\",\n  \"accountNumber\": \"12345678\",\n  \"defaultAmount\": 500,\n  \"paymentMethod\": \"MPESA_PAYBILL\",\n  \"businessNumber\": \"88880\"\n}"

response = http.request(request)
puts response.read_body
```

```java Wallet_Bills - Accounts & Providers_Create Bill Account_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("http://localhost:8080/api/v3/bill-accounts")
  .header("Content-Type", "application/json")
  .body("{\n  \"isActive\": true,\n  \"nickname\": \"Electricity\",\n  \"isFavorite\": true,\n  \"billProvider\": \"5c6d7e8f-9a0b-4c1d-8e2f-3a4b5c6d7e8f\",\n  \"accountNumber\": \"12345678\",\n  \"defaultAmount\": 500,\n  \"paymentMethod\": \"MPESA_PAYBILL\",\n  \"businessNumber\": \"88880\"\n}")
  .asString();
```

```php Wallet_Bills - Accounts & Providers_Create Bill Account_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'http://localhost:8080/api/v3/bill-accounts', [
  'body' => '{
  "isActive": true,
  "nickname": "Electricity",
  "isFavorite": true,
  "billProvider": "5c6d7e8f-9a0b-4c1d-8e2f-3a4b5c6d7e8f",
  "accountNumber": "12345678",
  "defaultAmount": 500,
  "paymentMethod": "MPESA_PAYBILL",
  "businessNumber": "88880"
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Wallet_Bills - Accounts & Providers_Create Bill Account_example
using RestSharp;

var client = new RestClient("http://localhost:8080/api/v3/bill-accounts");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"isActive\": true,\n  \"nickname\": \"Electricity\",\n  \"isFavorite\": true,\n  \"billProvider\": \"5c6d7e8f-9a0b-4c1d-8e2f-3a4b5c6d7e8f\",\n  \"accountNumber\": \"12345678\",\n  \"defaultAmount\": 500,\n  \"paymentMethod\": \"MPESA_PAYBILL\",\n  \"businessNumber\": \"88880\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Wallet_Bills - Accounts & Providers_Create Bill Account_example
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = [
  "isActive": true,
  "nickname": "Electricity",
  "isFavorite": true,
  "billProvider": "5c6d7e8f-9a0b-4c1d-8e2f-3a4b5c6d7e8f",
  "accountNumber": "12345678",
  "defaultAmount": 500,
  "paymentMethod": "MPESA_PAYBILL",
  "businessNumber": "88880"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "http://localhost:8080/api/v3/bill-accounts")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```