## Authorize charge

The Authorize endpoint creates a loan and reserves the funds. When you authorize, Affirm will generate a `charge_id` that you’ll use to reference the charge moving forward. You must authorize a charge to fully create it.

_If you do not authorize a charge, it will not be considered active. This means the user will not see the loan, and you will not be able to capture the funds. For this reason, you should authorize the loan as soon as you receive a checkout token._

To authorize a charge, you'll need the `checkout_token` returned from your [client integration](🔗).

You should receive a response that looks like this with the `charge_id`.

After successfully authorizing a charge and receiving the response object, your site should do the following:

  • Validate that the authorized amount equals the order total

  • Store the `charge_id`

  • Mark the order payment as pending

If the authorization fails, your site could potentially store this checkout attempt, as it is **not** required on our end.

You should only authorize a given Affirm loan once for the entire amount of the transaction being purchased. If you have a specific use case where this may be difficult, please contact us at [[email protected]](🔗) or use the widget at the bottom of the page.

## Capture a charge

Once an order has been fulfilled, you must send a `Capture` API request to Affirm in order to capture or settle the funds. You will want to perform this activity from your secure back-end systems. To capture a previous authorization, you'll need the `charge_id` provided in the `Authorization` API response. There aren't any required fields that need to be stored from the `Capture` response.

Capturing the funds is similar to capturing a credit card transaction. After capturing the loan, we do the following:

  • We notify the customer that the loan has been captured and that their first payment is due to Affirm in 30 days

  • Pay the merchant within 2-3 business days

You will then receive back a response with the confirmation.