Get Purchase Orders Based on the Data Security of the User Role

You can use the Purchase Order REST resource to get details of purchase orders based on your privileges and data security.

The Purchase Order resource is no longer limited to the Integrator. Now you can access the Purchase Order resource as a Buyer, Accounts Payable, or Line of Business user. You can get purchase orders based on your privileges and data access security.

To access this resource, you need the View Purchase Order privilege that is inherited in the Employee role or other job roles, like Buyer. You can access purchase orders based on your data security. As a buyer, you will be able to see the same purchase orders you can see on the user interface, based on your agent access setup. As an Accounts Payable user, you will need a job role with the AP_VIEW_AP_PO_DOC_TXN_DATA data privilege so that you can view the purchase orders for the bill-to business units to which you have access. As a Line of Business user, you need the Purchase Analysis role so that you can view the purchase orders for the requisitioning business unit to which you have access. These requisitioning business units are the primary assignment of the employment record or the business units assigned to the purchase analysis role.

If you have multiple job roles across different functions, you can use the resource to get all purchase orders based on the data access for your roles. If you want to view all purchase orders by job function, you can specify an intent. Here are the supported intents:

  • APUser: Get the approved purchase orders for the bill-to business units to which you have access.
  • POUser: Get all purchase orders based on your agent access.
  • LOBUser: Get the approved purchase orders for the requisitioning business units to which you have access.

Let's consider Mary Brown has both Buyer and Accounts Payable Specialist roles, which is not a likely scenario. If Mary runs a query without specifying an intent, all purchase orders allowed by her agent access as well as all purchase orders with bill-to business units to which she has access as an Accounts Payable Specialist are returned. If Mary specifies the intent to be POUser, then only the purchase orders based on the agent access are returned.

This table shows Mary Brown with the assigned job roles:

  • Buyer role who has agent access Access Other Agent's Document = Full for Vision Operations
  • Accounts Payable Specialist role who has to access to Vision Italy business unit
POHeaderId Procurement Business Unit Bill-to Business Unit Status Access Notes
1001 Vision Operations Vision Operations Open The buyer role will be able to view the purchase orders.
1002 Vision Italy Vision Italy Open The AP role will be able to view the purchase orders.
1003 Vision Italy Vision Italy Incomplete The AP role will not be able to view the purchase orders that are not approved. The buyer role does not have access to this Procurement business unit.

Let's discuss these scenarios:

  • Request without Intent
  • Request with Intent=POUser

Request without Intent

Let's consider Mary is running a request without intent. The response payload will contain information for both PO1001 and PO1002 purchase orders.

Example URL

Use this resource URL format.

GET

curl -u username:password -X GET -H "Content-Type:text/xml" -d 'request payload' 
https://servername/fscmRestApi/resources/version/purchaseOrders

Example Response

Here's an example of the response body in JSON format.

