Finance Approval Rule APIs
To update finance approval rules, use the following APIs.
List of finance approval rules
To get the list of all finance approval rules, issue a GET financeApprovalRules request.
The following JSON code snippet is an example of a GET financeApprovalRules request.
GET https://sparkrock365.api.bc.dynamics.com/v2.0/{tenantId}/{environmentName}/api/sparkrock/srf/v2.0/companies({companyId})/financeApprovalRules Authorization: Bearer {token}
List of properties for a specific finance approval rule
To get a list of properties for a specific finance approval rule, issue a GET request.
The following JSON code snippet is an example of a GET request.
GET https://sparkrock365.api.bc.dynamics.com/v2.0/{tenantId}/{environmentName}/api/sparkrock/srf/v2.0/companies({companyId})/financeApprovalRules({code}) Authorization: Bearer {token}
List of all document types in a specific finance approval rule
To get a list of all document types for a specific finance approval rule, issue a GET request.
The following JSON code snippet is an example of a GET request.
GET https://sparkrock365.api.bc.dynamics.com/v2.0/{tenantId}/{environmentName}/api/sparkrock/srf/v2.0/companies({companyId})/financeApprovalRules({code})?$Expand=financeApprovalRuleDocumentTypes Authorization: Bearer {token}
Create finance approval rule
To create a finance approval rule, issue a POST request. By default, a finance approval rule is created with all document types and the Enabled checkbox is clear.
The following JSON code snippet is an example of a POST request.
POST https://sparkrock365.api.bc.dynamics.com/v2.0/{tenantId}/{environmentName}/api/sparkrock/srf/v2.0/companies({companyId})/fiannceApprovalRules Authorization: Bearer {token} Content-type: application/json { "code": "R-7", "description": "", "approvalType": "Amount", "approverType": "Approval Group", "approverNo": "API-TEST1", "approvalAmountThreshold": 0.01, "gLAccountFilter": "", "globalDimension1Filter": "", "globalDimension2Filter": "", "globalDimension3Filter": "", "globalDimension4Filter": "", "globalDimension5Filter": "", "globalDimension6Filter": "", "globalDimension7Filter": "", "globalDimension8Filter": "", "srfPRTypeFilter": "", "srfExpTypeCategoryFilter": "", "override": false }
Modify finance approval rule properties
To modify a finance approval rule, issue a PATCH finance approval rule request.
The following JSON code snippet is an example of a PATCH finance approval rule request.
PATCH https://sparkrock365.api.bc.dynamics.com/v2.0/{tenantId}/{environmentName}/api/sparkrock/srf/v2.0/companies({companyId})/financeApprovalRule({code}) Authorization: Bearer {token} Content-type: application/json If-Match: * { "enable": true }
Delete finance approval rule
To delete a finance approval rule, issue a DELETE finance approval rule request.
The following JSON code snippet is an example of a DELETE finance approval rule request.
DELETE https://sparkrock365.api.bc.dynamics.com/v2.0/{tenantId}/{environmentName}/api/sparkrock/srf/v2.0/companies({companyId})/financeApprovalRules({code}) Authorization: Bearer {token} If-Match: *
The request does not return anything in the response body.
List of finance approval rule document types
To get a list of all document types that are associated with a specific finance approval rule, issue a GET financeApprovalRuleDocumentTypes request.
The following JSON code snippet is an example of a GET financeApprovalRuleDocumentTypes request.
GET https://sparkrock365.api.bc.dynamics.com/v2.0/{tenantId}/{environmentName}/api/sparkrock/srf/v2.0/companies({companyId})/financeApprovalRules({code})/financeApprovalRuleDocumentTypes Authorization: Bearer {token}
Modify finance approval rule document types properties
To include and exclude the one or more document types that are associated with a finance approval rule, issue a PATCH finance approval rule document types request.
The following JSON code snippet is an example of a PATCH finance approval rule document types request.
PATCH https://sparkrock365.api.bc.dynamics.com/v2.0/{tenantId}/{environmentName}/api/sparkrock/srf/v2.0/companies({companyId})/financeApprovalRules({code})/financeApprovalRuleDocumentTypes({documentType}) Authorization: Bearer {token} Content-type: application/json If-Match: * { "include": false }
See also
Feedback
To send feedback about this page, select the following link: