My Products
Help
adrianm
PARTNER

Internal server error when creating sales order on V3

by adrianm

Using SalesOrderApi to create a sales order with order type "SE".

 

Order with same values can be created in GUI.

 

Visma.Net: POST: https://salesorder.visma.net/api/v3/SalesOrders
Headers: {
    Accept: application/json
    Authorization: <hidden>
    Accept-Encoding: gzip    Accept-Encoding: deflate
    Content-Type: application/json; charset=utf-8
    Content-Length: 215
}
{
	"type": "SE",
	"date": "2023-02-28T07:00:00",
	"description": "21804",
	"customer": {
		"id": "10004",
		"locationId": "ESKILSTUNA"
	},
	"orderLines": [
		{
			"inventoryId": "6004601L",
			"quantity": 5.0,
			"warehouseId": "7",
			"subaccount": {
				"1": "00"
			}
		}
	]
}
Response: 500 Internal Server Error
Headers: {
    Date: Tue, 28 Feb 2023 13:51:26 GMT
    Connection: keep-alive
    apigw-requestid: BDYChgKqAi0EJRQ=
    Content-Length: 0
}
6 REPLIES 6
Gabriella Hennings
CHAMPION *

by Gabriella Hennings

HI 

We are also experienceing the same error, some orders just don't work and we just get 500 error in return with, I can POST one order to one customer and then we can POST the same order to another customer and the we receive 500 error with no response message.

this feels really unstable.

Best regards
Gabriella Hennings
Cloud Connection AB
Yıldırım
VISMA

by Yıldırım

Hi Adrian, is it only happening with SE type ? 

adrianm
PARTNER

by adrianm

Yes, probably. I can create "TR" order in same tenant.

Accepted solution
Yıldırım
VISMA

by Yıldırım (Updated ‎01-03-2023 11:30 by Yıldırım VISMA )

I see, could you possibly try the same payload with the legacy salesOrder API to determine whether the root cause is company or the endpoint base ? 

adrianm
PARTNER

by adrianm

Works fine with "legacy".

(Sorry for the format. The extended formatting toolbar is not available anymore)

 

POST: https://integration.visma.net/API/controller/api/v2/salesorder
Headers: {
Accept: application/json
Authorization: <hidden>
Content-Type: application/json; charset=utf-8
Content-Length: 342
}
{
"lines": [
{
"subaccount": [
{
"segmentId": 1,
"segmentValue": "00"
}
],
"operation": "Insert",
"inventoryNumber": {
"value": "6004601L"
},
"warehouse": {
"value": "7"
},
"quantity": {
"value": 5.0
}
}
],
"orderType": {
"value": "SE"
},
"date": {
"value": "2023-03-02T00:00:00+01:00"
},
"customer": {
"value": "10004"
},
"location": {
"value": "ESKILSTUNA"
},
"description": {
"value": "21804"
}
}Response: 201 Created
Headers: {
Strict-Transport-Security: max-age=31536000; includeSubDomains Strict-Transport-Security: max-age=31536000; includeSubDomains
ipp-request-id: a975f496-d80f-4c8a-97c0-5d0464d6611b
X-Content-Type-Options: application/json
Pragma: no-cache
X-Handled-By: Visma-PX.Export/AuthenticationManagerModule
Referrer-Policy: origin-when-cross-origin
VnfInstanceId: ERP_SE_DEMO_0017
X-XSS-Protection: 1;mode=block
Cache-Control: no-cache
Date: Thu, 02 Mar 2023 11:46:26 GMT
Location: https://integration.visma.net/API/controller/api/v2/salesorder/SE/000004
Set-Cookie: <crumbs>; path=/; secure; expires=Wed, 01-Mar-2023 11:46:19 GMT; HttpOnly
Server: Apache/2.4.52 Server: (Debian) Server: OpenSSL/1.1.1n
Content-Length: 0
Expires: -1
}

Yıldırım
VISMA

by Yıldırım (Updated ‎02-03-2023 14:47 by Yıldırım VISMA )

Hello, could you please send "CompanyID" to the developersupport@visma.com ?