Skip to main content

Affirm


Affirm is a real-time financing solution that you can offer to your customers through .

Affirm integrates into your existing checkout experience and enables your customers to pay for their purchases in monthly installments. There are no additional fees for paying with Affirm, which gives your customers the choice to pick an installment plan that works best for them.

Benefits

Affirm optimizes financing with these features:

  • Improved customer choice and experience.
  • Flexible monthly payments.
  • Improved customer enrollment, average return on value, and revenue for each visitor.
  • Reduced risk of fraud and default after shipment.
  • Payment authorization, capture and settlement, and refunds.

Requirements

You must obtain an account ID from Affirm and provide it to Customer Support.

Getting Started with REST

To begin processing payments through , you must first set up your payment processing system to be REST compliant. uses REST for developing web services. REST enables communication between a client and server using HTTP protocols.

For more information about how to set up secure communications between your client and server using either a JSON Web Token or HTTP signature, see Getting Started with REST.

Requesting Services

Request these services using the REST API to process Affirm transactions.

  • Session
  • Authorization
  • Authorization Reversal
  • Capture
  • Refund
  • Transaction Status

Workflow for Processing a Payment

This workflow describes the sequence of events that comprises an Affirm payment.

Figure: Payment Processing Workflow

  1. The customer begins to check out on the merchant's website and chooses to pay with Affirm.
  2. The merchant sends a session API request to . For more information, see Create a Session.
  3. responds to the merchant with the COMPLETED status, Affirm redirect URL, and pre-approval token.
  4. The merchant redirects the customer to the Affirm URL.
  5. The customer completes the payment using Affirm and is redirected to the merchant's website.
  6. The merchant sends an authorization API request to with the pre-approval token. For more information, see Authorize a Payment.
  7. responds to the merchant with the AUTHORIZED status and request ID.
  8. The merchant sends a capture API request to with the request ID. For more information, see Capture a Payment.
  9. responds with the SETTLED status.
  10. The merchant displays a payment confirmation to the customer.

Workflow for Cancelling a Payment

This workflow describes the sequence of events that comprises an Affirm payment cancellation.

Figure: Cancelling a Payment Workflow

  1. The customer begins to check out on the merchant's website and chooses to pay with Affirm.
  2. The merchant sends a session API request to . For more information, see Create a Session.
  3. responds to the merchant with the COMPLETED status, Affirm redirect URL, and pre-approval token.
  4. The merchant redirects the customer to the Affirm URL.
  5. The customer completes the payment using Affirm and is redirected to the merchant's website.
  6. The merchant sends an authorization API request to with the pre-approval token. For more information, see Authorize a Payment.
  7. responds to the merchant with the AUTHORIZED status and request ID.
  8. The customer or merchant decides to cancel the payment.
  9. The merchant sends an authorization reversal request to with the request ID. For more information, see Reverse an Authorization.
  10. responds to the merchant with the AUTH_REVERSED status.
  11. The merchant displays a cancellation confirmation to the customer.

Workflow for Refunding a Payment

This workflow describes the sequence of events that comprises an Affirm refund.

Figure: Refunding Payment Workflow

  1. The customer decides to return a purchase to the merchant.
  2. The merchant sends a refund API request to with the request ID from a settled capture request. For more information, see Refund a Payment.
  3. responds to the merchant with the REFUNDED status and a request ID.
  4. The merchant displays a refund confirmation to the customer.

Transaction Statuses Workflow

This workflow describes the sequence of possible statuses you can receive in an Affirm transaction.

Figure: Transaction Statuses Workflow

  1. The merchant sends a session request to and receives one of these possible statuses:
    • COMPLETED: The session is created. When the customer completes the payment using the Affirm redirect URL, you can send an authorization request.
    • FAILED: The session request is not successful. Send a new session request.
  2. The merchant sends an authorization request to and receives one of these possible statuses:
    • AUTHORIZED: The authorization request is successful and the amount is authorized.
    • FAILED: The authorization request is not successful. Send a new authorization request.
  3. If the customer or merchant decides to cancel the payment, the merchant sends an authorization reversal request to and receives one of these possible statuses:
    • AUTH_REVERSED: The authorization reversal is complete and the purchase is cancelled.
    • FAILED: The authorization reversal request is not successful. Send a new authorization reversal request.
  4. If the customer decides to complete the purchase, the merchant sends a capture request to and receives one of these possible statuses:
    • FAILED: The capture request is not successful. Send a new capture request.
    • SETTLED: The capture is complete and the payment is finalized. You can display a payment confirmation to the customer.
  5. If the customer decides to return the purchase, the merchant sends a refund request to and receives one of these possible statuses:
    • FAILED: The refund request is not successful. Send a new refund request.
    • REFUNDED: The refund is complete and the purchase is refunded. You can display a refund confirmation to the customer.

Last published: September 29, 2026