SumUp CLI tool allows you to manage your SumUp account, create checkouts, and much more all from your terminal.
go install github.com/sumup/sumup-cli/cmd/sumupThe CLI expects an API key via the SUMUP_API_KEY environment variable by default. You can also pass --api-key explicitly.
export SUMUP_API_KEY=your_api_keyTo avoid repeating the --merchant-code flag in every command, you can set a merchant context:
# Set the merchant context interactively
sumup context set
# View the current merchant context
sumup context get
# Unset the merchant context
sumup context unsetOnce set, all commands that accept --merchant-code will use the context value by default. You can still override it by providing the flag explicitly.
sumup checkouts create \
--reference order-123 \
--amount 19.99 \
--currency EUR \
--merchant-code M123 \
--description "Ticket purchase" \
--return-url https://example.com/return \
--redirect-url https://example.com/3ds \
--customer-id cst_42 \
--purpose "Event"List readers for a merchant:
sumup readers list --merchant-code M123Pair a new reader with a pairing code:
sumup readers add \
--merchant-code M123 \
--pairing-code ABCDEF \
--name "Front counter"Trigger a checkout on a reader (this example charges EUR 14.99 and offers tip rates):
sumup readers checkout \
--merchant-code M123 \
--reader-id reader_42 \
--amount 14.99 \
--currency EUR \
--tip-rate 0.10 \
--tip-rate 0.15 \
--description "In-person order #123"When using affiliate attribution, pass all affiliate flags: --affiliate-app-id, --affiliate-key, and --affiliate-foreign-transaction-id.