Are you looking for test card numbers?

Would you like to contact support?

Payment-method icon

Affirm Drop-in integration

Add Affirm to an existing Drop-in integration.

On this page, you can find additional configuration for adding Affirm to your Drop-in integration.

Before you begin

This page assumes you have already:

API reference

Select which endpoint you're integrating:

This is the default with Drop-in v5.0.0 or later.

Parameter name Required Description
shopperName -white_check_mark- Shopper's first name and last name.
telephoneNumber -white_check_mark- The shopper's phone number.
shopperEmail -white_check_mark- The shopper's email address.
shopperReference -white_check_mark- A unique reference to identify the shopper (minimum length three characters).
billingAddress The address where to send the invoice.
deliveryAddress The address where the purchased goods should be delivered. If blank or missing, billingAddress is used by default.
lineItems Price and product information about the purchased items. This is optional, but we recommend to include this data to improve approval rates.
curl \
-H "x-API-key: YOUR_X-API-KEY" \
-H "content-type: application/json" \
-d '{
   "{ from onSubmit}billingAddress{/hint}":{
      "city":"San Francisco",
      "street":"Brannan St."
   "{ from onSubmit}deliveryAddress{/hint}":{
      "city":"San Francisco",
      "street":"Brannan St."
         "id":"Item #1",
         "id":"Item #2",

Optional Drop-in configuration

You can add the optional visibility configuration object to have more control over which fields are displayed to the shopper:

Parameter name Description
personalDetails Shopper name, phone number, and email address.
billingAddress The address where to send the invoice.
deliveryAddress The address where the purchased goods should be delivered.

If you want to add optional configuration, include this in a configuration object.

const affirmConfiguration = {
  visibility: {
      personalDetails: "hidden", // These fields will not appear on the payment form.
      billingAddress: "readOnly", // These fields will appear on the payment form,
                                //but the shopper can't edit them.
      deliveryAddress: "editable" // These fields will appear on the payment form,
                                // and the shopper can edit them.
                                // This is the default behavior.

If you created a affirmConfiguration object, include this when creating a configuration object:

AdyenCheckout configuration
const configuration = {
  // ...  other required configuration
  paymentMethodsConfiguration: {
    affirm: affirmConfiguration

Capture the payment

After the goods have been sent, you also need to capture the payment. All Affirm payments have to be manually captured, even if you have enabled automatic capture for other payment methods. Capturing the payment is what triggers the installment payment schedule for the shopper.

If for any reason you need to capture a lesser amount than what was authorised, you need to issue a refund for the difference after the capture, that . For example, a customer purchases two items of $500 each, totaling $1.000, but only one is fulfilled. After capturing $1.000, you should issue a subsequent refund for the unfulfilled item of $500.

Test and go live

To receive your test credentials, contact Affirm. After reviewing your test transactions, Affirm will provide you with the credentials for processing live transactions.

You can check the status of the test payments in your test Customer Area > Transactions > Payments.

Before you can accept live Affirm payments, you need to submit a request for Affirm in your live Customer Area, and provide us with your Affirm live credentials.