Skip to main content

Function: usePlaceOrder()

usePlaceOrder(param): MutationResult<"placeOrder", Order, Error, NewOrder>

Place an order.

When the order has been placed, the orders query will be invalidated and re-fetched.

If the order amount is above 15000, a supporting document is required.

Parameters

param = {}

param.mutation?: MutationOptions<Order, Error, NewOrder>

See Tanstack Query - useMutation options.

param.supportingDocument?: File

Supporting document file.

Returns

MutationResult<"placeOrder", Order, Error, NewOrder>

Example

const {
placeOrder, // useMutation's `mutateAsync` property
isPending,
isError,
error,
status,
...moreUseMutationResults
} = usePlaceOrder();

See

API Documentation

NewOrder type

Defined in

hooks.tsx:510