Create product
POST
https://api.light.inc/v1/products
Creates a new product
name must be unique among catalogue products of the company, case-sensitively, and an archived product still holds its name (PRODUCT_NAME_CONFLICT, returned as 400). pricings needs at least one entry and at most one per currency; amounts are in minor units of that currency. defaultTaxId and defaultLedgerAccountId must exist (PRODUCT_TAX_NOT_FOUND, PRODUCT_LEDGER_ACCOUNT_NOT_FOUND). The default tax is only applied to invoice lines when Light's own tax engine is in force.
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
-
namestring -
pricingTypestringFIXED- The product has a single price per unitPACKAGE- The product is sold in packages with a fixed quantity
⚠️ This enum is not exhaustive; new values may be added in the future.
One of
FIXEDPACKAGE -
billingRecurrencestringONE_TIME- The product is billed onceMONTHLY- The product is billed every monthQUARTERLY- The product is billed every three monthsHALF_YEARLY- The product is billed every six monthsYEARLY- The product is billed every year
⚠️ This enum is not exhaustive; new values may be added in the future.
One of
ONE_TIMEMONTHLYQUARTERLYHALF_YEARLYYEARLY -
pricingsarray of object-
currencystring -
amountinteger · int64Price in cents
-
-
defaultAvataxCodestring -
defaultTaxIdstring · uuid -
defaultLedgerAccountIdstring · uuid -
customPropertiesarray of object-
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.
Catalogue value ids for this group. Required; send
[](with an emptyinlineValues) to clear the group.SINGLE_SELECTandMULTI_SELECTgroups accept nothing else. See Custom properties on writes. -
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.
Literal values for
TEXT,NUMERIC,BOOLEANandDATEgroups, as strings (yyyy-MM-ddfor dates). Rejected on select groups withCUSTOM_PROPERTY_VALUE_TYPE_MISMATCH. See Custom properties on writes.
-
Response
-
idstring · uuidUnique identifier for the object
-
companyIdstring · uuidID of the company
-
namestringName of the product
-
pricingTypestringPricing type of the product
FIXED- The product has a single price per unitPACKAGE- The product is sold in packages with a fixed quantity
⚠️ This enum is not exhaustive; new values may be added in the future.
One of
FIXEDPACKAGE -
billingRecurrencestringBilling frequency for the product. Used in contracts
ONE_TIME- The product is billed onceMONTHLY- The product is billed every monthQUARTERLY- The product is billed every three monthsHALF_YEARLY- The product is billed every six monthsYEARLY- The product is billed every year
⚠️ This enum is not exhaustive; new values may be added in the future.
One of
ONE_TIMEMONTHLYQUARTERLYHALF_YEARLYYEARLY -
pricingsarray of objectList of product price per currency
-
currencystring -
amountinteger · int64Price in cents
-
-
statestringProduct state
ACTIVE- The product is active and can be used in invoices and contractsARCHIVED- The product is archived and cannot be used in new invoices or contracts
⚠️ This enum is not exhaustive; new values may be added in the future.
One of
ACTIVEARCHIVED -
defaultTaxIdstring · uuidID of the default tax code for this product. Will be assigned to invoice lines when creating a line with this product
-
defaultAvataxCodestringDefault Avalara tax code. Used when the invoice tax engine is
AVATAX. Will be assigned to invoice lines when creating a line with this product -
defaultLedgerAccountIdstring · uuidID of the default ledger account for this product. Will be assigned to invoice lines when creating a line with this product
-
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 product was created
-
updatedAtstring · date-timeTimestamp when the product was last updated
-
customPropertiesarray of objectList of custom properties associated with the product
-
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
-
-