Checkout Sessions

Preview Capture Allocation

Changed on

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.

post/v1/checkout/sessions/{id}/capture_allocation

Request

  • Base URL
    https://api.withflex.com
  • URL
    https://api.withflex.com/v1/checkout/sessions/{id}/capture_allocation
  • Auth
    HTTP bearer

Path parameters

idstring required
Example:fcs_01J9XR8M3K7VZ8N2YB4WJ6T0RA

Request body

Example request

{
  "checkout_session": {
    "final_capture": false,
    "line_items": [
      {
        "amount_to_capture": 2500,
        "product": "fprod_01J9XR8M3K7VZ8N2YB4WJ6T0RA",
        "price": "fprice_01J9XR8M3K7VZ8N2YB4WJ6T0RA"
      }
    ],
    "metadata": {
      "order_id": "8842",
      "channel": "shopify"
    },
    "capture_metadata": {
      "order_id": "8842",
      "channel": "shopify"
    },
    "amount_shipping": 2500,
    "amount_discount": 2500,
    "amount_tax": 2500
  }
}

Response

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

Example response

{
  "allocations": [
    {
      "payment_method_id": "fpm_01J9XR8M3K7VZ8N2YB4WJ6T0RA",
      "last4": "4242",
      "amount": 2500
    }
  ]
}

Changes

    • warning

      the / request property's max was set to 2147483647.00

    • warning

      the / request property's max was set to 2147483647.00

    • warning

      the / request property's max was set to 2147483647.00

    • warning

      the / request property's min was set to -2147483648.00

    • warning

      the / request property's min was set to -2147483648.00

    • warning

      the / request property's min was set to -2147483648.00