API Documentation

API Endpoint

Invoice Templates

Invoice Templates

The invoice template object represents a reusable template for creating invoices automatically. Templates are linked to specific recurring budgets and define all the necessary invoice details, line item generation rules, and contact information that will be used when automatic invoicing rules create draft invoices.

You can find out more about invoice templates in our Help documentation: Automatic Invoicing

Following diagram shows invoice templates in our data hierarchy:

Invoice Templates diagram

How Invoice Templates Work

Invoice templates serve as blueprints for automatic invoice creation. When an automatic invoicing rule is triggered, it uses the associated invoice template to create the invoice with the corresponding invoice attribution and line items.

Supported filter params

  • budget_id (array)

  • creator_id (array)

  • document_type_id (array)

  • id (array)

  • issuer_id (array)

Supported sort params

  • created_at

  • id

Filter operations are supported on this endpoint.

Invoice Templates & Automatic Invoicing

Each invoice template works with automatic invoicing rules:

  • One-to-One: Each budget can have only one invoice template

  • Dependency: Automatic invoicing rules require an associated invoice template

  • Processing: Rules use templates to create invoices automatically

Custom Fields Support

Invoice templates support custom fields that will be applied to generated invoices.

For more details on how to work with custom fields please refer to Working with custom fields guide.

Workflow Example

Here’s a typical workflow for setting up automatic invoicing:

  1. Create Budget: Set up a recurring project budget with defined start and end dates

  2. Create Invoice Template: Configure template with document type, subsidiary, and line item generation rules

  3. Create Automatic Invoicing Rule: Define when invoices should be created relative to budget dates

  4. Automatic Processing: System creates draft invoices automatically based on the rule schedule

GET /api/v2/invoice_templates
Requestsreturns invoice templates

GET  /api/v2/invoice_templates

Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": [
    {
      "id": "2",
      "type": "invoice_templates",
      "attributes": {
        "invoice_creation_options": null,
        "invoice_due_in_days": 10,
        "custom_fields": null,
        "note": null,
        "subject": "test name",
        "bank_account_details": null
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": "2363"
          }
        },
        "budget": {
          "meta": {
            "included": false
          }
        },
        "document_type": {
          "meta": {
            "included": false
          }
        },
        "subsidiary": {
          "meta": {
            "included": false
          }
        },
        "creator": {
          "meta": {
            "included": false
          }
        },
        "issuer": {
          "meta": {
            "included": false
          }
        },
        "bank_account": {
          "meta": {
            "included": false
          }
        }
      }
    }
  ],
  "links": {
    "first": "http://api-test.productive.io/api/v2/invoice_templates?page%5Bnumber%5D=1&page%5Bsize%5D=30",
    "last": "http://api-test.productive.io/api/v2/invoice_templates?page%5Bnumber%5D=1&page%5Bsize%5D=30"
  },
  "meta": {
    "current_page": 1,
    "total_pages": 1,
    "total_count": 1,
    "page_size": 30,
    "max_page_size": 200
  }
}

Get invoice templates
GET/api/v2/invoice_templates


GET /api/v2/invoice_templates/1
Requestsreturns a invoice template

GET  /api/v2/invoice_templates/3

Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "3",
    "type": "invoice_templates",
    "attributes": {
      "invoice_creation_options": null,
      "invoice_due_in_days": 10,
      "custom_fields": null,
      "note": null,
      "subject": "test name",
      "bank_account_details": null
    },
    "relationships": {
      "organization": {
        "data": {
          "type": "organizations",
          "id": "2365"
        }
      },
      "budget": {
        "meta": {
          "included": false
        }
      },
      "document_type": {
        "meta": {
          "included": false
        }
      },
      "subsidiary": {
        "meta": {
          "included": false
        }
      },
      "creator": {
        "meta": {
          "included": false
        }
      },
      "issuer": {
        "meta": {
          "included": false
        }
      },
      "bank_account": {
        "meta": {
          "included": false
        }
      }
    }
  },
  "meta": {}
}

Gets an invoice template
GET/api/v2/invoice_templates/{id}

URI Parameters
HideShow
id
number (required) Example: 1

invoice template id


POST /api/v2/invoice_templates
Requestscreates invoice template when valid paramsreturns error when invalid params

POST  /api/v2/invoice_templates

Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "invoice_templates",
    "attributes": {
      "invoice_creation_options": {
        "invoicing_method": "percentage",
        "invoicing_by": "budget",
        "percentage": 50,
        "display_format": "{budget}"
      },
      "custom_fields": {
        "26": "High"
      }
    },
    "relationships": {
      "budget": {
        "data": {
          "type": "quotes",
          "id": "1935"
        }
      },
      "document_type": {
        "data": {
          "type": "document_types",
          "id": "2250"
        }
      },
      "subsidiary": {
        "data": {
          "type": "subsidiaries",
          "id": "2745"
        }
      }
    }
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "4",
    "type": "invoice_templates",
    "attributes": {
      "invoice_creation_options": {
        "invoicing_method": "percentage",
        "invoicing_by": "budget",
        "percentage": 50,
        "display_format": "{budget}"
      },
      "invoice_due_in_days": 15,
      "custom_fields": {
        "26": "High"
      },
      "note": null,
      "subject": "test name",
      "bank_account_details": null
    },
    "relationships": {
      "organization": {
        "data": {
          "type": "organizations",
          "id": "2367"
        }
      },
      "budget": {
        "meta": {
          "included": false
        }
      },
      "document_type": {
        "meta": {
          "included": false
        }
      },
      "subsidiary": {
        "meta": {
          "included": false
        }
      },
      "creator": {
        "meta": {
          "included": false
        }
      },
      "issuer": {
        "meta": {
          "included": false
        }
      },
      "bank_account": {
        "meta": {
          "included": false
        }
      }
    }
  },
  "meta": {}
}

