WP-CLI
Every admin function is also available as a wp trustorder command, using the same services as the admin screen.
Exit status: 0 means success, 1 means a service or validation error. On an error the message is only the error code or a fixed text, never your buyers’ data or the API key.
Status
Section titled “Status”wp trustorder status [--format=table|json]Shows the key (first 12 characters only), the connection test (shop, account status, daily quota, today’s checks), the last error, the intl, order storage and checkout type checks, and the backfill progress of both environments. Exits with 1 if the service cannot be reached.
Settings
Section titled “Settings”wp trustorder settings get [<key>] [--format=table|json]Shows the settings. Keys: api-key (prefix only), strictness, hidden-gateways, fallback-gateways, pickup-methods, enabled, share-geo, silent.
wp trustorder settings set <key> <value>Changes one setting, validated exactly like the admin screen.
- Lists are comma-separated.
enabled,share-geoandsilenttaketrue/false,on/off,yes/noor1/0.
Examples:
wp trustorder settings set strictness normalwp trustorder settings set silent onwp trustorder settings set share-geo offSet the API key from STDIN only
Section titled “Set the API key from STDIN only”The API key is read only from piped STDIN, so it never appears in the command line or the shell history:
printf '%s' "$KEY" | wp trustorder settings set api-key -- Any other value after
api-key,--api-key=...and WP-CLI’s--promptare refused. - A terminal or no input within 5 seconds is an error.
- An empty STDIN removes the key.
- If the key is set with the
TRUSTORDER_API_KEYconstant, it cannot be changed here.
Check one buyer
Section titled “Check one buyer”wp trustorder check --email=<email> [--phone=<phone>] [--country=<ISO2>] [--postcode=<postcode>] [--address=<address>] [--strictness=lenient|normal|strict] [--format=table|json]Asks the service about one buyer and shows the verdict, level, score, reasons and check id. This is an admin tool: it skips the result cache and does not use the checkout limits. The values are hashed locally, only hashes are sent, and nothing is logged.
Backfill
Section titled “Backfill”wp trustorder backfill start [--env=live|test]Starts or resumes the backfill for the environment of the saved key. Another environment is refused.
wp trustorder backfill status [--format=table|json]Shows the state of both environments.
wp trustorder backfill run [--limit=<orders>]Runs the backfill in your terminal with a progress bar instead of in the background. A pending background step is taken over. --limit pauses after the 200-order page in which that many orders were processed; backfill start resumes. When the service is unavailable, the retry goes back to the background.
Order reports
Section titled “Order reports”wp trustorder signal send <order-id>... [--format=table|json]Sends the current outcome of the orders now. Nothing is sent if the service already holds it. Exits with 1 if an order is missing or its report failed or waits for a retry.
wp trustorder signal status <order-id> [--format=table|json]Shows the stored state without a request, including the outcome wanted for the order’s current status (refund for a refunded order).
Exceptions
Section titled “Exceptions”wp trustorder exceptions list [--limit=<1-100>] [--cursor=<cursor>] [--format=table|json]wp trustorder exceptions add --kind=email|phone|address --action=allow|deny [--value=<value>] [--country=<ISO2>] [--postcode=<postcode>] [--address=<address>] [--address-2=<address-2>] [--note=<note>]wp trustorder exceptions remove --kind=email|phone|address [--value=<value>] [--country=<ISO2>] [--postcode=<postcode>] [--address=<address>] [--address-2=<address-2>]The same always-allow and always-deny exceptions as the admin screen.
- Use
--valuefor an e-mail or phone number. - Use
--country,--postcodeand--addressfor an address. - The value is hashed locally; the list never shows values.
Keep buyer data out of your shell history
Section titled “Keep buyer data out of your shell history”check --email / --phone and exceptions add / remove --value take the buyer’s data as a command-line argument, which a logging shell keeps in its history. Run them in a shell that does not log, or clear the history afterwards.
The TrustOrder API itself is documented here: TrustOrder API.