_customerSourceTagsImport
Documentation: _customerSourceTagsImport
Function
_customerSourceTagsImport
function is designed to import a batch of customer source tag data into the Shopranos platform. It handles authentication, sends a POST request with the customer source tag data to the Shopranos API, and processes the response and potential errors. The function returns a structured result indicating the outcome of the import operation.Function Signature:
Parameters:
payload
(Array of customer source tags):Array<Object>
Return Value:
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
Function Workflow:
1.
2.
3.
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.4.
StatusCode
and Content
from the response.5.
StatusCode
set to "EXCEPTION" and the exception message as the Content
.Example Usage:
Important Considerations:
payload
parameter must be an array of customer source tag objects formatted according to the Shopranos API requirements.Customer.Api.Features.CustomerTags.SourceTagDTO
id
string | null
Id
name
string | null
Name
_customerSourceTagsImport
, you can automate the import of customer source tag data into the Shopranos platform, ensuring that the data is sent securely and that any issues are handled and reported appropriately.