to get a personalized navigation.
to get a personalized navigation.
Hello everyone,
I'm trying to change the location of my sales order using the API. I've reviewed the JSON model and the VISMA.Net financials UI, but no success.
The data I'm trying to pass in is this
{
"orderType": {
"value": "CS"
},
"hold": {
"value": false
},
"date": {
"value": "2021-02-17"
},
"customerRefNo": {
"value": "D344"
},
"customer": {
"value": "10003"
},
"currency": {
"value": "NOK"
},
"paymentRef": {
"value": "F43255"
},
"location": {
"id": "22",
"name": "Fredrikstad"
},
"soBillingAddress": {
"overrideAddress": true,
"addressId": 51259,
"addressLine1": "heigata 2",
"postalCode": "1602",
"city": "FREDRIKSTAD",
"country": {
"id": "NO",
"name": "NORGE"
},
"county": {
"id": "0106",
"name": "FREDRIKSTAD"
}
},
"soShippingAddress": {
"overrideAddress": false,
"addressId": 51252,
"addressLine1": "heigata 2",
"postalCode": "1602",
"city": "FREDRIKSTAD",
"country": {
"id": "NO",
"name": "NORGE"
},
"county": {
"id": "0106",
"name": "FREDRIKSTAD"
}
},
"lines": [
{
"operation": "Insert",
"lineNbr": {
"value": 1
},
"inventoryId": {
"value": "126"
},
"warehouse": {
"value": "1"
},
"uom": {
"value": "STK"
},
"quantity": {
"value": 1
},
"unitPrice": {
"value": 1000
},
"lineDescription": {
"value": "Elektrisk tannbørste"
}
}
]
}
The error:
Please review the errors.\r\nError: 'Location' cannot be empty
The location I'm trying to use for my sales order already exists in registered locations for that customer. What am I doing wrong?
Solved! Go to Solution.
This is the screenID. I currently have 3 different locations for that customer. I want to register a new sales order on "Fredrikstad" instead of my main location. I've tried sending both the ID and name in the JSON, but I keep getting that Location is empty.
Please send us your current JSON that you're trying the operation with. Please also try the same operation in the Financials UI by creating CS type Sales Order and assigning the desired location.
{
"orderType": {
"value": "CS"
},
"hold": {
"value": false
},
"date": {
"value": "2021-02-17"
},
"customerRefNo": {
"value": "A555"
},
"customer": {
"value": "10003"
},
"currency": {
"value": "NOK"
},
"paymentRef": {
"value": "PF4433"
},
"soBillingAddress": {
"overrideAddress": true,
"addressId": 51259,
"addressLine1": "heigata 2",
"postalCode": "1602",
"city": "FREDRIKSTAD",
"country": {
"id": "NO",
"name": "NORGE"
},
"county": {
"id": "0106",
"name": "FREDRIKSTAD"
}
},
"soShippingAddress": {
"overrideAddress": false,
"addressId": 51252,
"addressLine1": "heigata 2",
"postalCode": "1602",
"city": "FREDRIKSTAD",
"country": {
"id": "NO",
"name": "NORGE"
},
"county": {
"id": "0106",
"name": "FREDRIKSTAD"
}
},
"location": {
"id": "22",
"name": "Fredrikstad"
},
"lines": [
{
"operation": "Insert",
"lineNbr": {
"value": 1
},
"inventoryId": {
"value": "124"
},
"warehouse": {
"value": "1"
},
"uom": {
"value": "STK"
},
"quantity": {
"value": 1
},
"unitPrice": {
"value": 1000
},
"lineDescription": {
"value": "Elektrisk tannbørst"
}
}
]
}
Location field still sent in the wrong format. There are also another syntax errors with "Address" arrays such as missing value keys & wrong { } usage.
Please copy-paste example value format from the Sales Order POST DTO : https://integration.visma.net/API-index/
Then remove the fields you don't need. Replace the values of the fields you'd like to send with.
I've tried to only send the Location model with the other necessary values, but still can't seem to get it to work, Whats wrong about my location format? By looking at the UI I see theres a "connection number" from my customer? If you take a look at this;
{
"orderType": {
"value": "CS"
},
"hold": {
"value": false
},
"date": {
"value": "2021-02-17"
},
"customerRefNo": {
"value": "A555"
},
"customer": {
"value": "10003"
},
"currency": {
"value": "NOK"
},
"paymentRef": {
"value": "PF4433"
},
"location": {
"id": "22",
"name": "Fredrikstad"
},
"lines": [
{
"operation": "Insert",
"lineNbr": {
"value": 1
},
"inventoryId": {
"value": "124"
},
"warehouse": {
"value": "1"
},
"uom": {
"value": "STK"
},
"quantity": {
"value": 1
},
"unitPrice": {
"value": 1000
},
"lineDescription": {
"value": "Elektrisk tannbørst"
}
}
]
}
The correct definitions of the key-value pairs are represented in the Swagger Documentation for Visma.net ERP API that can be found at https://integration.visma.net/API-index/
You need to open the link > find Sales Order POST endpoint and check Example Value information to find out correct syntax.
As we've stated above, Location can not be sent in this format.
"location": {
"id": "22",
"name": "Fredrikstad"
},
Correct format is
"location": { "value": "string" },
where you have to replace "string" with desired "LOCATION ID"
I see, the thing is... I've already tried that aswell and it still gives me the same error message.
Like this:
"location": {
"id": "22"
},
Please pay extra attention to the above shared information and the format.
"location": { "value": "yourLocationID" },
Hello,
You should only include the fields that you'd like to update their values in the PUT (Update) requests. The rest should be excluded from your JSON.
Please see the documentation for the syntax: https://integration.visma.net/API-index/
Field should be sent in the following format:
...
"location": {
"value": "string"
},
...
Oh sorry just realised the question I asked was a bit vague. I'm trying to add a completely new sales order, not update. I want to add the new sales order with one of my other three exisiting locations registered for that customer if that makes sense.
Hello, this is also valid for POST operation. You should correct the syntax used in your JSON.
Used
"location": {
"id": "22",
"name": "Fredrikstad"
},
Should be used:
"location": {
"value": "string"
},
I'm still getting the same error that Location can't be empty.
Please send us the latest POST payload that you've corrected and retried. Make sure that existing / assigned location ID sent in the JSON.
Financials UI>Customer Card: ScreenId=AR303000
Copyright © 2022 Visma.com. All rights reserved.