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
- The customer begins to check out on the merchant's website and chooses to pay with Affirm.
- The merchant sends a session API request to . For more information, see Create a Session.
- responds to the merchant with the
COMPLETEDstatus, Affirm redirect URL, and pre-approval token. - The merchant redirects the customer to the Affirm URL.
- The customer completes the payment using Affirm and is redirected to the merchant's website.
- The merchant sends an authorization API request to with the pre-approval token. For more information, see Authorize a Payment.
- responds to the merchant with the
AUTHORIZEDstatus and request ID. - The merchant sends a capture API request to with the request ID. For more information, see Capture a Payment.
- responds with the
SETTLEDstatus. - 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
- The customer begins to check out on the merchant's website and chooses to pay with Affirm.
- The merchant sends a session API request to . For more information, see Create a Session.
- responds to the merchant with the
COMPLETEDstatus, Affirm redirect URL, and pre-approval token. - The merchant redirects the customer to the Affirm URL.
- The customer completes the payment using Affirm and is redirected to the merchant's website.
- The merchant sends an authorization API request to with the pre-approval token. For more information, see Authorize a Payment.
- responds to the merchant with the
AUTHORIZEDstatus and request ID. - The customer or merchant decides to cancel the payment.
- The merchant sends an authorization reversal request to with the request ID. For more information, see Reverse an Authorization.
- responds to the merchant with the
AUTH_REVERSEDstatus. - 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
- The customer decides to return a purchase to the merchant.
- The merchant sends a refund API request to with the request ID from a settled capture request. For more information, see Refund a Payment.
- responds to the merchant with the
REFUNDEDstatus and a request ID. - 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
- 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.
- 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.
- 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.
- 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.
- 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.
Thanks for your feedback!
Last published: September 29, 2026