---
updatedAt: 2025-11-13T14:13:11.000Z
agentTools:
  siteIndex: https://docs.affirm.com/llms.txt
  projectIndex: https://docs.affirm.com/developers/llms.txt
---

# Authorize Charge

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.

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "Charges API",
    "version": "1.3"
  },
  "security": [
    {
      "basicAuth": []
    }
  ],
  "paths": {
    "/charges": {
      "post": {
        "tags": [
          "Charges API"
        ],
        "operationId": "authorize_charge",
        "summary": "Authorize Charge",
        "description": "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.",
        "requestBody": {
          "description": "The `checkout_id` generated on your client.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AuthorizeRequest",
                "description": "The `checkout_id` generated on your client."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "HTTP 200 OK",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/Charge"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400 Bad Request",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401 Unauthorized",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorUnauthorized"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404 Not Found",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorNotFound"
                }
              }
            }
          }
        }
      }
    }
  },
  "servers": [
    {
      "url": "https://api.affirm.com/api/v2"
    },
    {
      "url": "https://sandbox.affirm.com/api/v2"
    }
  ],
  "components": {
    "securitySchemes": {
      "basicAuth": {
        "type": "http",
        "scheme": "basic"
      }
    },
    "schemas": {
      "ErrorBadRequest": {
        "properties": {
          "message": {
            "description": "The error message.",
            "example": "Bad Request",
            "type": "string"
          },
          "status_code": {
            "description": "The HTTP status code.",
            "example": 400,
            "type": "integer"
          },
          "type": {
            "description": "The error type.",
            "example": "BAD_REQUEST",
            "type": "string"
          },
          "code": {
            "description": "The error type.",
            "example": "BAD_REQUEST",
            "type": "string"
          }
        }
      },
      "ErrorNotFound": {
        "properties": {
          "message": {
            "description": "The error message.",
            "example": "Not Found",
            "type": "string"
          },
          "status_code": {
            "description": "The HTTP status code.",
            "example": 404,
            "type": "integer"
          },
          "type": {
            "description": "The error type.",
            "example": "NOT_FOUND",
            "type": "string"
          },
          "code": {
            "description": "The error type.",
            "example": "NOT_FOUND",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ErrorUnauthorized": {
        "properties": {
          "message": {
            "description": "The error message.",
            "example": "Unauthorized",
            "type": "string"
          },
          "status_code": {
            "description": "The HTTP status code.",
            "example": 401,
            "type": "integer"
          },
          "type": {
            "description": "The error type.",
            "example": "UNAUTHORIZED",
            "type": "string"
          },
          "code": {
            "description": "The error type.",
            "example": "UNAUTHORIZED",
            "type": "string"
          }
        },
        "type": "object"
      },
      "AuthorizeRequest": {
        "type": "object",
        "properties": {
          "checkout_token": {
            "required": [
              "checkout_token"
            ],
            "description": "The checkout_id generated on your client.",
            "example": "ABCD1234",
            "type": "string"
          },
          "order_id": {
            "description": "Identifies the order within the merchant's order management system that this charge corresponds to. It is only returned in the response if included in the request.",
            "example": "A1B2C3D4",
            "maxLength": 128,
            "minLength": 1,
            "type": "string"
          }
        }
      },
      "Charge": {
        "type": "object",
        "properties": {
          "id": {
            "description": "A unique identifier representing the charge. ",
            "example": "ALO4-UVGR",
            "type": "string"
          },
          "status": {
            "description": "The status of the charge.",
            "example": "captured",
            "type": "string"
          },
          "created": {
            "description": "The time when the charge was created. The value is formatted in RFC 3339.",
            "example": "2019-01-01T00:00:00Z",
            "type": "string"
          },
          "currency": {
            "description": "The local currency of the charge with its being a valid subset of the ISO 4217 currency code.",
            "example": "USD",
            "type": "string"
          },
          "amount": {
            "description": "The original amount financed to the customer in this charge. The value is non-negative and is represented in the smallest currency unit, such as cents instead of dollars.",
            "example": 20000,
            "type": "integer"
          },
          "authorization_hold": {
            "description": "The amount of the authorization hold on the charge. ",
            "example": 6100,
            "type": "integer"
          },
          "payable": {
            "description": "The payable amount of the charge. ",
            "example": 0,
            "type": "integer"
          },
          "void": {
            "description": "Indicates if the charge was voided. ",
            "example": false,
            "type": "boolean"
          },
          "expires": {
            "description": "The time when the charge will expire. The value is formatted in RFC 3339.",
            "example": "2019-04-18T19:19:04Z"
          },
          "order_id": {
            "description": "Identifies the order within the merchant's order management system that this charge corresponds to.",
            "example": "A1B2C3D4",
            "type": "string"
          },
          "events": {
            "description": "An array of TransactionEvent objects.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ChargeEvent"
            }
          },
          "details": {
            "description": "An array of Details objects.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Details"
            }
          },
          "shipping_amount": {
            "description": "The amount to ship the item.",
            "example": 400,
            "type": "integer"
          },
          "tax_amount": {
            "description": "The shipping tax amount.",
            "example": 700,
            "type": "integer"
          },
          "shipping": {
            "type": "object",
            "properties": {
              "name": {
                "type": "object",
                "properties": {
                  "full": {
                    "description": "The customer's name.",
                    "example": "John Doe",
                    "type": "string"
                  }
                }
              },
              "address": {
                "type": "object",
                "properties": {
                  "line1": {
                    "description": "A U.S. street address.",
                    "example": "123 Example Street",
                    "type": "string"
                  },
                  "line2": {
                    "description": "The apartment number, floor or suite that complements the street address.",
                    "example": "Apt 123",
                    "type": "string"
                  },
                  "city": {
                    "description": "The name of the city.",
                    "example": "San Francisco",
                    "type": "string"
                  },
                  "state": {
                    "description": "The 2-letter postal abbreviation or full name of the U.S. state.",
                    "example": "CA",
                    "type": "string"
                  },
                  "zipcode": {
                    "description": "The 5-digit postal code of the address.",
                    "example": "94107",
                    "type": "string"
                  },
                  "country": {
                    "description": "The abbreviated name of the country.",
                    "example": "USA",
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      },
      "Details": {
        "type": "object",
        "properties": {
          "product": {
            "type": "object",
            "properties": {
              "sku": {
                "description": "The Stock Keeping Unit of the product.",
                "maxLength": 128,
                "minLength": 1,
                "type": "string"
              },
              "display_name": {
                "description": "The name of the product.",
                "example": "Sweater",
                "maxLength": 128,
                "minLength": 1,
                "type": "string"
              },
              "qty": {
                "description": "The quantity of the item.",
                "example": 2,
                "type": "integer"
              },
              "item_type": {
                "description": "Identifies the type of the item.",
                "example": "physical",
                "maxLength": 128,
                "minLength": 1,
                "type": "string"
              },
              "item_image_url": {
                "description": "The URL linking to the image.",
                "example": "http://placehold.it/350x150",
                "type": "string"
              },
              "item_url": {
                "description": "The URL linking to the item.",
                "example": "http://placehold.it/350x150",
                "type": "string"
              },
              "unit_price": {
                "description": "The price of the item",
                "example": 5000,
                "minimum": 1,
                "type": "integer"
              }
            }
          }
        }
      },
      "ChargeEvent": {
        "type": "object",
        "properties": {
          "amount": {
            "description": "The total value of the charge, including tax and shipping. The value is non-negative and is represented in the smallest currency unit, such as cents instead of dollars. If the type is capture, this field represents the amount captured. If the type is refund, this field represents the amount refunded, including the fee that was refunded.",
            "example": 20000,
            "type": "integer"
          },
          "created": {
            "description": "The time when the charge event was created. The value is formatted in RFC 3339.",
            "example": "2019-01-01T00:00:00Z",
            "type": "string"
          },
          "currency": {
            "description": "The local currency of the charge with its being a valid subset of the ISO 4217 currency code.",
            "example": "USD",
            "type": "string"
          },
          "fee": {
            "description": "The merchant fee.",
            "example": 500,
            "type": "integer"
          },
          "fee_refunded": {
            "description": "Portion of the refunded amount that is subtracted from the merchant fee.",
            "example": 500,
            "type": "integer"
          },
          "id": {
            "description": "A unique identifier for the charge event.",
            "example": "79JHNWEMTCO3YXHE",
            "type": "string"
          },
          "transaction_id": {
            "description": "An optional, unique identifier that may be associated with each charge event and reconciled with the system of record used by the merchant.",
            "example": "ozd441HqnwpJVZl",
            "maxLength": 128,
            "minLength": 1,
            "type": "string"
          },
          "merchant_transaction_id": {
            "description": "Your internal charge reference number; it may be different for each auth, capture, void, refund request for a single order.",
            "example": "W1X2Y3Z4",
            "maxLength": 128,
            "minLength": 1,
            "type": "string",
            "nullable": true
          },
          "order_id": {
            "description": "An optional, unique identifier that may be associated with each charge event and reconciled with the system of record used by the merchant.",
            "example": "4134623150183",
            "maxLength": 128,
            "minLength": 1,
            "type": "string"
          },
          "type": {
            "description": "The type of event.",
            "enum": [
              "auth",
              "auth_expired",
              "capture",
              "confirm",
              "confirmation_expired",
              "refund",
              "split_capture",
              "update",
              "void",
              "partial_void",
              "refund_voided"
            ],
            "example": "capture",
            "type": "string"
          }
        }
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true,
    "samples-enabled": true
  }
}
```