Skip to main content

Merchant Help


Affirm Merchant Help

Shopify Integration

Retrieve keys

Affirm Merchant Live Dashboard

  1. Go to
  2. Login with your Google credentials

Install Affirm

  1. Sign in to your Shopify account and navigate to Settings > Payments.

  2. Select Affirm as your additional alternative payment method.

  3. Select the 'Use test mode' check box
  4. Enter the Public API Key and Private API Key that you retrieved from the Affirm Merchant Live Dashboard.
  5. Click Activate. Affirm now shows as an alternative payment option.

Shopify Test Mode

  1. Ensure that the 'Use test mode' check box is checked in your Affirm payment method settings
    1. Go to Shopify Admin
    2. Click the Settings (gear) icon at the bottom-left of the screen
    3. Click 'Payments'
    4. Scroll down to 'Alternative Payments'
    5. Click the 'Edit' Button next to the 'Using: Affirm' label
    6. Click the 'Use test mode' checkbox in the settings panel
    7. Click 'Save'
  2. Checkout on your store
  3. Select Affirm as the payment method
  4. When Affirm loads
    1. Login screen
      1. If you haven't already created an account in the sandbox environment
        1. Create account
          1. Name -any valid name format accepted
          2. Email - any valid email address
          3. Phone number - any valid US cell phone number
            • There are no texts sent to this number
            • We only store the number to give you a faster way to complete the Sandbox checkout
          4. Birthday - any date more than 18 years in the past
          5. Last 4 of social - any four numbers
      2. If you have created an account:
        1. Enter the same phone number that you used to initially create account
    2. PIN entry
      1. It will say, 'We sent you a text message with a PIN number', ignore this.
      2. When asked to enter a PIN number, just enter: 1234
    3. Select loan terms
      1. You will be presented with a set of three loan terms at 10% APR interest rate
      2. Select any of the loan terms to see the corresponding interest amount/details
      3. Click 'Continue'
    4. Confirming your loan
      1. Click the checkbox to agree to the terms
      2. Click 'Confirm' 
        • No real loan is created
  5. Check for the order in your Shopify Orders screen
  6. Check for the charge in your Sandbox Affirm Dashboard:

Affirm Merchant Sandbox Dashboard

  1. Go to:
  2. Use your Google account credentials to login.

Add Affirm "As Low As" messaging to a product page

For testing purposes, add messaging to at least one product page. In the future you will add messaging to all of the product and cart pages where you want to offer Affirm.

Integrating As Low As on your site


Add a price floor to checkout (Shopify Plus only)

To implement a price floor for the Affirm payment method in your checkout flow, follow these steps:

  1. Go to your script editor.
  2. Click Create script to begin creating a new script.
  3. Choose 'Payment gateway' as the type of script that you want to create.
  4. Choose a Blank template
  5. Click Create script.
  6. In the Title box, enter "Affirm price floor" as the name for the script.
  7. Click Code to open the Ruby source code console.
  8. Paste in this code:
    available_gateways = Input.payment_gateways
    cart = Input.cart
    subtotal = cart.subtotal_price
    unless cart.line_items.empty? or cart.discount_code.nil?
      case cart.discount_code
      when CartDiscount::Percentage
        if cart.subtotal_price >= cart.discount_code.minimum_order_amount
          subtotal = cart.subtotal_price * (( - cart.discount_code.percentage) / 100)
          subtotal = cart.subtotal_price
      when CartDiscount::FixedAmount
        if cart.subtotal_price >= cart.discount_code.minimum_order_amount
          subtotal = cart.subtotal_price - cart.discount_code.amount
          subtotal = cart.subtotal_price
        subtotal = cart.subtotal_price
    if subtotal < * 250
      available_gateways = available_gateways.delete_if do |payment_gateway| == "Affirm"
    Output.payment_gateways = available_gateways
  9. Click 'Run script' to run the script.
  10. Click 'Save and publish'

At this point, your changes should now be live. You can test whether it's working by checking out for an amount less than the price floor and seeing if Affirm is unavailable.


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:

Note: In Shopify, clear the Use test mode check box when you enter your production API keys.