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

# Business Services

> Manage business customers — create, retrieve, update, and disable customers using the Monei Python SDK

`monei.business` provides methods to manage business customers under a specific business ID.

With this service, you can:

* Create a business customer
* Retrieve all business customers
* Get customer details
* Update a customer
* Disable a customer

> **Note**: All methods return response objects with attributes accessible via dot notation (e.g., `customer.id`, `customers.data`).

***

## Create Business Customer

Create a new customer under a specific business.

```python theme={null}
business_id = "your-business-id"

customer = monei.business.create_business_customer(
    business_id,
    first_name="John",
    last_name="Doe",
    email="john@example.com",
    phone_number="+2348012345678"
)

print(customer)
```

***

## Get Business Customers

Retrieve all customers associated with a business.

```python theme={null}
business_id = "your-business-id"

customers = monei.business.get_business_customers(
    business_id
)

print(customers)
```

***

## Get Customer Details

Retrieve detailed information about a specific customer.

```python theme={null}
business_id = "your-business-id"
customer_id = "customer-id"

customer = monei.business.get_customer_details(
    business_id,
    customer_id
)

print(customer)
```

***

## Update Customer

Update an existing customer's information.

```python theme={null}
business_id = "your-business-id"
customer_id = "customer-id"

updated_customer = monei.business.update_customer(
    business_id,
    customer_id,
    first_name="Jane",
    last_name="Doe",
    email="jane@example.com"
)

print(updated_customer)
```

***

## Disable Customer

Disable a customer under a business.

```python theme={null}
business_id = "your-business-id"
customer_id = "customer-id"

response = monei.business.disable_customer(
    business_id,
    customer_id
)

print(response)
```

***

## Working with Response Objects

All methods return objects with attribute access:

```python theme={null}
# Create customer response
customer = monei.business.create_business_customer(
    business_id,
    first_name="John",
    last_name="Doe",
    email="john@example.com",
    phone_number="+2348012345678"
)
print(customer.id)           # Customer ID
print(customer.first_name)   # First name
print(customer.last_name)    # Last name
print(customer.email)        # Email address
print(customer.phone_number) # Phone number
print(customer.status)       # Customer status
print(customer.created_at)   # Creation date

# Get business customers response
customers = monei.business.get_business_customers(business_id)
for customer in customers.data:
    print(customer.id)           # Customer ID
    print(customer.first_name)   # First name
    print(customer.last_name)    # Last name
    print(customer.email)        # Email address
    print(customer.phone_number) # Phone number
    print(customer.status)       # Customer status
print(customers.pagination)      # Pagination info
print(customers.pagination.total)     # Total count
print(customers.pagination.page)      # Current page
print(customers.pagination.limit)     # Items per page

# Get customer details response
customer = monei.business.get_customer_details(business_id, customer_id)
print(customer.id)           # Customer ID
print(customer.first_name)   # First name
print(customer.last_name)    # Last name
print(customer.email)        # Email address
print(customer.phone_number) # Phone number
print(customer.status)       # Customer status
print(customer.created_at)   # Creation date
print(customer.updated_at)   # Last update date

# Update customer response
updated_customer = monei.business.update_customer(
    business_id,
    customer_id,
    first_name="Jane",
    last_name="Doe",
    email="jane@example.com"
)
print(updated_customer.id)         # Customer ID
print(updated_customer.first_name) # Updated first name
print(updated_customer.last_name)  # Updated last name
print(updated_customer.email)      # Updated email
print(updated_customer.updated_at) # Update timestamp

# Disable customer response
response = monei.business.disable_customer(business_id, customer_id)
print(response.message)      # Success message
print(response.customer_id)  # Disabled customer ID
print(response.status)       # New status
```

***

## Response Types

### BusinessCustomerDto

```python theme={null}
{
    "id": str,
    "first_name": str,
    "last_name": str,
    "email": str,
    "phone_number": str,
    "status": "active" | "disabled",
    "created_at": str,
    "updated_at": str
}
```

### BusinessCustomersListDto

```python theme={null}
{
    "data": [BusinessCustomerDto],
    "pagination": {
        "total": int,
        "page": int,
        "limit": int,
        "total_pages": int
    }
}
```

### DisableCustomerResponseDto

```python theme={null}
{
    "message": str,
    "customer_id": str,
    "status": "disabled"
}
```

***

## Error Handling

All business service calls may raise an exception if the request fails.

```python theme={null}
from monei import MoneiError

try:
    customer = monei.business.create_business_customer(
        business_id,
        first_name="John",
        last_name="Doe",
        email="john@example.com",
        phone_number="+2348012345678"
    )
    print(customer.id)
except MoneiError as err:
    print(err.status_code)  # HTTP status code
    print(err.message)      # Error message
    print(err.code)         # Error code
```

***

## Service Overview

| Method                                                                              | Description                     |
| ----------------------------------------------------------------------------------- | ------------------------------- |
| `create_business_customer(business_id, first_name, last_name, email, phone_number)` | Create a new business customer  |
| `get_business_customers(business_id)`                                               | Retrieve all business customers |
| `get_customer_details(business_id, customer_id)`                                    | Get customer details            |
| `update_customer(business_id, customer_id, first_name, last_name, email)`           | Update customer information     |
| `disable_customer(business_id, customer_id)`                                        | Disable a customer              |

***

## Notes

* All methods require a valid `business_id`
* A properly configured `MoneiClient` instance is required
* Ensure authentication headers are set before making requests
* All responses are strongly typed objects with attribute access
* Disabled customers cannot perform transactions until re-enabled

***
