Customers

Manage customer records for invoicing and receipt generation.

Customers represent the businesses or individuals you invoice. Store customer details including tax identification numbers (TIN) for ZIMRA compliance.

For B2B invoices in Zimbabwe, a valid TIN is required for the customer to claim VAT input credits.

The Customer Object

The customer object contains contact information, tax identifiers, and billing address details.

Customer Object
{
  "id": "cust_xyz789",
  "name": "Acme Corporation",
  "email": "billing@acme.com",
  "phone": "+263771234567",
  "tin": "123456789",
  "vat_number": "VAT123456",
  "address": {
    "line1": "123 Main Street",
    "line2": "Suite 100",
    "city": "Harare",
    "state": "Harare",
    "postal_code": "00263",
    "country": "ZW"
  },
  "metadata": {
    "industry": "technology",
    "account_manager": "john.doe"
  },
  "created_at": "2024-01-01T00:00:00Z",
  "updated_at": "2024-01-15T10:30:00Z"
}

Required Fields for ZIMRA

For invoices submitted to ZIMRA, the following customer fields are required:

  • name - The customer's legal business name
  • tin - Tax Identification Number for B2B transactions
  • address - At least city and country are required

Create a Customer

Create a new customer record. The customer can then be referenced when creating invoices and receipts.

POST/v1/customers
Auth required

Creates a new customer.

Request Body

namestring required

The customer's name or business name.

Example: Acme Corporation

emailstring

Primary email address for invoices.

Example: billing@acme.com

phonestring

Contact phone number.

Example: +263771234567

tinstring

Tax Identification Number. Required for B2B invoices.

Example: 123456789

vat_numberstring

VAT registration number if different from TIN.

addressobject

Customer's billing address.

metadataobject

Custom key-value pairs for additional data.

Example Request

JSON
{
  "name": "Acme Corporation",
  "email": "billing@acme.com",
  "phone": "+263771234567",
  "tin": "123456789",
  "vat_number": "VAT123456",
  "address": {
    "line1": "123 Main Street",
    "line2": "Suite 100",
    "city": "Harare",
    "state": "Harare",
    "postal_code": "00263",
    "country": "ZW"
  }
}

Response

201Customer created successfully
JSON
{
  "id": "cust_xyz789",
  "name": "Acme Corporation",
  "email": "billing@acme.com",
  "phone": "+263771234567",
  "tin": "123456789",
  "vat_number": "VAT123456",
  "address": {
    "line1": "123 Main Street",
    "line2": "Suite 100",
    "city": "Harare",
    "state": "Harare",
    "postal_code": "00263",
    "country": "ZW"
  },
  "metadata": {
    "industry": "technology",
    "account_manager": "john.doe"
  },
  "created_at": "2024-01-01T00:00:00Z",
  "updated_at": "2024-01-15T10:30:00Z"
}

List Customers

Retrieve a paginated list of customers. Search by name, email, or TIN.

GET/v1/customers
Auth required

Returns a paginated list of customers.

Query Parameters

searchstring

Search by name, email, or TIN.

pageinteger default: 1

Page number for pagination.

per_pageinteger default: 20

Number of items per page (max 100).

Response

200List of customers
JSON
{
  "data": [
    {
      "id": "cust_xyz789",
      "name": "Acme Corporation",
      "email": "billing@acme.com",
      "tin": "123456789"
    },
    {
      "id": "cust_abc123",
      "name": "TechStart Inc",
      "email": "accounts@techstart.co.zw",
      "tin": "987654321"
    }
  ],
  "meta": {
    "current_page": 1,
    "per_page": 20,
    "total": 234
  }
}

Update a Customer

Update an existing customer. Only the fields you include will be updated. Nested objects like address are merged with existing data.

PATCH/v1/customers/{customer_id}
Auth required

Updates the specified customer.

Path Parameters

customer_idstring required

The unique identifier of the customer.

Example: cust_xyz789

Example Request

JSON
{
  "email": "finance@acme.com",
  "address": {
    "line1": "456 Business Park",
    "city": "Harare"
  }
}

Response

200Customer updated successfully
JSON
{
  "id": "cust_xyz789",
  "name": "Acme Corporation",
  "email": "billing@acme.com",
  "phone": "+263771234567",
  "tin": "123456789",
  "vat_number": "VAT123456",
  "address": {
    "line1": "123 Main Street",
    "line2": "Suite 100",
    "city": "Harare",
    "state": "Harare",
    "postal_code": "00263",
    "country": "ZW"
  },
  "metadata": {
    "industry": "technology",
    "account_manager": "john.doe"
  },
  "created_at": "2024-01-01T00:00:00Z",
  "updated_at": "2024-01-15T10:30:00Z"
}
Updating a customer's TIN may affect pending invoices. Ensure the TIN is correct before submitting invoices to ZIMRA.