Remote Includes

With B2C Commerce 24.2, you can build your own SCAPI responses and include responses from other sources, such as SCAPI System APIs or other Custom APIs, using Custom API Remote Includes.

As discussed in Custom API Authentication, Custom API endpoints are secured using either Shopper Login and API Access or Account Manager based Authentication and Authorization, just like other SCAPI endpoints.

You can include a response from another Custom API or an out-of-the-box SCAPI API, for example: Shopper Products getProducts, and annotate it with additional information.

For example: let’s use an API endpoint named includeTest1. A second API endpoint, remoteInclude, grabs the response from the includeTest1 endpoint and adds it to the includeArray array as includeArrayItem1.

You can add multiple remote includes in the array and create complex and powerful responses.

  • The RestResponseMgr method createScapiRemoteInclude() allows only SCAPI URLs.
  • The RestResponseMgr method createStorefrontControllerRemoteInclude() allows only Controller URLs.

For additional information , see Passing Data Between Hooks.