Affirm authenticates your API requests using your account’s API keys. If you do not include your key when making an API request or use one that is incorrect or outdated, Affirm returns an error.
Every account is provided with separate keys for testing and for running live transactions. All API requests exist in either test or live mode, and objects in one mode cannot be manipulated by objects in the other.
There are also two types of API keys: public and private.
- Private API keys should be kept confidential and only stored on your own servers. Your account’s private API key can perform any API request to Affirm with some restrictions.
Each account has a total of four keys: a public and private key pair for test mode and live mode.
Your API keys are available in the Merchant Portal.
Use only your test API keys for testing and development. This ensures that you don't accidentally modify your live charges.
If you don’t have access to the Dashboard, you may contact your Affirm account’s owner and ask to be added.
The test and live modes function almost identically, with a few necessary differences:
In test mode, payments are not processed by card networks or payment providers, and only our test payment information can be used.
Updated 10 months ago