Overview
To execute various toolkit features, the toolkit should be initialized. The initialize API will save different configuration values, which will get used by other toolkit methods and features.
Signature
Signature:
PUT /toolkit/initialize
Note! • To make it secured, credentials will be encripted and cached in the SQLite DB. We are following symmetric encryption methodology.
Inputs
Body of the request contains 4 simple properties followed by 3 complex objects for scheduling background services:
Input parameter | Type | Description | Value example |
---|---|---|---|
saveCredential | Boolean | true to save the credentials in the local cache, otherwise false. | true / false |
resumeWithInvalidCache | Boolean | true to allow working with expired cache, or false to raise error while performing issue / submit / sync activities | true / false |
cachLookupDurationInHours | Number | it is a numerical configuration input value to set the cache lookups duration in hours. | 24 |
maximumSubmissionDocumentCount | Number | Maximum No. of receipts added to the submission when submitting to the invoicing portal. | 500 |
retentionSchedule | complex | ||
submitSchedule | complex | ||
syncSchedule | complex |
Note!
• In order to save the given credentials for future purposes, developer needs to set this value to true. Once it is saved, developer doesn't need to pass the client id, secret, pos details every time to get a token. Also background jobs will use the saved credetials to refresh lookups data. If credentials are not saved, developer needs to pass the client id, secret, pos details every time to get a token and refresh the lookups manually.
• MaximumSubmissionDocumentCount setting gives the ability to override No. of receipts in the submission. No. of receipts in the submission also decided based on file size and number of the issued receipts in the local database.
• RetentionSchedule, SubmitSchedule and SyncSchedule background jobs could be configured but those are not supported by Nuget / CLI integrations. Mentioned background jobs are only supported by Docker container API.
Retention Schedule
Based on this dynamic configuration, toolkit retention schedule background job will only delete receipts local data.
Inputs
Input parameter | Type | Description | Value example |
---|---|---|---|
statusToDelete | String | The status of the receipts that will be deleted after the configured scheduled period. Multiple values could be provided separated by comma (,). Validation error will be returned for invalid values, or if the same status is duplicated in the input string. Both integer inputs or string inputs are accepted. | Valid inputs are: “2” “-1” “Valid,Exported” Invalid inputs are: “Valid, Valid, Exported” |
deleteOlderThanInDays | Number | configuration value to delete the local receipts. | 30 |
enabled | Boolean | true to enable the job and false to disable it. | true / false |
runEveryUnit | String | Job occurance configuration. | Possible input “Minute”/”Hour”/”Day”. This value is case-sensitive. |
runEvery | Number | as per this numerical input value, job will run repeatedly | 24 |
Submit Schedule
Locally issued receipts will be submitted based on this scheduled configuration. Only new and cancelled receipts will be submitted by the background service.
Inputs
Input parameter | Type | Description | Value example |
---|---|---|---|
enabled | Boolean | true to enable the job and false to disable it. | true / false |
runEveryUnit | String | Job occurance configuration. | Possible input “Minute”/”Hour”/”Day”. This value is case-sensitive. |
runEvery | Number | as per this numerical input value, job will run repeatedly | 24 |
Sync Schedule
As per the below dynamic configuration, Local receipts’ statuses and validations will be synchronized from the backend system.
Inputs
Input parameter | Type | Description | Value example |
---|---|---|---|
enabled | Boolean | true to enable the job and false to disable it. | true / false |
runEveryUnit | String | Job occurance configuration. | Possible input “Minute”/”Hour”/”Day”. This value is case-sensitive. |
runEvery | Number | as per this numerical input value, job will run repeatedly | 24 |
Outputs
Upon successful submission, API must return 200
status code with the below mentioned output parameters.
Output parameter | Type | Description | Value example |
---|---|---|---|
initialized | Boolean | true if the initialization is successful, otherwise false |
Error Response
Error situations are reported back by this API through the standard error response.
No custom error codes are provided by this API.
Additional considerations
This API is called only over protected HTTPS
channel.