Preview Refund Allocation
Changed onComputes how a refund would be allocated across the Checkout Session's payment methods, without executing any refund. Takes the same request body as the refund endpoint and returns the per-payment-method allocations so you can preview a split-cart refund before committing.
Request
- Base URLhttps://api.withflex.com
- URLhttps://api.withflex.com/v1/checkout/sessions/{id}/refund_allocation
- AuthHTTP bearer
Path parameters
Request body
Example request
{
"checkout_session": {
"refund_metadata": {
"order_id": "8842",
"channel": "shopify"
},
"amount_tax": 2500,
"amount_shipping": 2500,
"amount_discount": 2500,
"payment_methods": [
{
"payment_method_id": "fpm_01J9XR8M3K7VZ8N2YB4WJ6T0RA",
"amount": 2500
}
],
"line_items": [
{
"amount_to_refund": 2500,
"product": "fprod_01J9XR8M3K7VZ8N2YB4WJ6T0RA",
"price": "fprice_01J9XR8M3K7VZ8N2YB4WJ6T0RA"
}
],
"amount": 0
}
}Response
Preview of how a refund 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 to2147483647.00 - warning
the
/request property's max was set to2147483647.00 - warning
the
/request property's max was set to2147483647.00 - warning
the
///request property's max was set to2147483647.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 - warning
the
///request property's min was set to-2147483648.00
- warning