Introduction
The Smartbills API is a RESTful API that allows you to integrate expense management capabilities into your applications. This guide will help you get started with building on Smartbills.Prerequisites
Before you begin, make sure you have:- A Smartbills account (sign up here)
- Basic knowledge of REST APIs
- A development environment set up for your preferred programming language
API Overview
Base URL
All API requests should be made to:Versioning
The Smartbills API uses URL-based versioning. The current version isv1. All endpoints are prefixed with /v1/.
Data Format
- Request Format: JSON (use
Content-Type: application/json) - Response Format: JSON
- File Uploads: multipart/form-data
- Date Format: ISO 8601 (e.g.,
2024-01-15T10:30:00Z) - Currency Format: ISO 4217 currency codes (e.g.,
USD,CAD,EUR)
Authentication
All API requests require authentication using JWT Bearer tokens. See the Authentication guide for details.Making Requests
Example GET Request
Example POST Request
Response Format
Success Response
All successful responses return a200 (or 201 for create operations) status code with a JSON body:
Paginated Response
List endpoints return paginated results:Error Response
Error responses include a status code and error details:Pagination
List endpoints support pagination using query parameters:page- Page number (default: 1)pageSize- Items per page (default: 20, max: 100)
Filtering and Sorting
Many list endpoints support filtering and sorting:Filtering
Sorting
Common Patterns
Resource IDs
All resources have a unique numericid:
Timestamps
All timestamps use ISO 8601 format with UTC timezone:Money Amounts
Amounts are represented as decimal numbers with currency codes:Status Fields
Many resources have astatus field with predefined values:
Rate Limiting
The API implements rate limiting to ensure fair usage. See Rate Limits for details. Rate limit information is included in response headers:Error Handling
Always check the HTTP status code and handle errors appropriately:SDKs and Libraries
While we don’t currently provide official SDKs, the API is designed to work seamlessly with standard HTTP libraries in any programming language.Recommended Libraries
- JavaScript/TypeScript:
fetch,axios,node-fetch - Python:
requests,httpx - PHP:
Guzzle,cURL - Ruby:
HTTParty,Faraday - Go:
net/http - C#:
HttpClient
Testing
Test Environment
Use test API keys (prefixsk_test_) for development and testing. Test keys:
- Don’t process real data
- Have separate databases
- Can be safely shared with your team
- Have higher rate limits for testing
Example Test Data
When testing, you can use these example values:Webhooks
Set up webhooks to receive real-time notifications about events in your Smartbills account. See Webhooks for details.Next Steps
Create Account
Set up your developer account
API Keys
Generate and manage API keys
API Reference
Explore all endpoints
Webhooks
Set up event notifications
Support
Need help? We’re here to assist:- Documentation: Browse our API Reference
- Email: [email protected]
- Community: Join our developer community