Skip to main content
POST
/
v1
/
invoice-receivables
/
{invoiceReceivableId}
/
archive
Archive invoice
curl --request POST \
  --url https://api.light.inc/v1/invoice-receivables/{invoiceReceivableId}/archive \
  --header 'Authorization: <api-key>'
{
  "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": 123,
  "paymentType": "BANK_TRANSFER",
  "payeeBankAccountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "invoiceDate": "2023-12-25",
  "dueDate": "2023-12-25",
  "netTerms": 123,
  "customerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "invoiceTemplateId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "invoiceTemplateAdditionalText": "<string>",
  "invoiceNumber": "<string>",
  "state": "DRAFT",
  "openedAt": "2023-11-07T05:31:56Z",
  "poNumber": "<string>",
  "description": "<string>",
  "currency": "USD",
  "taxEngineName": "AVATAX",
  "areLinesWithTax": true,
  "localCurrencyFxRate": 123,
  "groupCurrencyFxRate": 123,
  "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": 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"
            }
          ]
        }
      ]
    }
  ],
  "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"
        }
      ]
    }
  ],
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z",
  "updatedBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "failureContext": {
    "name": "<string>",
    "type": "BAD_REQUEST",
    "errors": [
      {
        "type": "<string>",
        "message": "<string>",
        "path": [
          "<string>"
        ],
        "context": {}
      }
    ]
  }
}

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

Response

default - application/json;charset=UTF-8

default response

id
string<uuid>

Unique identifier for the object

companyId
string<uuid>

ID of the company

contractId
string<uuid> | null

ID of the contract, if this is invoice is linked to a contract

companyEntityId
string<uuid> | null

ID of the entity

amount
integer

Total invoice amount in cents, with discounts and tax applied

paymentType
enum<string> | null

Payment type for the invoice

  • BANK_TRANSFER - Payment via bank transfer. Bank information will be displayed on the invoice
  • STRIPE - Payment via Stripe. A payment link will be sent to the customer
Available options:
BANK_TRANSFER,
STRIPE
payeeBankAccountId
string<uuid> | null

ID of the bank account where money should be sent to

invoiceDate
string<date> | null

Date the invoice was issued

dueDate
string<date> | null

Date the invoice payment is due

netTerms
integer | null

Number of days from the invoice date to when the invoice is due. Updating this field will automatically set the invoice due date

customerId
string<uuid> | null

ID of the customer

invoiceTemplateId
string<uuid> | null

ID of the invoice template

invoiceTemplateAdditionalText
string | null

Text that will added to the additional text section of the invoice template

invoiceNumber
string | null

Invoice number. This number is guaranteed to be unique and sequential per entity. By default Light will generate this number when the invoice is opened, but you can provide your own custom number when creating or updating a draft invoice

state
enum<string>

The invoice state

  • DRAFT - The invoice is in draft and can be modified. Next valid states are OPEN_IN_PROGRESS or ARCHIVED
  • OPEN_IN_PROGRESS - The invoice is being opened. Next valid state is OPEN or DRAFT
  • OPEN - The invoice is open. Next valid states are PAYMENT_PENDING, PARTIALLY_PAID, PAID or ARCHIVED
  • PAYMENT_PENDING - The payment was initiated by Light and is waiting to be collected. Next valid state is PAID
  • PARTIALLY_PAID - The invoice is partially paid. Next valid state is PAID
  • PAID - The invoice is fully paid
  • ARCHIVED - The invoice is archived and cannot be modified
Available options:
DRAFT,
OPEN_IN_PROGRESS,
OPEN,
PAYMENT_PENDING,
PARTIALLY_PAID,
PAID,
ARCHIVED
openedAt
string<date-time> | null

Timestamp when the invoice was opened

poNumber
string | null

Purchase order number

description
string | null

Description of the invoice

currency
string
Example:

"USD"

taxEngineName
enum<string>

Name of the tax engine to be used

  • AVATAX - Avalara AvaTax will be used for tax calculations
  • LIGHT - Light built-in tax engine will be used for tax calculations
Available options:
AVATAX,
LIGHT
areLinesWithTax
boolean

Whether the invoice line amount is inclusive of tax or not. True means tax is already included in the line amount and will not be added on top, false means tax will be added on top of the line amount

localCurrencyFxRate
number | null

Custom foreign exchange rate for the ledger's local currency. If not provided Light uses official ECB rates

groupCurrencyFxRate
number | null

Custom foreign exchange rate for the ledger's group currency. If not provided Light uses official ECB rates

lines
object[] | null

List of invoice line items. This is only returned when fetching a single invoice by id

customProperties
object[] | null

List of custom properties associated with the invoice

createdAt
string<date-time>

Timestamp when the invoice was created

updatedAt
string<date-time>

Timestamp when the invoice was last updated

updatedBy
string<uuid> | null

ID of the user who last updated the invoice

failureContext
object