Skip to main content
POST
/
api
/
v1
/
invoices
Create new invoice
curl --request POST \
  --url https://dev-billing-api.iqraa.ai/api/v1/api/v1/invoices \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "amount": 9999,
  "currency": "USD",
  "description": "Monthly Premium Plan Subscription - January 2024",
  "planCode": "PREMIUM_MONTHLY",
  "planName": "Premium Monthly Plan",
  "templateId": "template-123",
  "status": "DRAFT",
  "components": {
    "lineItems": [
      {
        "description": "Premium Plan Subscription",
        "quantity": 1,
        "unitPrice": 99.99,
        "amount": 99.99
      }
    ],
    "customerDetails": {
      "customerName": "John Doe",
      "customerEmail": "[email protected]",
      "customerAddress": "123 Business Street, Suite 100",
      "customerCity": "San Francisco",
      "customerCountry": "United States"
    }
  },
  "startDate": "2024-01-01T00:00:00.000Z",
  "renewalDate": "2024-02-01T00:00:00.000Z",
  "paymentTerms": 30
}
'
{
  "id": "<string>",
  "invoiceNumber": "<string>",
  "date": "<string>",
  "status": "DRAFT",
  "amount": 123,
  "currency": "<string>",
  "description": "<string>",
  "customerName": "<string>",
  "customerEmail": "<string>",
  "downloadLink": "<string>",
  "planType": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Invoice creation details

amount
number
required

The total amount for the invoice in smallest currency unit (e.g., cents)

Required range: x >= 0
Example:

9999

currency
enum<string>
required

The currency code in ISO 4217 format

Available options:
USD,
EUR,
GBP,
AED
Example:

"USD"

description
string
required

A clear description of what this invoice is for

Example:

"Monthly Premium Plan Subscription - January 2024"

planCode
string

The unique identifier of the plan being billed

Example:

"PREMIUM_MONTHLY"

planName
string

The display name of the plan being billed

Example:

"Premium Monthly Plan"

templateId
string

ID of the invoice template to use. If not provided, default template will be used

Example:

"template-123"

status
enum<string>
default:DRAFT

Current status of the invoice

Available options:
DRAFT,
FINALIZED,
PAYMENT_FAILED,
PAID,
VOID
Example:

"DRAFT"

components
object

Custom invoice components including line items and customer details

startDate
string<date-time>

The start date of the billing period

Example:

"2024-01-01T00:00:00.000Z"

renewalDate
string<date-time>

The next renewal date for recurring invoices

Example:

"2024-02-01T00:00:00.000Z"

paymentTerms
number

Number of days until payment is due

Required range: x >= 0
Example:

30

Response

Invoice created successfully

id
string
required
invoiceNumber
string
required
date
string
required
status
enum<string>
required
Available options:
DRAFT,
FINALIZED,
PAYMENT_FAILED,
PAID,
VOID
amount
number
required
currency
string
required
description
string
required
customerName
string
required
customerEmail
string
required
planType
string