| Cmdlet | CLI equivalent | What it does |
|---|---|---|
Get-Product |
product list, get |
Lists products (filter by group, item code, time, or the server-side filters below; -All reads every product) or gets one by -ItemCode. |
New-Product |
product create |
Creates a product from fields, a hashtable, or a JSON file. |
Update-Product |
product update |
Sparse update of a product. |
Remove-Product |
product delete |
Deletes a product. Confirmation: High. |
Get-ProductPrice |
product price |
Calculates a price for a quantity and an optional customer or coupon. |
Get-ProductGroup |
product group list |
Lists product groups (-All reads every group). |
Get-ProductCategory |
product category list |
Lists product categories (-All reads every category). |
Get-ProductUnit |
product unit list |
Lists product units (-All reads every unit). |
Get-Product -Group 01 -Take 20
Get-Product P1 | Format-List ItemCode, Description, UnitPrice, QuantityInStock
# Streams the products changed in the last week, 500 per request
Get-Product -ModifiedSince (Get-Date).AddDays(-7) -PageSize 500
New-Product P1 -Description 'Widget' -Group 01 -UnitCode PCS -CurrencyCode ISK -UnitPrice 2490
New-Product -InputObject @{ ItemCode = 'P2'; Description = 'Gadget'; Warehouses = @(@{ Warehouse = 'MAIN'; MinimumStock = 5 }) }
# Change the price and clear the secondary description
Update-Product P1 -UnitPrice 2790 -SecondaryDescription ''
# Preview deactivating a group
Get-Product -Group 99 -Take 1000 | Update-Product -Inactive -WhatIf
Get-Product returns 100 products by default. -Take N changes the limit (1 to 1000; 0.4.2 allowed up to 10,000, so use -All to read more). -All reads every product and, because that can move a lot of data, asks for confirmation like a High-impact cmdlet: pass -Confirm:$false in scripts, and -All -WhatIf sends nothing. -All cannot be combined with -Take, -All:$false behaves as if -All were omitted (no prompt, the first 100), and -WhatIf and -Confirm have no effect on the other parameter sets. The same holds for Get-ProductGroup, Get-ProductCategory, and Get-ProductUnit.
Get-Product -All -Confirm:$false | Export-Csv products.csv -NoTypeInformation
-Include and -Exclude choose which properties DK Plus returns (Tab completes the names); the request always carries the item code. Get-Product also has server-side filters: -AliasItemCode, -Inactive, -OnWeb, and -Deleted. DK Plus applies them; the module never filters records itself. A text filter is sent only when given, a switch only when passed (-OnWeb:$false sends false). -Group is sent lowercase, like the customer group; -AliasItemCode is sent as written and * is a wildcard.
Get-Product -OnWeb -AliasItemCode 'BOLT*' -Include ItemCode, Description, UnitPrice
Like the CLI, Get-Product skips malformed DK Plus rows that have no item code and reports them as a warning. Valid products are still returned.
Price calculation:
Get-ProductPrice P1 -Quantity 10 -Customer 10001
# Show why a discount applied
Get-ProductPrice P1 -Quantity 10 -Customer 10001 -Trace | Select-Object -ExpandProperty RuleMatchDetails
# Price every product of a group for one customer
Get-Product -Group 01 | Get-ProductPrice -Customer 10001 | Select-Object ItemCode, UnitPrice, Total
Get-ProductPrice writes a non-terminating DkPlus.NotFound error (category ObjectNotFound) when DK Plus returns no price for an item code, so a piped list continues.
| Cmdlet | CLI equivalent | What it does |
|---|---|---|
Get-Warehouse |
warehouse list |
Lists warehouses. |
Update-ProductWarehouse |
warehouse update-product |
Updates the settings of one product in one warehouse (stock limits, location, subgroups). |
New-InventoryJournal |
inventory journal |
Books inventory journal lines. Confirmation: High. |
New-InventoryTransfer |
inventory transfer |
Transfers stock between warehouses, optionally posting the journal. Confirmation: High. |
New-InventoryCount |
inventory count |
Creates a physical inventory count. Confirmation: High. |
Update-ProductWarehouse is an ordinary update (Medium). The three inventory cmdlets move stock, so they need confirmation; scripts pass -Confirm:$false.
Get-Warehouse | Format-Table Code, Name, Location
Update-ProductWarehouse MAIN P1 -MinimumStock 5 -MaximumStock 50 -Location 'A-12'
# Same minimum for a product group, previewed
Get-Product -Group 01 | Update-ProductWarehouse -Warehouse MAIN -MinimumStock 2 -WhatIf
New-InventoryJournal -Description 'Damaged goods' -ItemCode P1 -Quantity -2 -Warehouse MAIN -Confirm:$false
New-InventoryTransfer P1 -FromWarehouse MAIN -ToWarehouse OUTLET -Quantity 3 -Confirm:$false
# Several transfers, posted
New-InventoryTransfer -InputObject @(
@{ ItemCode = 'P1'; From = 'MAIN'; To = 'OUTLET'; Quantity = 3 }
@{ ItemCode = 'P2'; From = 'MAIN'; To = 'OUTLET'; Quantity = 1 }
) -Post -Description 'Weekly refill' -Confirm:$false
# A count from a CSV file
$lines = Import-Csv count.csv | ForEach-Object { @{ ItemCode = $_.ItemCode; Counted = [decimal]::Parse($_.Counted, [cultureinfo]::InvariantCulture); Warehouse = 'MAIN' } }
New-InventoryCount -InputObject @{ Description = 'Q4 count'; Lines = $lines } -Confirm:$false
| Cmdlet | CLI equivalent | What it does |
|---|---|---|
Get-Webhook |
webhook list, get |
Lists webhook subscriptions or gets one by -Id. |
Get-WebhookTemplate |
webhook template |
Returns an example webhook document. |
New-Webhook |
webhook create |
Creates a webhook. Confirmation: High. |
Update-Webhook |
webhook update |
Updates a webhook. Confirmation: High. |
Test-Webhook |
webhook test |
Asks DK Plus to send a test delivery. Confirmation: High. |
Remove-Webhook |
webhook delete |
Deletes a webhook. Confirmation: High. |
Webhooks are safety-sensitive because DK Plus calls an external URL, so every write needs confirmation. The authorization value is the header value DK Plus sends with each delivery. It is a secret of your receiver:
-AuthorizationValue is a SecureString.Get-Webhook never writes the stored authorization value. AuthorizationValue comes back empty, and a HasAuthorizationValue property tells you whether DK Plus stores one.Get-Webhook | Format-Table Id, Description, Url, Options
$secret = Read-Host -AsSecureString 'Authorization value'
New-Webhook -Description 'Customers' -Url https://example.com/hooks/dk -AuthorizationScheme Bearer -AuthorizationValue $secret -Enabled -Event Customer, CustomerTransactions -Confirm:$false
# Point a webhook at a new URL; the stored authorization value and events are kept
Update-Webhook -Id 6d2f1d0e-8a1c-4e5b-9a39-0b6a6c1d2e3f -Url https://example.com/hooks/v2 -Confirm:$false
# Preview disabling all webhooks
Get-Webhook | Update-Webhook -Enabled:$false -WhatIf
Test-Webhook -Url https://example.com/hooks/dk -Enabled -Event Customer -Confirm:$false
DK Plus replaces the whole subscription on an update. With field parameters, the cmdlet reads the stored webhook after you confirm, applies your fields ('' clears text, an omitted parameter keeps the stored value, -Event replaces the event list), and sends the result. The read and the write are not one atomic step, so a change made by someone else in between is overwritten.
Because Get-Webhook redacts the authorization value, a webhook object from Get-Webhook cannot be sent back as a complete document. Update-Webhook -InputObject and New-Webhook -InputObject reject a webhook object that has a stored authorization value unless you also pass -AuthorizationValue, which is then used for the value. This stops a round trip from silently erasing the value. Prefer field parameters for edits.
To start from a template, save it, edit the file, and pass it with -Path. Treat a completed file as a secret if it contains an authorization value.
Get-WebhookTemplate | ConvertTo-Json -Depth 5 | Set-Content webhook.json
New-Webhook -Path ./webhook.json -WhatIf
| Cmdlet | CLI equivalent | What it does |
|---|---|---|
Get-Token |
token list, get |
Lists API tokens or gets one by -Id. Values are masked unless -ShowToken is used. |
New-Token |
token create |
Creates a token with a user name and password, or a credential. |
Update-Token |
token update |
Changes a token's company or description. |
Remove-Token |
token delete |
Deletes a token. Confirmation: High. |
Get-TokenCompany |
token companies |
Lists the companies available to the user. |
Get-TokenEmployee |
token employee |
Gets the employee identity for a user and company. |
Get-RequestLog |
token report logs |
Reads the request log of the token in use. |
Save-TokenReport |
token report pdf |
Saves the token usage report as a PDF file. |
Send-TokenReport |
token report email |
Emails the token usage report. Confirmation: High. |
Treat token values as secrets. Get-Token shows a masked value such as 0f3b...6f10. A token is also its identifier, so only a token written with -ShowToken can be piped into Remove-Token:
Get-Token | Format-Table User, Type, Description, Created
# Remove old tokens: -ShowToken output is a secret, keep it out of logs
Get-Token -ShowToken | Where-Object Description -eq 'old' | Remove-Token -WhatIf
Get-TokenCompany | Format-Table Id, Number, Name
# PowerShell prompts for the password without echo
New-Token [email protected] -CompanyId 11111111-1111-1111-1111-111111111111 -Description 'Integration'
$credential = Get-Credential
New-Token -Credential $credential -Description 'Nightly sync'
Update-Token -Id 0f3b7a52-5b16-4c3e-8c8e-3d1b9a7e6f10 -Description 'Nightly sync'
# Failed requests of the last day
Get-RequestLog -From (Get-Date).AddDays(-1) -StatusCode 500 | Format-Table Created, Method, Uri, StatusCode
Save-TokenReport ./token-usage.pdf -From (Get-Date).AddMonths(-1)
Send-TokenReport [email protected] -Subject 'API usage' -From (Get-Date).AddMonths(-1) -Confirm:$false
New-Token shows the new token value once, unmasked, and warns you to store it securely. Put it in a secret store, then use Connect-DkPlus -Token or Save-Login. See Safety and errors before you store or log it.