API Reference for Hauling Software Invoicing
To access our Invoicing API, contact us so that we can provide you with the necessary credentials and API URL endpoints.
All API calls are POST request to the endpoint URL, with JSON data returned.
Using the API to retrieve all invoice status categories
Action: get_invoice_status
Values Passed: api_key, action
Return: Notice, Result (array)
Example: {API URL}?api_key={APIKEY}&action=get_invoice_status
Example Returned Data
{ "Notice": "Success!", "Result": { "2": { "invoice_status": "104", "name": "Bill at Month End", "order_num": "2" }, "1": { "invoice_status": "105", "name": "Out for Signature", "order_num": "1" } } }
Using the API to retrieve all invoices in a specific invoice status
Action: get_by_id
Values passed: api_key, action, invoice_status
Return: Notice, Result (array)
Example: {API URL}?api_key={APIKEY}&action=get_by_id&invoice_status={HS STATUS ID}
Example Returned Data
{ "Notice": "Success!", "Result": [ "117446", "217076", "217077", "217078", "217389", "217390", "217391", "217507", "217508" ] }
Using the API to retrieve data from a specific invoice
Action: get
Values Passed: api_key, action, invoice_no
Return: invoice_number, invoice_status, customer, customer_ext_id, lease, yard, invoice_total, invoice_processed_by, pdflink, current_status, signed_invoice (array), ip, fieldtickets (array)
Example: {API URL}?api_key={APIKEY}&action=get&invoice_no={HS INVOICE ID}
{ "invoice_number": "217389", "invoice_status": "Bill at Month End", "customer": "PetroFind", "customer_ext_id": false, "lease": "Griffin Mountain 2-10H", "yard": "El Reno Yard",<span class="fr-marker" data-id="0" data-type="false" style="display: none; line-height: 0;"></span><span class="fr-marker" data-id="0" data-type="true" style="display: none; line-height: 0;"></span> "invoice_total": "614.40", "invoice_processed_by": "Hauling Software", "pdflink": "{PDF URL LINK}", "current_status": false, "signed_invoice": [ null ], "ip": "{IGNORE}", "fieldTickets": [ { "ticketNumber": "1154383", "created_date": "12\/14\/2018 10:27 AM", "ticket_scan": "{PDF LINK}", "last_updated": "01\/02\/2019 1:22 PM", "company": "PetroFind", "lease": "Griffin Mountain 2-10H", "driver": "Simon Helberg", "truck": "8978", "starttime": "1544808600", "disposal": "Pearcy SWD", "dispatchcomments": "", "complete_comments": "", "paperticket": "1214-39", "loadtime": "1544823000", "complete_time": "12\/14\/2018 3:30 PM", "pickupcomments": "", "bill_bbls": "129", "bill_hours": "4", "bill_type": "BBLs\/QTY", "bill_yard": "Ada Yard", "price_per_bbl": "1.00", "trailer": "400", "custom_ordered_by": "", "admin_approved_by": "466", "invoice_approved_by": "466", "additional_line_items": null, "charge_disposal": [ { "name": "Pearcy SWD", "charge_bbls": "129", "charge_price": "0.60" } ] }, { "ticketNumber": "1211883", "created_date": "01\/02\/2019 10:18 AM", "ticket_scan": "{PDF LINK}", "last_updated": "01\/02\/2019 1:22 PM", "company": "PetroFind", "lease": "Griffin Mountain 2-10H", "driver": "Jim Parsons", "truck": "8978", "starttime": "1539091800", "disposal": "Pearcy SWD", "dispatchcomments": "", "complete_comments": "", "paperticket": "1231-26", "loadtime": "1539106200", "complete_time": "10\/09\/2018 12:30 PM", "pickupcomments": "", "bill_bbls": "131", "bill_hours": "4", "bill_type": "BBLs\/QTY", "bill_yard": "Ada Yard", "price_per_bbl": "1.00", "trailer": "400", "custom_ordered_by": "", "admin_approved_by": "466", "invoice_approved_by": "466", "additional_line_items": null, "charge_disposal": [ { "name": "Pearcy SWD", "charge_bbls": "131", "charge_price": ".60" } ] } ] }
Using the API to change the status of a specific invoice
Action: update
Values Passed: api_key, action, invoice_no, invoice_status (where the invoice status is the NEW invoice status id)
Return: Success or Fail with the new status name returned
Example:
Example: {API URL}?api_key={APIKEY}&action=update&invoice_no={HS INVOICE ID}&invoice_status={HS STATUS ID}
{ "Sucess!": "Updated Invoice Status to Out for Signature" }