# Create invoice

> Creates a new sales invoice

`POST https://api.light.inc/v1/invoice-receivables`

## Note

Created in DRAFT . Defaults when omitted: postingDate is invoiceDate , else today; paymentType is BANK_TRANSFER ; currency comes from the customer, else the entity; payeeBankAccountId and invoiceTemplateId fall back to the entity's defaults; areLinesWithTax is true ; line quantity is 1 . Line tax fields must match the tax engine of the entity and customer: taxCodeId only for Light's own engine, avataxCode only for Avalara, neither for Sphere, otherwise INVOICE_RECEIVABLE_INVALID_TAX_UPDATE with the offending line in path . Every line's product needs a price in the invoice currency unless priceOverwrite is set ( INVOICE_RECEIVABLE_PRODUCT_CURRENCY_MISMATCH ); a missing product is 404 PRODUCT_NOT_FOUND even with a price override. netTerms must be 0 to 9999. Send an X-Idempotency-Key to make retries safe; without it nothing is de-duplicated, and reusing a key with a different body is 409 IDEMPOTENCY_VIOLATION . invoiceNumber stays null until the invoice is opened unless you set one.

## Authorization

- API key
- Bearer token

See https://light.inc/docs/getting-started/authentication.

## Header parameters

- `X-Idempotency-Key` (string)

## Request body

`application/json;charset=UTF-8`

