Afterpay
Afterpay is a Buy Now, Pay Later payment method popular in the United States. When the consumer chooses to pay with Afterpay, they simply enter their personal information for a risk check and, if they are approved, Afterpay pays you up front. Consumers later pay back Afterpay in 4 interest-free installments. Learn more.
Markets | US |
Processing currencies | USD |
Consumer currencies | USD |
Settlement currencies | USD |
Minimum payment amount | Configured per merchant |
Maximum payment amount | Configured per merchant |
Recurring payments | No |
Separate captures | No |
Timeout | 4 hours |
Refund Types | Full - Partial - Multiple partial |
Refund Validity | 120 days |
Chargeback | Yes |
Sandbox Availability | Afterpay native sandbox |
Integrating Afterpay into your checkout
You can use Afterpay's messaging widget to optimize how Afterpay is displayed in your checkout and ensure you are always compliant with Afterpay's terms of service.
Make an Afterpay Payment
Request
To make a payment with Afterpay, you'll need to provide the following data at minimum when you call our Payment Charges API:
Data Field | Required | Description |
---|---|---|
paymentMethod | Y | AFTERPAY |
amount.value | Y | The amount to be paid in the smallest units of the currency used. |
amount.currency | Y | The currency used for the payment |
consumer.name | Y | The full name of the consumer |
consumer.email | Y | The consumer's email address |
consumer.country | Y | The country where the consumer is shopping |
order.orderReferenceNumber | Y | Your order reference id provided to the consumer |
order.shippingAddress | Y | The shipping address to deliver the goods |
consumer.billingAddress | It is recommended to include a billing address for the consumer | |
order.orderItems | You can list all order items with name, quantity and amount for each | |
webhooksUrl | You should include the endpoint url where you want to receive webhooks for updates to the payment charge. |
POST /v1/payment-charges
{
"paymentMethod": "AFTERPAY",
"amount": {
"value": 1000,
"currency": "USD"
},
"consumer": {
"name": "Connor Summer",
"email": "consumer@gmail.com",
"country": "US",
"billingAddress": {
"firstName": "Connor",
"lastName": "Summer",
"street": "First Street 1",
"postalCode": "03240",
"city": "San Francisco",
"region": "California",
"country": "US"
}
},
"order": {
"orderItems": [
{
"name": "White T-Shirt",
"quantity": 1,
"amount": 1000
}
],
"orderReferenceNumber": "13412943298",
"shippingAddress": {
"firstName": "Connor",
"lastName": "Summer",
"street": "Maple Street 10",
"postalCode": "41460",
"city": "San Mateo",
"region": "California",
"country": "US"
}
},
"webhooksUrl": "https://your-webhooks-endpoint/",
"authenticationSettings": [
{
"type": "REDIRECT",
"settings": {
"returnUrl": "https://example.com/order_details?order_id=12345"
}
}
]
}
Response
You'll receive one of our standard payment charge responses (see potential responses in the API Reference)
{
"id": "charge_SFixoMZGlaD7qEwhnIVSL",
"status": "AUTHENTICATION_PENDING",
"authenticationMethods": [
{
"type": "REDIRECT",
"details": {
"requestUrl": "https://afterpay.com/login",
"requestMethod": "GET",
}
}
]
}
Consumer Authentication
Afterpay requires authentication by the consumer, which they do by logging into their Afterpay account and approving the installment plan there. You will receive a redirect link to send the consumer to this login page. Learn more about the REDIRECT
authentication type in the Payment Authentication guide.
The authenticationMethods
array in the response will contain a REDIRECT
authentication type. You will need to redirect their browser to the link provided in the requestUrl
field of the authenticationMethod details.
Handling the Payment Result
The payment charge will remain in the AUTHENTICATION_PENDING
state until the consumer logs in to their Afterpay account and accepts the payment plan. After this, the charge will transition to the CAPTURED
state automatically.
The consumer will be redirected to the authenticationMethods.settings.returnUrl
provided in the initial payment charge creation request, depending on whether the authorization is a success, a failure or if the user cancelled/aborted the flow.
If the consumer fails to authenticate the payment within the timeout window, the charge will transition to the DISCARDED
state.
You can receive webhooks for all changes to the payment charge state and use these to build business logic such as delivering the goods when the charge is CAPTURED.
Updated about 3 hours ago