My Products
Help
ViktorGastro
CONTRIBUTOR **

nextgen salesorder API POST salesorder - Subaccount incorrectly formatted

by ViktorGastro

Hello!

 

I'm working with the nextgen salesorder API to create a post request and add a new order to the system. However i get the following error message:
"Could not find Subaccount segment value for SegmentId: 2 and Value: 09020".

After some trial and error i found that this is connected to my inventory items that are getting added to the order. 

My inventory item Subaccount segments have the following structure:
ID 1 = Product, Length 2, adjustment: left, validate: yes
ID 2 = Supplier, length: 5, adjustment: left, validate: yes
ID 3 = customer group, length: 3, adjustment: left, validate: yes

My postman post request looks like this: 

"

{
    "type": "SO",
    "description": "Order: 26778",
    "customer": {
        "id": "10965"
    },
    "print": {
        "noteOnInternalDocuments": true
    },
    "orderLines":[
        {
            "inventoryId": "30-999978",
            "quantity": 6
        }
    ]
}"

The above error is in response to the inventoryId stated in my request. In visma.net on the inventory item page i can see that the correct subaccount structure is: "90-90203-000" But if i try to add the segment id and value as suggested by the error output i do get my order created in the system but with the following subaccount structure: "90-09020-902". 

I've tried turning off the validation for the affected segment id:s but no luck. 
Any help with getting my items in correctly would be greatly appreciated.
1 REPLY 1
Accepted solution
Magnus Johnsen
VISMA

by Magnus Johnsen

Hi,

Since you are not sending any subaccount values in your JSON, we would suggest that you check the subaccount set in the items "generel ledger accounts":

2022-01-06 10_36_09-Stock items - Brave.png

The values you have set under the second segment in subaccounts(ScreenId=CS203000&DimensionID=SUBACCOUNT&SegmentID=2):2022-01-06 10_39_05-Segment values - Brave.png

As well as the combinations you have set under subaccounts(ScreenId=GL203000):

2022-01-06 10_39_16-Subaccounts - Brave.png