Skip to main content
Invoice Details API
curl --request GET \
  --url https://api.pazy.io/v1.0/invoice/:id

Documentation Index

Fetch the complete documentation index at: https://docs.pazy.io/llms.txt

Use this file to discover all available pages before exploring further.

Authentication

All requests require an API key in the request headers. Headers:
Authorization: Api-Key YOUR_API_KEY

Request

Content-Type: application/json

Path Parameters

ParameterTypeRequiredDescription
idstringYesThe unique identifier of the invoice to retrieve

Code Examples

curl -X GET https://api.pazy.io/v1.0/invoice/invoice_identifier \
  -H "Authorization: Api-Key YOUR_API_KEY"

Success Response

HTTP Status: 200 OK Response Fields:
FieldTypeDescription
okbooleanIndicates whether the request was successful
dataobjectContains the invoice detail response data
data.idstringUnique identifier for the invoice
data.invoiceNumberstringInvoice number as specified on the invoice document
data.descriptionstringDescription or notes about the invoice
data.invoiceDatestringDate when the invoice was issued (ISO 8601 format)
data.dueDatestringDue date for invoice payment (ISO 8601 format)
data.amountnumberTotal invoice amount
data.currencystringCurrency code (e.g., INR, USD)
data.statestringCurrent state of the invoice. Possible values include: DRAFTED, PENDING, APPROVED, PAID, DECLINED, DELETED, APPROVAL_PENDING, etc.
data.paymentStatestringPayment state of the invoice. Possible values include: PAID, MARKED_AS_PAID, PARTIALLY_PAID, UNPAID, etc.
data.amountPaidnumberAmount that has been paid towards this invoice
data.dateCreatedstringDate when the invoice was created in the system (ISO 8601 format)
data.remarksstringAdditional remarks or notes associated with the invoice
data.sourcestringSource of invoice creation. Possible values: API, WEB, EMAIL, SLACK, WHATSAPP, APP, etc.
data.syncedReferenceIdstringReference identifier from the accounting system if the invoice has been synced
data.taxobjectTax information object containing tax breakdown
data.tax.subTotalnumberSubtotal amount before taxes
data.tax.gstnumberGST (Goods and Services Tax) amount
data.tax.tdsnumberTDS (Tax Deducted at Source) amount
data.tax.roundOffnumberRound-off adjustment amount
data.vendorobjectVendor information object
data.vendor.idstringUnique identifier for the vendor
data.vendor.namestringDisplay name of the vendor
data.vendor.legalNamestringLegal name of the vendor
data.vendor.logostringURL to the vendor’s logo image
data.vendor.localitystringVendor locality type. Possible values: DOMESTIC, INTERNATIONAL
data.syncStatestringSynchronization state with accounting system. Possible values: SYNCED, NOT_SYNCED, SYNCED_WITH_ERRORS, etc.
data.accountingDatestringDate recorded in the accounting system (ISO 8601 format)
data.approvedDatestringDate when the invoice was approved (ISO 8601 format)
data.paymentDatestringDate when the invoice was paid (ISO 8601 format)
data.selfUrlstringShareable URL for viewing the invoice in the web interface
data.accountingPlatformstringName of the connected accounting platform (e.g., “Tally”, “Zoho Books”, “Oracle Fusion”) if available
data.processingStatusobjectProcessing status information for invoices that are still being processed
data.processingStatus.processingIdstringIdentifier for the processing job
data.processingStatus.statusstringCurrent processing status. Possible values: QUEUED, PROCESSING, PROCESSED, FILLED, FAILED, USER_CANCELLED, DISCARDED
data.processingStatus.isReadybooleanIndicates whether the invoice processing is complete and the invoice is ready for use
data.lineItemsarrayList of line items on the invoice, ordered by sequence number
data.lineItems[].sequenceNumbernumberPosition of the line item on the invoice (1-based)
data.lineItems[].quantitynumberQuantity of the line item
data.lineItems[].ratenumberUnit rate of the line item
data.lineItems[].skuNamestringName of the SKU associated with this line item, if any
data.lineItems[].amountnumberTotal amount for the line item (quantity × rate after taxes)
data.lineItems[].taxAppliedstringName of the tax applied to this line item (e.g., “GST 18%”), if any
data.lineItems[].descriptionstringDescription of the line item
data.flags[]arrayList of flags on the invoice
data.flags[].codestringThe flag code which is of enum values. Click here for more details.
data.flags[].descriptionstringThe flag code description.

Flag Code Enum Description

