Toolkit Command Line Interface(CLI) Usage

It will gives the developers understand about CLI(Command Line Interface) usage and toolkit CLI features.

CLI Config Toolkit Overview

Overview

Toolkit CLI commands are useful to the developers to test and use the various functionalities. To use the toolkit cli, it can be downloaded from the eInvoicing SDK portal as a zip file to be installed and configured it locally.
To get to know about all the available Toolkit CLI commands.
Help attribute is available for each toolkit command to see all the available parameters to know more about the details of the command.

toolkit --help
(or)
toolkit -?

CLI Help

Note!RetentionSchedule, SubmitSchedule and SyncSchedule background jobs could be configured but those are not supported by CLI / Nuget integrations. Mentioned background jobs are only supported by Docker container API.
• Using windows command prompt / windows powershell, developers can perform the quick tests.

Here is the initialize command help.

toolkit --init --help

CLI init help

Here is the initialize usage example..

toolkit --init --cach-lookups-duration 90 --save-credential true

CLI init

Here is the authenticate command help.

toolkit --authenticate -?

Here is the authenticate command usage example with ERP details.

toolkit --authenticate --client-id "ccb43e72-bcdc-45ab-ba72-af1430cb9650" --client-secret "4bd378b4-28f0-40bc-b3f1-ef62fcf94de7"

Here is the authenticate command usage example with POS details.

toolkit --authenticate --client-id "0979864e-5b34-4dc4-b555-3b5f8549c4ce" --client-secret "3f58c0cd-e60b-4275-ae3d-8b972503dd67" --pos-serial "Sofy123" --pos-os-version "V/OS (linux-based)" --pos-model-framework-version "" --pos-pre-shared-key "C68FEC13-FE34-4839-89F9-ADB0D678CFE0"

CLI Authenticate

Here is the authenticate command example error output scenario.

CLI Authenticate Error

Here is the refresh cache usage example.

toolkit --refresh-cache

CLI refresh

Here is the generate UUID example valid scenario and json file path needs to be provided.

toolkit --generate-uuid --input-json-path "D:\inputReceipt.json" --output-json-path "D:\outputReceiptWithUuid.json"

CLI uuid

Here is the generate QR code valid scenario and json file path needs to be provided.

toolkit --generate-qr-code --input-json-path "D:\inputReceipt.json" --output-qr-path "D:\outputQr.json"

CLI Qr

Here is the issue receipt local validation scenario and json file path needs to be provided.

toolkit --issue-receipt --input-json-path "D:\inputReceiptWithUuid.json" --output-qr-path "D:\outputQr.json"

CLI issue receipt

Here is the submit receipt usecase example.

toolkit --submit

Here is the submit receipt usecase example with argument.

toolkit --submit --receipts-count 1

CLI submit

Here is the sync all usecase example.

toolkit --sync --all true

Here is the sync submission usecase example with a specific UUID.

toolkit --sync --submission-uuids "K5SCED3D2G3HDCTT24S2ZX9G10"

CLI sync

Here is the export receipts usecase example.

toolkit --export

Here is the export number of receipts usecase example.

toolkit --export --receipts-count 2

CLI Export Nodata

Here is the search command usage example.

toolkit --search --uuid "0979864e-5b34-4dc4-b555-3b5f8549c4ce" --reference-uuid "" --submission-uuid "" --buyer-id "" --buyer-type "" --receipt-number "" --datetime-issued "" --total-amount-egp "" --local-status "" --page-number "" --page-size ""

Here is the summary for all the above listed CLI command’s and their usage.

 toolkit --help
 toolkit --init --help
 toolkit --init --resume-with-invalid-cache true
 toolkit --init --cach-lookups-duration 90 --save-credential true
 toolkit --authenticate -?
 toolkit --refresh-cache -?
 toolkit --generate-uuid -?
 toolkit --generate-qr-code -?
 toolkit --issue-receipt -?
 toolkit --submit -?
 toolkit --sync -?
 toolkit --export -?
 toolkit --authenticate --client-id "ccb43e72-bcdc-45ab-ba72-af1430cb9650" --client-secret
 "4bd378b4-28f0-40bc-b3f1-ef62fcf94de7"
 toolkit --authenticate --client-id "0979864e-5b34-4dc4-b555-3b5f8549c4ce" --client-secret
 "3f58c0cd-e60b-4275-ae3d-8b972503dd67" --pos-serial "Sofy123" --pos-os-version "V/OS (linux-based)"
 --pos-model-framework-version "" --pos-pre-shared-key "C68FEC13-FE34-4839-89F9-ADB0D678CFE0"
 toolkit --refresh-cache
 toolkit --generate-uuid --input-json-path "D:\inputReceiptJson.json"
 --output-json-path "D:\outputReceiptJson.json"
 toolkit --generate-qr-code --input-json-path "D:\inputReceiptJsonWithUuid.json"
 --output-qr-path "D:\outputQr.json"
 toolkit --generate-qr-code --input-json-path "D:\inputReceiptJsonWithUuid.json"
 --output-qr-path "D:\outputQr.json"
 toolkit --issue-receipt --input-json-path "D:\inputReceiptJsonWithUuid.json"
 --output-qr-path "D:\outputQr.json"
 toolkit --issue-receipt --input-json-path "D:\inputReceiptJsonWithUuid.json"
 --output-qr-path "D:\outputQr.json"
 toolkit --submit
 toolkit --submit --receipts-count 1
 toolkit --sync --all true
 toolkit --sync --submission-uuids "K5SCED3D2G3HDCTT24S2ZX9G10"
 toolkit --export
 toolkit --export --receipts-count 2
 toolkit --search --uuid "0979864e-5b34-4dc4-b555-3b5f8549c4ce" --reference-uuid "" --submission-uuid ""
 --buyer-id "" --buyer-type "" --receipt-number "" --datetime-issued "" --total-amount-egp ""
 --local-status "" --page-number "" --page-size ""