Vendor API Authentication

The Vendor 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 Vendor dashboard and navigating on Settings -> Integrations -> PartnerStack API Keys

1106

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/api/v2/partnerships
import requests
from requests.auth import HTTPBasicAuth

r = requests.get(
  'https://api.partnerstack.com/api/v2/partnerships',
  auth=HTTPBasicAuth('YOUR_PUBLIC_KEY', 'YOUR_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.