Set up your account
To call the Paid API you need an API key. Create it in a sandbox organization, where nothing is ever billed, and build and test there. When your integration is ready, create a key in your production organization.
Organizations
Your company’s Paid account is an organization, and every user signs in to one or more organizations.
- A production organization holds your real customers, orders and invoices.
- A sandbox organization is a separate organization for building and testing. It has its own customers, orders and API keys, and never charges anyone. Its members are kept in step with the production organization it belongs to.
Every object the API returns says which kind of organization it’s in with livemode: true in production, false in a sandbox.
Create a sandbox organization
- Sign in to the Paid app, and open the organization switcher at the bottom of the sidebar.
- Choose Create sandbox org.
- Name the sandbox, pick the production organization it belongs to, and choose Create. Paid copies that organization’s currencies into it.
The switcher lists your organizations under Production and Sandbox. Switch to the new sandbox before you create a key.
Create an API key
- In the sandbox, go to Developers > API keys and choose Create API key.
- Give the key a name, such as “Local development”, and optionally a description of what it’s for.
- Leave Restricted mode off for a key with full access, or turn it on to limit the key to the scopes you choose.
- Choose Create key, then copy the key. Paid shows it once: you can’t see it again.
A key from a sandbox starts with paid_sk_test_, and a key from a production organization with paid_sk_live_. A key works only in the organization that created it.
Keep the key in an environment variable, so it stays out of your code:
Keep your keys safe
- Use keys only on your servers. Never put one in browser or mobile app code, or commit one to source control.
- Create a separate key for each service or environment, so you can revoke one without breaking the others.
- If a key may have leaked, revoke it in Developers > API keys and create a new one.
Next steps
- Make your first request with your new key.