Skip to main content

API Usage Guide

This guide contains important information about using the Invoiless API effectively.

HTTP Methods​

PUT vs PATCH​

When updating resources (invoices, customers, etc.), you can use either PUT or PATCH:

  • PUT - Replaces the entire resource with the provided data

    • All fields in the request body will replace the existing resource
    • Any fields not included will be removed or reset to defaults
  • PATCH - Updates only the fields you provide

    • Only the fields in the request body will be updated
    • Fields not included in the request remain unchanged

Removing Field Values​

To remove or clear a field value when updating a resource, pass either:

  • An empty string ""
  • null

Example:

{
"notes": "",
"terms": null
}

Rate Limiting​

Rate limits vary by endpoint. See Rate Limits for the limits, the response headers, and how to handle them.

Best Practices​

  1. Use HTTPS only - All API requests must use HTTPS. HTTP requests will be rejected.
  2. Store your API key securely - Never expose your API key in client-side code or public repositories.
  3. Use PATCH for partial updates - When updating a few fields, use PATCH instead of PUT to avoid accidentally removing data.
  4. Handle errors gracefully - Always check response codes and handle errors appropriately.
  5. Use pagination - When fetching lists of resources, use the page and limit parameters to manage large result sets.