Invoices

Create and manage invoices.

Invoices API

The Invoices API allows you to create, send, and manage invoices for your customers.

The Invoice Object

{
  "id": "inv_abc123def456",
  "object": "invoice",
  "status": "open",
  "customer": "cus_xyz789",
  "customer_email": "customer@example.com",
  "customer_name": "John Doe",
  "customer_phone": "0241234567",
  "customer_address": "123 Main St, Accra",
  "description": "January services",
  "footer": "Thank you for your business",
  "memo": "Net 30",
  "amount_due": 150,
  "amount_paid": 0,
  "currency": "GHS",
  "due_date": "2024-02-15T00:00:00Z",
  "collection_method": "send_invoice",
  "line_items": [
    {
      "id": "li_abc123",
      "description": "Web Development",
      "quantity": 1,
      "unit_amount": 100,
      "amount": 100,
      "taxable": false
    },
    {
      "id": "li_def456",
      "description": "Hosting",
      "quantity": 1,
      "unit_amount": 50,
      "amount": 50,
      "taxable": false
    }
  ],
  "metadata": {},
  "created_at": "2024-01-15T10:00:00Z"
}

Attributes

AttributeTypeDescription
idstringUnique identifier
objectstringAlways "invoice"
statusstringdraft, open, paid, void, uncollectible
customerstringCustomer ID
customer_emailstringCustomer email
customer_namestringCustomer name
customer_phonestringCustomer phone
customer_addressstringCustomer address
descriptionstringInvoice description
footerstringInvoice footer text
memostringInternal memo
amount_duenumberTotal amount due in GHS
amount_paidnumberAmount paid in GHS
currencystringCurrency code
due_datestringDue date
collection_methodstringCollection method
line_itemsarrayLine items on the invoice
metadataobjectCustom metadata
created_atstringCreation timestamp

Create an Invoice

POST /v1/invoices

Request Body

ParameterTypeRequiredDescription
customerstringNoCustomer ID (auto-fills email/name/phone)
customer_emailstringNoCustomer email
customer_namestringNoCustomer name
customer_phonestringNoCustomer phone
customer_addressstringNoCustomer address
descriptionstringNoInvoice description
footerstringNoFooter text
memostringNoInternal memo
due_datestringNoDue date (ISO 8601)
collection_methodstringNoDefault: send_invoice
auto_finalizebooleanNoAutomatically finalize on creation
metadataobjectNoCustom metadata
line_itemsarrayNoInitial line items

Line Item Fields

ParameterTypeRequiredDescription
descriptionstringYesItem description
quantitynumberNoQuantity (default: 1)
unit_amountnumberYesUnit price in GHS
productstringNoProduct ID
taxablebooleanNoWhether item is taxable (default: false)
tax_percentnumberNoTax percentage
metadataobjectNoCustom metadata
curl -X POST https://api.shikacreators.com/v1/invoices \
  -H "Authorization: Bearer sk_test_..." \
  -H "Content-Type: application/json" \
  -d '{
    "customer": "cus_xyz789",
    "description": "January services",
    "due_date": "2024-02-15T00:00:00Z",
    "line_items": [
      {
        "description": "Web Development",
        "unit_amount": 100,
        "quantity": 1
      },
      {
        "description": "Hosting",
        "unit_amount": 50,
        "quantity": 1
      }
    ]
  }'
const invoice = await shikacreators.invoices.create({
  customer: 'cus_xyz789',
  description: 'January services',
  due_date: '2024-02-15T00:00:00Z',
  line_items: [
    { description: 'Web Development', unit_amount: 100 },
    { description: 'Hosting', unit_amount: 50 }
  ]
})
invoice = client.invoices.create(
    customer='cus_xyz789',
    description='January services',
    due_date='2024-02-15T00:00:00Z',
    line_items=[
        {'description': 'Web Development', 'unit_amount': 100},
        {'description': 'Hosting', 'unit_amount': 50}
    ]
)

Retrieve an Invoice

GET /v1/invoices/:id

Update an Invoice

Updates a draft invoice.

POST /v1/invoices/:id

Only invoices with status draft can be updated.


Add a Line Item

Adds a line item to a draft invoice.

POST /v1/invoices/:id/lines

Request Body

ParameterTypeRequiredDescription
descriptionstringYesItem description
quantitynumberNoQuantity (default: 1)
unit_amountnumberYesUnit price in GHS
productstringNoProduct ID
taxablebooleanNoWhether item is taxable
tax_percentnumberNoTax percentage
metadataobjectNoCustom metadata

Finalize an Invoice

Finalizes a draft invoice, changing its status to open.

POST /v1/invoices/:id/finalize

The invoice must be in draft status and must have at least one line item. Finalizing triggers PDF generation and notification queuing.


Pay an Invoice

Marks an invoice as paid and creates an associated payment.

POST /v1/invoices/:id/pay

Request Body

ParameterTypeRequiredDescription
payment_methodstringNoPayment method identifier
sourcestringNoSource/phone number for payment
off_sessionbooleanNoOff-session payment indicator

Only invoices with status open can be paid.


Void an Invoice

Voids an invoice, making it uncollectable.

POST /v1/invoices/:id/void

Paid invoices cannot be voided. Issue a refund instead.


Send an Invoice

Sends the invoice to the customer via email and/or SMS.

POST /v1/invoices/:id/send

The invoice must have a customer email or phone number and cannot be in draft status.


Download PDF

Generates and downloads the invoice as a PDF.

GET /v1/invoices/:id/pdf

Delete an Invoice

Deletes a draft invoice.

DELETE /v1/invoices/:id

Only invoices with status draft can be deleted.


List Invoices

GET /v1/invoices

Query Parameters

ParameterTypeDescription
limitintegerNumber of results (1-100, default 10)
starting_afterstringCursor for pagination
customerstringFilter by customer ID
statusstringFilter by status (draft, open, paid, void, uncollectible)
due_datestringFilter by due date range
createdstringFilter by creation date range

Invoice Statuses

StatusDescription
draftInvoice is being prepared (editable)
openInvoice has been finalized and sent
paidInvoice has been paid
voidInvoice has been voided
uncollectibleInvoice is uncollectable