CodeDescription
DUPLICATEAn invoice with the same number already exists in your organization.
NON_ACTIVE_FINANCIAL_YEARThis invoice falls outside the current financial year.
INACTIVE_CURRENCYThe currency used in this invoice is no longer active for your organization.
MISSING_RECEIPTSOne or more receipts are missing for this invoice.
GST_MISMATCHThe GST number on this invoice does not match the organization’s registered GST number.
PROFORMAThis is a proforma invoice.
BANK_ACCOUNT_MISMATCHThe bank account on this invoice does not match the vendor’s registered bank account.
OVERDUEThis invoice is overdue and the payment has not been made.
MSME_VENDORThe vendor associated with this invoice is classified as MSME.
OUT_OF_POLICYThis invoice does not comply with the organization’s policy.
PO_MISMATCHThis invoice line items does not match with purchase order line items.
LI_PO_RATE_OVERCHARGEThe unit rate for one or more line items exceeds the rate specified in the purchase order.
LI_QUANTITY_OVERCHARGEThe quantity for one or more line items exceeds the quantity specified in the purchase order.
LI_AMOUNT_OVERCHARGEThe amount for one or more line items exceeds the amount specified in the purchase order.
AMOUNT_MISMATCHThe total invoice amount does not match the sum of its line items.

Response Example

{
  "ok": true,
  "data": {
    "id": "invoice_identifier",
    "invoiceNumber": "INV-2024-001",
    "description": "Monthly services invoice",
    "invoiceDate": "2024-01-15",
    "dueDate": "2024-02-15",
    "amount": 50000.00,
    "currency": "INR",
    "state": "APPROVED",
    "paymentState": "UNPAID",
    "amountPaid": 0.00,
    "dateCreated": "2024-01-15T10:30:00Z",
    "remarks": "Payment due in 30 days",
    "source": "API",
    "syncedReferenceId": "ACC-REF-12345",
    "tax": {
      "subTotal": 44000.00,
      "gst": 6000.00,
      "tds": 0.00,
      "roundOff": 0.00
    },
    "vendor": {
      "id": "vendor_identifier",
      "name": "ABC Suppliers",
      "legalName": "ABC Suppliers Private Limited",
      "logo": "https://cdn.pazy.io/logos/vendor_logo.png",
      "locality": "DOMESTIC"
    },
    "syncState": "SYNCED",
    "accountingDate": "2024-01-15",
    "approvedDate": "2024-01-16T14:20:00Z",
    "paymentDate": null,
    "selfUrl": "https://app.pazy.io/invoice/invoice_identifier",
    "accountingPlatform": "Tally",
      "flags": [
      {
        "code": "OVERDUE",
        "description": "This invoice is overdue and the payment has not been made."
      }
    ],
    "processingStatus": {
      "processingId": "job_123456",
      "status": "FILLED",
      "isReady": true
    },
    "lineItems": [
      {
        "sequenceNumber": 1,
        "quantity": 2,
        "rate": 20000.00,
        "skuName": "Laptop Stand",
        "amount": 40000.00,
        "taxApplied": "GST 18%",
        "description": "Ergonomic laptop stand"
      },
      {
        "sequenceNumber": 2,
        "quantity": 1,
        "rate": 10000.00,
        "skuName": null,
        "amount": 10000.00,
        "taxApplied": null,
        "description": "Setup and installation"
      }
    ]
  }
}

Error Responses

Missing Invoice ID

HTTP Status: 400 Bad Request
{
  "ok": false,
  "error": {
    "code": "MISSING_REQUIRED_FIELD",
    "message": "Invoice ID is required"
  }
}

Invoice Not Found

HTTP Status: 404 Not Found
{
  "ok": false,
  "error": {
    "code": "INVOICE_NOT_FOUND",
    "message": "Invoice not found"
  }
}

Access Denied

HTTP Status: 403 Forbidden
{
  "ok": false,
  "error": {
    "code": "ACCESS_DENIED",
    "message": "Access denied: You can only view your own invoices or invoices where you are the vendor owner"
  }
}

Authentication Errors

HTTP Status: 401 Unauthorized
{
  "ok": false,
  "error": {
    "code": "MISSING_CREDENTIALS",
    "message": "Missing Credentials"
  }
}
{
  "ok": false,
  "error": {
    "code": "INVALID_API_KEY",
    "message": "Invalid API Key"
  }
}

Permission Errors

HTTP Status: 403 Forbidden
{
  "ok": false,
  "error": {
    "code": "INSUFFICIENT_PERMISSIONS",
    "message": "Permission check failed - PERMISSION_CHECK_FAILED"
  }
}

Best Practices

Access Control

  • Only invoices you created or where you are the vendor owner are accessible (unless you have admin or auditor role)
  • Use the invoice id returned from the invoice creation endpoint to retrieve details
  • Check the processingStatus.isReady field to ensure the invoice is fully processed before using its data

Invoice States

  • Common invoice states: DRAFTED, PENDING, APPROVED, PAID, DECLINED
  • Use processingStatus field to track invoice processing for newly uploaded invoices
  • Check syncState to verify accounting system synchronization status