---
title: "Preview Capture Allocation"
method: POST
path: "/v1/checkout/sessions/{id}/capture_allocation"
tags: ["Checkout Sessions"]
---

# Preview Capture Allocation

`POST /v1/checkout/sessions/{id}/capture_allocation`

Computes how a capture would be allocated across the Checkout Session's payment methods,
without executing any capture. Takes the same request body as the capture endpoint and
returns the per-payment-method allocations so you can preview a split-cart capture before
committing.

## Path parameters

- `id` string, required

## Request body

- CheckoutSessionBodyForCaptureCheckoutSessionRequest — An envelope wrapping a single checkout session object.
  - `checkout_session` CaptureCheckoutSessionRequest, required — Parameters for capturing funds previously authorized on a Checkout Session.
    - `final_capture` boolean, nullable — Whether this is the final capture. When `true`, any uncaptured authorized amount is released; when `false` (Default), the remaining amount stays authorized and can be captured by a subsequent request. `null` defaults to `false`.
    - `line_items` LineItemCaptureRequest[], nullable — The specific line items and amounts to capture. Omit to capture the full authorized amount across all line items.
      - `amount_to_capture` integer, nullable — The amount to capture for this line item, in the smallest currency unit (e.g., `2500` = $25.00 USD). Omit to capture the full authorized amount for the item.
      - `product` string — ID of the Product identifying the line item.
      - `price` string — ID of the Price identifying the line item.
    - `metadata` object, nullable — Set of key-value pairs to attach to the capture for storing additional structured information.
    - `capture_metadata` object, nullable — Set of key-value pairs to set on the Checkout Session's `metadata` when the capture succeeds. `null` to leave the session metadata unchanged.
    - `amount_shipping` integer, nullable — Portion of the captured amount attributable to shipping, in the smallest currency unit (e.g., `599` = $5.99 USD).
    - `amount_discount` integer, nullable — Portion of the captured amount attributable to discounts, in the smallest currency unit (e.g., `500` = $5.00 USD).
    - `amount_tax` integer, nullable — Portion of the captured amount attributable to tax, in the smallest currency unit (e.g., `175` = $1.75 USD).

## Response `200`

Preview of how a capture would be distributed across the session's payment methods.

- CaptureAllocationResponse — Preview of how a capture would be distributed across the session's payment methods.
  - `allocations` CaptureAllocation[], required — The computed capture amount allocated to each payment method. No capture is executed.
    - `payment_method_id` string, required — ID of the PaymentMethod this portion of the capture is allocated to.
    - `last4` string, required — The last four digits of the card backing this payment method. `"unknown"` if the card details could not be resolved.
    - `amount` integer, required — Amount allocated to this payment method, in the smallest currency unit (e.g., `2500` = $25.00 USD).

## Other responses

- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not Found
- `409` — Conflict
- `422` — Validation Error
- `429` — Too Many Requests

---

[API](https://skmtc.dev/withflex/apis/flex-api.md) · [All operations](https://skmtc.dev/withflex/apis/flex-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/withflex/flex-api/revisions/b1560fc2f199/schema)
