API / Reference / Purchase Orders
Batch update purchase order lines
PUT
https://api.light.inc/v1/purchase-orders/{purchaseOrderId}/lines/bulk
Updates multiple purchase order line items
Not a replace-all, and not a merge either. Only the lines whose lineId you list are touched (unknown id: PURCHASE_ORDER_LINE_NOT_RECOGNIZED; the same id twice: PURCHASE_ORDER_LINE_DUPLICATE_UPDATE), but for each listed line every scalar field is overwritten with what you send, so an omitted description, costCenterId, accountId, taxCodeId, quantity or unitPrice becomes null. customProperties is the one field null leaves unchanged. The single-line PATCH uses the usual omit-to-keep rule instead.
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
Path parameters
-
purchaseOrderIdstring · uuidrequired
Request body
application/json;charset=UTF-8
-
lineIdstring · uuid -
descriptionstringOverwritten with whatever you send, so an omitted value becomes
null. The same applies tocostCenterId,accountId,taxCodeId,quantityandunitPricein this batch body; onlycustomPropertieskeeps its value onnull. -
costCenterIdstring · uuid -
accountIdstring · uuid -
taxCodeIdstring · uuid -
quantitynumber -
unitPriceinteger · int64 -
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 · uuid -
companyIdstring · uuid -
purchaseOrderIdstring · uuid -
descriptionstring -
costCenterIdstring · uuid -
accountIdstring · uuid -
taxCodeIdstring · uuid -
quantitynumber -
unitPriceinteger · int64 -
amountinteger · int64 -
netAmountinteger · int64 -
createdAtstring · date-time -
updatedAtstring · date-time -
customPropertiesarray of object-
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
-
-