This PR adds support for custom APIs by exposing a helper function called callCustomEndpoint that allows users to call their custom API following common SDK patterns.
Defaults content-type header to application/json if not provided
options.body can be passed as an object and will be automatically formatted to match Content-Type through commerce-sdk-core
Below is a sample script I used for testing the callCustomEndpoint helper function. Reach out to me for instructions on how to run this with the proper credentials:
This PR adds support for custom APIs by exposing a helper function called
callCustomEndpoint
that allows users to call their custom API following common SDK patterns.There is a companion PR in the
commerce-sdk-core
package that will need to be released first then consumed by this PR in order to pass the CI checks. The companion PR: https://github.com/SalesforceCommerceCloud/commerce-sdk-core/pull/110Some features of the
callCustomEndpoint
helper:apiVersion
tov1
if not providedcontent-type
header toapplication/json
if not providedContent-Type
throughcommerce-sdk-core
Below is a sample script I used for testing the
callCustomEndpoint
helper function. Reach out to me for instructions on how to run this with the proper credentials: