Create product
https://api.light.inc/v1/products
Creates a new product
Permission: products:create (AR_CLERK, COMPANY_ADMIN, CONTROLLER)
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- Label only. Pricing is the same as FIXED: the line amount is the product price times the line 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-
currencystringCurrency for this pricing
-
amountinteger · int64Price per unit in the smallest currency unit. Examples of the smallest unit: GBP 42.15 = 4215, JPY 12345 = 12345, BHD 7.321 = 7321
-
-
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.
Note
Catalog 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.
Note
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. -
attachmentIdsarray of string · uuidIDs of attachments to assign to an ATTACHMENT property on an existing vendor. Send valueIds as an empty list. Only one active attachment belonging to the vendor can be assigned per group. Clear the current file before assigning another. Create the vendor first, request POST /v1/attachments/upload-url with its resourceId, upload the file to the returned URL, then POST /v1/attachments with documentKey set to the returned key. Use the created attachment's id here in PUT or PATCH /v1/vendors/{vendorId}. A PATCH that sends only customProperties and changes only their files works in every vendor status. customProperties replaces the whole set, so send the vendor's other properties as they are, by valueIds. A PUT, or a PATCH that changes anything else, returns 400 while the vendor is IN_REVIEW, ONBOARDING or INACTIVE. An empty list clears the assignment without archiving the file.
-
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- Label only. Pricing is the same as FIXED: the line amount is the product price times the line 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
-
currencystringCurrency for this pricing
-
amountinteger · int64Price per unit in the smallest currency unit. Examples of the smallest unit: GBP 42.15 = 4215, JPY 12345 = 12345, BHD 7.321 = 7321
-
-
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
-
attachmentobjectFile assigned to an ATTACHMENT property. Null for other property types.
-
idstring · uuidAttachment ID. Use GET /v1/attachments/{attachmentId}/document to download the file.
-
fileNamestring -
contentTypestring
-
-
-