{
  "opencollection": "1.0.0",
  "info": {
    "name": "Earnipay Invoicing App Invoices API",
    "version": "1.0"
  },
  "items": [
    {
      "info": {
        "name": "Invoices",
        "type": "folder"
      },
      "items": [
        {
          "info": {
            "name": "Get invoices list",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "{{baseUrl}}/v1/invoices",
            "params": [
              {
                "name": "businessId",
                "value": "",
                "type": "query",
                "description": "Business ID"
              },
              {
                "name": "page",
                "value": "",
                "type": "query",
                "description": "Page number"
              },
              {
                "name": "limit",
                "value": "",
                "type": "query",
                "description": "Items per page"
              },
              {
                "name": "search",
                "value": "",
                "type": "query",
                "description": "Search query (searches in IRN, customer name)"
              },
              {
                "name": "status",
                "value": "",
                "type": "query",
                "description": "Filter by status"
              },
              {
                "name": "invoiceType",
                "value": "",
                "type": "query",
                "description": "Filter by invoice type"
              },
              {
                "name": "customerId",
                "value": "",
                "type": "query",
                "description": "Filter by customer ID"
              },
              {
                "name": "dateFrom",
                "value": "",
                "type": "query",
                "description": "Filter by issue date (from)"
              },
              {
                "name": "dateTo",
                "value": "",
                "type": "query",
                "description": "Filter by issue date (to)"
              },
              {
                "name": "sortBy",
                "value": "",
                "type": "query",
                "description": "Sort field"
              },
              {
                "name": "sortOrder",
                "value": "",
                "type": "query",
                "description": "Sort order"
              }
            ],
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Retrieve paginated list of invoices with search, filter, and sort capabilities."
        },
        {
          "info": {
            "name": "Create new invoice",
            "type": "http"
          },
          "http": {
            "method": "POST",
            "url": "{{baseUrl}}/v1/invoices",
            "params": [
              {
                "name": "businessId",
                "value": "",
                "type": "query",
                "description": "Business ID"
              }
            ],
            "body": {
              "type": "json",
              "data": "{}"
            },
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Create a new invoice with line items. IRN is automatically generated."
        },
        {
          "info": {
            "name": "Approve invoice",
            "type": "http"
          },
          "http": {
            "method": "POST",
            "url": "{{baseUrl}}/v1/invoices/:id/approve",
            "params": [
              {
                "name": "id",
                "value": "",
                "type": "path",
                "description": "Invoice ID"
              },
              {
                "name": "businessId",
                "value": "",
                "type": "query"
              }
            ],
            "body": {
              "type": "json",
              "data": "{}"
            },
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Approve a PENDING_APPROVAL invoice. Only OWNER and ADMIN can approve."
        },
        {
          "info": {
            "name": "Reject invoice",
            "type": "http"
          },
          "http": {
            "method": "POST",
            "url": "{{baseUrl}}/v1/invoices/:id/reject",
            "params": [
              {
                "name": "id",
                "value": "",
                "type": "path",
                "description": "Invoice ID"
              },
              {
                "name": "businessId",
                "value": "",
                "type": "query"
              }
            ],
            "body": {
              "type": "json",
              "data": "{}"
            },
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Reject a PENDING_APPROVAL invoice. Only OWNER and ADMIN can reject. Invoice returns to DRAFT."
        },
        {
          "info": {
            "name": "Get invoice details",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "{{baseUrl}}/v1/invoices/:id",
            "params": [
              {
                "name": "id",
                "value": "",
                "type": "path",
                "description": "Invoice ID"
              }
            ],
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Retrieve detailed information about a specific invoice including all line items."
        },
        {
          "info": {
            "name": "Update invoice",
            "type": "http"
          },
          "http": {
            "method": "PATCH",
            "url": "{{baseUrl}}/v1/invoices/:id",
            "params": [
              {
                "name": "id",
                "value": "",
                "type": "path",
                "description": "Invoice ID"
              }
            ],
            "body": {
              "type": "json",
              "data": "{}"
            },
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Update invoice information. Only DRAFT invoices can be updated."
        },
        {
          "info": {
            "name": "Cancel invoice",
            "type": "http"
          },
          "http": {
            "method": "DELETE",
            "url": "{{baseUrl}}/v1/invoices/:id",
            "params": [
              {
                "name": "id",
                "value": "",
                "type": "path",
                "description": "Invoice ID"
              }
            ],
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Cancel an invoice. Cannot cancel submitted or approved invoices."
        },
        {
          "info": {
            "name": "Generate QR code",
            "type": "http"
          },
          "http": {
            "method": "POST",
            "url": "{{baseUrl}}/v1/invoices/:id/generate-qr",
            "params": [
              {
                "name": "id",
                "value": "",
                "type": "path",
                "description": "Invoice ID"
              }
            ],
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Generate FIRS-compliant QR code for the invoice. Requires business FIRS configuration."
        },
        {
          "info": {
            "name": "Download invoice PDF",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "{{baseUrl}}/v1/invoices/:id/pdf",
            "params": [
              {
                "name": "id",
                "value": "",
                "type": "path",
                "description": "Invoice ID"
              }
            ],
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Download invoice as PDF file. QR code will be included if generated."
        },
        {
          "info": {
            "name": "Submit invoice to APP provider",
            "type": "http"
          },
          "http": {
            "method": "POST",
            "url": "{{baseUrl}}/v1/invoices/:id/submit-to-app",
            "params": [
              {
                "name": "id",
                "value": "",
                "type": "path",
                "description": "Invoice ID"
              }
            ],
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Submit an APPROVED invoice to the APP provider (FIRS)."
        },
        {
          "info": {
            "name": "Validate invoice data against FIRS schema",
            "type": "http"
          },
          "http": {
            "method": "POST",
            "url": "{{baseUrl}}/v1/invoices/validate",
            "body": {
              "type": "json",
              "data": "{}"
            },
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Validate invoice data structure without creating an invoice.\n\nThis endpoint checks if your invoice data matches the FIRS requirements:\n- Required fields presence\n- IRN format validation\n- Party information completeness (supplier & customer)\n- Line items structure\n- Tax totals validation\n- Legal monetary totals calculations\n\nUse this before submitting invoices to FIRS to catch validation errors early."
        }
      ]
    }
  ],
  "bundled": true
}