orders->get('ord_8wmqcHMN4U'); $refund = $order->refund(['lines' => [['id' => 'odl_dgtxyl', 'quantity' => 1]], "description" => "Required quantity not in stock, refunding one photo book."]); echo 'Refund ' . $refund->id . ' was created for part of your order ' . $order->id; echo 'You will receive ' . $refund->amount->currency . $refund->amount->value; } catch (\Mollie\Api\Exceptions\ApiException $e) { echo "API call failed: " . \htmlspecialchars($e->getMessage()); }