Skip to Content
HelvetlyDocs
API referenceEngagements

Create an invoice draft for a period

Needs a token with the write:engagements scope. Authentication

Try in Playground sends a real request to app.helvetly.com with a token you paste. It stays in this browser tab only (session storage) and goes to no one else.

POST
/api/v1/engagements/{id}/periods/{period_id}/invoice

Makes one invoice draft for the period (it is not issued: use issue_invoice). kind advance bills the committed quantity (advance engagements, once per period: 409 already_invoiced); kind usage bills the uninvoiced entries and marks them invoiced (409 nothing_to_invoice when there are none). Needs both write:engagements and write:invoices. Not idempotent for usage: a second call bills the entries not yet covered.

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal API token, hvt_…, with scopes such as read:* or write:invoices

Path Parameters

id*string

The engagement's id.

period_id*string

The period's id, from list_engagement_periods.

Request Body

application/json
  1. body
kind*string

advance: the committed quantity (advance engagements only). usage: the uninvoiced entries (for advance engagements only what exceeds the commitment).

Value in"advance""usage"
detail?string

Default: the engagement's invoice_detail.

Value in"summary""per_entry"

Response Body

Created

application/json
  1. response
data*
Example Request
curl -X POST 'https://app.helvetly.com/api/v1/engagements/string/periods/string/invoice' \  -H 'Content-Type: application/json' \  -d '{  "kind": "usage",  "detail": "per_entry"}'
Example Response
{  "data": {    "invoice_id": "string",    "period": {      "id": "string",      "index": 0,      "starts_on": "2019-08-24",      "ends_on": "2019-08-24",      "natural_ends_on": "2019-08-24",      "full_quantity": "string",      "quantity_manual": true,      "quantity": "string",      "unit_price": "1234.50",      "overage_unit_price": "1234.50",      "used": "string",      "invoiced_quantity": "string",      "advance_invoice": {        "id": "string",        "number": "string",        "status": "string",        "kind": "string"      },      "unearned": "string",      "carried_in": "string",      "available": "string",      "remaining": "string",      "overage": "string",      "expected": "string",      "state": "string",      "uninvoiced_quantity": "string",      "invoices": [        {          "id": "string",          "number": "string",          "status": "string",          "kind": "string"        }      ]    }  }}