Create invoice line

POST https://api.ecurring.com/invoice-lines

Add a new invoice-line to an invoice. This can only be done while the invoice is in draft state.

Request attributes

invoice_id
integer
The identifier of the invoice. The identifer can be retrieved through the Get invoices endpoint.
description
string
The description of the invoice line. This could be the name of your product.
amount
double
The amount (per unit) of the product, in euro.
tax_rate
double
The tax rate (percentage) that is applied or should be applied to the amount, depending on tax_included.
tax_included
boolean
Indicates whether or not the tax_rate is already applied to the given amount.
quantity
integer
The quantity of the product. The total amount will be calculated by multiplying the quantity with the amount.

Examples

Creating an invoice line

This will create an invoice line for the given invoice.

Request

POST /invoice-lines HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
{
    "data": {
        "type": "invoice-line",
        "attributes": {
        	"invoice_id": 637377985,
        	"description": "lunchbox",
        	"amount": 10.00,
        	"tax_rate": 21.0,
        	"tax_included": false,
        	"quantity": 2
        }
    }
}

Response

{
    "links": {
        "self": "https://api.ecurring.com/invoice-lines/1562050264"
    },
    "data": {
        "type": "invoice-line",
        "id": "1562050264",
        "links": {
            "self": "https://api.ecurring.com/invoice-lines/1562050264"
        },
        "attributes": {
            "description": "lunchbox",
            "amount_excl": "10.00",
            "amount_incl": "12.10",
            "tax_rate": "21.00",
            "tax_amount": "2.10",
            "tax_included": false,
            "quantity": 2,
            "created_at": "2019-10-04T14:44:47+02:00",
            "updated_at": "2019-10-04T14:44:47+02:00"
        }
    }
}