Sharpei icon

Sharpei

Consume Sharpei Api

Overview

This node integrates with the Sharpei API to manage various resources, including products. Specifically, for the "Create a Product" operation under the "Products" resource, it allows users to create new product entries by sending detailed product data in JSON format to the Sharpei backend.

Common scenarios where this node is beneficial include:

  • Automating product catalog updates by programmatically adding new products.
  • Integrating external systems or databases with Sharpei to synchronize product information.
  • Bulk importing products from other platforms into Sharpei via n8n workflows.

For example, a user can prepare a JSON object describing a product's title, description, price, tags, and status, then use this node to create that product in Sharpei without manual entry.

Properties

Name Meaning
Product Data (JSON) JSON-formatted data representing the product details. It includes fields such as:
- body: Description of the product (string)
- status_pid: Identifier of the product's status (string)
- title: Title of the product (string)
- slug: Slug of the product (string)
- remote_id: Remote identifier of the product (number)
- value: Price of the product (string)
- tags: List of product tags (array)

The property expects a valid JSON object containing these fields to define the product being created.

Output

The node outputs JSON data representing the response from the Sharpei API after attempting to create the product. This typically includes details of the newly created product such as its unique identifiers, stored fields, and any metadata returned by the API.

If the API supports binary data output (e.g., images or files related to the product), the node would handle it accordingly, but based on the provided code and properties, the primary output is JSON data reflecting the created product.

Dependencies

  • Requires an active connection to the Sharpei API.
  • Needs an API authentication token or key configured in n8n credentials (referred generically as "an API key credential").
  • The base URL for API requests is https://api.prod.gosharpei.com/api.
  • The node sends and receives data in JSON format with appropriate headers (Accept: application/json, Content-Type: application/json).

Troubleshooting

  • Invalid JSON Input: If the "Product Data (JSON)" property contains malformed JSON, the node will fail. Ensure the JSON is correctly formatted.
  • Missing Required Fields: The API may reject requests missing mandatory product fields like title or status_pid. Verify all required fields are included.
  • Authentication Errors: If the API key credential is missing or invalid, the node will return authentication errors. Confirm the credential is properly set up.
  • API Endpoint Issues: Network problems or incorrect base URL configuration can cause request failures. Check connectivity and endpoint correctness.
  • Error Responses from API: The node passes through error messages from Sharpei API; review those messages for specific issues like duplicate slugs or invalid field values.

Links and References

Discussion