My Products
Help
Stefan Hult
PARTNER

Transferorder and receipt

by Stefan Hult

Hi

 

In the GUI I can connect a transferorder to a Purchase Receipts, and as you see below it works fine.

 

StefanHult_1-1651170039975.png

 

 

StefanHult_0-1651169995583.png

 

If I try the same in the API it doesn't work as expected.

 


{
  "purchaseOrders": [
    {
      "orderNbr": "4300046"
    }
  ]
}

Error adding purchase orders to receipt: Open order with number 4300046 could not be found"

 

It doesn't  matter is I use the ordertype or not. I have tested different combinations, but non of them work.

 

5 REPLIES 5
Stefan Hult
PARTNER

by Stefan Hult

Okay I sum up the conversation.

What you mean, is that we can't use the action/addpurchaseorder endpoint to automatically add the transfer order and all it's lines. With other words, the same routine that works in the GUI.

Instead we have to  POST a receipt with all information from the transferOrder? 

 

Accepted solution
Magnus Johnsen
VISMA

Hi,

Yes, the addPurchaseOrder action can only add purchaseOrders, and is a different action than the "add transfer" action in the UI:

2022-05-02 08_52_33-Visma.net Integrations Documentation - Brave.png

Add purchaseOrder only allows for types: RegularOrder, DropShip, Blanket, StandardBlanket.

 

Minimal information that needs to be in the JSON when you post a transferReceipt seems to be this:

{
  "receiptType": {
    "Value": "TransferReceipt"
  },
  "warehouseId": {
    "Value": "2"
  },
  "date": {
    "Value": "2022-04-22T00:00:00.000Z"
  },
  "hold": {
    "Value": false
  },
  "lines": [
    {
      "operation": "Insert",
      "transferOrderNbr": {
        "Value": "000108"
      },
     
      "transferOrderType": {
        "Value": "TransferOrder"
      },
       "transferOrderLineNbr": {
        "Value": 1
      }
    }
  ]
}
 
So atleast what lineNumbers from what transferOrder needs to be included.
If you want an action exposed for linking transferReceipts, please make a post in the ideas part of the forum.
Thank you. 
Accepted solution
Magnus Johnsen
VISMA

by Magnus Johnsen

Hi,

When using a tranferReceipt and transferOrder you need to use the fields that belong to transfers.

TransferOrders are created in the SalesOrder module and not via the PurchaseOrder module.

Please try Post the transferReceipt with a JSON as the example below:

{
  "receiptType": {
    "Value": "TransferReceipt"
  },
  "warehouseId": {
    "Value": "2"
  },
  "date": {
    "Value": "2022-04-22T00:00:00.000Z"
  },
  "hold": {
    "Value": false
  },
  "lines": [
    {
      "operation": "Insert",
      "transferOrderNbr": {
        "Value": "000108"
      },
      "transferOrderLineNbr": {
        "Value": 1
      },
      "transferOrderType": {
        "Value": "TransferOrder"
      },
      "receiptQty": {
        "Value": 1
      },
      "lineNbr": {
        "Value": 0
      }
    }
  ]
}
Stefan Hult
PARTNER

Hi Magnus

Just to be sure, what you described, isn't that step 1 and not step 2?

Not sure what you mean, the workflow for this is:
1. Create salesOrder of type TransferOrder

2. Create purchaseReceipt of type transferReceipt with a transferOrder added to the lines.