Alokai
You are reading the documentation for v7.x and earlier, which is no longer the latest version. Switch to v8.x

placeOrgOrder

Method that creates a B2B order, based on a cart

This method sends a POST request to the placeOrgOrder endpoint of the Alokai Middleware. In turn, it exchanges data with the placeOrgOrder endpoint exposed by the SAP OCC API .

Signature

export declare function placeOrgOrder<Res extends Order = Order,
	Props extends PlaceOrgOrderProps = PlaceOrgOrderProps>(
	props: Props,
	options?: MethodOptions
): Promise<Res>;

Parameters

NameRequiredTypeDescription
propsRequiredPropsParameter object which can be used with this method. Refer to its type definition to learn about possible properties.
optionsOptionalMethodOptionsOptions that can be passed to additionally configure the request or customize the logic in a plugin.

Returns

Returns the newly created order

Referenced Types

Examples

Placing a new order

import { sdk } from '~/sdk';

// All the complex info like shipping/delivery address must already filled out in the cart entity
// see sdk.createCart()
const props = {
  cartId: "00001234",
  termsChecked: true,
}
const newOrder = await sdk.commerce.placeOrgOrder(props);

On this page