About the GET POSections API

The POSections API is a GET Endpoint used to view the PO and Receipt Amount values. The API compares the PO Receipt Amount to the Invoice Total amount to determine if the PO should be closed using the TMT/WorkOptima automated process.

This API is necessary to get the PO Receipt Amount, needed to calculate whether the PO Amount is within the acceptable variance of the invoice amount.

The integration uses the combination of the PO OrderID and OrderNum as the unique identifier for the action.

Minimum Requirements

  • The minimum TMT version is 2025.3.1.856

  • Shop Prefixes must be enabled for Purchase Order Numbers.

  • The Integration Toolkit module must be enabled.

  • You must have a WorkOptima license.

  • Imaging Settings must be configured for WorkOptima.

    1. Open TMT Web.

    2. Go to Menu > Configuration > Imaging Settings > Generic Imaging Configuration. The Imaging Settings page opens.

    3. In the heading bar:

      1. Set the Type to AMSEnterprise.

      2. Set the Viewer to GenericImageViewer. The Generic Imaging Configuration section opens.

    4. For the Server field under Web Service (URL), enter https://document-service.app.workoptima.com/document/v1/processes/2c2fd33c-2660-4a6c-b354-481e82ac80a2/latest-doc?fileField=Image

    5. Leave the User Id and Password fields blank. They are not required for this integration.

    6. Near the upper-right corner of the page, select Save Configuration.

For the API to work successfully, it requires a PONUMBER from the TMT database. That is a purchase order number, not a repair order number. The API sends the TMT PONUMBER to the integration, which maps that value to a WorkOptima OrderNum. WorkOptima then sends that OrderNum back to TMT.

You must enable Shop Prefixes for Purchase Orders if you intend to use this integration. This ensures that unique PO Numbers are issued by TMT for each combination of Shop Number and PO Number. You can set up Shop Prefixes on the Shop Masters Orders tab.

POSections API Workflow

The POSections API completes these steps:

  1. Calls the POSections API with the PO Number from the invoice to get the PO Receipt Amount.

  2. Compares the PO Receipt Amount (TotalReceivedReceipts) to the Invoice Amount.

  3. Closes the PO if the PO Amount (TotalAmt) and Invoice Amount match or if the value is within the variance threshold.

    Note: WorkOptima has provided TMT users with an option to define the variance threshold. You can define the variance threshold in WorkOptima as a percentage (+/- x%) of the total mismatch or a fixed dollar amount.

  4. Handles the success and failure of messages.

    1. Provide a confirmation message if the difference matches and the integration closes the PO.

    2. Provide an error message if the difference does not match and leaves the PO status unchanged.

Payload Definitions for TMT POs from ORDERS table

  • ORDERS table

    • OrderID: Represents the TMT unique PO order ID number. This is not the same as a PO Number.

    • OrderNum: Represents the user-facing TMT PO Number (has a maximum of 12 characters).

    • ShopId: Represents the TMT Shop Number where the PO was created.

    • Vendor: Represents the TMT Vendor ID on the PO.

    • Opened: Represents the TMT Opened Date/Time hh:mm:ss (user date).

  • ORDERSEC table

    • Section: Represents the TMT unique PO item ID number known as a PO Section.

  • PURORDER table

    • POType: Represents the PO Type (Standard, Blanket, Credit, Vendor RO).

    • ShipToId: Represents the Ship To Shop Number.

    • ShipName: Represents the Ship To Shop Name.

  • Calculated Values

    • TotalAmt: Represents the PO Total Amount (the sum of all line amounts).

    • Total: Represents the Section Receipt Total Amount (the sum of all lines that are in RECEIVED or CLOSED status).

    • TotalReceivedReceipts: Represents the total of all received receipts for a PO. This value is used to review the value of the TotalAmt field to determine whether the Total Received Amounts are equal to (or greater than) the TotalAmt to determine if the PO should be closed.

    • Optional values: These values are not likely to be known by the image viewer processor at the time that the GET process is invoked:

      • ORDERID: TMT System number

      • VENDORID: TMT Vendor ID

POSections API Error Use Case Guide

POSections API Error Message Description Corrective Action

No records found for the given parameters.

PO Number is invalid or not found in TMT

Task: One or more of the parameters that were provided are not found in TMT.

TMT User:

  • Verify the PO Number, OrderID, and VendorID combination provided.

  • A Standard PO Status must be in RECEIVED or CLOSED status.

  • A VRO PO must be set to COMPLETE status.

Image Integration User: No action required.

More than one Receipt exists. Please assign the Receipt number.

Multiple Receipts exist on the PO

Task: More than one receipt exists for the PO and the Invoice cannot be processed without the receipt number.

TMT User: Review the PO Receipts on the PO in TMT.

WorkOptima User: Respond to the error message with the preferred receipt number from the TMT PO.

Example Payloads

Vendor RO: 000000000045 Standard Blanket PO: 000000000050

Response body for VRO 000000000045

Response body for PO 000000000050

Standard Credit PO: 000000000300

Standard PO: 000000000066

Response body for Credit PO 000000000300

Response body for PO 000000000066