{
	"items": [
	{
		"POHeaderId": 1001,
		"OrderNumber": "1000223",
		"SoldToLegalEntityId": 204,
		"SoldToLegalEntity": "Vision Operations",
		"CreationDate": "2009-09-13T22:31:03.530+00:00",
		"StatusCode": "OPEN",
		"Status": "Open",
		"ProcurementBUId": 204,
		"ProcurementBU": "Vision Operations",
		"RequisitioningBUId": 204,
		"RequisitioningBU": "Vision Operations",
		"BillToBUId": 204,
		"BillToBU": "Vision Operations",
		"Revision": 0,
		"BuyerId": 100010024202242,
		"Buyer": "Robinson,Andrew",
		"SupplierId": 100000011547508,
		"Supplier": "cPO-Supplier09",
		"SupplierSiteId": 100000011547553,
		"SupplierSite": "cPO-SITE01",
		"SupplierContactId": null,
		"SupplierContact": null,
		"BillToLocationId": 204,
		"BillToLocation": "V1- New York City",
		"ConversionRateType": null,
		"Ordered": 4400.00,
		"CurrencyCode": "USD",
		"Currency": "US Dollar",
		"TotalTax": 0,
		"Total": 4400.00,
		"Description": "zBIA CO 7.1,CO 7.2\n",
		"RequiredAcknowledgmentCode": "N",
		"RequiredAcknowledgment": "None",
		"SupplierOrder": null,
		"ReferenceNumber": null,
		"AcknowledgmentDueDate": null,
		"PaymentTermsId": 10003,
		"PaymentTerms": "45 Net (terms date + 45)",
		"CarrierId": null,
		"Carrier": null,
		"ModeOfTransportCode": null,
		"ModeOfTransport": null,
		"ServiceLevelCode": null,
		"ServiceLevel": null,
		"ShippingMethod": "",
		"FreightTermsCode": "Due",
		"FreightTerms": "Due",
		"FOBCode": "Origin",
		"FOB": "Origin",
		"RequiresSignatureFlag": false,
		"AcknowledgeWithinDays": null,
		"BuyerManagedTransportFlag": false,
		"PayOnReceiptFlag": false,
		"ConfirmingOrderFlag": null,
		"NoteToSupplier": null,
		"NoteToReceiver": null,
	}
	{
		"POHeaderId": 1002,
		"OrderNumber": "1000223",
		"SoldToLegalEntityId": 204,
		"SoldToLegalEntity": "Vision Operations",
		"CreationDate": "2009-09-13T22:31:03.530+00:00",
		"StatusCode": "OPEN",
		"Status": "Open",
		"ProcurementBUId": 204,
		"ProcurementBU": "Vision Operations",
		"RequisitioningBUId": 204,
		"RequisitioningBU": "Vision Operations",
		"BillToBUId": 204,
		"BillToBU": "Vision Operations",
		"Revision": 0,
		"BuyerId": 100010024202242,
		"Buyer": "Robinson,Andrew",
		"SupplierId": 100000011547508,
		"Supplier": "cPO-Supplier09",
		"SupplierSiteId": 100000011547553,
		"SupplierSite": "cPO-SITE01",
		"SupplierContactId": null,
		"SupplierContact": null,
		"BillToLocationId": 204,
		"BillToLocation": "V1- New York City",
		"ConversionRateType": null,
		"Ordered": 4400.00,
		"CurrencyCode": "USD",
		"Currency": "US Dollar",
		"TotalTax": 0,
		"Total": 4400.00,
		"Description": "zBIA CO 7.1,CO 7.2\n",
		"RequiredAcknowledgmentCode": "N",
		"RequiredAcknowledgment": "None",
		"SupplierOrder": null,
		"ReferenceNumber": null,
		"AcknowledgmentDueDate": null,
		"PaymentTermsId": 10003,
		"PaymentTerms": "45 Net (terms date + 45)",
		"CarrierId": null,
		"Carrier": null,
		"ModeOfTransportCode": null,
		"ModeOfTransport": null,
		"ServiceLevelCode": null,
		"ServiceLevel": null,
		"ShippingMethod": "",
		"FreightTermsCode": "Due",
		"FreightTerms": "Due",
		"FOBCode": "Origin",
		"FOB": "Origin",
		"RequiresSignatureFlag": false,
		"AcknowledgeWithinDays": null,
		"BuyerManagedTransportFlag": false,
		"PayOnReceiptFlag": false,
		"ConfirmingOrderFlag": null,
		"NoteToSupplier": null,
		"NoteToReceiver": null,
	}
	]
}

Request with Intent

Let's consider Mary is running a request with Intent=POUser. The response payload will contain information only for PO1001 purchase orders.

Example URL

Use this resource URL format.

GET

curl -u username:password -X GET -H "Content-Type:text/xml" -d 'request payload' 
https://servername/fscmRestApi/resources/version/purchaseOrders?finder=findByIntent;Intent=POUser"

Example Response

Here's an example of the response body in JSON format.

{
	"items": [
	{
		"POHeaderId": 1001,
		"OrderNumber": "1000223",
		"SoldToLegalEntityId": 204,
		"SoldToLegalEntity": "Vision Operations",
		"CreationDate": "2009-09-13T22:31:03.530+00:00",
		"StatusCode": "OPEN",
		"Status": "Open",
		"ProcurementBUId": 204,
		"ProcurementBU": "Vision Operations",
		"RequisitioningBUId": 204,
		"RequisitioningBU": "Vision Operations",
		"BillToBUId": 204,
		"BillToBU": "Vision Operations",
		"Revision": 0,
		"BuyerId": 100010024202242,
		"Buyer": "Robinson,Andrew",
		"SupplierId": 100000011547508,
		"Supplier": "cPO-Supplier09",
		"SupplierSiteId": 100000011547553,
		"SupplierSite": "cPO-SITE01",
		"SupplierContactId": null,
		"SupplierContact": null,
		"BillToLocationId": 204,
		"BillToLocation": "V1- New York City",
		"ConversionRateType": null,
		"Ordered": 4400.00,
		"CurrencyCode": "USD",
		"Currency": "US Dollar",
		"TotalTax": 0,
		"Total": 4400.00,
		"Description": "zBIA CO 7.1,CO 7.2\n",
		"RequiredAcknowledgmentCode": "N",
		"RequiredAcknowledgment": "None",
		"SupplierOrder": null,
		"ReferenceNumber": null,
		"AcknowledgmentDueDate": null,
		"PaymentTermsId": 10003,
		"PaymentTerms": "45 Net (terms date + 45)",
		"CarrierId": null,
		"Carrier": null,
		"ModeOfTransportCode": null,
		"ModeOfTransport": null,
		"ServiceLevelCode": null,
		"ServiceLevel": null,
		"ShippingMethod": "",
		"FreightTermsCode": "Due",
		"FreightTerms": "Due",
		"FOBCode": "Origin",
		"FOB": "Origin",
		"RequiresSignatureFlag": false,
		"AcknowledgeWithinDays": null,
		"BuyerManagedTransportFlag": false,
		"PayOnReceiptFlag": false,
		"ConfirmingOrderFlag": null,
		"NoteToSupplier": null,
		"NoteToReceiver": null,
	}
	]
}