---
title: "Authorize Transaction"
method: POST
path: "/transactions"
tags: ["Transactions API"]
---

# Authorize Transaction

`POST /transactions`

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.

## Headers

- `Idempotency-Key` string

## Request body

- AuthorizeRequest
  - `expand` string — A comma-separated set of related objects to expand in the response.
  - `order_id` string — Identifies the order within the merchant's order management system that this transaction corresponds to. It is only returned in the response if included in the request.
  - `reference_id` string — An optional, unique identifier that may be associated with each transaction event and reconciled with the system of record used by the merchant.
  - `transaction_id` string — Required. A unique identifier representing the checkout.
  - `currency` string — Three-letter ISO currency code in uppercase.
  - `total` integer — The total amount of the checkout in the lowest denomination of the currency.
  - `shipping` AuthorizeShippingAddress
    - `name` object
      - `first` string — Customer's first name. Can also contain multiple words (for middle names).
      - `last` string — Customer's last name.
      - `full` string — Required if `first` and `last` keys are missing. The string must contain at least two words.
    - `address` object
      - `line1` string — Address line 1 (e.g., street, PO Box, or company name).
      - `line2` string — Address line 2 (The apartment
      - `city` string — City, district, suburb, town, or village.
      - `state` string — State, county, province, or region.
      - `zipcode` string — ZIP or postal code.
      - `country` string — Two-letter country code (ISO 3166-1 alpha-2).
    - `phone_number` string — The phone number of the customer.
    - `email` string — The email address of the customer.
  - `items` AuthorizeItemsSKU[] — An array of various details of the item being sold.
    - `item` object
      - `display_name` string — The display name of the product.
      - `sku` string — The product SKU.
      - `unit_price` integer — The item price amount in USD or CAD cents.
      - `qty` integer — The item quantity expressed as an integer.
      - `item_image_url` string — The item's product image URL.
      - `item_url` string — The item's product description page URL.

## Response `200`

HTTP 200 OK

## Other responses

- `400` — HTTP 400 Bad Request
- `401` — HTTP 401 Unauthorized
- `404` — HTTP 404 Not Found

---

[API](https://skmtc.net/affirm/apis/merchant-transaction-api.md) · [All operations](https://skmtc.net/affirm/apis/merchant-transaction-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/affirm/merchant-transaction-api/versions/f2f4252c946f/schema)
