Create Line in Sales Credit Memo

Prev Next
Post
/softera/softeraEInvoice/v2.0/companies({companyId})/salesCreditMemos({salesCreditMemoId})/salesCreditMemoLines

Creates a line on the sales credit memo. documentId is taken from the parent. Lines can only be created, modified or deleted while the credit memo 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
Path parameters
companyId
string (uuid) Required

GUID for targeted Company

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

SystemId (GUID) of the sales credit memo

Example1ef44eac-0700-4693-89c3-99e20ca6cb13
Body parameters
account

G/L account line

{
  "lineType": "Account",
  "lineObjectNumber": "5001",
  "description": "Suteiktų paslaugų pajamos",
  "quantity": 1,
  "unitPrice": 300,
  "taxCode": "F PASL21"
}
item

Item line

{
  "lineObjectNumber": "Z0000002",
  "description": "Stalas baro",
  "unitOfMeasureCode": "VNT",
  "unitPrice": 150,
  "quantity": 20,
  "taxCode": "A PREK21",
  "shipmentDate": "2020-10-22"
}
object

Payload to create or update a sales credit memo line. Lines can only be changed on draft credit memos. documentId is required when the line is created through the root salesCreditMemoLines 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
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-04-02
itemVariantId
string (uuid)
locationId
string (uuid)
shortcutDimension1Code
string
ExamplePARD
shortcutDimension2Code
string
Example333
Responses
201

Created

Headers
Location
string (uri)
URL of the created sales credit memo line
Expand All
object
id
string (uuid)
documentId
string (uuid)

SystemId of the sales credit memo. 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
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-04-02
itemVariantId
string (uuid)
locationId
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"