Using Custom Order Type on Order Simulation and Sales Order BOD

Use the Custom Order Type API to override Virtual Enterprise (VE) defaults for order simulation and ProcessSalesOrderBOD creation on a temporary order.

This feature adds a dedicated endpoint for setting custom order type values on a temporary or current order. When set, these custom values override the order types that would normally be fetched from Virtual Enterprise during order simulation and ProcessSalesOrder BOD generation. When not set, the system falls back to the current Virtual Enterprise retrieval logic.

Payload file size

The file size of payloads cannot be greater than 1 MB.

Types

When you call the Custom Order Type endpoint, the operation is always a full replacement. All fields are written on every call.

Created/Updated: Use this endpoint to set or update the custom order type fields on an existing temporary order.

Behavior: Once the endpoint is called for the first time on a temporary order, the useCustomOrderType flag is permanently set to true for the lifetime of that order.

Custom Order Type Endpoint

This section describes how to use the Custom Order Type API endpoint to set custom order types on a temporary order for order simulation and ProcessSalesOrderBOD generation.

Endpoint details

Property Value
Method PUT
URL /api/v2/orders/temp/{id}/ordertype
Auth Standard session/token authentication (same as existing order endpoints)
Content-Type application/json

Payload description

The payload consists of two optional string fields: orderType and orderTypeSimulate. The orderType field specifies the order type used for ProcessSalesOrderBOD generation. The orderTypeSimulate field specifies the order type used for order simulation.

Fields not included (blank or null) in the payload are eagerly resolved to the current Virtual Enterprise default at PUT time. The stored value is always a resolved order type, not null.

To receive an appropriate error response when the payload fails validation, ensure you provide the correct temporary order ID in the URL path.

No order simulation is triggered by the PUT endpoint itself. Simulation occurs separately through existing mechanisms.

Sample payload

{
  "orderType": "Z01",
  "orderTypeSimulate": "X10"
}

Sample payload — update only BOD order type

{
  "orderType": "Z01"
}

When orderTypeSimulate is omitted, it is eagerly resolved from the current Virtual Enterprise default and stored.

Sample payload - update only simulation order type

{
  "orderTypeSimulate": "X10"
}

When orderType is omitted, it is eagerly resolved from the current Virtual Enterprise default and stored.

Response

The endpoint returns the updated order representation including the custom order type fields.

Response fields

Field Type Description
orderType String The stored custom order type for ProcessSalesOrder BOD
orderTypeSimulate String The stored custom order type for order simulation
useCustomOrderType Boolean Flag indicating custom order type mode is active

Frontend API Wrapper (rhythm-ecom)

Description

A thin API client or wrapper class in the rhythm-ecom front-end project to call the new back-end endpoint programmatically. No visible UI component used by other backend services or programmatic front-end flows.

Endpoint

PUT /delegate/ecom-api/orders/temp/{id}/ordertype

Usage
OrderTypeModel.save({
    orderType: "X10",
    orderTypeSimulate: "Z01"
})
Pattern

Standard ecom-common Backbone model following existing API wrapper patterns.

Other considerations
  • No validation of order type values against ERP master data
  • Once useCustomOrderType is set to true, it cannot be reverted to false
  • Custom order type values are cleared when the temporary order is submitted or deleted