WbProducts icon

WbProducts

n8n node to interact with WB API

Overview

This node is designed to interact with a product card creation API, specifically for uploading product cards. It allows users to send detailed product variant information in JSON format to the API endpoint. This is useful in scenarios where bulk or structured product data needs to be uploaded or updated programmatically, such as in e-commerce platforms managing large inventories.

A practical example would be an online retailer automating the upload of new product cards with multiple variants, sizes, SKUs, and characteristics, ensuring consistent and efficient product catalog management.

Properties

Name Meaning
Body A JSON object representing the product card details to upload. It includes an array of variants, each containing dimensions, sizes (with nested skus), and characteristics. The user must provide this JSON structure to define the product card's specifics.

The Body property expects a JSON input structured like this:

{
  "variants": [
    {
      "dimensions": {},
      "sizes": [
        {
          "skus": [null]
        }
      ],
      "characteristics": [{}]
    }
  ]
}

Users should replace the placeholders with actual product data.

Output

The node outputs JSON data returned from the API after attempting to upload the product cards. This typically includes confirmation of the upload status, any created resource identifiers, or error messages if the upload failed.

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

Dependencies

  • Requires access to the external product card API endpoint.
  • Needs an API key or authentication token configured in n8n credentials to authorize requests.
  • The base URL for the API is derived from a bundled Swagger/OpenAPI specification.
  • The node uses standard HTTP headers for JSON content type.

Troubleshooting

  • Invalid JSON in Body: If the JSON structure in the Body property is malformed, the node will fail to parse it. Ensure valid JSON syntax.
  • Authentication Errors: Missing or incorrect API credentials will cause authorization failures. Verify that the API key or token is correctly set up in n8n.
  • API Endpoint Issues: Network errors or incorrect base URL configuration can prevent successful requests. Confirm connectivity and correct API endpoint.
  • Empty or Null SKUs: The example shows null in SKUs; ensure actual SKU values are provided to avoid API validation errors.
  • Unexpected API Responses: Check the API documentation for required fields and constraints to avoid rejection due to missing or invalid data.

Links and References

  • Refer to the official API documentation for the product card service to understand the expected JSON schema and response formats.
  • n8n documentation on creating and using custom nodes: https://docs.n8n.io/integrations/creating-nodes/
  • JSON validation tools to verify the Body property content before use.

Discussion