You are reading the documentation for v7.x and earlier, which is no longer the latest version. Switch to v8.x
createReplenishmentOrder
Create B2B replenishment order, based on a cart.
This method exchanges data with the createReplenishmentOrder endpoint exposed by the SAP OCC API .
Signature
export declare function createReplenishmentOrder(
context: SapccIntegrationContext,
props: CreateReplenishmentOrderProps
): Promise<ReplenishmentOrder>;Parameters
| Name | Required | Type | Description |
|---|---|---|---|
context | Required | SapccIntegrationContext | |
props | Required | CreateReplenishmentOrderProps | Parameter object which can be used with this method. Refer to its type definition to learn about possible properties. |
Returns
Returns the newly created replenishment order
Referenced Types
- SapccIntegrationContext
CreateReplenishmentOrderProps- ReplenishmentOrder
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);