_productsImport
Function_productsImport
function is designed to import a batch of product data into the Shopranos platform. It manages authentication and sends a POST request with the product data to the Shopranos API. The function handles responses and errors, and returns a structured result indicating the outcome of the import operation.
payload
(Array of products):Array<Object>
StatusCode
: The HTTP status code of the response from the Shopranos platform.Content
: The content of the response body from the Shopranos platform, typically containing success or error messages.Object
Authorization
header with the Bearer token and x-companyid
header with the company ID from the certificate.payload
is converted to a JSON string and sent in the request body.StatusCode
and Content
from the response.StatusCode
set to "EXCEPTION" and the exception message as the Content
.
payload
parameter must be an array of product objects formatted according to the Shopranos API requirements._productsImport
, you can automate the import of product data into the Shopranos platform, ensuring that the data is sent securely and that any issues are handled and reported appropriately.