Options
			
				
					
	
			
		
	- Mark Topic as New
 - Mark Topic as Read
 - Float this Topic for Current User
 - Bookmark
 - Subscribe
 - Mute
 - Printer Friendly Page
 
			
				
					
						
							Unhandled error creating a inventory receipt with a transfer number
						
					
					
				
			
		
	
			
	
	
	
	
	
‎18-09-2023
14:09
 
by
MarcusHedlund
Hi,
The procedure of creating a inventory receipt with a transfer number is fully possible in Visma.NET but when trying to do the same thing with the API there is an unhandled error thrown.
Full request:
POST: https://integration.visma.net/API/controller/api/v1/inventoryReceipt
Headers: {
    Accept: application/json
    Authorization: <hidden>
    Accept-Encoding: gzip    Accept-Encoding: deflate
    Request-Id: |lakrQ37sjdI=.b3f622d3_4.
    Content-Type: application/json; charset=utf-8
    Content-Length: 346
}
{"transferNumber":{"value":"2700198"},"receiptLines":[{"warehouseId":{"value":"10"},"operation":"Insert","inventoryNumber":{"value":"121500"},"quantity":{"value":5.000000}},{"warehouseId":{"value":"10"},"operation":"Insert","inventoryNumber":{"value":"122210"},"quantity":{"value":7.000000}}],"date":{"value":"2023-08-26T12:01:38.8295738+02:00"}}
Response: 500 Internal Server Error
Headers: {
    Date: Sat, 26 Aug 2023 10:01:43 GMT
    Server: Nginx
    Strict-Transport-Security: max-age=31536000; includeSubDomains    Strict-Transport-Security: max-age=31536000; includeSubDomains
    ipp-request-id: 6910054c-2769-4f0b-9b48-1a7fb3cf73dc
    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
    Cache-Control: no-cache
    X-XSS-Protection: 1;mode=block
    Set-Cookie: <crumbs>;  path=/;  secure;  expires=Fri, 25-Aug-2023 10:01:42 GMT;  HttpOnly
    Connection: close
    Transfer-Encoding: chunked
    Content-Type: application/json; charset=utf-8
    Expires: -1
}
{"message":"VismaId: 6910054c-2769-4f0b-9b48-1a7fb3cf73dc. Error creating inventory receipt Error: An error in processing of field TransferNbr: Object reference not set to an instance of an object.."}
		2 REPLIES 2
	
		
		
			
			
			
					
	
			Have you tried posting it first and then following up with a put with the transferNumber?
We'll have a look at it.
Thank you.
Hi,
Thank you.
Yes, I have tried that. I get a 204 response but the transfer number field is not updated/populated on the inventory receipt, so no luck there either.
Example:
PUT: https://integration.visma.net/API/controller/api/v1/inventoryReceipt/2700193
Headers: {
    Accept: application/json
    Authorization: <hidden>
    Accept-Encoding: gzip    Accept-Encoding: deflate
    Request-Id: |mNxxPaa2S54=.73b6c807_5.
    Content-Type: application/json; charset=utf-8
    Content-Length: 38
}
{"transferNumber":{"value":"2700188"}}
Response: 204 No Content
Headers: {
    Date: Fri, 25 Aug 2023 14:50:32 GMT
    Server: Nginx
    Strict-Transport-Security: max-age=31536000; includeSubDomains    Strict-Transport-Security: max-age=31536000; includeSubDomains
    ipp-request-id: f8e62102-bed6-49b2-96e7-fc42bdce0789
    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
    Cache-Control: no-cache
    X-XSS-Protection: 1;mode=block
    Set-Cookie: <crumbs>;  path=/;  secure;  expires=Thu, 24-Aug-2023 14:50:31 GMT;  HttpOnly
    Expires: -1
}