Order Management APIs
Get All Orders (GET)
Returns all orders in the system.
Route
|
URI |
/api/v1/orders/GetAllOrders |
|
Method |
GET |
|
Result |
JSON – Array of OrderModel |
Parameters
None
Response Structure
Returns array of OrderModel objects, each containing:
-
MetaKey: Order identifier
-
Requester: AccountModel of the requester
-
Grantees: Array of AccountModel for beneficiaries
-
RequestDate: Order creation date
-
RequestDateTimeString: Formatted date string
-
Comment: Requester’s comment
-
Resources: Array of OrderItemModel with ordered resources
Example
GET http://localhost/api/v1/orders/GetAllOrders
Example Response
[
{
"MetaKey": "order-12345",
"Requester": {
"UriKey": "john.doe@contoso.com",
"DisplayName": "John Doe",
"ResourceTypeGuid": "...",
"SerializedAccountId": "...",
"IsGroup": false,
"TypeId": 1
},
"Grantees": [{
"UriKey": "jane.smith@contoso.com",
"DisplayName": "Jane Smith",
"ResourceTypeGuid": "...",
"SerializedAccountId": "...",
"IsGroup": false,
"TypeId": 1
}],
"RequestDateTimeString": "2024-12-05 10:30:00",
"RequestDate": "2024-12-05T10:30:00Z",
"Comment": "Access needed for Project Alpha",
"Resources": [
{
"ResourceModel": {
"UriKey": "resource://contoso/shared",
"Name": "Shared Drive",
"DisplayPath": "/Shared/ProjectAlpha",
"ResourceType": 1,
"CanBeOrdered": true,
"HasChildren": false
},
"Status": "Pending",
"ApprovalHistory": []
}
]
}
]
Get All Orders Paged (GET)
Returns all orders with pagination support.
Route
|
URI |
/api/v1/orders/GetAllOrdersPaged |
|
Method |
GET |
|
Result |
JSON – PagedResult |
Parameters
|
Name |
Type |
Mandatory |
Description |
|
page |
int |
No |
Page number (default: 1) |
|
pageSize |
int |
No |
Number of items per page |
|
sortBy |
string |
No |
Field name to sort by |
|
sortOrder |
string |
No |
Sort direction (asc/desc) |
Response Structure
Returns PagedResult containing:
-
Items: Array of OrderModel objects
-
TotalCount: Total number of orders
-
PageNumber: Current page number
-
PageSize: Number of items per page
-
TotalPages: Total number of pages
Example
GET http://localhost/api/v1/orders/GetAllOrdersPaged?page=1&pageSize=50
Example Response
{
"Items": [
{
"MetaKey": "order-12345",
"Requester": {
"UriKey": "john.doe@contoso.com",
"DisplayName": "John Doe",
"IsGroup": false,
"TypeId": 1
},
"Grantees": [{
"UriKey": "jane.smith@contoso.com",
"DisplayName": "Jane Smith",
"IsGroup": false,
"TypeId": 1
}],
"RequestDateTimeString": "2024-12-05 10:30:00",
"RequestDate": "2024-12-05T10:30:00Z",
"Comment": "Access needed",
"Resources": []
}
],
"TotalCount": 150,
"PageNumber": 1,
"PageSize": 50,
"TotalPages": 3
}
Get Orders Requested By (GET)
Returns orders requested by the current user.
Route
|
URI |
/api/v1/orders/getOrdersRequestedBy |
|
Method |
GET |
|
Result |
Array of OrderModel |
Parameters
None
Example
GET http://localhost/api/v1/orders/getOrdersRequestedBy
{
"MetaKey": "order-12345",
"Requester": {
"UriKey": "john.doe@contoso.com",
"DisplayName": "John Doe",
"IsGroup": false,
"TypeId": 1
},
"Grantees": [{
"UriKey": "jane.smith@contoso.com",
"DisplayName": "Jane Smith",
"IsGroup": false,
"TypeId": 1
}],
"RequestDateTimeString": "2024-12-05 10:30:00",
"RequestDate": "2024-12-05T10:30:00Z",
"Comment": "Access needed",
"Resources": []
}
Get Orders Requested By Paged (GET)
Returns orders requested by the current user with pagination support.
Route
|
URI |
/api/v1/orders/GetOrdersRequestedByPaged |
|
Method |
GET |
|
Result |
JSON – Array of OrderModel |
Parameters
|
Name |
Type |
Mandatory |
Description |
|
page |
int |
No |
Page number (default: 1) |
|
pageSize |
int |
No |
Number of items per page |
Example
GET http://localhost/api/v1/orders/GetOrdersRequestedByPaged?page=1&pageSize=50
Get Orders Waiting For (GET)
Returns orders waiting for approval by the current user.
Route
|
URI |
/api/v1/orders/getOrdersWaitingFor |
|
Method |
GET |
|
Result |
JSON – Array of OrderModel |
Parameters
None
Example
GET http://localhost/api/v1/orders/getOrdersWaitingFor
Example Response
{
[
{
"MetaKey": "order-12345",
"Requester": {
"UriKey": "john.doe@contoso.com",
"DisplayName": "John Doe",
"IsGroup": false,
"TypeId": 1
},
"Grantees": [{
"UriKey": "jane.smith@contoso.com",
"DisplayName": "Jane Smith",
"IsGroup": false,
"TypeId": 1
}],
"RequestDateTimeString": "2024-12-05 10:30:00",
"RequestDate": "2024-12-05T10:30:00Z",
"Comment": "Access needed",
"Resources": []
}
]}
Get Orders Waiting For Paged (GET)
Returns orders waiting for approval with pagination support.
Route
|
URI |
/api/v1/orders/GetOrdersWaitingForPaged |
|
Method |
GET |
|
Result |
JSON – Array of OrderModel |
Parameters
|
Name |
Type |
Mandatory |
Description |
|---|---|---|---|
|
page |
int |
No |
Page number (default: 1) |
|
pageSize |
int |
No |
Number of items per page |
Example
GET http://localhost/api/v1/orders/GetOrdersWaitingForPaged?page=1&pageSize=50
{
"Orders": [
{
"MetaKey": "order-12345",
"Requester": {
"UriKey": "john.doe@contoso.com",
"DisplayName": "John Doe",
"IsGroup": false,
"TypeId": 1
},
"Grantees": [{
"UriKey": "jane.smith@contoso.com",
"DisplayName": "Jane Smith",
"IsGroup": false,
"TypeId": 1
}],
"RequestDateTimeString": "2024-12-05 10:30:00",
"RequestDate": "2024-12-05T10:30:00Z",
"Comment": "Access needed",
"Resources": []
}
],
"TotalOrders": 150}
Get Order Preview (GET)
Returns a preview of an order before submission.
Route
|
URI |
/api/v1/orders/getOrderPreview |
|
Method |
POST |
|
Result |
JSON – Array of OrderItemModel |
Parameters
{
"granteesAccountModelJsonStrings": [
{
"$type": "libExternalInterface.model.AccountModel, libExternalInterface",
"resourceTypeGuid": "00000000-0000-0000-0000-000000000000",
"serializedAccountId": null,
"uriKey": "guid://protected-networks.local/ad/9d4d978c-31be-4a6d-86ea-90003dca8053",
"displayName": "Pratikshit Chattopadhyay",
"provider": {
"$type": "libExternalInterface.model.TechnologyProvider, libExternalInterface",
"technologyKey": "ad",
"technologyDisplayName": "Active Directory",
"providerName": "protected-networks.local"
},
"isGroup": false,
"sid": "S-1-5-21-3538591785-2569434479-3236329609-38665",
"guid": "9d4d978c-31be-4a6d-86ea-90003dca8053",
"typeId": 11100
}
],
"resourceModelJsonStrings": [
{
"$type": "pn.openService.models.ResourceModel, pn.openService.interfaces",
"uriKey": "path://brn-cld-arm-561/fs/%5C%5Cbrn-cld-arm-561%5CC%24%5CSystem%20Volume%20Information?class=Directory",
"resourceType": 2,
"name": "System Volume Information",
"resourceTypeDescription": "File server - Directory",
"displayPath": "\\\\brn-cld-arm-561\\C$\\System Volume Information",
"categoryName": "Test Workflow",
"canBeOrdered": true,
"hasChildren": false,
"organizationId": "afd2fb6f-a3db-4db2-869c-e5d1f0a778de",
"description": "\\\\brn-cld-arm-561\\C$\\System Volume Information",
"templateSummary": null,
"properties": [],
"resourceOrderFormTemplate": {
"type": "Container",
"label": null,
"templates": [
{
"key": "FileServer",
"value": {
"type": "DropDownList",
"summary": "Modify",
"items": [
{
"$type": "pn.formTemplates.resourceTemplates.DropDownListFormTemplate+ValueDisplayValuePair, pn.formTemplates",
"value": "197052",
"displayValue": "Modify"
},
{
"$type": "pn.formTemplates.resourceTemplates.DropDownListFormTemplate+ValueDisplayValuePair, pn.formTemplates",
"value": "131242",
"displayValue": "Read & Execute"
}
],
"value": "197052",
"defaultValue": "197052",
"displayValue": "Modify",
"dynamicResultWasSet": false,
"dynamicQuery": null,
"isRequired": false,
"description": null,
"customError": null,
"allowApply": true,
"label": "File server",
"isEnabled": true,
"isEnabledRule": null,
"parsedIsEnabledRule": null,
"customAttributes": null,
"isHidden": false,
"isVisibleRule": null,
"parsedIsVisibleRule": null
},
"lowerKey": "fileserver"
},
{
"key": "_activationOptionsKey",
"value": {
"type": "AccountActivationOptions",
"summary": "",
"customAttributes": {
"$type": "System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[System.String, mscorlib]], mscorlib"
},
"isHidden": false,
"isVisibleRule": null,
"parsedIsVisibleRule": null,
"activationState": "0",
"activationDate": null,
"expirationDate": null,
"isExpiring": false,
"disableInactive": true,
"hideActivationOptions": false,
"activateImmediatelyLabel": null,
"isEnabled": true,
"isEnabledRule": null,
"parsedIsEnabledRule": null
},
"lowerKey": "_activationoptionskey"
}
],
"summary": null,
"customAttributes": null,
"isHidden": false,
"isVisibleRule": null,
"parsedIsVisibleRule": null
},
"isCreationalResource": false,
"hasCreationalResourceChild": false,
"iconBase64": null,
"isOrganization": false
}
]
}
Example
GET http://localhost/api/v1/orders/getOrderPreview
Example Response
[
{
"$type": "pn.openService.models.OrderItemModel, libOpenService",
"orderItemKey": "eccaaf07-5251-40d1-8a0e-b613a841726c",
"orderedResource": {
"$type": "pn.openService.models.ResourceModel, pn.openService.interfaces",
"uriKey": "path://brn-cld-arm-561/fs/%5C%5Cbrn-cld-arm-561%5CC%24%5CSystem%20Volume%20Information?class=Directory",
"resourceType": 2,
"name": "System Volume Information",
"resourceTypeDescription": "File server - Directory",
"displayPath": "\\\\brn-cld-arm-561\\C$\\System Volume Information",
"categoryName": "Test Workflow",
"canBeOrdered": true,
"hasChildren": false,
"organizationId": "afd2fb6f-a3db-4db2-869c-e5d1f0a778de",
"description": "\\\\brn-cld-arm-561\\C$\\System Volume Information",
"templateSummary": "Modify",
"properties": [],
"resourceOrderFormTemplate": {
"Type": "Container",
"label": null,
"templates": [
{
"key": "FileServer",
"value": {
"Type": "DropDownList",
"summary": "Modify",
"items": [
{
"$type": "pn.formTemplates.resourceTemplates.DropDownListFormTemplate+ValueDisplayValuePair, pn.formTemplates",
"value": "197052",
"displayValue": "Modify"
},
{
"$type": "pn.formTemplates.resourceTemplates.DropDownListFormTemplate+ValueDisplayValuePair, pn.formTemplates",
"value": "131242",
"displayValue": "Read & Execute"
}
],
"value": "197052",
"defaultValue": "197052",
"displayValue": "Modify",
"dynamicResultWasSet": false,
"dynamicQuery": null,
"isRequired": false,
"description": null,
"customError": null,
"allowApply": true,
"label": "File server",
"isEnabled": true,
"isEnabledRule": null,
"parsedIsEnabledRule": null,
"customAttributes": null,
"isHidden": false,
"isVisibleRule": null,
"parsedIsVisibleRule": null
}
},
{
"key": "_activationOptionsKey",
"value": {
"Type": "AccountActivationOptions",
"summary": "",
"customAttributes": {
"$type": "System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[System.String, mscorlib]], mscorlib"
},
"isHidden": false,
"isVisibleRule": null,
"parsedIsVisibleRule": null,
"activationState": 0,
"activationDate": null,
"expirationDate": null,
"isExpiring": false,
"disableInactive": true,
"hideActivationOptions": false,
"activateImmediatelyLabel": null,
"isEnabled": true,
"isEnabledRule": null,
"parsedIsEnabledRule": null
}
}
],
"summary": null,
"customAttributes": null,
"isHidden": false,
"isVisibleRule": null,
"parsedIsVisibleRule": null
},
"isCreationalResource": false,
"hasCreationalResourceChild": false,
"iconBase64": null,
"isOrganization": false
},
"orderStatus": "Open",
"orderStatusName": null,
"orderProblemStatus": "None",
"orderProblemStatusString": null,
"changeContextId": null,
"approveHistory": null,
"requiresExplicitConfirmation": false,
"nextApprovers": null,
"shouldSelectNextApprover": false,
"orderItemLabel": null,
"hasNotBeenUpdatedRecently": false,
"finalizationDate": null
}
]
Submit Order (POST)
Submit a new order for processing.
Route
|
URI |
/api/v1/orders/SubmitOrder |
|
Method |
POST |
|
Result |
JSON – OrderSubmissionResult |
Request Payload
OrderSubmissionModel containing:
|
Property |
Type |
Mandatory |
Description |
|---|---|---|---|
|
Requester |
AccountModel |
Yes |
Account submitting the order |
|
Grantees |
AccountModel[] |
Yes |
Accounts receiving the access |
|
Comment |
string |
No |
Requester’s comment |
|
Resources |
OrderItemModel[] |
Yes |
Resources being requested |
Response Structure
OrderSubmissionResult containing:
-
OrderId: Guid of the created order
-
Success: Boolean indicating submission success
-
Message: Status or error message
Example Request
POST http://localhost/api/v1/orders/SubmitOrder
Content-Type: application/json
{
"Requester": {
"UriKey": "user@domain.com",
"DisplayName": "John Doe",
"ResourceTypeGuid": "...",
"SerializedAccountId": "...",
"IsGroup": false,
"TypeId": 1
},
"Grantees": [{
"UriKey": "target@domain.com",
"DisplayName": "Jane Smith",
"ResourceTypeGuid": "...",
"SerializedAccountId": "...",
"IsGroup": false,
"TypeId": 1
}],
"Comment": "Access needed for project XYZ",
"Resources": [
{
"ResourceModel": {
"UriKey": "resource://domain/folder",
"Name": "Shared Folder",
"DisplayPath": "/Shared/Project",
"ResourceType": 1,
"CanBeOrdered": true,
"HasChildren": false,
"OrganizationId": "..."
}
}
]
}
Example Response
{
"OrderId": "123e4567-e89b-12d3-a456-426614174000",
"Success": true,
"Message": "Order submitted successfully"
}
Approve Order (POST)
Approves one or more order items.
Route
|
URI |
/api/v1/orders/ApproveOrderItems |
|
Method |
POST |
|
Result |
JSON – OrderApprovalResult |
Request Payload
Array of order item IDs (Guid strings) to approve.
|
Property |
Type |
Mandatory |
Description |
|---|---|---|---|
|
orderItemIds |
string[] |
Yes |
Array of order item IDs to reject |
|
comment |
string |
Yes |
Reason for approve |
{
"comment": "Approve",
"orderItems": [
{"OrderItemKey":"eccaaf07-5251-40d1-8a0e-b613a841726c"}
]
}
Response Structure
OrderApprovalResult containing:
-
Success: Boolean indicating if approval was successful
-
Message: Status or error message
-
ApprovedItems: Array of successfully approved item IDs
-
FailedItems: Array of item IDs that failed to approve
Example Request
POST http://localhost/api/v1/orders/ApproveOrderItems
Content-Type: application/json
["123e4567-e89b-12d3-a456-426614174001", "123e4567-e89b-12d3-a456-426614174002"]
Example Response
{
"Success": true,
"Message": "2 order items approved successfully",
"ApprovedItems": [
"123e4567-e89b-12d3-a456-426614174001",
"123e4567-e89b-12d3-a456-426614174002"
],
"FailedItems": []
}
Reject Order (POST)
Rejects one or more order items.
Route
|
URI |
/api/v1/orders/RejectOrderItems |
|
Method |
POST |
|
Result |
JSON – OrderRejectionResult |
Request Payload
Object containing:
{
"comment": "Reject",
"orderItems": [
{
"orderItemKey": "a9623f0c-1177-43f0-9e5b-a12bbdb6f2e1"
}
]
}
|
Property |
Type |
Mandatory |
Description |
|---|---|---|---|
|
orderItemIds |
string[] |
Yes |
Array of order item IDs to reject |
|
comment |
string |
Yes |
Reason for rejection |
Response Structure
OrderRejectionResult containing:
-
Success: Boolean indicating if rejection was successful
-
Message: Status or error message
-
RejectedItems: Array of successfully rejected item IDs
-
FailedItems: Array of item IDs that failed to reject
Example Request
POST http://localhost/api/v1/orders/RejectOrderItems
Content-Type: application/json
{
"orderItemIds": ["123e4567-e89b-12d3-a456-426614174001", "123e4567-e89b-12d3-a456-426614174002"],
"reason": "Does not meet security requirements"
}
Example Response
{
"Success": true,
"Message": "2 order items rejected successfully",
"RejectedItems": [
"123e4567-e89b-12d3-a456-426614174001",
"123e4567-e89b-12d3-a456-426614174002"
],
"FailedItems": []
}
Storno Order Item (POST)
Cancels (stornos) one or more order items.
Route
|
URI |
/api/v1/orders/StornoOrderItems |
|
Method |
POST |
|
Result |
JSON – StornoResult |
Request Payload
Array of order item IDs (Guid strings) to cancel.
|
Property |
Type |
Mandatory |
Description |
|---|---|---|---|
|
orderItemIds |
string[] |
Yes |
Array of order item IDs to reject |
|
comment |
string |
Yes |
Reason for Delete |
|
hardDelete |
Boolean |
Yes |
reason |
{
"orderItemKeys": [
"eb0fa8d8-dc34-4b21-8b37-0e974df63255"
],
"hardDelete": false,
"comment": "Delete"
}
Response Structure
StornoResult containing:
-
Success: Boolean indicating if cancellation was successful
-
Message: Status or error message
-
CancelledItems: Array of successfully cancelled item IDs
-
FailedItems: Array of item IDs that failed to cancel
Example Request
POST http://localhost/api/v1/orders/StornoOrderItems
Content-Type: application/json
["123e4567-e89b-12d3-a456-426614174001", "123e4567-e89b-12d3-a456-426614174002"]
Example Response
{
"Success": true,
"Message": "2 order items cancelled successfully",
"CancelledItems": [
"123e4567-e89b-12d3-a456-426614174001",
"123e4567-e89b-12d3-a456-426614174002"
],
"FailedItems": []
}
Email Order Item (POST)
Sends email notifications for order items.
Route
|
URI |
/api/v1/orders/EmailOrderItems |
|
Method |
POST |
|
Result |
JSON – EmailResult |
Request Payload
Object containing:
|
Property |
Type |
Mandatory |
Description |
|---|---|---|---|
|
orderItemIds |
string[] |
Yes |
Array of order item IDs to reject |
{
"orderItemKeys": [
"eb0fa8d8-dc34-4b21-8b37-0e974df63255"
]
}
Response Structure
EmailResult containing:
-
Success: Boolean indicating if emails were sent successfully
-
Message: Status or error message
-
SentCount: Number of emails sent
-
FailedCount: Number of emails that failed
Example Request
POST http://localhost/api/v1/orders/EmailOrderItems
Content-Type: application/json
Example Response
{
"$type": "System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[pn.openService.models.OrderResultModel, libOpenService]], mscorlib"
}
Get Root Resources (GET/POST)
Returns the root resources available for ordering.
Route
|
URI |
/api/v1/orders/GetRootResources |
|
Method |
POST |
|
Result |
JSON – Array of ResourceModel |
Parameters
Null
Response Structure
Returns array of ResourceModel objects, each containing:
-
UriKey: Resource’s unique identifier
-
ResourceType: Type of the resource
-
Name: Display name
-
DisplayPath: Resource path
-
CanBeOrdered: Boolean indicating if orderable
-
HasChildren: Boolean indicating if has child resources
-
Description: Optional description
-
Properties: Additional metadata
-
ResourceOrderFormTemplate: Form template if orderable
Example
GET http://localhost/api/v1/orders/GetRootResources
Example Response
[
{
"UriKey": "resource://contoso/root1",
"ResourceType": 1,
"Name": "Shared Drives",
"ResourceTypeDescription": "Active Directory",
"DisplayPath": "/Shared",
"CanBeOrdered": false,
"HasChildren": true,
"OrganizationId": "123e4567-e89b-12d3-a456-426614174000",
"Description": "Root level shared resources",
"Properties": [
{"Key": "ChildCount", "Value": "15"}
],
"ResourceOrderFormTemplate": null,
"IsCreationalResource": false,
"HasCreationalResourceChild": false,
"IconBase64": null,
"IsManualInteractionRequired": false
}
]
Get Child Resources (POST)
Returns child resources for a given parent resource.
Route
|
URI |
/api/v1/orders/GetChildResources |
|
Method |
POST |
|
Result |
JSON – Array of ResourceModel |
Request Payload
OrderableChildResourceRequest object:
|
Property |
Type |
Mandatory |
Description |
|---|---|---|---|
|
OrganizationId |
Guid |
Yes |
The organization identifier |
|
ResourceType |
string |
Yes |
The type of resource |
|
ParentKey |
string |
Yes |
The parent resource key |
Response Structure
Returns array of ResourceModel objects representing child resources.
Example Request
POST http://localhost/api/v1/orders/GetChildResources
Content-Type: application/json
{
"OrganizationId": "123e4567-e89b-12d3-a456-426614174000",
"ResourceType": "AD",
"ParentKey": "resource://contoso/shared"
}
Example Response
[
{
"UriKey": "resource://contoso/shared/finance",
"ResourceType": 1,
"Name": "Finance Folder",
"DisplayPath": "/Shared/Finance",
"CanBeOrdered": true,
"HasChildren": false,
"OrganizationId": "123e4567-e89b-12d3-a456-426614174000",
"Description": "Finance department documents",
"Properties": [],
"ResourceOrderFormTemplate": {
"Fields": []
},
"IsCreationalResource": false,
"IconBase64": null
},
{
"UriKey": "resource://contoso/shared/hr",
"ResourceType": 1,
"Name": "HR Folder",
"DisplayPath": "/Shared/HR",
"CanBeOrdered": true,
"HasChildren": true,
"OrganizationId": "123e4567-e89b-12d3-a456-426614174000",
"Description": "Human resources documents",
"Properties": [
{"Key": "ChildCount", "Value": "5"}
],
"ResourceOrderFormTemplate": null,
"IsCreationalResource": false,
"IconBase64": null
}
]