Developer
API Integration Guide
Create API keys, sync payment profiles, and let your ERP issue invoices safely with idempotent requests.
Quickstart
Go from account signup to invoice creation in minutes.
Base URL
http://invoicegen.dawnsynch.co.ke/api/v1
Required headers
Authorization: Bearer <token>
Accept: application/json
Idempotency-Key: unique-key
Recommended key scopes
This set gives an ERP enough access to list payment profiles, sync customers, create invoices, and fetch PDFs without over-provisioning.
01
Create an API key
Open Profile, create a named key like ERP Production, and copy the token once.
02
Fetch payment profiles
Use payment-information endpoints to choose the currency/remittance profile you want tied to the invoice.
03
Sync your customer
Create or update the customer your ERP is billing before invoice creation.
04
Create the invoice
Send the invoice payload with an Idempotency-Key so retries never create duplicates.
Create payment profile
Set invoice currency through payment information
curl --request POST 'http://invoicegen.dawnsynch.co.ke/api/v1/payment-information' \
--header 'Authorization: Bearer ig_live_replace_with_your_api_key' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"currency": "USD",
"account_name": "InvoiceGen LLC",
"bank_name": "I&M Bank",
"account_number": "00105089851250",
"swift_code": "IMBLKENA",
"instructions": "Use invoice number as payment reference.",
"is_default": true
}'
Create customer
Sync the billing party first
curl --request POST 'http://invoicegen.dawnsynch.co.ke/api/v1/customers' \
--header 'Authorization: Bearer ig_live_replace_with_your_api_key' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"name": "AGRO LINK LTD",
"company_name": "AGRO LINK LTD",
"email": "billing@agrolink.test",
"phone": "+254700000000",
"address": "46 WATTS GROVE\nLONDON E3 3RE"
}'
Create invoice
Use idempotency for ERP-safe retries
curl --request POST 'http://invoicegen.dawnsynch.co.ke/api/v1/invoices' \
--header 'Authorization: Bearer ig_live_replace_with_your_api_key' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: erp-sync-20260514-0001' \
--data '{
"customer_id": 12,
"payment_information_id": 3,
"invoice_type": "commercial",
"awb": "176-12345675",
"issue_date": "2026-05-14",
"due_date": "2026-05-28",
"tax_enabled": false,
"status": "pending",
"items": [
{
"description": "Green chili",
"quantity": 120,
"unit_price": 19.5
}
]
}'
Operational notes
How the API behaves in production
Idempotent invoice creation
Reusing the same Idempotency-Key with the same payload replays the original invoice response instead of creating duplicates.
Request tracing
Every successful API response includes an X-Request-Id header so your ops team can match ERP logs to InvoiceGen requests.
Currency derivation
Invoices inherit currency from the chosen payment profile. Your ERP should select the right payment_information_id instead of sending freeform currency strings.
Scope-aware keys
Create separate keys for staging and production. Use the smallest scope set each integration needs so revocation stays safe and low-risk.
Response shape
Structured JSON, ready for ERP parsers
{
"data": {
"id": 42,
"invoice_number": "INV-010042",
"invoice_type": "commercial",
"currency": "USD",
"status": "pending",
"customer": { ... },
"payment_information": { ... },
"items": [ ... ],
"totals": {
"subtotal": "2340.00",
"tax": "0.00",
"total": "2340.00"
}
}
}