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?
Installation
Install the VasBox SDK for your preferred language. We provide official SDKs for PHP and JavaScript.
PHP Installation
composer require vasbox/vasbox-php
JavaScript Installation
npm install @vasbox/sdkConfiguration
Add your API credentials to your environment variables:
VASBOX_API_KEY=your_api_key_here
VASBOX_ENVIRONMENT=sandbox
Keep your API key secure
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!
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:
- Authentication - Learn about API key management and security best practices
- Invoices - Deep dive into invoice creation and management
- ZIMRA Integration - Understand the fiscal compliance workflow
- Error Handling - Handle API errors gracefully