Skip to main content

Function: usePlaceOrder()

usePlaceOrder(param: {mutation: MutationOptions<Order, Error, NewOrder>;supportingDocument: File; }): MutationResult<"placeOrder", Order, Error, NewOrder>

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

ParameterTypeDescription
paramobject
param.mutation?MutationOptions<Order, Error, NewOrder>See Tanstack Query - useMutation options.
param.supportingDocument?FileSupporting document file.

Returns

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

Example

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

See

API Documentation

Defined in

sdk-react-provider/src/lib/hooks.tsx:881