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:
- Deploy a new MYOB Acumatica instance with the U100 dataset. For details on deploying an instance, see To Deploy an MYOB Acumatica Instance.
- On the Enable/Disable Features (CS100000) form, enable the Inventory and Order Management and Approval Workflow features, or make sure that they are enabled.
- On the form toolbar of the Assignment and Approval Maps (EP205500) form, click Add Approval Map.
- On the Approval Maps (EP205015) form, which
opens, configure a new approval map as follows:
- In the Name box, type Bill Approval.
- In the Entity Type box, select Bills and Adjustments.
- In the Steps pane, click Add Step.
- Select the Rule tree item that has appeared.
- 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
- On the Rule Actions tab, change the approval
settings to the following:
- Approver: Employee
- Employee: Anna Johnson
- Save the approval map.
- On the Accounts Payable Preferences
(AP101000) form, make the following changes:
- On the General tab, in the Data Entry Settings section, select the Require Approval of Bills Prior to Payment check box.
- 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
- Save your changes.
- On the Bills and Adjustments (AP301000) form, open the 000159 bill.
- On the form toolbar, click Remove Hold, then click Save.
- 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.
- 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": {}
}