About output XML files and templates for APIs

APIs return data using two types of output XML files that define which elements and attributes are required by an API.

Note: Template files must be encoded in UTF-8 format.

Output XML templates

Many APIs use a corresponding output template. The output template is in XML format and is read in by an API in order to determine the elements and attributes for which it should return. The standard output template defines the elements and attributes returned for any specific API. (To see the entire range of possible values an API can return, see its output XML in Javadocs.) The standard template can be a subset of the entire range of values returned, as determined by the output XML in the Javadocs.

Note: Ensure that when adding elements and attributes to the output template, use only those that are documented in the Javadocs. While the APIs can output additional elements and attributes, only those that are documented in the Javadocs are supported.

For example, the standard output template of the getOrderList() API returns the header-level information of an order and the standard output template of the getOrderDetails() API returns in depth information about an order.

Besides the standard output XML template, you can create custom output templates for APIs to use for your own business requirements, such as different output for different document types.

Document types

If you use a variety of business-related document types such as orders, planned orders, purchase orders, and returns, you can use custom templates that enable an API to return the values that pertain to each unique document type.

For example, you can use one template with the getOrderDetails() API to return information about Planned Orders and another template for the getOrderDetails() API to return different information about Orders.

Standard output template behavior

The set of values that the standard output template returns covers a variety of business scenarios. With such a large range of possibilities, an API using the standard output template may return much more data than you need for your business purposes (and take much more time to process than you prefer).

If you want to customize the information returned by an API, you can do so by creating and using a custom template, using our guidelines and procedures.