Product Order Open API Developer Guide
-
- UpdatedJan 30, 2025
- 3 minutes to read
- Yokohama
- Developer guides
Use the Product Order Open API to create, update, and retrieve product order information.
This developer guide provides information on how to extend the Product Order Open API to make various customizations.
Extending the Product Order Open API
The Product Order Open API can be extended by editing script includes.
- TMFProductOrderAPIUtil: Contains functions to handle POST requests.
- TMFProductOrderGetAPIUtil: Contains functions to handle GET requests.
- ProductOrderExtensionOOB: Contains helper functions that support functions in TMFProductOrderAPIUtil and TMFProductOrderGetAPIUtil.
- ProductOrderProcessor: An empty script include file. Use this file to define any functions that you want to override from ProductOrderExtensionOOB.
Extend the Product Order Open API to make the following customizations.
Required parameters
To change which request body parameters are required or not required to create a product order, override the function getProductOrderSchema()
contained in the ProductOrderExtensionOOB script
include.
The function getProductOrderSchema()
reads the schema from the TMFOrderAPIConstants script include. TMFOrderAPIConstants is protected and can't be edited, so you can't
just update the schema. Instead, a new schema must be read from a different file. You can override getProductOrderSchema()
to read a new schema. To override getProductOrderSchema()
, write a
function with the same name in the ProductOrderProcessor script include. The new function in ProductOrderProcessor will be called by TMFProductOrderAPIUtil to
replace the default getProductOrderSchema()
function in ProductOrderExtensionOOB.
getProductOrderSchema()
returns a custom schema that is defined in a new constant file. Request body validation
true
by default.validatePostRequest()
- Called byprocessCreateOrder()
in TMFProductOrderAPIUtil.validateProductObj()
- Called byprocessCreateOrder()
in TMFProductOrderAPIUtil.validateRelatedPartyObj()
- Called byprocessCreateOrder()
in TMFProductOrderAPIUtil.validateGetRequest()
- Called byprocessGetOrder()
in TMFProductOrderGetAPIUtil.
false
, it stops the API operation. To apply custom validation, override ProductOrderExtensionOOB helper functions by creating functions with identical names
and parameters in ProductOrderProcessor. These new ProductOrderProcessor functions will be called by TMFProductOrderAPIUtil and
TMFProductOrderGetAPIUtil to replace the default ProductOrderExtensionOOB helper functions.Additional REST operations
To create additional operations beyond the existing GET and POST operations, create additional scripted REST resources for the Product Order Open API. The logic of the new scripted REST resources should be consistent with the existing operations. Define functions for the new operations in a new script include.
Field mapping
When creating records, the API maps request body parameters to record fields. When retrieving records, the API maps record fields to response object attributes.
transformOrderGr()
transformOrdLineItemGr()
getLineItemPrice()
transformPriceOrderTypeAndState()
transformCustLineItmContact()
transformOrderItemChar()
transformPostOrderResponse()
transformGetOrderResponse()
transformProductObj()
transformRelatedPartyCustomerLineItem()
transformOrderItemRelationship()
transformGetOrdLineItmResponse()
transformProductCharacteristics()
transformProductSpecification()