Laravel Polar exposes refund operations directly on theDocumentation Index
Fetch the complete documentation index at: https://danestvesllc-2b77d201.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Order model. Issue a full refund, a partial refund, or a targeted refund with a reason, comment, and metadata — without leaving PHP.
Under the hood, $order->refund() calls the Polar Refunds API. You can also use the LaravelPolar facade directly when managing refunds outside the context of a single order model instance.
Full refund
Callrefund() with no arguments to refund the entire remaining unrefunded amount. The reason defaults to customer_request.
$order->amount - $order->refunded_amount, so calling it on a partially refunded order will cover only what remains.
Partial refund
Pass an explicitamount in minor units (cents) to refund only part of the order:
Refund with reason, comment, and metadata
For more detailed refunds — such as those triggered by fraud detection or support tickets — pass any combination ofreason, comment, and metadata:
Available reasons
| Enum value | When to use |
|---|---|
RefundReason::CustomerRequest | Customer asked for a refund (default) |
RefundReason::Fraudulent | Fraudulent transaction or chargeback risk |
RefundReason::Duplicate | Order was placed more than once |
RefundReason::Other | Any other reason |
Listing previous refunds
Callrefunds() on an order to retrieve a collection of all refunds issued against it:
refunds() returns an empty collection when the order has no polar_id.
Using the facade directly
For admin workflows that operate across multiple orders, useLaravelPolar::createRefund() and LaravelPolar::listRefunds() directly:
$order->refund() and LaravelPolar::createRefund() both call the same Polar endpoint. Use whichever fits your workflow — $order->refund() when you have a model instance, the facade when working with raw order IDs.