In-store
Merchants stores can integrate their point of sale systems to support Affirm payment.
How it works
This diagram shows how your customers, your point of sale system, your server (e.g OMS) and Affirm interact:
1. In-store checkout
Sales associates will select Affirm as a payment option from your point of sale system. This action will trigger a request to Affirm to send a checkout link (via email/text) to the customers 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
}
The Store API will send SMS text messages only in the Affirm Live environment. During Sandbox environment testing, please rely on email messages to receive the Checkout URL to complete your Affirm purchase.
2. Webhook confirm event
Once a user receives and confirms their loan, Affirm's server will be notified of that event. A checkout_id
will be POSTed back to your server at the webhook URL you provided
A webhook URL will need to be configured to complete the in-store integration. Please reach out to Affirm via the support widget.
3. Create order
On confirmation, Affirm's server will POST
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.
Updated 9 months ago