Contents
API keys are essential for merchants when integrating with Affirm. Your developers can learn more about Affirm's APIs in detail here.
Key environments
After navigating to the API Keys menu item or by using this link (for your production/live environment) or this link (for your sandbox/test environment). You'll know which environment you are in due to a few differences in the field labels:
For Sandbox keys, you'll see the header above the key pairs as "Sandbox API Keys".
For Production API keys, you'll see the header above the key pairs as "Production API Keys".
Field Descriptions
We'll cover what each of the fields are and how they are used:
-
Production/Sandbox API Keys:
-
Public API Key - The public key is one that you can distribute to others, to allow them to get some subset of information about you from the API. Think of it as a simple identifying number.
- Private API Key - Also known as a secret key, is used with an algorithm to encrypt and decrypt data. Private keys should be kept secure and only be shared with authorized parties.
-
Public API Key - The public key is one that you can distribute to others, to allow them to get some subset of information about you from the API. Think of it as a simple identifying number.
-
Financial Product Key:
- Financial Product Key - While most integrations are fine with just a Public and Private API key and do not need this key, some integrations may additionally require the financial product key. Our API integration guides will specify whether this key is required or not.
- Financial Product Key - While most integrations are fine with just a Public and Private API key and do not need this key, some integrations may additionally require the financial product key. Our API integration guides will specify whether this key is required or not.
-
API URLs:
- API URL - The URL of Affirm's API version that your integration will be using. Most merchants will be set to the default Affirm API v2. You must contact our merchant care team if you want to leverage a different API.
- API Base URL - The base folder where Affirm's APIs are stored.
-
Affirm JS:
- Affirm JS URL - The URL of Affirm's javascript file. This file is referenced in things like the promotional messaging within your eCommerce website in order to render properly.
You can hover your mouse cursor over the Public API Key, Private API Key, and Financial Product Key fields for a copy icon to appear. Clicking on it will copy the key to your clipboard, which you can then use to paste it into whatever Platform Integration or Direct API integration you are working with.