My Products
Help
Margarita G
CONTRIBUTOR **

Purchase receipt does not appears in the Purchase Order when the receipt is created through the API

by Margarita G

Hello.  

 

When we manually  created a Purchase Receipt of an Purchase Order, that receipt appears in Puchase Receipts section of the Purchase Order.

 

 

pr.png

 

But when we made the same action through the API, using PurchaseReceiptBasic method, the receipt is not displayed in that section inside the PO.

 

This is the json that we are using:  code

 

What we are making bad? thanks

 

Thanks by your help.

 

Margarita

 

 

 

3 REPLIES 3

by Magnus Johnsen

Hi,

To make the link purchaseOrder-> purchaseReceipt work you need to use the action endpoints purchaseReceipt - add purchaseOrder or add purchaseOrderLines:

2020-09-29 07_52_30-Visma.net Integrations Documentation.png

 

The easiest way to do this is to follow the workflow below when you are ready to create your receipt:

POST empty purchaseReceipt for the supplier:

{
    "receiptType": {
    "value": "PoReceipt"
  },"supplierId": {
    "value": "50000"
  }
}

 

POST PurchaseReceipt/{receiptNumber}/action/addpurchaseorder:

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

 or addpurchaseorderlines:

{
  "purchaseOrderLines": [
    {
      "orderNbr": "string",
      "lines": [
        {
          "lineNbr": "string"
        }
      ]
    }
  ]
}

 

When this has been done, the link between the documents will be showing in the UI as well.

Margarita G
CONTRIBUTOR **

Thanks Magnus

 

We associated the PO when we created the PO Receipt, and we have the link in the PO Receipt to the PO:

IPOLink.png

And that link correctly navigates to the PO:

 

EmptyReceipts.png

 

But in the PO I can not see the PO Receipt.

 

When I made this action manually, not with the API, PO Receipts have the link to the PO and also are displayed in PO Receipt´s section in the PO

 

This is the used code 

 

Thanks 

 

Margarita

 

 

 

Accepted solution
Yıldırım
VISMA

by Yıldırım (Updated ‎15-10-2020 14:38 by Yıldırım VISMA )

Hello,

 

In order to be able to establish document links between Purchase Receipt & Order the following endpoints need to be used.

https://integration.visma.net/API-index/
purchaseReceipt.png

 




 

1) POST an empty Purchase Receipt :  POST /controller/api/v1/PurchaseReceipt

{
 "receiptType": {
 "value": "PoReceipt"
 },
 "supplierId": {
 "value": "00005"
 },
 "date": {
 "value": "2020-10-15"
 }
}

2) For Adding Purchase Order to newly created Purchase Receipt POST /controller/api/v1/PurchaseReceipt/{PurchaseReceiptNumber}/action/addpurchaseorder

{
 "purchaseOrders": [
 {
 "orderNbr": "PURCHASE ORDER NUMBER"
 }
 ]
}

2.1) For Adding Purchase Order Line to newly created Purchase Receipt POST controller/api/v1/PurchaseReceipt/{PurchaseReceiptNumber}/action/addpurchaseorderlines

{
 "purchaseOrderLines": [
 {
 "orderNbr": "PURCHASE ORDER NUMBER",
 "lines": [
 {
 "lineNbr": "PURCHASE ORDER LINE NUMBER"
 }
 ]
 }
 ]
}


Following aforementioned operations will correctly,

  • transfer Discount Etc fields from the Purchase Order to the Purchase Receipt Lines.
  • establish references between Purchase Order <> Purchase Receipt that can be seen under Purchase Order : Purchase Receipts tab