Invoices
Invoices are used to request payment from customers. Dimebia provides automated invoicing with support for multiple currencies, tax calculation, and payment tracking.
Overview
An invoice is a document requesting payment for goods or services. Dimebia invoices can be:
- One-time: Single payment invoices
- Recurring: Generated automatically for subscriptions
- Proforma: Estimates before final invoice
Create an Invoice
POST /api/invoice/create
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
customerId | Long | Yes | Customer ID |
dueDate | String | Yes | Due date (YYYY-MM-DD) |
items | Array | Yes | Invoice line items |
taxRate | Integer | No | Tax rate percentage (0-100) |
currency | String | No | Currency code (default: USD) |
notes | String | No | Additional notes |
Line Item Structure
{
"description": "Premium Plan - Monthly",
"quantity": 1,
"unitPrice": 9900,
"amount": 9900
}
Example
curl -X POST http://localhost:8080/api/invoice/create \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <YOUR_TOKEN>" \
-d '{
"customerId": 1,
"dueDate": "2026-09-01",
"currency": "USD",
"taxRate": 10,
"items": [
{
"description": "Premium Plan - Monthly",
"quantity": 1,
"unitPrice": 9900,
"amount": 9900
}
],
"notes": "Thank you for your business"
}'
Invoice Status
| Status | Description |
|---|---|
DRAFT | Invoice is being prepared |
SENT | Invoice sent to customer |
VIEWED | Customer viewed the invoice |
PAID | Payment received |
OVERDUE | Past due date, unpaid |
CANCELLED | Invoice cancelled |
Invoice Numbering
Invoices follow a sequential numbering pattern:
- Format:
INV-YYYYMMDD-XXXX - Example:
INV-20260818-0001
Tax Calculation
Dimebia automatically calculates tax based on:
- Customer location (billing address)
- Product/service type
- Current tax rates
See Tax Guide for detailed tax configuration.
Payment Tracking
Track invoice payments through the transaction system:
GET /api/invoice/{id}/payments
Code Examples
Node.js
const invoice = await client.invoices.create({
customerId: 1,
dueDate: '2026-09-01',
items: [
{
description: 'Premium Plan',
quantity: 1,
unitPrice: 9900,
},
],
taxRate: 10,
});