Quick Start

Get up and running with VasBox in under 5 minutes. This guide will walk you through installation, configuration, and making your first API request.

VasBox provides a simple and powerful API for creating ZIMRA-compliant invoices and receipts. This quick start guide will help you integrate VasBox into your application in just a few steps.

Prerequisites

Before you begin, make sure you have the following:

  • A VasBox account with API credentials
  • PHP 8.1+ or Node.js 18+ (depending on your platform)
  • A registered business with ZIMRA
  • Basic familiarity with REST APIs

Don't have an account?

Sign up for a free sandbox account at vasbox.co.zw/register to get your API keys.

Installation

Install the VasBox SDK for your preferred language. We provide official SDKs for PHP and JavaScript.

PHP Installation

Terminal
composer require vasbox/vasbox-php

JavaScript Installation

npm install @vasbox/sdk

Configuration

Add your API credentials to your environment variables:

.env
VASBOX_API_KEY=your_api_key_here
VASBOX_ENVIRONMENT=sandbox

Keep your API key secure

Never commit your API key to version control or expose it in client-side code. Always use environment variables.

Your First Request

Let's create your first invoice using the VasBox API. This example creates a simple invoice with one line item.

<?php

use VasBox\VasBox;

$vasbox = new VasBox(env('VASBOX_API_KEY'));

// Create your first invoice
$invoice = $vasbox->invoices->create([
    'customer_id' => 'cust_123',
    'currency' => 'USD',
    'items' => [
        [
            'description' => 'Software License',
            'quantity' => 1,
            'unit_price' => 99.00,
            'tax_code' => 'STD',
        ],
    ],
]);

echo "Invoice created: " . $invoice->id;

Success!

If everything is configured correctly, you should see a response with your new invoice ID. The invoice is created in draft status and can be submitted to ZIMRA when ready.

Next Steps

Congratulations! You've successfully made your first VasBox API request. Here's what to explore next: