API / Reference / Invoice Receivables
Create invoice
POST
https://api.light.inc/v1/invoice-receivables
Creates a new sales invoice
Authorization
Send one of these on every request. See Authentication for how to get credentials.
- API key
Basic authentication header of the form Basic <api_key>, where <api_key> is your api key.
- Bearer token
Headers
-
X-Idempotency-Keystring
Request body
application/json;charset=UTF-8
-
companyEntityIdstring · uuidID of the company entity
-
invoiceNumberstringUnique invoice number. If not provided, one will be generated automatically when the invoice is opened.
-
descriptionstringInvoice description
-
currencystring -
paymentTypestringPayment type for the invoice
AIRWALLEX- Payment via Airwallex. A payment link will be displayed on the invoiceBANK_TRANSFER- Payment via bank transfer. Bank information will be displayed on the invoiceDIRECT_DEBIT- Payment via direct debit. A notice that the amount will be collected automatically will be displayed on the invoiceSTRIPE- Payment via Stripe. A payment link will be sent to the customer
⚠️ This enum is not exhaustive; new values may be added in the future.
One of
AIRWALLEXBANK_TRANSFERDIRECT_DEBITSTRIPE -
payeeBankAccountIdstring · uuidID of the bank account where money should be sent to
-
invoiceDatestring · dateDate the invoice was issued
-
postingDatestring · dateDate the invoice is posted to the ledger (drives GL, VAT and revenue recognition). Defaults to the invoice date when omitted.
-
dueDatestring · dateDate the invoice payment is due
-
customerIdstring · uuidID of the customer
-
invoiceTemplateIdstring · uuidID of the invoice template
-
netTermsinteger · int32Number of days from the invoice date to when the invoice is due. Setting this will automatically calculate the due date
-
poNumberstringPurchase order number
-
referencestringReference number for cross-referencing with procurement and invoicing workflows
-
invoiceTemplateAdditionalTextstringText that will be added to the additional text section of the invoice template
-
areLinesWithTaxbooleanWhether the invoice line amounts are inclusive of tax. True means tax is included in the line amount, false means tax will be added on top
-
localCurrencyFxRatenumberCustom foreign exchange rate for the ledger's local currency. If not provided, Light uses official ECB rates
-
groupCurrencyFxRatenumberCustom foreign exchange rate for the ledger's group currency. If not provided, Light uses official ECB rates
-
linesarray of objectList of invoice line items to create
-
productIdstring · uuidID of the product
-
quantitynumberQuantity of the product
-
taxCodeIdstring · uuidID of the tax code to apply to this line
-
accountIdstring · uuidID of the ledger account for this line
-
discountobjectDiscount to apply to this line (can be percentage or amount-based)
-
typestring⚠️ This enum is not exhaustive; new values may be added in the future.
One of
PERCENTAGEAMOUNT
-
-
priceOverwriteinteger · int64Price overwrite in smallest denomination. If not provided, the product's default price will be used
-
productNameOverwritestringProduct name overwrite. If not provided, the product's default name will be used
-
taxAmountOverwriteinteger · int64Tax amount override in smallest denomination. 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.
Amounts use smallest denomination. Examples: GBP 42.15 = 4215, JPY 12345 = 12345, BHD 7.321 = 7321.
-
avataxCodestringAvalara tax code. Used when the invoice tax engine is AVATAX
-
billingStartstring · dateStart of the billing period for this line
-
billingEndstring · dateEnd of the billing period for this line
-
accrualTemplateIdstring · uuidID of the accrual/amortization template to apply to this line
-
accrualStartDatestring · dateStart date for accrual/amortization
-
accrualEndDatestring · dateEnd date for accrual/amortization
-
customPropertiesarray of objectList of custom properties to set on the invoice or line
-
groupIdstring · uuidID of the custom property group.
-
valueIdsarray of string · uuidIDs of the selected custom property values. It behaves as a PUT operation, so if empty the existing ones will be effectively deleted.
-
inlineValuesarray of stringInline custom property values (used for TEXT/NUMERIC/DATE/etc. groups). It behaves as a PUT operation, so if empty or null the existing ones will be effectively deleted.
-
-
-
customPropertiesarray of objectList of custom properties to set on the invoice or line
-
groupIdstring · uuidID of the custom property group.
-
valueIdsarray of string · uuidIDs of the selected custom property values. It behaves as a PUT operation, so if empty the existing ones will be effectively deleted.
-
inlineValuesarray of stringInline custom property values (used for TEXT/NUMERIC/DATE/etc. groups). It behaves as a PUT operation, so if empty or null the existing ones will be effectively deleted.
-
Response
-
idstring · uuidUnique identifier for the object
-
companyIdstring · uuidID of the company
-
contractIdstring · uuidID of the contract, if this is invoice is linked to a contract
-
companyEntityIdstring · uuidID of the entity
-
amountinteger · int64Total invoice amount in smallest denomination, with discounts and tax applied
-
paymentTypestringPayment type for the invoice
AIRWALLEX- Payment via Airwallex. A payment link will be displayed on the invoiceBANK_TRANSFER- Payment via bank transfer. Bank information will be displayed on the invoiceDIRECT_DEBIT- Payment via direct debit. A notice that the amount will be collected automatically will be displayed on the invoiceSTRIPE- Payment via Stripe. A payment link will be sent to the customer
⚠️ This enum is not exhaustive; new values may be added in the future.
One of
AIRWALLEXBANK_TRANSFERDIRECT_DEBITSTRIPE -
payeeBankAccountIdstring · uuidID of the bank account where money should be sent to
-
invoiceDatestring · dateDate the invoice was issued
-
effectiveInvoiceDatestring · dateThe invoice date shown to customers; falls back to the posting date when the invoice date is not set
-
postingDatestring · dateDate the invoice is posted to the ledger (drives GL, VAT and revenue recognition)
-
dueDatestring · dateDate the invoice payment is due
-
netTermsinteger · int32Number of days from the invoice date to when the invoice is due. Updating this field will automatically set the invoice due date
-
customerIdstring · uuidID of the customer
-
invoiceTemplateIdstring · uuidID of the invoice template
-
invoiceTemplateAdditionalTextstringText that will added to the additional text section of the invoice template
-
invoiceNumberstringInvoice 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
-
typestringWho raised the invoice
STANDARD- The company raised the invoiceSELF_BILLED- The customer issued the invoice on the company's behalf and sent it in
⚠️ This enum is not exhaustive; new values may be added in the future.
One of
STANDARDSELF_BILLED -
statestringThe invoice state
CREATED- The invoice document was received and is waiting to be parsed. Next valid state is DRAFTDRAFT- The invoice is in draft and can be modified. Next valid states are OPEN_IN_PROGRESS or ARCHIVEDOPEN_IN_PROGRESS- The invoice is being opened. Next valid state is OPEN or DRAFTOPEN- The invoice is open. Next valid states are PAYMENT_PENDING, PARTIALLY_PAID, PAID or ARCHIVEDPAYMENT_PENDING- The payment was initiated by Light and is waiting to be collected. Next valid state is PAIDPARTIALLY_PAID- The invoice is partially paid. Next valid state is PAIDPAID- The invoice is fully paidREVERSED- The invoice was reversed by a credit note and reissued as a new invoice; it is locked and cannot be modifiedARCHIVED- The invoice is archived and cannot be modified
⚠️ This enum is not exhaustive; new values may be added in the future.
One of
CREATEDDRAFTOPEN_IN_PROGRESSOPENPAYMENT_PENDINGPARTIALLY_PAIDPAIDREVERSEDARCHIVED -
openedAtstring · date-timeTimestamp when the invoice was opened
-
poNumberstringPurchase order number
-
referencestringReference number for cross-referencing with procurement and invoicing workflows
-
descriptionstringDescription of the invoice
-
currencystring -
taxEngineNamestringName of the tax engine to be used
AVATAX- Avalara AvaTax will be used for tax calculationsLIGHT- Light built-in tax engine will be used for tax calculationsSPHERE- Sphere tax engine will be used for tax calculations
⚠️ This enum is not exhaustive; new values may be added in the future.
One of
AVATAXLIGHTSPHERE -
areLinesWithTaxbooleanWhether 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
-
localCurrencyFxRatenumberCustom foreign exchange rate for the ledger's local currency. If not provided Light uses official ECB rates
-
groupCurrencyFxRatenumberCustom foreign exchange rate for the ledger's group currency. If not provided Light uses official ECB rates
-
linesarray of objectList of invoice line items. This is only returned when fetching a single invoice by id
-
idstring · uuidUnique identifier for the object
-
companyIdstring · uuidID of the company
-
invoiceReceivableIdstring · uuidID of the invoice receivable this line belongs to
-
productIdstring · uuidID of the product
-
quantitynumberQuantity of the product
-
taxCodeIdstring · uuidID of the tax code
-
accountIdstring · uuidID of the ledger account
-
discountobjectDiscount to apply to this line (can be percentage or amount-based)
-
typestring⚠️ This enum is not exhaustive; new values may be added in the future.
One of
PERCENTAGEAMOUNT
-
-
discountAmountinteger · int64Discount amount in smallest denomination
-
netAmountinteger · int64Net amount in smallest denomination after discount but before tax
-
taxAmountinteger · int64Tax amount in smallest denomination
-
avataxCodestringAvalara tax code. Used when the invoice tax engine is
AVATAX -
billingStartstring · dateStart of the billing period
-
billingEndstring · dateEnd of the billing period
-
priceOverwriteinteger · int64Custom product price in smallest denomination. This overrides the default product's price
-
productNameOverwritestringCustom product name. This overrides the default product's name
-
createdAtstring · date-timeTimestamp when the line was created
-
updatedAtstring · date-timeTimestamp when the line was last updated
-
accrualTemplateIdstring · uuidID of the accrual template
-
accrualStartDatestring · dateStart date for accrual
-
accrualEndDatestring · dateEnd date for accrual
-
customPropertiesarray of objectList of custom properties associated with the line
-
groupIdstring · uuidID of the custom property group
-
groupInternalNamestringInternal name of the custom property group
-
valuesarray of objectList of values. Note that this will be a single value unless the group input type supports multiple values
-
idstring · uuidUnique identifier for the object
-
groupIdstring · uuidID of the custom property group
-
groupInternalNamestringInternal name of the custom property group
-
companyIdstring · uuidID of the company
-
internalNamestringInternal name of the custom property value
-
labelstringLabel of the custom property value
-
contextstringContext/description of the custom property value
-
createdAtstring · date-timeTimestamp when the custom property value was created
-
updatedAtstring · date-timeTimestamp when the custom property value was last updated
-
-
-
-
customPropertiesarray of objectList of custom properties associated with the invoice
-
groupIdstring · uuidID of the custom property group
-
groupInternalNamestringInternal name of the custom property group
-
valuesarray of objectList of values. Note that this will be a single value unless the group input type supports multiple values
-
idstring · uuidUnique identifier for the object
-
groupIdstring · uuidID of the custom property group
-
groupInternalNamestringInternal name of the custom property group
-
companyIdstring · uuidID of the company
-
internalNamestringInternal name of the custom property value
-
labelstringLabel of the custom property value
-
contextstringContext/description of the custom property value
-
createdAtstring · date-timeTimestamp when the custom property value was created
-
updatedAtstring · date-timeTimestamp when the custom property value was last updated
-
-
-
externalSourceobjectThe external system where this product was synced from
-
namestringThe name of the external source
CHARGEBEE- Data synced from ChargebeeHUBSPOT- Data synced from HubSpotSALESFORCE- Data synced from SalesforceSTRIPE- Data synced from Stripe
⚠️ This enum is not exhaustive; new values may be added in the future.
One of
CHARGEBEEHUBSPOTSALESFORCESTRIPE -
externalIdstringThe ID of the object in the external source system
-
-
createdAtstring · date-timeTimestamp when the invoice was created
-
updatedAtstring · date-timeTimestamp when the invoice was last updated
-
updatedBystring · uuidID of the user who last updated the invoice
-
failureContextobjectFailure context when vendor onboarding fails.
-
namestringThe error name
-
typestringThe error type
⚠️ This enum is not exhaustive; new values may be added in the future.
One of
BAD_REQUESTUNAUTHORIZEDFORBIDDENNOT_FOUNDCONFLICTUNPROCESSABLE_CONTENT -
errorsarray of objectList of errors providing details about what went wrong
-
typestringA string code identifying the error type
-
messagestringA human-readable message providing more details about the error
-
patharray of stringOptional path of the error when the error is for a specific field. Used mostly on BAD_REQUEST errors, that path will match the field name on the request object
-
contextobjectOptional context providing additional information about the error. This can include any relevant data that might help in understanding or resolving the error
-
-