My Products
Help

POST error "/controller/api/v2/customerCreditNote"

by Eirik Morken - Proplan AS

I am trying to post a new credit note to the new Customer Creditnote endpoint, but get a error message that does not mean anything to me. It works perfectly fine in the GUI.

Endpoint: /controller/api/v2/customerCreditNote

Error message:

{
  "message": "For Invoice type CRM with invoice number , you cannot update Field. Document status: Balanced."
}

 

Code:  

 

{
"currencyId": {
"value": "NOK"
},
"customerNumber": {
"value": "1009886407"
},
"project": {
"value": "X"
},
"lines": [
{
"operation": "Insert",
"lineNumber": {
"value": 1
},
"description": {
"value": "string"
},
"quantity": {
"value": 1
},
"manualAmountInCurrency": {
"value": 1234
},
"accountNumber": {
"value": "2942"
},
"vatCodeId": {
"value": null
},
"subaccount": [
{
"segmentId": 1,
"segmentValue": "01"
}
],
}
],
"overrideNumberSeries": {
"value": false
},
"referenceNumber": {
"value": "123456"
},
"documentDate": {
"value": "2021-06-25T12:11:27.336Z"
},
"origInvoiceDate": {
"value": "2021-06-25T12:11:27.336Z"
},
"hold": {
"value": true
},
"invoiceText": {
"value": "string"
}
}
2 REPLIES 2
Accepted solution
Magnus Johnsen
VISMA

by Magnus Johnsen

Hi,

The area seems to be concerning "origInvoiceDate" but the error is a bit missleading.

Please try removing this field from your query.

Works like a charm! Thank you and have a nice weekend😁