Skip to main content
Solved

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

  • November 7, 2022
  • 1 reply
  • 97 views

Forum|alt.badge.img+2
  • Varsity I
  • 283 replies

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

Best answer by Evgeny Afanasiev

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


 

View original
Did this topic help you find an answer to your question?

1 reply

Evgeny Afanasiev
Acumatica Moderator
Forum|alt.badge.img
  • Acumatica Moderator
  • 31 replies
  • Answer
  • November 9, 2022

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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings