Payment-method icon

Affirm for API only

Add Affirm to an existing API-only integration.

Accept Affirm payments using our APIs, and build your own payment form to have full control over the look and feel of your checkout page.

When making an Affirm payment, you also need to:

  1. Provide details about the items being purchased when making a payment request.
  2. Capture the payment after the transaction has been fulfilled. When the payment has been captured, Affirm starts the repayment period for the shopper.

Requirements

Requirement Description
Integration type Make sure that you have built an API-only integration.
Setup steps Before you begin, add Affirm in your test Customer Area.

Build your payment form for Affirm

To make an Affirm payment, you need to collect the following shopper details:

Name Description
firstName Shopper's first name.
lastName Shopper's last name.
telephoneNumber Shopper's phone number.
shopperEmail Shopper's email address.
billingAddress The address where to send the invoice.
deliveryAddress The address where the purchased goods should be delivered.

We provide an Affirm logo which you can use in your payment form. For more information, refer to Downloading logos.

Make a payment

From your server, make a /payments request, specifying:

Parameter name Required Description
paymentMethod.type -white_check_mark- Set to affirm.
shopperName.firstName -white_check_mark- Shopper's first name.
shopperName.lastName -white_check_mark- Shopper's last name.
telephoneNumber -white_check_mark- Shopper's telephone number.
shopperEmail -white_check_mark- Shopper's email address.
billingAddress -white_check_mark- 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.