cancel
Showing results for 
Search instead for 
Did you mean: 
My Areas

Sign in or create account

to get a personalized navigation.

whoppe2001
CONTRIBUTOR *

Issue creating a customerledgeritemswithvoucher

by whoppe2001

Hi,

 

 We are trying to create a customerledgeritem with voucher. And, somehow we are failing even if our data seems right.

 

We are submitting this:

 

{
  "CurrencyCode": "NOK",
  "CustomerId": "dfe3861c-4d39-4e0c-b6f8-eda01f5c548f",
  "DueDate": "2020-01-18",
  "InvoiceDate": "2020-01-08",
  "InvoiceNumber": "9001",
  "IsCreditInvoice": false,
  "RemainingAmountInvoiceCurrency": "161.25",
  "RoundingsAmountInvoiceCurrency": "0",
  "TotalAmountInvoiceCurrency": "161.25",
  "VATAmountInvoiceCurrency": "32.25",
  "Voucher": {
    "VoucherDate": "2020-01-08",
    "VoucherText": "Faktura 9001",
    "Rows":  [
      {
        "AccountNumber": "1500",
        "DebitAmount": "161.25"
      },
      {
        "AccountNumber": "3000",
        "CreditAmount": "129"
      },
      {
        "AccountNumber": "2700",
        "CreditAmount": "32.25"
      }
    ]
  }
}

 

but getting back:

 

Receive:
{
    "ErrorCode": 2000,
    "DeveloperErrorMessage": "ValidateModelAttributeException - The VoucherDate property is required. The VoucherText field is required. ",
    "ErrorId": "40b5de11-e16a-4c6d-98c9-4d7112a359a5"
}

 

It seems that our formatting may be off, but cant quite see what 🙂

2 REPLIES 2

by krzysztofbrozek

Hello,

I just tested this (customerledgeritems/customerledgeritemswithvoucherendpoint with an exact request body as You provided in the thread (i changed only customerID). It looks that it is working. You can see the request and correct server response in the picture:

 

CustomerLedgerItemsWithVoucher.png

Please try to make your request once again. If the problem will still persist, we would need HTTP request/response to analyze that case.

 

Thank You!

Accepted solution
whoppe2001
CONTRIBUTOR *

So the issue on our side was that we used the wrong encoding for the submission. Thanks for the confirmation that it was indeed correct.