P4W utilizes OData when querying database through API calls. Following example retrieves first 20 purchase orders (including corresponding warehouse and assigned clients and users if applicable) sorted by creation date.
GET
https://{tenant_name}.p4warehouse.com/odata/PurchaseOrder
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
{
"@odata.context": "https://doc1.p4warehouse.com/odata/$metadata#PurchaseOrder(Warehouse(Id,WarehouseCode),Vendor(Id,VendorCode,CompanyName),Client(Id,Name),AssignedUser(Id,Username),DockDoor(Id,Name))",
"@odata.count": 6,
"value": [
{
"PurchaseOrderNumber": "PO-0000033",
"WarehouseId": "1ab1f713-a451-4019-9e3c-25624374508c",
"PurchaseOrderState": "Draft",
"Carrier": null,
"ReferenceNumber": "1234567890",
"Reference1": null,
"Reference2": null,
"Reference3": null,
"Container": null,
"Comments": null,
"CancelDate": null,
"RequiredDate": null,
"ReleaseDate": null,
"ReceivingStarted": null,
"ReceivingCompleted": null,
"CloseDate": null,
"TotalLines": 2,
"TotalQuantity": 4.00,
"UploadDate": null,
"UploadedSuceeded": null,
"UploadMessage": null,
"AppointmentNumber": null,
"AppointmentDate": null,
"ParentBackOrderId": null,
"DockDoorId": null,
"ClientId": null,
"VendorId": "a69a50b4-4116-4525-8d35-43be41822250",
"IsWarehouseTransfer": false,
"WarehouseTransferPickTicketId": null,
"AssignedUserId": null,
"Tag1": null,
"Tag2": null,
"Tag3": null,
"Tag4": null,
"Tag5": null,
"Info1": null,
"Info2": null,
"Info3": null,
"Info4": null,
"Info5": null,
"Info6": null,
"Info7": null,
"Info8": null,
"Info9": null,
"Info10": null,
"Id": "1f263997-ad5a-46d4-819e-52bc1b6834c5",
"DateCreated": "2023-08-18T16:29:46.343921Z",
"Warehouse": {
"Id": "1ab1f713-a451-4019-9e3c-25624374508c",
"WarehouseCode": "01"
},
"Vendor": {
"Id": "a69a50b4-4116-4525-8d35-43be41822250",
"VendorCode": "AB01",
"CompanyName": "A and B Supplier"
},
"Client": null,
"AssignedUser": null,
"DockDoor": null
},
{
"PurchaseOrderNumber": "PO-0000023",
"WarehouseId": "1ab1f713-a451-4019-9e3c-25624374508c",
"PurchaseOrderState": "NotReceived",
"Carrier": null,
"ReferenceNumber": null,
"Reference1": null,
"Reference2": null,
"Reference3": null,
"Container": null,
"Comments": null,
"CancelDate": null,
"RequiredDate": null,
"ReleaseDate": "2023-05-05T12:52:38.9370681-04:00",
"ReceivingStarted": null,
"ReceivingCompleted": null,
"CloseDate": null,
"TotalLines": 1,
"TotalQuantity": 400.00,
"UploadDate": null,
"UploadedSuceeded": null,
"UploadMessage": null,
"AppointmentNumber": null,
"AppointmentDate": null,
"ParentBackOrderId": null,
"DockDoorId": null,
"ClientId": "91c64445-04d0-41da-a9ce-f05c0db7d4d4",
"VendorId": "68511bc9-2d5b-4fcc-8a93-10434e049e58",
"IsWarehouseTransfer": false,
"WarehouseTransferPickTicketId": null,
"AssignedUserId": null,
"Tag1": null,
"Tag2": null,
"Tag3": null,
"Tag4": null,
"Tag5": null,
"Info1": null,
"Info2": null,
"Info3": null,
"Info4": null,
"Info5": null,
"Info6": null,
"Info7": null,
"Info8": null,
"Info9": null,
"Info10": null,
"Id": "9256e6be-edc4-42f8-88af-7a3d2349ab1c",
"DateCreated": "2023-05-05T16:51:30.4246728Z",
"Warehouse": {
"Id": "1ab1f713-a451-4019-9e3c-25624374508c",
"WarehouseCode": "01"
},
"Vendor": {
"Id": "68511bc9-2d5b-4fcc-8a93-10434e049e58",
"VendorCode": "GES",
"CompanyName": "General Electronic Store"
},
"Client": {
"Id": "91c64445-04d0-41da-a9ce-f05c0db7d4d4",
"Name": "02"
},
"AssignedUser": null,
"DockDoor": null
},
{
"PurchaseOrderNumber": "PO-0000020_1",
"WarehouseId": "1ab1f713-a451-4019-9e3c-25624374508c",
"PurchaseOrderState": "NotReceived",
"Carrier": null,
"ReferenceNumber": null,
"Reference1": null,
"Reference2": null,
"Reference3": null,
"Container": null,
"Comments": null,
"CancelDate": null,
"RequiredDate": null,
"ReleaseDate": "2022-07-26T11:15:59.4947735-04:00",
"ReceivingStarted": null,
"ReceivingCompleted": null,
"CloseDate": null,
"TotalLines": 1,
"TotalQuantity": 75.00,
"UploadDate": null,
"UploadedSuceeded": null,
"UploadMessage": null,
"AppointmentNumber": null,
"AppointmentDate": null,
"ParentBackOrderId": "51ebe7a2-fd82-447b-86ca-0674921fe8ab",
"DockDoorId": null,
"ClientId": "ce54af79-2587-4053-8c65-b13734f4bf39",
"VendorId": "0d3ff2a8-8b8a-49a4-a606-8ff73cf32754",
"IsWarehouseTransfer": false,
"WarehouseTransferPickTicketId": null,
"AssignedUserId": null,
"Tag1": null,
"Tag2": null,
"Tag3": null,
"Tag4": null,
"Tag5": null,
"Info1": null,
"Info2": null,
"Info3": null,
"Info4": null,
"Info5": null,
"Info6": null,
"Info7": null,
"Info8": null,
"Info9": null,
"Info10": null,
"Id": "e750898c-649f-4832-8cce-e6bf4f47db62",
"DateCreated": "2022-07-22T18:49:11.3110899Z",
"Warehouse": {
"Id": "1ab1f713-a451-4019-9e3c-25624374508c",
"WarehouseCode": "01"
},
"Vendor": {
"Id": "0d3ff2a8-8b8a-49a4-a606-8ff73cf32754",
"VendorCode": "BNBS",
"CompanyName": "Bed and Bath Supplies"
},
"Client": {
"Id": "ce54af79-2587-4053-8c65-b13734f4bf39",
"Name": "01"
},
"AssignedUser": null,
"DockDoor": null
},
{
"PurchaseOrderNumber": "PO-0000018",
"WarehouseId": "1ab1f713-a451-4019-9e3c-25624374508c",
"PurchaseOrderState": "Draft",
"Carrier": null,
"ReferenceNumber": null,
"Reference1": null,
"Reference2": null,
"Reference3": null,
"Container": null,
"Comments": null,
"CancelDate": "2022-07-16T00:00:00-04:00",
"RequiredDate": "2022-07-15T00:00:00-04:00",
"ReleaseDate": null,
"ReceivingStarted": null,
"ReceivingCompleted": null,
"CloseDate": null,
"TotalLines": 2,
"TotalQuantity": 300.00,
"UploadDate": null,
"UploadedSuceeded": null,
"UploadMessage": null,
"AppointmentNumber": null,
"AppointmentDate": null,
"ParentBackOrderId": null,
"DockDoorId": "ca381bc7-bb89-4b59-941b-b361d0b5297e",
"ClientId": null,
"VendorId": "a69a50b4-4116-4525-8d35-43be41822250",
"IsWarehouseTransfer": false,
"WarehouseTransferPickTicketId": null,
"AssignedUserId": null,
"Tag1": null,
"Tag2": null,
"Tag3": null,
"Tag4": null,
"Tag5": null,
"Info1": null,
"Info2": null,
"Info3": null,
"Info4": null,
"Info5": null,
"Info6": null,
"Info7": null,
"Info8": null,
"Info9": null,
"Info10": null,
"Id": "45baf65c-6917-4cfa-91df-2c1bb0ec6296",
"DateCreated": "2022-07-22T17:40:19.2814114Z",
"Warehouse": {
"Id": "1ab1f713-a451-4019-9e3c-25624374508c",
"WarehouseCode": "01"
},
"Vendor": {
"Id": "a69a50b4-4116-4525-8d35-43be41822250",
"VendorCode": "AB01",
"CompanyName": "A and B Supplier"
},
"Client": null,
"AssignedUser": null,
"DockDoor": {
"Id": "ca381bc7-bb89-4b59-941b-b361d0b5297e",
"Name": "DOCK1"
}
},
{
"PurchaseOrderNumber": "PO-0000017",
"WarehouseId": "1ab1f713-a451-4019-9e3c-25624374508c",
"PurchaseOrderState": "NotReceived",
"Carrier": null,
"ReferenceNumber": null,
"Reference1": null,
"Reference2": null,
"Reference3": null,
"Container": null,
"Comments": null,
"CancelDate": null,
"RequiredDate": null,
"ReleaseDate": "2022-07-21T13:11:30.4780619-04:00",
"ReceivingStarted": null,
"ReceivingCompleted": null,
"CloseDate": null,
"TotalLines": 1,
"TotalQuantity": 1000.00,
"UploadDate": null,
"UploadedSuceeded": null,
"UploadMessage": null,
"AppointmentNumber": null,
"AppointmentDate": null,
"ParentBackOrderId": null,
"DockDoorId": null,
"ClientId": null,
"VendorId": "c24b4e27-b007-4648-9bfb-febb2b02f093",
"IsWarehouseTransfer": false,
"WarehouseTransferPickTicketId": null,
"AssignedUserId": null,
"Tag1": null,
"Tag2": null,
"Tag3": null,
"Tag4": null,
"Tag5": null,
"Info1": null,
"Info2": null,
"Info3": null,
"Info4": null,
"Info5": null,
"Info6": null,
"Info7": null,
"Info8": null,
"Info9": null,
"Info10": null,
"Id": "bbefbb2c-71ef-4773-bbf9-88f254584589",
"DateCreated": "2022-07-21T17:11:19.5902215Z",
"Warehouse": {
"Id": "1ab1f713-a451-4019-9e3c-25624374508c",
"WarehouseCode": "01"
},
"Vendor": {
"Id": "c24b4e27-b007-4648-9bfb-febb2b02f093",
"VendorCode": "ZBRK",
"CompanyName": "Brick Company"
},
"Client": null,
"AssignedUser": null,
"DockDoor": null
},
{
"PurchaseOrderNumber": "PO-0000015",
"WarehouseId": "1ab1f713-a451-4019-9e3c-25624374508c",
"PurchaseOrderState": "NotReceived",
"Carrier": null,
"ReferenceNumber": null,
"Reference1": null,
"Reference2": null,
"Reference3": null,
"Container": null,
"Comments": null,
"CancelDate": "2022-07-31T00:00:00-04:00",
"RequiredDate": "2022-07-29T00:00:00-04:00",
"ReleaseDate": "2022-07-21T13:11:02.2448617-04:00",
"ReceivingStarted": null,
"ReceivingCompleted": null,
"CloseDate": null,
"TotalLines": 1,
"TotalQuantity": 300.00,
"UploadDate": null,
"UploadedSuceeded": null,
"UploadMessage": null,
"AppointmentNumber": "4",
"AppointmentDate": "2022-07-29T10:30:00-04:00",
"ParentBackOrderId": null,
"DockDoorId": "ca381bc7-bb89-4b59-941b-b361d0b5297e",
"ClientId": "e21f7253-b17b-42f8-bacc-ff968df4fcfc",
"VendorId": "eb540d7a-5793-4778-b5a3-b0b168e98529",
"IsWarehouseTransfer": false,
"WarehouseTransferPickTicketId": null,
"AssignedUserId": null,
"Tag1": null,
"Tag2": null,
"Tag3": null,
"Tag4": null,
"Tag5": null,
"Info1": null,
"Info2": null,
"Info3": null,
"Info4": null,
"Info5": null,
"Info6": null,
"Info7": null,
"Info8": null,
"Info9": null,
"Info10": null,
"Id": "0062c189-cbf2-4e03-b288-a7568c1011e0",
"DateCreated": "2022-07-20T16:55:58.1381169Z",
"Warehouse": {
"Id": "1ab1f713-a451-4019-9e3c-25624374508c",
"WarehouseCode": "01"
},
"Vendor": {
"Id": "eb540d7a-5793-4778-b5a3-b0b168e98529",
"VendorCode": "WAGS",
"CompanyName": "Wearing Apparel General Store"
},
"Client": {
"Id": "e21f7253-b17b-42f8-bacc-ff968df4fcfc",
"Name": "03"
},
"AssignedUser": null,
"DockDoor": {
"Id": "ca381bc7-bb89-4b59-941b-b361d0b5297e",
"Name": "DOCK1"
}
}
]
}
```
Use OData syntax to personalize queries through API calls.
https://{tenant_name}.p4warehouse.com/odata/PurchaseOrder
?$expand=Warehouse($select=Id,WarehouseCode),Vendor($select=Id,VendorCode,CompanyName),Client($select=Id,Name),AssignedUser($select=Id,Username),DockDoor($select=Id,Name)
&$orderby=PurchaseOrderNumber desc
&$top=20
&$filter=PurchaseOrderState ne 'Closed'&$count=true
$expand
String
A list of collections or data entities to be included in the response
$orderby
String
Date created
$top
Double
Number of purchase orders to retrieve
$count
Boolean
Whether to displays total number of purchase orders available
ApiKey*
String
System API key