My Products
Help
SitterIT
CONTRIBUTOR ***

SalesOrder api subaccount issue mandatory

by SitterIT

In the new SalesOrder api, I face the same issue as in the case described here , having to provide the  correct subaccount array on orderlines.

 

If we look at the "old" integration.visma.net api, there is no need to include subaccount on orderlines. This should still be optional in the new api, and when omited, the orderline should inherrit the the default subaccont set on that inventroy in Visma.net. Just like it works today.

 

From what I can see today, one have to either :

- specify the subaccount in a settings-file or such.

   This will fail as soon as one changes the subaccount dimentions in Visma.net

 

- do a GET on inventory to get the subaccount of an inventory to set on orderlines

 

- do a GET using the integration.visma.net api to get subaccount from there.

 

It's not always one wish to set subaccount, and thats why I still want it to be optional.

18 REPLIES 18
Accepted solution
Yıldırım
VISMA

by Yıldırım

Thanks for the confirmations @SitterIT & @Anders_Traventus !

Accepted solution
Joni Wolff
PARTNER

by Joni Wolff

We have now deployed a fix for this, could you please retest now and check that it works.

SitterIT
CONTRIBUTOR ***

by SitterIT

Now it works as it should. Thanks.

by Anders_Traventus

At our side it seams to be working correct now!

by Yıldırım

@SitterIT & @Anders_Traventus 

Could you please provide Financials ERP Company IDs where you're using POST - SalesOrder Service API ? 

SitterIT
CONTRIBUTOR ***

by SitterIT

Hi, I'm using client 2106142 with the request posted earlier

I trying with ERP ID 1303428

Can you provide the POST JSON used in the 1303428-DEMO Mer Sweden AB

Here it is.

{
    "type": "HI",
    "description": "Anläggnings-ID: 123456789012345678\n\nUppsäkring: Nej\n\nSkattereduktion för grön teknik: Nej\n\n",
    "customer": {
        "id": "500851",
        "order": "REF-123",
        "refNo": "TEST_123_456",
        "locationId": "500914"
    },
    "print": {
        "descriptionOnInvoice": false,
        "noteOnInternalDocuments": false,
        "noteOnExternalDocuments": false
    },
    "shipping": {
        "residentialDelivery": false,
        "saturdayDelivery": false,
        "insurance": false
    },
    "billing": {
        "contact": {
            "name": "InvoiceCustomerName",
            "phone1": "10736301480",
            "email": "InvoiceCustomer@Invoice.se"
        },
        "address": {
            "line1": "Gatan 1 Invoice",
            "postalCode": "25111",
            "city": "Staden Invoice",
            "countryId": "SE"
        }
    },
    "orderLines": [{
            "inventoryId": "4125101-01",
            "unitOfMeasure": "STYCK",
            "quantity": 1.0,
            "unitCost": 0.0,
            "unitPrice": 4800.0,
            "discountPercent": 0.0,
            "discountAmount": 0.0,
            "hasManualDiscount": false,
            "operation": "Issue"
        }
    ]
}
SitterIT
CONTRIBUTOR ***

by SitterIT

Hi, this is still not fixed. I just tried with this:

{
  "type""SO" ,
  "customer": {    "id""10001" },
  "orderLines": [ { "inventoryId""105","quantity"1,"unitPrice"100} ]  
}

SitterIT_1-1675340557691.png

 

However, If one includes the subaccount, then it works:

{
    "type""SO",
  "customer": {
    "id""10001"
  },
  "orderLines": [  
      {"inventoryId""105","quantity"1,"unitPrice"100,"subaccount":{ "1""00""2""000""3""0000"}}
    ] 
  }
 
So we still need to provide subaccount when creating the salesorder.

by Anders_Traventus (Updated ‎02-02-2023 14:47 by Anders_Traventus PARTNER )

We are having the same issue, and when specifiying the subaccount on the rows it goes throw.

by Magnus Johnsen

Hi,

We'll inform the development team, and get back to you when we have more information.

Thank you. 

SitterIT
CONTRIBUTOR ***

by SitterIT

Great! So that means that this will work in SalesOrder API just as it works in the integration.visma.net . And that we do not need to provide subaccount in the post-command.

by Yıldırım

Hi, that's true, as long as company setup allows such as oriented with the Segment (Subaccount) validation & default values.

by Yıldırım

Hello Rene, 

 

could you retry your transaction and inform us accordingly ? 

by Yıldırım

Hello Rene, 

 

we confirm your report that SalesOrder Service API doesn't seem fetching the default subaccount values when those are not provided in the POST Json, even though the Subaccount is set as "nullable" in the model (NewSalesOrderCommand). 

SO.jpg

This has been reported to the Sales Order Service API team, we'll keep you informed. 

SitterIT
CONTRIBUTOR ***

by SitterIT

Hi, do you know when this issue is fixed? 

by Yıldırım