You are reading the documentation for v7.x and earlier, which is no longer the latest version. Switch to v8.x
createReplenishmentOrder
Method that creates a B2B replenishment order, based on a cart
This method sends a POST request to the createReplenishmentOrder endpoint of the Alokai Middleware. In turn, it exchanges data with the createReplenishmentOrder endpoint exposed by the SAP OCC API .
Signature
export declare function createReplenishmentOrder<Res extends ReplenishmentOrder = ReplenishmentOrder,
Props extends CreateReplenishmentOrderProps = CreateReplenishmentOrderProps>(
props: Props,
options?: MethodOptions
): Promise<Res>;Parameters
| Name | Required | Type | Description |
|---|---|---|---|
props | Required | Props | Parameter object which can be used with this method. Refer to its type definition to learn about possible properties. |
options | Optional | MethodOptions | Options that can be passed to additionally configure the request or customize the logic in a plugin. |
Returns
Returns the newly created replenishment order
Referenced Types
- ReplenishmentOrder
CreateReplenishmentOrderProps- MethodOptions
Examples
Placing a new replenishment 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,
scheduleReplenishmentForm: {
replenishmentStartDate: "2023-10-25T11:56:39Z",
numberOfDays: "14",
numberOfWeeks: "1",
nthDayOfMonth: "1",
recurrencePeriod: "WEEKLY",
daysOfWeek: ["SUNDAY"]
}
};
const newReplenishmentOrder = await sdk.commerce.createReplenishmentOrder(props);