Fiserv

Integrate Affirm with Fiserv using Hosted Checkout or Direct API to increase AOV, reduce fraud risk, and deliver a seamless BNPL checkout.

Overview

Fiserv supports Affirm as a Buy Now, Pay Later (BNPL) payment method across its online and mobile checkout solutions utilizing their enterprise gateway, CommerceHub. Merchants can enable Affirm using either Hosted Checkout (SDK, Hosted Pages, Hosted Components) or Direct API integrations.

How Affirm works

Customer experience

  1. Customer selects Affirm as the payment method during checkout.
  2. Merchant initiates a payment request through CommerceHub (Hosted Checkout or Checkouts Orders API).
  3. Customer is redirected to Affirm to log in, review the loan, and approve.
  4. Customer is redirected back to the merchant’s site with the transaction decision.
  5. Merchant captures the payment if required (authorization → capture).
  6. CommerceHub processes and returns final transaction details to the merchant.

Who Affirm pays

Affirm pays the merchant after approval.

Fraud, repayment, and risk

  • Affirm owns fraud risk and consumer repayment risk for all approved transactions.
  • Merchants receive guaranteed funds once the transaction is captured.

Integration steps

CommerceHub offers three primary integration methods for enabling Affirm:

  • Hosted Checkout SDK
  • Hosted pages and hosted components
  • Direct API (full control integration)

1. Hosted Checkout SDK

Ideal for minimizing development lift. CommerceHub manages data collection, tokenization, and transmission to Affirm.

Steps

  1. Whitelist domains used in production. (Localhost testing allowed.)
  2. Start PaymentSession by submitting a server-side Security Credentials API request (returns: accessToken, sessionId, publicKey, clientEncryptionAlgorithm).
  3. Initialize the SDK using window.fiserv.init.
  4. Initialize the Affirm component with window.fiserv.components.affirm().
  5. Submit a Checkouts Orders request using values returned via the onApprove hook (orderId, transactionId).

After checkout

Use Checkouts Orders API to authorize, capture, cancel, refund, or update orders.

📘

Fiserv Hosted Checkout SDK documentation

For more details on this integration, please review the Affirm Hosted Checkout SDK integration guide on Fiserv’s developer site.

2. Hosted pages and hosted components

These options allow merchants to enable Affirm without building custom UI.

Hosted pages

Customers are redirected to a secure, branded CommerceHub-hosted checkout page with Affirm enabled.

Steps

  1. Access Checkout Configurator.
  2. Create a Checkout Page.
  3. Customize layout & payment fields.
  4. Configure appearance.
  5. Preview & test.
  6. Promote to production.

Hosted components

Embeddable iFrame/WebView/Modal components that support Affirm as a payment option.

Both Hosted Pages and Hosted Components use the same Checkout Configurator for design and layout.

📘

Fiserv Hosted pages and hosted components documentation

For more details on this integration, please review the Creating and managing Checkout Pages on Fiserv’s developer site.

3. Direct API (full control integration)

Ideal for merchants wanting full backend control over their Affirm checkout flow.

Steps

  1. Create a checkout order using the Checkouts Orders API.
  2. Redirect the customer to the actions.url returned in the API response.
  3. Submit a payment request:
    1. Can be sale or authorization.
    2. If authorization, follow with a capture request.

Additional actions available

  • Update checkout order
  • Cancel order
  • Refund captured order
  • Inquiry request to retrieve transaction history
📘

Fiserv Direct API documentation

For more details on this integration, please review the Affirm Direct API integration guide on Fiserv’s developer site.

Next steps

Please reach out to your Fiserv Relationship Manager for more information on how to get started with Affirm.

Additional resources

CommerceHub developer documentation: