Set Up In-Store
Integrate Affirm into your point-of-sale system to offer flexible payment options in-store. This guide covers initiating checkouts, sending payment links, authorizing transactions, and managing orders for a seamless customer experience.
Prerequisites
- Create an account in the Affirm Merchant Dashboard.
- Review the Transactions API reference.
Steps
1. In-Store Checkout
Sales associates select Affirm as a payment option in your point-of-sale (POS) system. This action triggers a request to Affirm to send a checkout link via email or text to the customer directly.
POST /api/v2/checkout/store HTTP/1.1
Host: sandbox.affirm.com
Content-Type: application/json
{
"merchant": {
"public_api_key": "PUBLIC_API_KEY",
"user_cancel_url": "https://www.google.com",
"user_confirmation_url": "https://www.affirm.com",
"user_confirmation_url_action": "POST",
"name": "In-store Affirm demo"
},
"billing":{
"name":{
"full": "John Doe"
},
"address":{
"line1": "325 Pacific Ave",
"city": "San Francisco",
"state": "CA",
"zipcode": "94112",
"country": "USA"
},
"phone_number": "4155552222",
"email": "[email protected]"
},
"metadata": {
"entity_name": "Vignan 1234",
"store_location": "Denver"
},
"order_id": "00de5cee-7226-4aec-b729-a571f773a58c",
"total": 5000
}
Receiving the Checkout URL
The Store API sends SMS text messages only in the Affirm Live environment. During Sandbox environment testing, use email messages to receive the Checkout URL to complete your Affirm purchase.
2. Webhook Confirm Event
When a user receives and confirms their loan, Affirm's server is notified of that event. A checkout_id
is POSTed back to your server at the webhook URL you provide.
3. Create Order
On confirmation, Affirm's server POSTs back to your server a checkout event containing the checkout_id
. This checkout_id
, also called the transaction_id, must be authorized securely before saving the order or updating the order's status on the in-store terminal.
4. In-Store Confirmation
Upon a successful authorization via Affirm, the in-store terminal must be able to receive the order confirmation and reflect paid status in near-real-time.
5. Manage Order
You can initiate different transaction actions depending on your internal processes.
What’s Next?
Updated about 7 hours ago