Quickstart

Make your first API call to Corebill in under 2 minutes.

Prerequisites

  1. A Corebill account at app.corebill.io
  2. At least one company created in your organization
  3. An API key (generate one in Settings > Developers)

Step 1: Install the SDK (optional)

If you're using Node.js, install the official SDK:

bashBash
1npm install @corebill/sdk

Step 2: Get your companies

First, retrieve your available companies to get the company_id you'll use in subsequent requests.

Bash
1curl "https://api.corebill.io/v1/companies" \
2 -H "Authorization: Bearer sk_live_your_api_key"

Copy the id value -- you'll need it for all other endpoints.

The SDK automatically sends the company_id when configured, so you don't need to pass it manually on every call.

Step 3: Create a customer

Bash
1curl -X POST "https://api.corebill.io/v1/customers?company_id=com_a1b2c3d4e5f6" \
2 -H "Authorization: Bearer sk_live_your_api_key" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "name": "Acme Corp",
6 "country": "US",
7 "email": "billing@acme.com",
8 "currency": "USD"
9 }'

Step 4: Create an invoice

Bash
1curl -X POST "https://api.corebill.io/v1/invoices?company_id=com_a1b2c3d4e5f6" \
2 -H "Authorization: Bearer sk_live_your_api_key" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "customer_id": "cus_a1b2c3d4e5f6",
6 "due_date": "2026-07-15",
7 "tax_rate": 16,
8 "line_items": [
9 {
10 "item_name": "Web Development",
11 "description": "Frontend implementation",
12 "quantity": 40,
13 "unit": "hour",
14 "unit_price": 75
15 },
16 {
17 "item_name": "UI Design",
18 "quantity": 1,
19 "unit": "project",
20 "unit_price": 2000
21 }
22 ]
23 }'

Response:

jsonJSON
1{
2 "id": "inv_x1y2z3a4b5c6",
3 "invoice_number": "INV-2026-000001",
4 "status": "draft",
5 "subtotal": 5000,
6 "tax_rate": 16,
7 "tax_amount": 800,
8 "total": 5800,
9 "amount_due": 5800,
10 "line_items": [...]
11}

Next steps