My Products
Help
ZlatkoS
CONTRIBUTOR *

Creation of Journal Transaction via API

by ZlatkoS

Hi All,

 

I have an issue when trying to create Journal transaction in Base Currency via API. When I send the currency information for another currency than the Base one it works fine:

"currencyId": {
"value": "USD"
},
"exchangeRate": {
"value": 0.8
},

when I don't include this part in the payload it also works fine by automatically assigning the Base (EUR) currency. But when I try to send it in EUR I always receive error message: "Error creating journal transaction. Customer currency and Base currency are Identical". Since it is tricky for me to dynamically include or exclude this part I have to always include it in the payload. 

I faced the same problem for Invoices but there if I simply place 0 in the "exchangeRate" it works fine, unfortunately same trick did not work for the Journal Transactions. Can somebody help on this?

 

Thanks in advance,

Zlatko 

6 REPLIES 6

by Magnus Johnsen

Hi,

Could you please send us the full JSON and we'll try to replicate it in our enviroment.

Thank you. 

ZlatkoS
CONTRIBUTOR *

by ZlatkoS

Hi Magnus,

here it is:

{
"hold": {
"value": false
},
"transactionDate": {
"value": "2022-01-17T00:00:00"
},
"ledger": {
"value": "802000"
},
"autoReversing": {
"value": false
},
"description": {
"value": "Test € 1.000,00 "
},
"controlTotalInCurrency": {
"value": 0
},
"createVatTransaction": {
"value": false
},
"skipVatAmountValidation": {
"value": true
},
"branch": {
"value": "100"
},
"currencyId": {
"value": "EUR"
},
"exchangeRate": {
"value": 0
},
"journalTransactionLines": [
{
"operation": "Insert",
"lineNumber": {
"value": 1
},
"accountNumber": {
"value": "802000"
},
"subaccount": [
{
"segmentId": 1,
"segmentValue": "BELGIUM"
}
],
"project": {
"value": "X"
},
"referenceNumber": {
"value": "220041"
},
"transactionDescription": {
"value": "Test € 1.000,00 "
},
"debitAmountInCurrency": {
"value": 1000
},
"creditAmountInCurrency": {
"value": 0
},
"branch": {
"value": "100"
},
"quantity": {
"value": 1
}
},
{
"operation": "Insert",
"lineNumber": {
"value": 2
},
"accountNumber": {
"value": "802000"
},
"subaccount": [
{
"segmentId": 1,
"segmentValue": "OVERHEAD"
}
],
"project": {
"value": "X"
},
"referenceNumber": {
"value": "220041"
},
"transactionDescription": {
"value": "CORRECTION - OVERHEAD"
},
"debitAmountInCurrency": {
"value": 0
},
"creditAmountInCurrency": {
"value": 1000
},
"branch": {
"value": "100"
},
"quantity": {
"value": 1
}
}
]
}

by Magnus Johnsen

Hi,

Could you please send us a screenshot of the ledger(802000) used from the UI(ScreenId=GL201500):

2022-02-17 09_57_45-Ledgers - Brave.png

Also, is it correct that you use ledger: "802000", send a debit to account: "802000" and a credit to the same account: "802000"?

As far as we know this would not do anything else than create a entry that in effect does nothing.

ZlatkoS
CONTRIBUTOR *

by ZlatkoS

Hi Magnus,

 

sorry I'm not into the Visma, I thought in the Ledger I should send the Account Number, thus I can not see the 802000 under Ledgers, but I made a GET of existing Journal transaction now and used the value (name, id) of the Ledger in the Post call and still I get the same error (with 0 and with 1 as exchange rate).

As for the purpose of it, it is more for administration purposes. But I think this should not be the stopper right?

by Magnus Johnsen

Hi,

Unfortunately, we can't give you a answer on how the entries should be made on the API team.

You should check this with your partner service, or ask your client regarding how the entries should be made.

You can check what ledgers the company you are targeting has via the ledger endpoint:

2022-02-17 13_18_32-Visma.net Integrations Documentation - Brave.png

And what accounts they have via the account endpoint:

2022-02-17 13_18_51-Visma.net Integrations Documentation - Brave.png

 

ZlatkoS
CONTRIBUTOR *

by ZlatkoS

Hi Magnus,

 

yes, I pulled the existing ledgers via the API and tried to use them but I still get the same error. When I set as Ledger 802000 but remove the ExchangeRate and Currency the API creates the Journal Transaction in Eur currency, when I insert ExchangeRate and Currency in USD it also created the Journal Transaction (regardless of the Ledger), I get error only when I try to send the above payload with ExchangeRate and Currency for EUR.