Authorize Transaction
Changed onAuthorizes 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.
Request
- Base URLhttps://sandbox.affirm.com/api/v1
- URLhttps://sandbox.affirm.com/api/v1/transactions
- AuthHTTP basic
Headers
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
Example response
{
"status": "authorized",
"amount_refunded": 5000,
"provider_id": 1,
"amount": 20000,
"authorization_expiration": "2019-01-01T00:00:00.000Z",
"checkout_id": "HTSZAGURU7PZ8ZAG",
"id": "ABCD-1234",
"events": [
{
"type": "refund",
"currency": "USD",
"created": "2019-01-01T00:00:00.000Z",
"amount": 20000,
"fee": 500,
"id": "1234567890ABCDEF"
}
],
"remove_tax": true,
"currency": "USD",
"order_id": "order_125",
"created": "2019-01-01T00:00:00.000Z"
}Changes
- warning
removed the optional property
from the response with the status - warning
removed the optional property
from the response with the status
- warning