Home > @shopware-pwa/composables > useOrderDetails

# useOrderDetails() function

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Composable for managing an existing order.

Signature:

export declare function useOrderDetails(params: {
    order: Ref<Order> | Order;
}): {
    order: ComputedRef<Order | undefined | null>;
    status: ComputedRef<string | undefined>;
    total: ComputedRef<number | undefined>;
    subtotal: ComputedRef<number | undefined>;
    shippingCosts: ComputedRef<number | undefined>;
    shippingAddress: ComputedRef<ShippingAddress | undefined>;
    billingAddress: ComputedRef<BillingAddress | undefined>;
    personalDetails: ComputedRef<{
        email: string | undefined;
        firstName: string | undefined;
        lastName: string | undefined;
    }>;
    paymentUrl: Ref<null | string>;
    shippingMethod: ComputedRef<ShippingMethod | undefined | null>;
    paymentMethod: ComputedRef<PaymentMethod | undefined | null>;
    errors: UnwrapRef<{
        [key: string]: ShopwareError[];
    }>;
    loaders: UnwrapRef<{
        [key: string]: boolean;
    }>;
    loadOrderDetails: () => void;
    handlePayment: (successUrl?: string, errorUrl?: string, paymentDetails?: unknown) => void;
    cancel: () => Promise<void>;
    changePaymentMethod: (paymentMethodId: string) => Promise<void>;
};

# Parameters

Parameter Type Description
params { order: Ref<Order> | Order; }

Returns:

{ order: ComputedRef<Order | undefined | null>; status: ComputedRef<string | undefined>; total: ComputedRef<number | undefined>; subtotal: ComputedRef<number | undefined>; shippingCosts: ComputedRef<number | undefined>; shippingAddress: ComputedRef<ShippingAddress | undefined>; billingAddress: ComputedRef<BillingAddress | undefined>; personalDetails: ComputedRef<{ email: string | undefined; firstName: string | undefined; lastName: string | undefined; }>; paymentUrl: Ref<null | string>; shippingMethod: ComputedRef<ShippingMethod | undefined | null>; paymentMethod: ComputedRef<PaymentMethod | undefined | null>; errors: UnwrapRef<{ [key: string]: ShopwareError[]; }>; loaders: UnwrapRef<{ [key: string]: boolean; }>; loadOrderDetails: () => void; handlePayment: (successUrl?: string, errorUrl?: string, paymentDetails?: unknown) => void; cancel: () => Promise<void>; changePaymentMethod: (paymentMethodId: string) => Promise<void>; }