Getting started¶
Paddle Client is a python (3.5+) wrapper around the Paddle.com API
Paddle authentication¶
Before you get started you will need an account on Paddle.com to generate authentication details.
Once you have an account go to the Paddle authentication page and find out both your Vendor ID
and API key
Usage¶
from paddle import PaddleClient
paddle = PaddleClient(vendor_id=12345, api_key='myapikey')
paddle.list_products()
If vendor_id
and api_key
are not passed through when initalising Paddle will fall back and try and use environmental variables called PADDLE_VENDOR_ID
and PADDLE_API_KEY
export PADDLE_VENDOR_ID=12345
export PADDLE_API_KEY="myapikey"
from paddle import PaddleClient
paddle = PaddleClient()
paddle.list_products()
Paddle sandbox environment¶
The Paddle sandbox environment is a separate Paddle environment which can be used for development and testing. You are required to create a new account in this environment, different to your production account.
Once you have this account setup and configured you can user the sandbox account by passing sandbox=True
when initialising the Paddle Client. This will send all API calls to the Paddle sandbox URLs instead of the production URLs
from paddle import PaddleClient
paddle = PaddleClient(vendor_id=12345, api_key='myapikey', sandbox=True)
It is also possible to turn the sandbox environment on using an environmental variable called PADDLE_SANDBOX
:
export PADDLE_SANDBOX="true"
from paddle import PaddleClient
paddle = PaddleClient(vendor_id=12345, api_key='myapikey')