POST  /api/v2/invoice_templates

Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "invoice_templates",
    "attributes": {
      "invoice_creation_options": {}
    },
    "relationships": {
      "document_type": {
        "data": {
          "type": "document_types",
          "id": "2251"
        }
      }
    }
  }
}
Responses422
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "errors": [
    {
      "status": "422",
      "code": "invalid_attribute",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "source": {
        "pointer": "data/attributes/budget"
      }
    },
    {
      "status": "422",
      "code": "invalid_attribute",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "source": {
        "pointer": "data/attributes/subsidiary"
      }
    }
  ]
}

Create an invoice template
POST/api/v2/invoice_templates

URI Parameters
HideShow
budget_id
number (required) Example: 1

Budget id that this template is linked to

document_type_id
number (required) Example: 1

Document type id for the invoice

subsidiary_id
number (required) Example: 1

Subsidiary id that will issue the invoice

issuer_id
number (optional) Example: 1

Person id who will be the invoice issuer

invoice_due_in_days
number (optional) Example: 30

Number of days after which invoice is due

note
string (optional) Example: Note+that+will+be+displayed+on+the+invoice

Note to include on generated invoices

bank_account_id
number (optional) Example: 1

Bank account id for the invoice

bank_account_details
json (optional) Example: %7B%22name%22%3A%22Bank+Account+Name%22%2C%22number%22%3A%22HR1210010051863000160%22%2C%22currency%22%3A%22EUR%22%2C%22bank_name%22%3A%22Placeholder+Bank%22%2C%22swift_code%22%3A%22PLCGHR2XXXX%22%2C%22bank_address%22%3A%22Placeholder+Bank+Address%22%7D

Custom bank account details

invoice_creation_options
json (optional) Example: %7B%22invoicing_method%22%3A%22percentage%22%2C%22invoicing_by%22%3A%22budget%22%2C%22percentage%22%3A50%2C%22display_format%22%3A%22%7Bbudget%7D%22%7D

Configuration for automatic line item generation


PATCH /api/v2/invoice_templates/1
Requestsupdates invoice template when valid paramsreturns error when invalid params

PATCH  /api/v2/invoice_templates/5

Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "invoice_templates",
    "attributes": {
      "invoice_creation_options": {
        "invoicing_method": "percentage",
        "invoicing_by": "budget",
        "percentage": 50,
        "display_format": "{budget}"
      }
    },
    "relationships": {
      "document_type": {
        "data": {
          "type": "document_types",
          "id": "2254"
        }
      }
    }
  }
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "5",
    "type": "invoice_templates",
    "attributes": {
      "invoice_creation_options": {
        "invoicing_method": "percentage",
        "invoicing_by": "budget",
        "percentage": 50,
        "display_format": "{budget}"
      },
      "invoice_due_in_days": 10,
      "custom_fields": null,
      "note": "Test note 2",
      "subject": "test name",
      "bank_account_details": null
    },
    "relationships": {
      "organization": {
        "data": {
          "type": "organizations",
          "id": "2369"
        }
      },
      "budget": {
        "meta": {
          "included": false
        }
      },
      "document_type": {
        "meta": {
          "included": false
        }
      },
      "subsidiary": {
        "meta": {
          "included": false
        }
      },
      "creator": {
        "meta": {
          "included": false
        }
      },
      "issuer": {
        "meta": {
          "included": false
        }
      },
      "bank_account": {
        "meta": {
          "included": false
        }
      }
    }
  },
  "meta": {}
}

PATCH  /api/v2/invoice_templates/6

Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "invoice_templates",
    "relationships": {
      "document_type": {
        "data": {
          "type": "document_types",
          "id": "-1"
        }
      }
    }
  }
}
Responses422
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "errors": [
    {
      "status": "422",
      "code": "invalid_attribute",
      "title": "Invalid Attribute",
      "detail": "attribute is invalid",
      "source": {
        "pointer": "data/attributes/document_type"
      }
    }
  ]
}

Update an invoice template
PATCH/api/v2/invoice_templates/{id}

URI Parameters
HideShow
id
number (required) Example: 1

invoice template id


DELETE /api/v2/invoice_templates/1
Requestsdeletes invoice template

DELETE  /api/v2/invoice_templates/7

Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Responses204
This response has no content.

Deletes an invoice template
DELETE/api/v2/invoice_templates/{id}

URI Parameters
HideShow
id
number (required) Example: 1

invoice template id


Generated by aglio on 13 Sep 2025