Update Sales Invoice Line

Prev Next
Patch
/softera/softeraEInvoice/v2.0/companies({companyId})/salesInvoiceLines({salesInvoiceLineId})

Updates a sales invoice line. documentId, sequence and lineObjectNumber cannot be changed. Lines can only be created, modified or deleted while the invoice is a draft (not posted).

Security
OAuth
FlowClient Credentials
Token URLhttps://login.microsoftonline.com/{tenantId}/oauth2/v2.0/token
Scopes:
https://api.businesscentral.dynamics.com/.defaultGrants the permissions assigned to the Microsoft Entra ID application in Business Central
Header parameters
If-Match
stringRequired

ETag for concurrency (use * to force update)

Path parameters
companyId
string (uuid) Required

GUID for targeted Company

Example54c4066e-2b2b-4118-ac75-7dfea25be205
salesInvoiceLineId
string (uuid) Required

SystemId (GUID) of the sales invoice line

Example2a7c1f5e-0a0e-f011-9346-002248a0b478
Body parameters
quantity

Change quantity and price

{
  "quantity": 10,
  "unitPrice": 95.5
}
dimensions

Change shortcut dimensions

{
  "shortcutDimension1Code": "PARD",
  "shortcutDimension2Code": "444"
}
object

Payload to create or update a sales invoice line. Lines can only be changed on draft invoices. documentId is required when the line is created through the root salesInvoiceLines endpoint. shortcutDimension1Code and shortcutDimension2Code are applied only when not empty.

documentId
string (uuid)
sequence
integer
Example10000
itemId
string (uuid)
accountId
string (uuid)
lineType
string
Valid values[ "Comment", "Account", "Item", "Resource", "Fixed_x0020_Asset", "Charge", "Allocation_x0020_Account" ]
ExampleItem
lineObjectNumber
string
Max length20
ExampleZ0000001
locationCode
string
Max length10
ExampleCENTRINIS
description
string
Max length100
ExampleSulankstoma kėdė
unitOfMeasureId
string (uuid)
unitOfMeasureCode
string
Max length10
ExampleVNT
quantity
number
Example20
unitPrice
number
Example100.1234
discountAmount
number
Example0
discountPercent
number
Example0
taxCode
string
Max length50
ExampleA PREK21
shipmentDate
string (date)
Example2025-03-22
itemVariantId
string (uuid)
shortcutDimension1Code
string
ExamplePARD
shortcutDimension2Code
string
Example333
Responses
200

OK

Expand All
object
id
string (uuid)
documentId
string (uuid)

SystemId of the sales invoice. Cannot be changed.

sequence
integer

Line No. Cannot be changed, delete and insert the line again.

Example10000
itemId
string (uuid)
accountId
string (uuid)
lineType
string
Valid values[ "Comment", "Account", "Item", "Resource", "Fixed_x0020_Asset", "Charge", "Allocation_x0020_Account" ]
ExampleItem
lineObjectNumber
string

Item or G/L account number, depending on lineType. Cannot be changed once set.

Max length20
ExampleZ0000001
locationCode
string
Max length10
ExampleCENTRINIS
description
string
Max length100
ExampleSulankstoma kėdė
unitOfMeasureId
string (uuid)
unitOfMeasureCode
string
Max length10
ExampleVNT
quantity
number
Example20
unitPrice
number
Example100.1234
discountAmount
number
Example0
discountPercent
number
Example0
discountAppliedBeforeTax
boolean
amountExcludingTax
number
taxCode
string
Max length50
ExampleA PREK21
taxPercent
number
Example21
totalTaxAmount
number
amountIncludingTax
number
invoiceDiscountAllocation
number
netAmount
number
netTaxAmount
number
netAmountIncludingTax
number
shipmentDate
string (date)
Example2025-03-22
itemVariantId
string (uuid)
shortcutDimension1Code
string
ExamplePARD
shortcutDimension2Code
string
Example333
dimensionSetLines
Array of object (dimensionSetLine)
object

Dimension set line (standard page "APIV2 - Dimension Set Lines"). If the customer, vendor, G/L account or item has default dimensions, overriding them on a document line needs additional PATCH requests; without default dimensions, send the dimensions with the line in the same request. For documents with hundreds of lines, post dimensions in a separate $batch request.

id
string (uuid)

SystemId of the dimension (not of the line)

code
string
ExamplePADALINYS
consolidationCode
string
Example
parentId
string (uuid)
parentType
string
Valid values[ "_x0020_", "Journal_x0020_Line", "Sales_x0020_Order", "Sales_x0020_Order_x0020_Line", "Sales_x0020_Quote", "Sales_x0020_Quote_x0020_Line", "Sales_x0020_Credit_x0020_Memo", "Sales_x0020_Credit_x0020_Memo_x0020_Line", "Sales_x0020_Invoice", "Sales_x0020_Invoice_x0020_Line", "Purchase_x0020_Invoice", "Purchase_x0020_Invoice_x0020_Line", "General_x0020_Ledger_x0020_Entry", "Time_x0020_Registration_x0020_Entry", "Sales_x0020_Shipment", "Sales_x0020_Shipment_x0020_Line", "Purchase_x0020_Receipt", "Purchase_x0020_Receipt_x0020_Line", "Purchase_x0020_Order", "Purchase_x0020_Order_x0020_Line", "Purchase_x0020_Credit_x0020_Memo", "Purchase_x0020_Credit_x0020_Memo_x0020_Line" ]
ExampleSales_x0020_Invoice
displayName
string
ExamplePadalinys
valueId
string (uuid)
valueCode
string
ExampleADM
valueConsolidationCode
string
Example
valueDisplayName
string
ExampleAdministracija
location
object (location)

Location (standard page "APIV2 - Locations").

id
string (uuid)
code
string
ExampleCENTRINIS
displayName
string
ExampleCentrinis sandėlis
contact
string
ExampleVardas Pavarde
addressLine1
string
ExampleSavanorių pr. 1
addressLine2
string
Example
city
string
ExampleVilnius
state
string
Example
country
string
ExampleLT
postalCode
string
ExampleLT-03116
phoneNumber
string
Example+370 5 2000000
email
string (email)
website
string
Example
lastModifiedDateTime
string (date-time)
400

Bad Request

Expand All
object
error
object
code
string
ExampleBadRequest
message
string
ExampleThe field Customer No. of table Sales Header contains a value (P9999999) that cannot be found in the related table (Customer). CorrelationId: fc7b9039-73d9-48d2-a9d3-9a8e0f8b91da.
401

Unauthorized

Headers
WWW-Authenticate
string
Expand All
object
error
object
code
string
Default"Unauthorized"
message
string
Default"The credentials provided are incorrect"
404

Not Found

Expand All
object
error
object
code
string
ExampleBadRequest_ResourceNotFound
message
string
ExampleResource not found for the segment 'dimensionValues'. CorrelationId: fc7b9039-73d9-48d2-a9d3-9a8e0f8b91da.