Authentication

Learn how to authenticate requests to our API

The PartnerStack API uses API keys to authenticate requests, and accepts them via Basic authentication.

Where do I find my API keys?

You can find your API keys by logging in to your PartnerStack dashboard, clicking on Settings and then clicking on Integrations. You should see "PartnerStack API Keys" appear on the left sidebar.

Using the API keys

The public key is to be used as the Basic Auth username, and the secret key is to be used as the Basic Auth password over HTTPS, for example:

curl -u YOUR_PUBLIC_KEY:YOUR_SECRET_KEY \ 
https://api.partnerstack.com/v1/partnerships/testpartner
import requests
from requests.auth import HTTPBasicAuth

r = requests.get(
  'https://api.partnerstack.com/v1/partnerships/testingpartner',
  auth=HTTPBasicAuth('YOUR_PUBLIC_KEY', 'YOUR_SECRET_KEY')
)

Note: You can place the authorization data directly in the header of the HTTP request as follows:

Authorization: Basic base64(public_key:secret_key)

Test vs. Production Keys

The Test keys function very similarly to the Production keys, with a few differences:

  • Any customers you create via the Customers API endpoints will be marked as test customers in your PartnerStack dashboard, if you use Test keys
  • You must create test customers under test partners. Every PartnerStack instance comes with a testing partner with partner key gstest. You can create another test partner over API using your test credentials.
  • You must use test credentials to record transactions for customers marked as test
  • Any transactions generated for test customers will not generate rewards in the dashboard

Regardless of whether you're using the test or production keys, please keep your API credentials secret as they're able to perform many actions in your instance.

🚧

Before launching your partner program

Before you launch your partner program on PartnerStack, please change any API keys you're using on your backend to production keys.


Did this page help you?