Create card transaction line
https://api.light.inc/v1/card-transactions/{transactionId}/lines
Adds a line to a card transaction
Permissions checked: card-transactions/own:update and card-transactions:update. What a call needs depends on the caller, the record and the request.
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
-
transactionIdstring · uuidrequired
Request body
application/json;charset=UTF-8
-
accountIdstring · uuidID of the ledger account to book this line against.
-
taxCodeIdstring · uuidID of the tax code to apply to this line. The line's tax is calculated from it.
-
costCenterIdstring · uuidID of the cost center.
-
amountinteger · int64Gross line amount in minor units (e.g. cents), including tax. Positive; the line takes the card transaction's direction.
-
descriptionstringDescription of this line.
-
customPropertiesarray of objectCustom properties to set on this 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.
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 record, a vendor, a bill, an invoice receivable or a purchase order. Send valueIds as an empty list. Each attachment must be active and belong to the record. A group whose canHoldMultipleFiles is false takes one attachment: a new attachment replaces the one the group holds, and the replaced attachment is archived. A group whose canHoldMultipleFiles is true takes several: list every attachment it should hold, since one left out is taken off the group and stays active. An attachment fills one group at most: one that another group holds is refused unless the same request takes it off that group, which moves it. A request that sends only customProperties and changes only their attachments also works while a bill's approval is pending. Create the record 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 when you update the record. An empty list clears the assignment without archiving the file. On a vendor, use PUT or PATCH /v1/vendors/{vendorId}; customProperties replaces the whole set, so send the vendor's other properties as they are, by valueIds. A PATCH that sends only customProperties and changes only their files works in every vendor status; a PUT, or a PATCH that changes anything else, returns 400 while the vendor is IN_REVIEW, ONBOARDING or INACTIVE. On a purchase order, use PATCH /v1/purchase-orders/{purchaseOrderId}, whose customProperties also replaces the whole set; one that sends only customProperties and changes only their files also works once the order is locked.
-
-
amortizationTemplateIdstring · uuidID of the amortization template to apply to this line.
-
amortizationStartDatestring · dateStart date for amortization of this line.
-
amortizationEndDatestring · dateEnd date for amortization of this line.
Response
-
idstring · uuid -
transactionIdstring · uuid -
companyIdstring · uuid -
accountIdstring · uuid -
taxCodeIdstring · uuid -
costCenterIdstring · uuid -
amountinteger · int64 -
netAmountinteger · int64 -
taxAmountinteger · int64 -
descriptionstring -
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
-
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
-
-
-
-
amortizationTemplateIdstring · uuid -
amortizationStartDatestring · date -
amortizationEndDatestring · date