Skip to main content
POST
/
v1
/
invoice-receivables
/
{invoiceReceivableId}
/
lines
Create line
curl --request POST \
  --url https://api.light.inc/v1/invoice-receivables/{invoiceReceivableId}/lines \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json;charset=UTF-8' \
  --data '
{
  "productId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "quantity": 1,
  "taxCodeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "accountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "discount": {
    "type": "PERCENTAGE"
  },
  "priceOverwrite": 123,
  "productNameOverwrite": "<string>",
  "taxAmountOverwrite": 123,
  "avataxCode": "<string>",
  "billingStart": "2023-12-25",
  "billingEnd": "2023-12-25",
  "accrualTemplateId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "accrualStartDate": "2023-12-25",
  "accrualEndDate": "2023-12-25",
  "customProperties": [
    {
      "groupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "valueIds": [
        "3c90c3cc-0d44-4b50-8888-8dd25736052a"
      ],
      "inlineValues": [
        "<string>"
      ]
    }
  ]
}
'
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "companyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "invoiceReceivableId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "productId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "quantity": 123,
  "taxCodeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "accountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "discount": {
    "type": "PERCENTAGE"
  },
  "discountAmount": 123,
  "netAmount": 123,
  "taxAmount": 123,
  "avataxCode": "<string>",
  "billingStart": "2023-12-25",
  "billingEnd": "2023-12-25",
  "priceOverwrite": 123,
  "productNameOverwrite": "<string>",
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z",
  "accrualTemplateId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "accrualStartDate": "2023-12-25",
  "accrualEndDate": "2023-12-25",
  "customProperties": [
    {
      "groupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "groupInternalName": "<string>",
      "values": [
        {
          "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "groupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "groupInternalName": "<string>",
          "companyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "internalName": "<string>",
          "label": "<string>",
          "context": "<string>",
          "createdAt": "2023-11-07T05:31:56Z",
          "updatedAt": "2023-11-07T05:31:56Z"
        }
      ]
    }
  ]
}

Authorizations

Authorization
string
header
required

Basic authentication header of the form Basic <api_key>, where <api_key> is your api key.

Path Parameters

invoiceReceivableId
string<uuid>
required

Body

application/json;charset=UTF-8
productId
string<uuid>

ID of the product

quantity
number
default:1

Quantity of the product

taxCodeId
string<uuid> | null

ID of the tax code to apply to this line

accountId
string<uuid> | null

ID of the ledger account for this line

discount
object

Discount to apply to this line (can be percentage or amount-based)

priceOverwrite
integer<int64> | null

Price overwrite in cents. If not provided, the product's default price will be used

productNameOverwrite
string | null

Product name overwrite. If not provided, the product's default name will be used

taxAmountOverwrite
integer<int64> | null

Tax amount override in cents. Bypasses tax calculation and sets the exact tax amount for this line.

Requirements: The line must have a valid amount (product price or priceOverwrite must be set).

The taxAmount field in the response will reflect this override value.

avataxCode
string | null

Avalara tax code. Used when the invoice tax engine is AVATAX

billingStart
string<date> | null

Start of the billing period for this line

billingEnd
string<date> | null

End of the billing period for this line

accrualTemplateId
string<uuid> | null

ID of the accrual/amortization template to apply to this line

accrualStartDate
string<date> | null

Start date for accrual/amortization

accrualEndDate
string<date> | null

End date for accrual/amortization

customProperties
(object | null)[] | null

List of custom properties to set on the invoice or line

List of custom properties to set on the vendor. Replaces the existing set.

Response

default - application/json;charset=UTF-8

default response

id
string<uuid>

Unique identifier for the object

companyId
string<uuid>

ID of the company

invoiceReceivableId
string<uuid>

ID of the invoice receivable this line belongs to

productId
string<uuid>

ID of the product

quantity
number

Quantity of the product

taxCodeId
string<uuid> | null

ID of the tax code

accountId
string<uuid> | null

ID of the ledger account

discount
object

Discount to apply to this line (can be percentage or amount-based)

discountAmount
integer<int64> | null

Discount amount in cents

netAmount
integer<int64> | null

Net amount in cents after discount but before tax

taxAmount
integer<int64> | null

Tax amount in cents

avataxCode
string | null

Avalara tax code. Used when the invoice tax engine is AVATAX

billingStart
string<date> | null

Start of the billing period

billingEnd
string<date> | null

End of the billing period

priceOverwrite
integer<int64> | null

Custom product price in cents. This overrides the default product's price

productNameOverwrite
string | null

Custom product name. This overrides the default product's name

createdAt
string<date-time>

Timestamp when the line was created

updatedAt
string<date-time>

Timestamp when the line was last updated

accrualTemplateId
string<uuid> | null

ID of the accrual template

accrualStartDate
string<date> | null

Start date for accrual

accrualEndDate
string<date> | null

End date for accrual

customProperties
(object | null)[] | null

List of custom properties associated with the line

Custom properties set on the vendor.