Solved

Send POReceiptNbr and PoReceipt Line columns values to Bill via Rest request

  • 7 November 2022
  • 1 reply
  • 52 views

Userlevel 4
Badge +2

Hi,

I need to send these values 

for new Bill, which I am creating via such request

{

  "entity": {

    "VendorRef": {

      "value": "Test"

    },

    "DueDate": {

      "value": "05/15/2022"

    },

    "Vendor": {

      "value": "0000000018"

    },

    "Date": {

      "value": "10/3/2022"

    },

    "Description": {

      "value": "docID \"1004\""

    },

    "ReleaseBill": {

      "value": "True"

    },

    "PostPeriod": {

      "value": "10-2022"

    },

    "Details": [

      {

        "InventoryID": {

          "value": "3050"

        },

        "Description": {

          "value": "Landed Cost Accrual"

        },

        "UOM": {

          "value": "EACH"

        },

        "Project": {

          "value": "X"

        },

        "Branch": {

          "value": "4011"

        },

        "ExtendedCost": {

          "value": "829"

        },

        "POReceiptNbr": {

          "value": "R0662"

        },

        "POReceiptLine": {

          "value": "1"

        },

        "Subaccount": {

          "value": "000-00"

        },

        "Account": {

          "value": "22725"

        }

      }

    ],

    "Hold": {

      "value": "false"

    }

  },

  }

}

What I am doing wrong in body of the request ? The state of the receipt that I am trying to send is “Released” and it was not used before.

Thanks in advance

icon

Best answer by Evgeny Afanasiev 9 November 2022, 12:05

View original

1 reply

Userlevel 3
Badge

Hi Ivan,

Here are couple of general notes regarding the request body:

the

{

  "entity": {….

clause is placed in the beginning of the request body for invocation of Actions in POST requests. To create or update the Document you would need to use PUT request and body should not contain this entity master node.

Another point, when we create or manipulate the document that has multiple keys, like Type and Ref number, we have to specify type for creating a document (taking that ref number is auto generated) and specify both (all) keys when updating a record. There none of it mentioned in the request body. So if you are creating a Document type of Bill using Bill Entity of Endpoint that should be specified in the request body.

Please also note that there is not ReleaseBill field mapped neither to Bill not to PurchaseReceipt entity. There is an Action ReleaseBill but this action should be invoked on already created document, when the current status implies that this Action is available.

Please see below the call the call that creates the Bill:
 

PUT {{sitename}}/entity/Default/20.200.001/Bill

{
    "BranchID": {
        "value""PRODWHOLE"
    },
    "CashAccount": {
        "value""10200"
    },
    "CurrencyID": {
        "value""USD"
    },
    "Date": {
        "value""2022-11-09T00:00:00+03:00"
    },
    "Description": {},
    "PostPeriod": {
        "value""112022"
    },
    "Project": {
        "value""X"
    },
    "Type": {
        "value""Bill"
    },
    "Vendor": {
        "value""AAVENDOR"
    },
    "VendorRef": {
        "value""test"
    },
    "Details": [
        {
            "Account": {
                "value""20100"
            },
            "Amount": {
                "value"247.0700
            },
            "Branch": {
                "value""PRODWHOLE"
            },
            "Description": {
                "value""Inventory Purchase Accrual"
            },
            "ExtendedCost": {
                "value"247.0700
            },
            "InventoryID": {
                "value""AACOMPUT01"
            },
            "NonBillable": {
                "value"false
            },
            "POLine": {
                "value"1
            },
            "POReceiptNbr": {
                "value""PR001709"},
            "POReceiptType": {
                "value""Receipt"
            },
            "Project": {
                "value""X"
            },
            "Qty": {
                "value"1.000000
            },
            "Subaccount": {
                "value""ELE000"
            },
            "TaxCategory": {
                "value""EXEMPT"
            },
            "TransactionDescription": {
                "value""Acer Laptop Computer"
            },
            "UnitCost": {
                "value"247.070000
            },
            "UOM": {
                "value""EA"
            }
        }
    ]
}

 

And funny enough it will created the Bill linked to PO although we only specified the Receipt parameters :

However if you create a PurchaseReceipt without creating of the Purchase Order before - very same request (just with adjusted POReceiptNbr) will do the trick:

The reason here might be in the Billing Based on value that specified on each line of the Purchase Order, and could take values as Order or Receipt

I think this is done to avoid situations that we pay twice on ordering and on receiving. In Sales Demo this is not editable, so probably related to some configuration of individual item or item class.

 

Hope that clarify the matter a little


 

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved