Zoomed Image

Purchase Order Approval API Calls

xAssets Procurement Guide
Purchase Order Approval API Calls

Purchase Order Approval API Calls

This page documents the API calls available for querying and managing purchase order approvals programmatically. These are useful for building custom approval workflows or integrating with external systems.


GetPurchaseOrderApprovalLevel

Returns the current approval level required for a purchase order.

Arguments:

# Name Required Description
1 PurchaseOrderID Yes The ID of the purchase order

Returns: A string containing a number from 1 to 6 representing the next approval level required. Levels that do not require approval are skipped. Returns an empty string if no approval is required or all approvals have been granted.


LookupPurchaseOrderApprovers

Returns the list of custodians who can approve a specific purchase order, starting from a given level or the current level.

Arguments:

# Name Required Description
1 PurchaseOrderID Yes The ID of the purchase order
2 Approval Level No The lowest level (1-6) to include. Defaults to the PO's current approval level.

Returns: A CSV list of CustodianIDs. This includes approvers at the specified level and all higher levels, since a higher-level approver can approve the PO and skip lower levels. Returns an empty string if no further approval is required or no approvers are found.


GetCustodianPOApprovalLevel

Returns the approval level at which a specific custodian can approve a purchase order.

Arguments:

# Name Required Description
1 PurchaseOrderID Yes The ID of the purchase order
2 CustodianID No The custodian to check. Defaults to the currently logged-in user's custodian.
3 NextLevel No Boolean. If true, returns the next level the custodian can approve at (starting from the PO's current level) rather than their highest possible level.

Returns: A string containing a number from 1 to 6. By default, this is the highest level the custodian can approve at. If NextLevel is true, it is the next applicable level starting from the PO's current approval level.