I create orders where I first need to create subaccounts. Problem is I can't use the just created subaccount on the order. I need to wait maybe 10-20 minutes before creating the order. Is there a delay between the API:s? If so, how long do I need to wait? First create subaccount with Visma Net Api PUT: https://integration.visma.net/API/controller/api/v1/dimension/SUBACCOUNT/4
{
"segmentValues": [
{
"operation": "Insert",
"value": "2134532",
"description": {
"value": "987654 "
}
}
],
"dimensionId": "SUBACCOUNT",
"segementId": 4
}
Response: 200 OK Then create order with Sales Order Api POST: https://salesorder.visma.net/api/v3/SalesOrders
{
"type": "IN",
"orderId": "1023",
"currencyId": "SEK",
"description": "",
"customer": {
"id": "1000011",
},
"orderLines": [
{
"inventoryId": "9521",
"quantity": 1.0,
"unitCost": 0.0,
"unitPrice": 131.0,
"subaccount": {
"1": "252",
"2": "009521",
"3": "1000011",
"4": "2134532",
"5": "4100022"
},
},
],
}
Response: 400 Bad Request
{
"title": "One or more validation errors occurred.",
"status": 400,
"detail": "Refer to the errors property for additional details",
"instance": "/api/v3/SalesOrders",
"details": [
{
"code": "1202-SegmentValueNotFound",
"message": "The value '2134532' is not valid for SegmentId 4",
"parameters": {
"property": "orderLines[0].subaccount"
}
}
],
"errors": {
"DomainValidation": [
"The value '2134532' is not valid for SegmentId 4"
]
}
}
... View more