nepalirdbilling
IndustriesPricingBlogsContact
Log inSign up

Developer

Sales Invoice API

Issue IRD-aligned sales invoices and credit notes from your website, ERP, or custom stack, same numbering, VAT rules, and CBMS path as the dashboard.

On this page

  • Overview
  • Authentication
  • Base URL
  • Sales invoices
  • Credit notes
  • Examples
  • Responses
  • Notes
  • FAQ

Overview

The Nepal IRD Billing REST API lets server-side applications create sales invoices and credit notes that respect your workspace tax settings, fiscal-year sequences, and CBMS configuration.

All requests use JSON over HTTPS. Responses use standard HTTP status codes; validation errors return a structured error body with field-level hints.

Authentication

Send a workspace API key on every request using the X-API-Key header.

  1. Sign in as a workspace admin.
  2. Open Settings → API Keys.
  3. Create a key and copy the raw value immediately, it is displayed only once.
  4. Store the key in server environment variables (for example NEPAL_IRD_BILLING_API_KEY).

Example keys look like NIB_live_••••••••. Rotate keys from Settings if compromised.

Base URL

Each workspace has a dedicated API host. Replace {workspace} with your workspace slug from the dashboard:

https://{workspace}.api.nepalirdbilling.com

Example: https://acme-traders.api.nepalirdbilling.com

POST /v1/sales-invoices

Create a new tax invoice. On success the invoice is persisted and, when CBMS sync is enabled, queued for transmission using the same pipeline as counter sales.

Request body

FieldTypeRequiredDescription
customer_namestringYesBuyer or walk-in customer label printed on the tax invoice.
customer_panstringConditionalBuyer PAN when B2B or buyer requests PAN on bill; omit or null for retail walk-ins.
phonestringNoContact number for receipt SMS or support follow-up.
payment_modeenumYesCA cash, CR credit, BA bank transfer, QR QR pay, KH Khalti, ES eSewa, PO purchase order.
invoice_datestring (ISO 8601)NoDefaults to server time in Nepal timezone if omitted.
productsarrayYesLine items; at least one product required.
products[].namestringYesProduct or service description.
products[].quantitynumberYesSold quantity; decimals allowed where your catalog supports them.
products[].unit_pricenumberYesTax-exclusive or tax-inclusive unit price per your workspace tax setting.
products[].skustringNoInternal SKU or barcode reference.
products[].vat_ratenumberNoOverride line VAT rate; defaults to product master or 13% standard rate.
discount_amountnumberNoInvoice-level discount before tax.
remarksstringNoPrinted or internal note; avoid PII you do not need on the invoice.
external_referencestringNoYour order ID for idempotency and reconciliation.

Payment mode codes

CA cash · CR credit · BA bank · QR QR pay · KH Khalti · ES eSewa · PO purchase order

POST /v1/credit-notes

Issue a credit note against a previously created sales invoice. Deletion of issued invoices is not supported, adjustments must flow through credit notes.

FieldTypeRequiredDescription
original_invoice_idstring (UUID)YesNepal IRD Billing invoice ID returned when the original sale was created.
reasonstringYesReturn, price adjustment, or cancellation reason for audit trail.
productsarrayYesLines being credited; quantities must not exceed the original sale.
payment_modeenumNoRefund channel if applicable; same codes as sales invoices.

Examples

Sample JSON body

{
  "customer_name": "Sharma Trading Pvt. Ltd.",
  "customer_pan": "601234567",
  "phone": "9800000000",
  "payment_mode": "BA",
  "external_reference": "ORD-2026-8842",
  "products": [
    {
      "name": "LED Panel 24W",
      "sku": "LED-24W",
      "quantity": 4,
      "unit_price": 1250,
      "vat_rate": 13
    }
  ],
  "remarks": "Delivered to Baneshwor warehouse"
}

cURL

curl -X POST "https://acme-traders.api.nepalirdbilling.com/v1/sales-invoices" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $NEPAL_IRD_BILLING_API_KEY" \
  -d '{
    "customer_name": "Sharma Trading Pvt. Ltd.",
    "customer_pan": "601234567",
    "phone": "9800000000",
    "payment_mode": "BA",
    "external_reference": "ORD-2026-8842",
    "products": [
      {
        "name": "LED Panel 24W",
        "sku": "LED-24W",
        "quantity": 4,
        "unit_price": 1250,
        "vat_rate": 13
      }
    ],
    "remarks": "Delivered to Baneshwor warehouse"
  }'

