Skip to main content

Merchant Help


Affirm Merchant Help

Oracle Commerce (ATG) Integration

Retrieve keys

  1. Sign in to
  2. Retrieve API keys
    1. Hover over the profile icon area at the lower-left of the page.
      Screen Shot 2016-03-22 at 7.56.58 AM-2.png
    2. Click the API Keys link that appears.
      Screen Shot 2016-03-22 at 7.56.20 AM.png
    3. Copy the public, private, and financial product keys.

Affirm Module 

You can download different Affirm Oracle Commerce module version from here:

The Affirm module is packaged as an ATG module. This structure will be familiar to all users of Oracle Commerce. The directory structure for the non-Versioned module contains:



Configuration for the build


The build file, modeled after the Oracle Commerce Reference Store build


Reference Only: File to hold sample data.


Reference Only: This holds the JSP files that were used for integrating the module with the Oracle Commerce Reference Store.


The libraries required for JSON parsing


The module definition file


The required SQL for the switching and core schemas to support the module functionality


This holds both the Java source as well as configuration files


This is the base of the module for BCC support.

The Versioned module is similar, but only has META-INF, sql and src directories, along with the build.xml and files to work with the Oracle Commerce Reference Store build scripts.

Install and Configure the Affirm Module

The reference implementation of the Affirm integration modules was done using the Oracle Commerce Reference Store. Therefore, the build scripts rely on the Oracle Commerce Reference Store ant build files. The merchant can choose to either keep the module separate from the existing application, or integrate the files in the module into the source code of the existing application. Details for each approach are below.

  • Maintain a separate module

If the module is going to be kept separate, then the module will at least need to be integrated to the existing build system and built and deployed with the application. This will require mimicking the existing applications build.xml file structure and including those in the separate module. The Affirm integration module's MANIFEST.MF needs to be updated to have ATG-Required: point to the existing main commerce module for the application. There will likely be individual files that need to be updated in this module, so building and deploying it along with the rest of the application is required. Finally, you will need to include the Affirm module in the module list when assembling your EAR file for deployment, and if you are specifying a command-line module list when starting your Oracle Commerce instances, you will need to add this module there as well.

  • Incorporate module code into existing module

If incorporating the code from the Affirm module into your existing application commerce module, you will simply copy the files in the src, config, and lib directories into your existing commerce module. The MANIFEST.MF will need to be updated to include the JSON libraries that are in the Affirm module's lib folder.

  • Module Configurations

The following configurations can be made in a centralized configuration component. The nucleus component path is /affirm/commerce/payment/AffirmPaymentConfiguration. Properties are:

Property Name





Currently set to 2. This is the Affirm API version



Set to sandbox or production URL. Use environment module or server configs to set production URL.
Defaults to sandbox:



Set to sandbox or production URL. Use environment module or server configs to set production URL.
Defaults to sandbox:



If false, disable display of Affirm offers, and do not show the Affirm payment option at checkout.
Default module config is set to true. 



If true, the debit call is made immediately after the authorize call as part of checkout.
Default module config is set to false 



The public API key



The private API key



The repository id of the rule that you want to set as a default rule to show. This rule will not be checked to see if the cart/products qualify. It is intended to apply to any product or cart as the default.



If the amount of the product (product/category pages) or cart (cart/checkout pages) is less than this amount, then we won't render the JSP code to invoke the Affirm Javascript call at all.



The URL to return to when the user cancels on the Affirm site for some reason



The URL to return to after the user has completed the loan.



This is set in the module to either be version 11.x or 10.x

These will need to be configured as appropriate for your different environments. You can find information on BCC rules setup for customized Affirm's monthly payment pricing and configuration here -

  • Required Code for Checkout Integration

The purchase process needs to redirect to Affirm at the time of checkout to complete the loan. That process either sends the user back to the billing page, or to a page that will submit the order and run it through the order processing pipeline. The merchant will need to handle these cases using the existing codebase. This front-end integration will be custom for each merchant. Examples of how this was done in the Reference Store can be found in src/Java/com/affirm/commerce/payment/ and src/Java/com/affirm/commerce/payment/

  • Handling void/refund/capture operations

The module adds a payment method in the standard way all ATG payment methods work. This means that all existing calls that perform standard payment group operations will work the same as they do for an order with a credit card payment group. For example, calling PaymentManager.debit on an order with an Affirm payment method will automatically debit the Affirm payment group by making the API call to Affirm for the debit operation. Sample code exists in the module for invoking the debit, void, refund, and shipping update methods using a separate form handler. These can be found in the src/Java/com/affirm/commerce/payment/ file.


Test your Affirm configuration

Test your configuration to ensure that everything is working before you go live. Email with a link to your test site so that we can verify your configuration and provide you with production keys.

  1. Add an item to the cart on your test site.
  2. Proceed to checkout.
  3. During checkout, enter valid U.S. addresses and mobile-phone information. Affirm cannot test your configuration if the address or phone information is fake.
  4. Select Affirm as the payment option.
  5. Proceed to Affirm's testing environment checkout.

Note: The URL indicates that you are in the testing environment.

6. When prompted for your security PIN, enter 1234.

7. Select terms.

8. Confirm your loan.


9. Wait to ensure that you have been redirected to your confirmation page.

10. Verify that the transaction appears in your platform's admin panel and on

Note: When a customer completes checkout with Affirm as the payment method, Affirm authorizes a charge for the amount of the order. The charge appears in a pending state on the customer’s Affirm account. Authorized transactions expire if they are not captured before the capture deadline. The default capture deadline is specified in your partnership agreement with Affirm. If you did not specify your authorization-period requirements because of inventory, pre-orders, or shipping time in your onboarding form, please email for help with completing this process.

Go live with Affirm financing

After you verify that your configuration is working properly in the Affirm Sandbox environment, your Affirm Client Success Manager will activate your Affirm Live environment access. This will allow you to sign into the Live version of the Merchant Dashboard, as well as access your Live API keys.

Retrieve Live API keys

  1. Go to the API keys page in the Affirm dashboard.
  2. Retrieve your live API keys.
  3. Enter the live API keys into your integration/platform.

Note: The email address that you use to access the dashboard must be registered as a Google account. Check to see if your existing email address is a Google account or create a new Google account. You can link your existing work email address to a Google account by signing up without Gmail.

Update Affirm URL and script references

  1. Affirm JS URL:
  2. Affirm API base URL: