1.) Create segment: https://integration.visma.net/API/controller/api/v1/dimension/SUBACCOUNT/2 {
"segmentValues": [
{
"operation": "Insert",
"value": "TW88752",
"description": {
"value": "TW88752"
},
"active": {
"value": true
}
}
]
} Response has HTTP 200, and empty body. Subaccount has been created: 2.) request for SO https://salesorder.visma.net/api/v3/SalesOrders {
"type": "SO",
"status": "Open",
"orderId": "SO88752",
"requestOn": "2023-12-12T12:51:51.000000Z",
"customer": {
"id": "237433",
"order": "TW88752",
"refNo": "Test reference"
},
"print": {
"descriptionOnInvoice": true,
"noteOnInternalDocuments": true,
"noteOnExternalDocuments": true
},
"orderLines": [
{
"inventoryId": "TEXT",
"description": "Order: TW88752 \nFrom: Amsterdam, NL (2023-12-12)\nTo: Berlin, DE (2023-12-12)\nReference: Test reference",
"quantity": 1,
"unitCost": 0,
"unitPrice": 0,
"requestDate": "2023-12-12T12:51:51.000000Z",
"subaccount": {
"1": "00",
"2": "TW88752"
}
},
{
"inventoryId": "ROAD",
"description": "Transport by road\nVehicle: Model1\nChassis number: 9ZPB76\n",
"quantity": 1,
"unitCost": 0,
"unitPrice": 0,
"requestDate": "2023-12-12T12:51:51.000000Z",
"subaccount": {
"1": "00",
"2": "TW88752"
}
},
{
"inventoryId": "TOWING",
"description": "Towing surcharge",
"quantity": 1,
"unitCost": 0,
"unitPrice": 0,
"requestDate": "2023-12-12T12:51:51.000000Z",
"subaccount": {
"1": "00",
"2": "TW88752"
}
},
{
"inventoryId": "TOWING",
"description": "Non rollable surcharge",
"quantity": 1,
"unitCost": 0,
"unitPrice": 0,
"requestDate": "2023-12-12T12:51:51.000000Z",
"subaccount": {
"1": "00",
"2": "TW88752"
}
},
{
"inventoryId": "ROAD",
"description": "Transport by road\nVehicle: Model2\nChassis number: TEST456\n",
"quantity": 1,
"unitCost": 0,
"unitPrice": 0,
"requestDate": "2023-12-12T12:51:51.000000Z",
"subaccount": {
"1": "00",
"2": "TW88752"
}
}
]
} Response: {
"details": [
{
"code": "1202-SegmentValueNotFound",
"message": "The value 'TW88752' is not valid for SegmentId 2",
"parameters": {
"property": "orderLines[0].subaccount"
}
},
{
"code": "1202-SegmentValueNotFound",
"message": "The value 'TW88752' is not valid for SegmentId 2",
"parameters": {
"property": "orderLines[1].subaccount"
}
},
{
"code": "1202-SegmentValueNotFound",
"message": "The value 'TW88752' is not valid for SegmentId 2",
"parameters": {
"property": "orderLines[2].subaccount"
}
},
{
"code": "1202-SegmentValueNotFound",
"message": "The value 'TW88752' is not valid for SegmentId 2",
"parameters": {
"property": "orderLines[3].subaccount"
}
},
{
"code": "1202-SegmentValueNotFound",
"message": "The value 'TW88752' is not valid for SegmentId 2",
"parameters": {
"property": "orderLines[4].subaccount"
}
}
],
"errors": {
"DomainValidation": [
"The value 'TW88752' is not valid for SegmentId 2",
"The value 'TW88752' is not valid for SegmentId 2",
"The value 'TW88752' is not valid for SegmentId 2",
"The value 'TW88752' is not valid for SegmentId 2",
"The value 'TW88752' is not valid for SegmentId 2"
]
},
"title": "One or more validation errors occurred.",
"status": 400,
"detail": "Refer to the errors property for additional details",
"instance": "/api/v3/SalesOrders"
}
... View more