API Documentation

Build integrations with the Zanzibar Digital Free Zone API. Manage digital residents, companies, invoices, and payments programmatically.

📍 Base URL

https://api.zanzibardigitalfreezone.com/api

📋 API Version

v1.0.0 • RESTful JSON API

Authentication

The ZDFZ API uses API keys for authentication. Include your API key in the Authorization header with all requests.

Authorization: Bearer YOUR_API_KEY

Obtaining an API Key

API keys are issued to registered resellers. Contact the ZDFZ administration to request API access for your organization.

POST /api/auth/api-key

Generate a new API key (requires reseller credentials)

Quick Start

Here's a quick example to get you started. This creates a new digital resident:

1. List Existing Residents

curl -X GET "https://api.zanzibardigitalfreezone.com/api/residents" \
  -H "Authorization: Bearer YOUR_API_KEY"

2. Create a Digital Resident

curl -X POST "https://api.zanzibardigitalfreezone.com/api/residents" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "first_name": "John",
    "last_name": "Doe",
    "email": "john.doe@example.com",
    "nationality": "US",
    "passport_number": "123456789"
  }'

3. Create a Company

curl -X POST "https://api.zanzibardigitalfreezone.com/api/companies" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Acme Global Ltd",
    "type": "FZCO",
    "resident_id": "RES-001",
    "business_activity": "Software Development"
  }'

Error Handling

The API uses standard HTTP status codes. Errors return a JSON object with an error field describing the issue.

Status Code Meaning
200 Success
201 Created
400 Bad Request - Invalid parameters
401 Unauthorized - Invalid or missing API key
404 Not Found - Resource doesn't exist
409 Conflict - Resource already exists
429 Too Many Requests - Rate limited
500 Internal Server Error

Error Response Format

{
  "error": "Description of what went wrong"
}

Digital Residents

Digital Residents are individuals registered in the Zanzibar Digital Free Zone. A resident can own multiple companies and manage their business activities remotely.

GET /api/residents

List all digital residents (supports pagination and search)

POST /api/residents

Create a new digital resident

GET /api/residents/{id}

Get a specific resident by ID

PUT /api/residents/{id}

Update a resident's information

DELETE /api/residents/{id}

Delete a resident

Free Zone Companies

Companies can be registered as FZCO (Free Zone Company), FZLLC (Free Zone Limited Liability Company), or Cooperatives. Each type has different requirements and structures.

FZCO

Standard Free Zone Company for 1-50 shareholders

FZLLC

Limited Liability Company with flexible ownership

Cooperative

Member-owned cooperative structure

GET /api/companies

List all companies

POST /api/companies

Register a new company

Invoices

Create and manage invoices for company fees, licensing, and services.

GET /api/invoices

List all invoices

POST /api/invoices

Create a new invoice

Contracts

Manage legal contracts and agreements. Templates are available for common contract types.

GET /api/contract-templates

List available contract templates

GET /api/companies/{id}/contracts

List contracts for a company

Payments

Process payments via cryptocurrency (Bitcoin, USDT) or PesaPal for fiat transactions.

Cryptocurrency Payments

POST /api/payments/wallet

Get a wallet address for cryptocurrency payment

PesaPal (Fiat)

POST /api/payments/pesapal/initiate

Initiate a PesaPal payment

KYC Verification

Know Your Customer (KYC) verification is required for all digital residents. The API integrates with third-party verification providers.

POST /api/kyc/start

Start a KYC verification session

GET /api/kyc/status/{session_id}

Check KYC verification status

Treasury

Access treasury accounts and transaction history for companies and residents.

GET /api/companies/{id}/treasury/accounts

List company treasury accounts

GET /api/companies/{id}/treasury/transactions

List company treasury transactions