to get a personalized navigation.
to get a personalized navigation.
In order to minimize toil in our organization I am developing an integration that will consumes contract data from HubSpot and injects it as invoices into Visma.net Financials. I have successfully opened an ISV account, and created a debtor and invoice through the GUI. My next step is to attempt to create an invoice through the API, I selected the customerinvoice v2 POST endpoint for this purpose.
Request
Headers:
Authorization: Bearer ....
Postman-Token: <calculated when request is sent>
Content-Type: application/json
Content-Length: <calculated when request is sent>
Host: <calculated when request is sent>
User-Agent: PostmanRuntime/7.26.5
Accept: */*
Accept-Encoding: gzip, deflate, br
Connection: keep-alive
ipp-company-id: ...
ipp-application-type: Visma.net Financials
Body
Expectation
HTTP status: 201 Created
Response
HTTP status: 400 Bad Request
Body
{"message":"VismaId: 09a72d7e-4c55-4680-99b0-26723da8334c. Error creating document. Operation parameter: value 0 - 0 is not valid for this type of request."}
I tried adding, changing, removing different elements in my request body but I haven't figured out what the "value 0 - 0" refers to. Does anyone here know what this message means?
Solved! Go to Solution.
Hi,
From what I can see, to start with you need to specify an operation for the invoice line:
"operation": "Insert" - To create a new line
There should be an inventoryNumber, or if the line does not have an item, at least a description of the line.
"inventoryNumber": { "value": "string" },
"description": { "value": "string" },
Please also have a look in the UI what subaccount you want to use, the value you have provided would translate that the second segment in the subaccount should be "0". E.g xx-0
Subaccount numbers are built up in the segments that you have specified in the ui(ScreenId=GL203000) as such:
"subaccount": [
{
"segmentId": 1,
"segmentValue": "1stSegment"
},
{
"segmentId": 2,
"segmentValue": "2segment"
},
{
"segmentId": 3,
"segmentValue": "3Segment"
}
],
Please have a look at this article that contains some basic usage of Customer Ledger endpoints:
Thank you, Magnus!
Yesterday I was relying on the GUI to find the required properties of an invoice. Sadly, the operation is not presented in a way to makes this clear. (It would be lovely if the Swagger mentioned which parameters are required instead.)
I am able to create an invoice without specifying inventoryNumber or description (see my new request body below). The sub account definition in my request body was invalid, but I corrected it based on the response I got when fetching an existing invoice (which was created through the GUI).
Request body
Copyright © 2022 Visma.com. All rights reserved.