Update Line of Purchase Credit Memo

Prev Next
Patch
/softera/softeraEInvoice/v2.0/companies({companyId})/purchaseCreditMemos({purchaseCreditMemoId})/purchaseCreditMemoLines(documentId={documentId},sequence={sequence})

Updates a line of a draft purchase credit memo. documentId, sequence and lineObjectNumber cannot be changed; delete and re-create the line instead.

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
purchaseCreditMemoId
string (uuid) Required

SystemId (GUID) of the purchase credit memo

Example7c41e2a9-5d1b-f011-9346-002248a0b478
documentId
string (uuid) Required

First part of the purchase credit memo line key: SystemId (GUID) of the parent purchase credit memo. The purchase credit memo line page has no ODataKeyFields, so a line is addressed by its primary key documentId + sequence, e.g. purchaseCreditMemoLines(documentId=7c41e2a9-5d1b-f011-9346-002248a0b478,sequence=10000).

Example7c41e2a9-5d1b-f011-9346-002248a0b478
sequence
integerRequired

Second part of the purchase credit memo line key, the line number (sequence).

Example10000
Body parameters
quantity

Change quantity

{
  "quantity": 150
}
Expand All
object

Writable purchase credit memo line fields. documentId is filled automatically when the line is created under a purchase credit memo. documentId, sequence and lineObjectNumber cannot be changed once set.

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
ExampleBENZINAS95
description
string
Max length100
ExampleBenzinas 95
unitOfMeasureId
string (uuid)
unitOfMeasureCode
string
Max length10
ExampleL
unitCost
number
Example0.98
quantity
number
Example200
discountAmount
number
Example0
discountPercent
number
Example0
taxCode
string
Max length50
ExampleA PREK21
depreciationBookCode
string
Example
salvageValue
number
Example0
expectedReceiptDate
string (date)
Example2025-04-23
itemVariantId
string (uuid)
locationId
string (uuid)
locationCode
string
Max length10
ExampleCENTRINIS
deferralCode
string
ExampleTIESIOG
shortcutDimension1Code
string
ExamplePIRK
shortcutDimension2Code
string
Example222
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
valueId
string (uuid)
valueCode
string
ExampleADM
Responses
200

OK

Expand All
object

The page has no ODataKeyFields, so a line is keyed by documentId + sequence (e.g. purchaseCreditMemoLines(documentId=...,sequence=10000)), not by id.

id
string (uuid)
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
ExampleBENZINAS95
description
string
Max length100
ExampleBenzinas 95
unitOfMeasureId
string (uuid)
unitOfMeasureCode
string
Max length10
ExampleL
unitCost
number
Example0.98
quantity
number
Example200
discountAmount
number
Example0
discountPercent
number
Example0
discountAppliedBeforeTax
boolean
amountExcludingTax
number
Example196
taxCode
string
Max length50
ExampleA PREK21
taxPercent
number
Example21
totalTaxAmount
number
Example41.16
amountIncludingTax
number
Example237.16
invoiceDiscountAllocation
number
Example0
netAmount
number
Example196
netTaxAmount
number
Example41.16
netAmountIncludingTax
number
Example237.16
depreciationBookCode
string
Example
salvageValue
number
Example0
expectedReceiptDate
string (date)
Example2025-04-23
itemVariantId
string (uuid)
locationId
string (uuid)
locationCode
string
Max length10
ExampleCENTRINIS
deferralCode
string
ExampleTIESIOG
shortcutDimension1Code
string
ExamplePIRK
shortcutDimension2Code
string
Example222
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.