Affirm-developers

Transaction Flow

Overview

Affirm's basic process flow begins when the customer selects Affirm at checkout. The steps below represents what the customer experiences on the front-end, and how Affirm's integration handles the checkout on the back-end.

The full transaction flow consist of the following steps:

1. Customer begins checkout
2. Create checkout object
3. Collect customer information
4. Authorize the charge and complete the order

Customer begins checkout

The steps below represent the customer's checkout experience when they choose Affirm:

1. The customer goes to the shopping cart and begins checkout.
2. The customer selects the Affirm payment method during checkout.
3. The customer submits checkout.

Create Checkout object

1. The merchant creates the checkout object.
2. The merchant sends the checkout object to Affirm.
3. The customer is either:

  • redirected to Affirm.
  • sees an Affirm modal.

Collect customer informtion

1. The customer signs in or creates an account with Affirm.
2. The customer selects loan terms.
3. The customer confirms loan terms.
4. Affirm redirects the customer to the merchant page defined in the user_confirmation_url property of the checkout object.
5. Affirm sends an HTTP request with the checkout token to the merchant page.
6. The merchant parses the response and stores the checkout token.

Authorize the charge and complete the order

1. The merchant sends an authorization request using checkout token to the Affirm Charge API
2. The Affirm Charge API responds with an authorized amount and the merchant-supplied order ID.
3. The merchant verifies that the authorized amount equals the order total.
4. The merchant verifies the order ID.
5. The merchant stores the charge ID, which is used for all future charge actions, retrieved from the Affirm [Charge API] response.
6. The merchant redirects the customer to order confirmation page or shows a confirmation message.
7. The order is complete.

After the order is complete, the merchant will fulfill the order.