Integration Checklist

Use this checklist to track your progress. Each item maps to the detailed in Set up Express Checkout

Prerequisites

  • Create an account in the Affirm Merchant Dashboard
  • Integrate the default Affirm Checkout
  • Have access to your public and private API keys
  • Reach out to your Affirm Account Manager to confirm availability and for next steps on building your APIs

Step 1: Create a Unique Order Identifier

  • Generate a unique, high-entropy identifier (e.g. UUID) in your backend

Step 2: Configure Affirm Express Checkout

  • Set checkout_variant: "express" in the merchant property
  • Set shipping_and_totals_callback_url to your server-to-server endpoint
  • Set order_id to the unique identifier generated in Step 1
  • Provide subtotal in metadata (item cost before tax/shipping)
  • Omit shipping object and total field
  • Include other standard Checkout Object attributes

Step 3: Set Up Shipping & Totals HTTP Endpoint

  • Endpoint accepts order_id, currency, and shipping address
  • Endpoint returns order_id, currency, subtotal, and shipping_options array with shipping_type, shipping_label, shipping_amount, tax_amount, and total per option
  • Verify X-Affirm-Signature HMAC header on all incoming requests
  • Serve endpoint over HTTPS (TLS 1.2+)
  • Meet the 5-second response time SLA
  • Handle errors by returning HTTP 422 with an errors array
  • Register your callback URL hostname pattern(s) with your TAM
  • Allowlist Affirm's outbound IPs in your CDN/Firewall (contact TAM for list)

Step 4: Calculate Order Total

  • On checkout confirmation, call Read Checkout API (GET /api/v2/checkout/{checkout_id})
  • Calculate final order total from the returned shipping details
  • Call Authorize Transaction API (POST /api/v1/transactions) with checkout token and order ID
  • Validate your calculated total matches the authorized loan amount
  • Finalize the order, then redirect customer to success or failure page based on validation

Step 5: Add Affirm Checkout Button

  • Add the pre-styled Affirm Checkout button on your website for Express Checkout

Did this page help you?