- `currency` — ISO 4217 code. Defaults to the customer's currency, else the entity's.
- `lines.discount` — Optional discount on the line, by percentage or by amount.
- `lines.customProperties.valueIds` — Catalog value ids for this group. Required; send `[]` (with an empty `inlineValues`) to clear the group. `SINGLE_SELECT` and `MULTI_SELECT` groups accept nothing else. See [Custom properties on writes](/docs/getting-started/pagination-filtering-errors#custom-properties-on-writes).
- `lines.customProperties.inlineValues` — Literal values for `TEXT`, `NUMERIC`, `BOOLEAN` and `DATE` groups, as strings (`yyyy-MM-dd` for dates). Rejected on select groups with `CUSTOM_PROPERTY_VALUE_TYPE_MISMATCH`. See [Custom properties on writes](/docs/getting-started/pagination-filtering-errors#custom-properties-on-writes).
- `customProperties.valueIds` — Catalog value ids for this group. Required; send `[]` (with an empty `inlineValues`) to clear the group. `SINGLE_SELECT` and `MULTI_SELECT` groups accept nothing else. See [Custom properties on writes](/docs/getting-started/pagination-filtering-errors#custom-properties-on-writes).
- `customProperties.inlineValues` — Literal values for `TEXT`, `NUMERIC`, `BOOLEAN` and `DATE` groups, as strings (`yyyy-MM-dd` for dates). Rejected on select groups with `CUSTOM_PROPERTY_VALUE_TYPE_MISMATCH`. See [Custom properties on writes](/docs/getting-started/pagination-filtering-errors#custom-properties-on-writes).

```json
{
  "companyEntityId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "invoiceNumber": "string",
  "description": "string",
  "currency": "USD",
  "paymentType": "AIRWALLEX",
  "payeeBankAccountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "invoiceDate": "2026-01-15",
  "postingDate": "2026-01-15",
  "dueDate": "2026-01-15",
  "customerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "invoiceTemplateId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "netTerms": 0,
  "poNumber": "string",
  "reference": "string",
  "invoiceTemplateAdditionalText": "string",
  "areLinesWithTax": true,
  "localCurrencyFxRate": 0,
  "groupCurrencyFxRate": 0,
  "lines": [
    {
      "productId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "quantity": 0,
      "taxCodeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "accountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "discount": {
        "type": "PERCENTAGE"
      },
      "priceOverwrite": 100000,
      "productNameOverwrite": "string",
      "taxAmountOverwrite": 100000,
      "avataxCode": "string",
      "billingStart": "2026-01-15",
      "billingEnd": "2026-01-15",
      "accrualTemplateId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "accrualStartDate": "2026-01-15",
      "accrualEndDate": "2026-01-15",
      "customProperties": [
        {
          "groupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "valueIds": [
            "3c90c3cc-0d44-4b50-8888-8dd25736052a"
          ],
          "inlineValues": [
            "string"
          ]
        }
      ]
    }
  ],
  "customProperties": [
    {
      "groupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "valueIds": [
        "3c90c3cc-0d44-4b50-8888-8dd25736052a"
      ],
      "inlineValues": [
        "string"
      ]
    }
  ]
}
```

Values above are generated from the schema: the shapes and types are real, the values are placeholders, and fields that exclude each other are all shown. Do not send it unchanged.

## Response

- `amount` — Gross total after discounts and tax, signed: a debit-side line (for example a negative `priceOverwrite`) reduces it.
- `invoiceNumber` — `null` on a draft unless you set one; assigned synchronously by `open` and kept across `reset` and `archive`.
- `currency` — The invoice currency.
- `lines` — `null` on the list endpoint; populated only by `GET /v1/invoice-receivables/{invoiceReceivableId}`.
- `lines.discount` — Discount applied to the line, by percentage or by amount.
- `lines.netAmount` — Signed: credit-side lines are positive, debit-side lines (a negative `priceOverwrite`) are negative. `discountAmount` is unsigned.
- `lines.taxAmount` — Signed the same way as `netAmount`: negative on a debit-side line.
- `externalSource` — Set when the invoice was imported from another system (for example Chargebee): the system's name and the invoice's id there.
- `failureContext` — Set when a background open fails and the invoice drops back to `DRAFT`; cleared by the next successful open. The description about vendor onboarding is a copy-paste from another model.

```json
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "companyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "contractId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "companyEntityId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "amount": 100000,
  "paymentType": "AIRWALLEX",
  "payeeBankAccountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "invoiceDate": "2026-01-15",
  "effectiveInvoiceDate": "2026-01-15",
  "postingDate": "2026-01-15",
  "dueDate": "2026-01-15",
  "netTerms": 0,
  "customerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "invoiceTemplateId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "invoiceTemplateAdditionalText": "string",
  "invoiceNumber": "string",
  "type": "STANDARD",
  "state": "CREATED",
  "openedAt": "2026-01-15T09:30:00Z",
  "poNumber": "string",
  "reference": "string",
  "paymentReference": "string",
  "description": "string",
  "currency": "USD",
  "taxEngineName": "AVATAX",
  "areLinesWithTax": true,
  "localCurrencyFxRate": 0,
  "groupCurrencyFxRate": 0,
  "lines": [
    {
      "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": 0,
      "taxCodeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "accountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "discount": {
        "type": "PERCENTAGE"
      },
      "discountAmount": 100000,
      "netAmount": 100000,
      "taxAmount": 100000,
      "avataxCode": "string",
      "billingStart": "2026-01-15",
      "billingEnd": "2026-01-15",
      "priceOverwrite": 100000,
      "productNameOverwrite": "string",
      "createdAt": "2026-01-15T09:30:00Z",
      "updatedAt": "2026-01-15T09:30:00Z",
      "accrualTemplateId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "accrualStartDate": "2026-01-15",
      "accrualEndDate": "2026-01-15",
      "customProperties": [
        {
          "groupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "groupInternalName": "string",
          "values": [
            {}
          ]
        }
      ]
    }
  ],
  "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": "2026-01-15T09:30:00Z",
          "updatedAt": "2026-01-15T09:30:00Z"
        }
      ]
    }
  ],
  "externalSource": {
    "name": "CHARGEBEE",
    "externalId": "string"
  },
  "createdAt": "2026-01-15T09:30:00Z",
  "updatedAt": "2026-01-15T09:30:00Z",
  "updatedBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "failureContext": {
    "name": "string",
    "type": "BAD_REQUEST",
    "errors": [
      {
        "type": "string",
        "message": "string",
        "path": [
          "string"
        ],
        "context": null
      }
    ]
  }
}
```

Values above are generated from the schema: the shapes and types are real, the values are placeholders.

## Code

```bash
# Set LIGHT_IDEMPOTENCY_KEY to a key saved for this operation; reuse it on retries.
curl -X POST "https://api.light.inc/v1/invoice-receivables" \
  -H "Authorization: Basic YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "X-Idempotency-Key: ${LIGHT_IDEMPOTENCY_KEY:?Set a saved key for this operation}" \
  -d '{
  "companyEntityId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "invoiceNumber": "string",
  "description": "string",
  "currency": "USD",
  "paymentType": "AIRWALLEX",
  "payeeBankAccountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "invoiceDate": "2026-01-15",
  "postingDate": "2026-01-15",
  "dueDate": "2026-01-15",
  "customerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "invoiceTemplateId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "netTerms": 0,
  "poNumber": "string",
  "reference": "string",
  "invoiceTemplateAdditionalText": "string",
  "areLinesWithTax": true,
  "localCurrencyFxRate": 0,
  "groupCurrencyFxRate": 0,
  "lines": [
    {
      "productId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "quantity": 0,
      "taxCodeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "accountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "discount": {
        "type": "PERCENTAGE"
      },
      "priceOverwrite": 100000,
      "productNameOverwrite": "string",
      "taxAmountOverwrite": 100000,
      "avataxCode": "string",
      "billingStart": "2026-01-15",
      "billingEnd": "2026-01-15",
      "accrualTemplateId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "accrualStartDate": "2026-01-15",
      "accrualEndDate": "2026-01-15",
      "customProperties": [
        {
          "groupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "valueIds": [
            "3c90c3cc-0d44-4b50-8888-8dd25736052a"
          ],
          "inlineValues": [
            "string"
          ]
        }
      ]
    }
  ],
  "customProperties": [
    {
      "groupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "valueIds": [
        "3c90c3cc-0d44-4b50-8888-8dd25736052a"
      ],
      "inlineValues": [
        "string"
      ]
    }
  ]
}'
```

---

Full page: https://light.inc/docs/api-reference/v1--invoice-receivables/create-invoice · Index: https://light.inc/docs/llms.txt
