Charge authorization occurs after a user completes the Affirm checkout flow and returns to the merchant site. Authorizing the charge generates a charge ID that will be used to reference it moving forward. You must authorize a charge to fully create it. A charge is not visible in the Read charge response, nor in the merchant dashboard until you authorize it.

Returns

Returns the charge object if the charge succeeded. This call will throw an error if something goes wrong. A common source of error is an invalid or expired checkout_token.

Error handling

If the authorization request fails for some reason, you'll setup error handling to block order creation and direct the user back to payment method selection.

ErrorHTTP statusMessage to displayAction
Authorization failed400"There was an issue authorizing your Affirm loan. Please check out again or use a different payment method."Redirect user back to payment method selection.
Unauthorized401"There was an issue authorizing your Affirm loan. Please check out again or use a different payment method."Redirect user back to payment method selection.
Checkout_token expired401"There was an issue authorizing your Affirm loan. Please check out again or use a different payment method."Redirect user back to payment method selection.
Language
Authentication
Query