to get a personalized navigation.
to get a personalized navigation.
Hi,
I'm trying to create a supplierpayment with crossrate.
Please see my json below. I can create the payment in Visma without any problems.
When trying to create via the API im getting this error message:
Do you have any suggestions to fix this?
{
"branch": {
"Value": "1"
},
"supplier": {
"Value": "50072"
},
"type": {
"Value": "Payment"
},
"paymentRef": {
"Value": "Nettan reglering"
},
"cashAccount": {
"Value": "1963 "
},
"paymentMethod": {
"Value": "4"
},
"paymentAmount": {
"Value": 32030.27
},
"applicationDate": {
"Value": "2023-06-15T00:00:00.000Z"
},
"paymentLines": [{
"refNbr": {
"Value": "201945"
},
"documentType": {
"Value": "Invoice"
},
"amountPaid": {
"Value": 32030.27
},
"crossRate": {
"Value": 7.45446484
},
"operation": "Insert",
"cashDiscountTaken": {
"Value": 0.0
},
"withholdingTax": {
"Value": 0.0
},
"applicationDate": {
"Value": "0001-01-01T00:00:00.000Z"
},
"date": {
"Value": "0001-01-01T00:00:00.000Z"
},
"dueDate": {
"Value": "0001-01-01T00:00:00.000Z"
},
"cashDiscountDate": {
"Value": "0001-01-01T00:00:00.000Z"
}
}
],
"appliedAmount": {
"Value": 0.0
},
"financeCharges": {
"Value": 0.0
},
"hold": {
"Value": false
},
"released": {
"Value": false
},
"unappliedBalance": {
"Value": 0.0
}
}
Hi, this might be related to the CrossRate amount that may cause difference in the total. In the first place, we'd recommend removing the fields with value 0 and dates such as "0001-01-01T00:00:00.000Z"
Afterwards, please try manually creating a Supplier Payment for that Invoice via the ERP UI to see what balance/values calculated.
I tried to save it and it was fine.
Please see below for the lateset JSON.
{
"supplier": {
"Value": "50072"
},
"type": {
"Value": "Payment"
},
"paymentRef": {
"Value": "Nettan reglering"
},
"cashAccount": {
"Value": "1963 "
},
"paymentMethod": {
"Value": "4"
},
"paymentAmount": {
"Value": 32030.27
},
"applicationDate": {
"Value": "2023-06-15T00:00:00.000Z"
},
"paymentLines": [{
"refNbr": {
"Value": "201945"
},
"documentType": {
"Value": "Invoice"
},
"amountPaid": {
"Value": 32030.27
},
"crossRate": {
"Value": 7.45446484
}
}
]
}
Hi,
You are missing the line operation, the below JSON (modified for use in local company works on our end):
{
"supplier": {
"Value": "50072"
},
"type": {
"Value": "Payment"
},
"paymentRef": {
"Value": "Nettan reglering"
},
"cashAccount": {
"Value": "1963 "
},
"paymentMethod": {
"Value": "4"
},
"paymentAmount": {
"Value": 32030.27
},
"applicationDate": {
"Value": "2023-06-15T00:00:00.000Z"
},
"paymentLines": [{
"operation": "Insert",
"refNbr": {
"Value": "201945"
},
"documentType": {
"Value": "Invoice"
},
"amountPaid": {
"Value": 32030.27
},
"crossRate": {
"Value": 7.45446484
}
}
]
}
Hi,
I've tried with and without operation and it failed for both calls.
The invoice is now closed so i can't try with the same invoice again.
I tried with another company and it works, so I guess it was something wrong in that specific company. I'll have to wait and i'll get back to you when i have a new invoice to test.
Alright, please do.
Thank you.
Copyright © 2022 Visma.com. All rights reserved.