From https://github.com/freakboy3742/pyxero#private-applications

From https://developer.xero.com/documentation/api-guides/create-publicprivate-key

➤ openssl genrsa -out privatekey.pem 1024
Generating RSA private key, 1024 bit long modulus

➤ openssl req -new -x509 -key privatekey.pem -out publickey.cer -days 1825
Country Name (2 letter code) [AU]:GB
State or Province Name (full name) [Some-State]:Devon
Locality Name (eg, city) []:Okehampton
Organization Name (eg, company) [Internet Widgits Pty Ltd]:KB Software Ltd
Organizational Unit Name (eg, section) []:
Common Name (e.g. server FQDN or YOUR name) []:kbsoftware.co.uk
Email Address []:patrick@kbsoftware.co.uk

➤ openssl pkcs12 -export -out public_privatekey.pfx -inkey privatekey.pem -in publickey.cer
Enter Export Password:
Verifying - Enter Export Password:


_images/xero-add-new-app-1.png _images/xero-add-new-app-2.png

Copy the Consumer Key from OAuth 1.0a Credentials to the .private file in your project e.g:


If you log into your Xero app, you can see the Connected App e.g:



pip install pyxero