fetch (Node / browser server routes)

const res = await fetch(
  'https://acme-traders.api.nepalirdbilling.com/v1/sales-invoices',
  {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'X-API-Key': process.env.NEPAL_IRD_BILLING_API_KEY!,
    },
    body: JSON.stringify({
      customer_name: 'Walk-in customer',
      payment_mode: 'CA',
      products: [{ name: 'Consulting hour', quantity: 1, unit_price: 5000 }],
    }),
  },
);

const data = await res.json();

Success responses

A 201 Created response includes the invoice identity and totals:

{
  "id": "8f3c2a1b-9d4e-4f5a-b6c7-d8e9f0a1b2c3",
  "invoice_number": "2083/84-000124",
  "status": "issued",
  "cbms_status": "pending",
  "total_amount": 5650,
  "vat_amount": 650,
  "issued_at": "2026-03-15T10:42:00+05:45",
  "pdf_url": "https://acme-traders.api.nepalirdbilling.com/v1/sales-invoices/8f3c2a1b../pdf"
}

cbms_status moves from pending to synced or surfaces IRD callback codes on the sync dashboard when transmission completes.

Notes

  • Fiscal-year invoice numbering matches your workspace setting, the API does not accept arbitrary invoice numbers.
  • VAT, buyer PAN rules, and line rounding follow the same configuration as the web POS.
  • Never embed API keys in mobile apps or browser bundles; proxy through your backend.
  • Configure allowed origins in Settings if you call the API from a dedicated integration subdomain; prefer server-to-server calls.
  • Use external_reference to safely retry POSTs without duplicate bills where your integration supports idempotency.

FAQ

Are API-created invoices IRD-aligned?
Yes. API sales follow the same fiscal-year numbering, VAT breakdown, immutability rules, and CBMS transmission path as invoices created in the Nepal IRD Billing dashboard when CBMS sync is enabled on your plan.
How do I get an API key?
Workspace admins open Settings → API Keys in the dashboard, create a key, and copy the raw value immediately, it is shown only once. Store it in your server environment, not in client-side code.
What can I build with the API?
E-commerce checkouts, ERP shipment billing, franchise portals, mobile field-sales apps, and middleware that centralises orders before they become tax invoices, anything that should issue a compliant bill without manual re-entry.
Which plans include API access?
Sales invoice and credit-note endpoints are included on Pro CBMS and Enterprise. See pricing for user limits, branch rules, and CBMS requirements.

Ready to integrate?

Request API-enabled onboarding or discuss ERP mapping with our team.

Contact salesView pricing

Reach Nepal IRD Billing

Questions about pricing, onboarding, or support? Pick the channel that fits, we typically reply within one business day.

Sales
  • WhatsApp

    Call or WhatsApp

    +977 9768540823
  • Email

    info@nepalirdbilling.com
Support
  • WhatsApp

    Call or WhatsApp

    +977 9768540824
  • Email

    info@nepalirdbilling.com
Coverage

We support VAT-registered businesses across Nepal with IRD e-billing, CBMS sync, and Nepal-hosted cloud, remote onboarding and local follow-up where it matters.

Open map
nepalirdbilling

IRD e-billing and CBMS software for Nepal, tax invoices, VAT billing, credit notes, offline queue, and Schedule-10 exports on Nepal-hosted cloud.

Features

  • Sales Invoice API
  • Offline CBMS Queue
  • Sales & Purchase Books
  • VAT Sales & Purchase Reports
  • Annex 5 & Annex 13 Reports
  • VAT 13% & Buyer PAN
  • View all →

Resources

  • API Docs
  • FAQ
  • Blog
  • Contact
  • IRD E-Billing Overview
  • CBMS Real-Time Sync
  • Listed Software vs Excel
  • FY 2083/84 Thresholds
  • All guides →

Industries

  • Retail & Grocery
  • Restaurants & Hotels
  • Pharmacies & Healthcare
  • Wholesale & Distribution
  • Hardware & Furnishing
  • Department Stores
  • View all →
Privacy PolicyTerms & ConditionsRefund Policy

© 2026 Nepal IRD Billing. All rights reserved.