v1
latestOpenAPI 3.0.02026-07-262561105.1 KBTransactions API
Authorize Transaction
Authorizes a transaction. After a user completes the Affirm checkout flow and returns to the merchant site, the merchant should call the Authorize Transaction endpoint. Authorizing a transaction generates a unique id that will be used as a reference moving forward.
post/transactions
Headers
Idempotency-Keystring
Unique identifier pre-generated by the client and used by the server to recognize successive calls to the same endpoint. This is required for Split Capture and encouraged for single transaction functionality. Note: If a request fails or times out, use the same idempotency key to retry the operation without risk of double-processing. For details, see the Idempotency section on About Split Capture.
Request body
Example request
{
"expand": "checkout",
"order_id": "order_125",
"reference_id": "202307011027",
"transaction_id": "1234567890ABCDEF",
"currency": "USD",
"total": 1999,
"shipping": {
"name": {
"first": "John",
"last": "Doe",
"full": "John Doe"
},
"address": {
"line1": "123 Example Street",
"line2": "Apt 123",
"city": "San Francisco",
"state": "CA",
"country": "US"
},
"email": "test@example.com"
},
"items": [
{
"item": {
"display_name": "Awesome Pants",
"sku": "ABC-123",
"unit_price": 1999,
"qty": 3,
"item_image_url": "http://merchantsite.com/images/awesome-pants.jpg",
"item_url": "http://merchantsite.com/products/awesome-pants.html"
}
}
]
}Response
HTTP 200 OK