How Can We Help?

EzzyBills User Guide

API to match bill with purchase order

EzzyBills can be used to match bill with an existing purchase order (PO).

For Custom/API integrations this an be done by

  1. Send your PO data to EzzyBills via API
  2. Create a workflow which does PO matching and then upload the invoice to this workflow.
  3. Fetch back the PO match result.

I. Send PO data to EzzyBills

To send PO data to EzzyBills, you can use our SOAP or REST API. The REST example is below

public class PODetails
    {
        public string PONumber { get; set; }
        public DateTime PODate { get; set; }
        public string Vendor { get; set; }
        public int Line { get; set; } 
        public string ItemCode { get; set; }
        public decimal Quantity { get; set; }
        public decimal UnitPrice { get; set; }
        public int Taxed { get; set; }
        public decimal LineTotal { get; set; }
        public string Description { get; set; }
    }
{
 List<PODetails> ven = new List<PODetails>();
 ven.Add(new PODetails() { PONumber = "PO-22", PODate = new DateTime(2023, 05, 01), Description="blah" });
 ven.Add(new PODetails() { PONumber = "PO-23", PODate = new DateTime(2023, 05, 02), ItemCode= "5920", Description= "INDUSTRIAL GAS TRADEFLAME++400G", UnitPrice=13.56m,  Quantity=1m, LineTotal=14.92m });
 ven.Add(new PODetails() { PONumber = "PO-23", PODate = new DateTime(2023, 05, 02), ItemCode = "6350", Description = "DRILL BIT STEP P&N++4-25MM", UnitPrice = 41.99m, Quantity = 1m, LineTotal = 46.19m });
 ven.Add(new PODetails() { PONumber = "PO-23", PODate = new DateTime(2023, 05, 02), ItemCode = "6351", Description = "DRILL BIT SET JOBBER FROST++25PC", UnitPrice = 47.47m, Quantity = 1m, LineTotal = 52.22m });

 JsonConvert.DefaultSettings = () => new JsonSerializerSettings
 {
    DateFormatHandling = Newtonsoft.Json.DateFormatHandling.MicrosoftDateFormat //  Dates are written in the Microsoft JSON format, e.g. "\/Date(1198908717056)\/" (ms since EPOCH).
 };
 var jsonbody = JsonConvert.SerializeObject(ven.ToArray());


 var request = new RestRequest($"/Rest/addPurchaseOrders?APIKey={APIKey}&target={10}", Method.POST);   //38 indictes po relates to work guru
 request.AddHeader("content-type", "application/json");
 request.AddParameter("application/json", jsonbody, ParameterType.RequestBody);

 var response3 = client.Execute(request);
 Debug.Assert(response3.StatusCode == HttpStatusCode.OK);
}

II. Create a match-PO workflow in EzzyBills

You need a workflow like this screen shot below. This will check that the PO exists and then does the match. If you add a webhook to the end of the workflow then we will notify you when the matching is complete.

[screenshot: line matching PO with bill]

III. Fetch back the PO match result

Upload a bill to EzzyBills, once the workflow completes, you can fetch the PO match result using codes below.

var request = new RestRequest("/Rest/MyMatchedPOData?invoiceid=555");  //where the docid=555
request.AddParameter("APIKey", APIKey);   //need to add your API key
var response3 = client.Execute(request);
Debug.Assert(response3.StatusCode == HttpStatusCode.OK);

This request will return a URL that contains json which indicates the PO lines matching. You can use this information to match the bill lines with PO lines.

Here is example of PO match result: one line item for each line on bill.

  • If the line item is null, then no match is found.
  • if line item is NOT null, then it will contain the PO line that it matches with.

(an image to come)

Sections of Article