Telesales
Telesales is an alternative way of initiating the Affirm checkout.
Overview
The Telesales Checkout API is an efficient method for initiating the Affirm checkout process. This user-friendly feature enables telesales agents to kick-start the checkout process for customers, seamlessly integrating the experience with the in-store flow.
How it works
Customer flow
When a customer completes a checkout, it triggers a browser redirect along with a webhook request that contains the checkout_token for authorization.
Security
We prioritize privacy and security for our customers. Therefore, the Telesales API requires customers to apply using their own device. Upon submitting an API request, Affirm sends a text message or email to the provided phone number or email address, containing a link to the customer’s online application.
Using Webhooks
For added efficiency and reliability, you have the option to provide Affirm with a webhook address for server-to-server confirmation of the checkout_token (after the customer confirms their loan) While Affirm will continue to POST the token to the user_confirmation_url
, utilizing a webhook can minimize the risk of client/browser errors and expedite the payment status update in your telesales system.
Integration steps
Step 1: Add Affirm as a payment option in your Telesales flow
When customers choose to pay with Affirm over the phone, your telesales agents will select Affirm as a payment option from your frontend (or agent dashboard). A sample frontend template and instructions can be found here.
Step 2: Call the /store API to initiate Affirm Checkout Call
When a customer selects Affirm, send the order and customer details to Affirm’s /store API. This prompts Affirm to send the customer a link via text and/or email to finish their checkout with Affirm. See the example below: \
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.cancelurl.com",
"user_confirmation_url": "https://www.confirmationurl.com",
"user_confirmation_url_action": "POST",
"name": "Telesales 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": "your_order_identifier_ABC_123",
"total": 5000
}
Testing
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.
In the response, you’ll receive the redirect_url
that the customer was sent as well as an Affirm checkout_id
which will be used for authorization.
Step 3: Receive Order Confirmation via Webhook
Once a user receives and confirms their loan, Affirm's server will be notified of that event. The checkout_id
will be POSTed back to your server at the webhook URL that you provide your Technical Account Manager.
Webhook Configuration
A webhook URL will need to be configured to complete the in-store integration. Please reach out to Affirm through your Account team or the support widget.
Call Affirm’s /transactions API and pass the checkout_id
to the transaction_id
parameter and authorize the order. The order must be authorized securely before saving the order or updating the order's status on the agent’s dashboard.
Step 4: Update the Agent Frontend
Update your agent frontend that the order has been authorized. At this step, the telesales agent can proceed with finalizing the order for the customer.
Step 5: Capture and Manage the Order
With the persistent id
received from authorization, you can initiate different transaction actions such as capturing the order on fulfillment or issuing a refund depending on your internal processes.
Updated 9 months ago