Approve a Bill

If you are using the REST API to integrate MYOB Acumatica with an external system, this external system can approve a bill.

Testing of the Request

Before you test the code below, you need to do the following to configure your client application and the MYOB Acumatica instance to be used:

  1. Deploy a new MYOB Acumatica instance with the U100 dataset. For details on deploying an instance, see To Deploy an MYOB Acumatica Instance.
  2. On the Enable/Disable Features (CS100000) form, enable the Inventory and Order Management and Approval Workflow features, or make sure that they are enabled.
  3. On the form toolbar of the Assignment and Approval Maps (EP205500) form, click Add Approval Map.
  4. On the Approval Maps (EP205015) form, which opens, configure a new approval map as follows:
    1. In the Name box, type Bill Approval.
    2. In the Entity Type box, select Bills and Adjustments.
    3. In the Steps pane, click Add Step.
    4. Select the Rule tree item that has appeared.
    5. On the Conditions tab, click Add Row, and specify the following settings in the row:
      • Active: Selected
      • Entity: Vendor
      • Field Name: Vendor
      • Condition: Equals
      • Value: IRS
    6. On the Rule Actions tab, change the approval settings to the following:
      • Approver: Employee
      • Employee: Anna Johnson
    7. Save the approval map.
  5. On the Accounts Payable Preferences (AP101000) form, make the following changes:
    1. On the General tab, in the Data Entry Settings section, select the Require Approval of Bills Prior to Payment check box.
    2. On the Approval tab, add a row to the table, and specify the following settings in the row:
      • Active: Selected
      • Type: Bill
      • Approval Map: Bill Approval
      • Pending Approval Notification: AP Bill
    3. Save your changes.
  6. On the Bills and Adjustments (AP301000) form, open the 000159 bill.
  7. On the form toolbar, click Remove Hold, then click Save.
  8. If you use Postman as the client application for testing, in the IntegrationDevelopmentGuide.postman_collection.json collection (which is located in the IntegrationDevelopment\Help folder of the Help-and-Training-Examples repository on GitHub), make sure the collection variables have the proper values.
  9. To sign in to the instance in the client application, use the tenant name (which you specified when you created the instance), the HEADOFFICE branch, the johnson name, and the 123 password.

Request

You can use the following example of an HTTP request to approve the 000159 AP bill.

Tip: In the request example below, <MYOB Acumatica instance URL> is the URL of the MYOB Acumatica instance (such as https://my.acumatica.com/MyInstance). You can omit the instance name in the URL (that is, you can use https://my.acumatica.com) if the instance is installed in the root of the website.
POST /Approve HTTP/1.1
Host: [<MYOB Acumatica instance URL>]/entity/Default/23.200.001/Bill
Accept: application/json
Content-Type: application/json

{
    "entity": {
        "Type": {"value": "Bill"},
        "ReferenceNbr": {"value": "000159"}
    },
    "parameters": {}
}