MoySklad

Interact with MoySklad API v1.2

Overview

This node integrates with the MoySklad API v1.2 to manage various resources, including Products. Specifically, the Update Status operation for the Product resource allows users to update the status metadata of a product by sending a raw JSON body that conforms to the API's expected format.

Common scenarios where this node is beneficial include:

  • Automating inventory or product lifecycle management by programmatically changing product statuses.
  • Integrating MoySklad product status updates into broader workflows, such as order processing or stock replenishment.
  • Synchronizing product data between MoySklad and other systems by updating product statuses based on external triggers.

For example, a user might use this node to mark a product as discontinued or to update its availability status after a stock audit.

Properties

Name Meaning
ID The unique identifier of the product to update. Required for operations like get, update, delete, updateStatus.
Body Raw JSON body containing the data to update the product status. Must conform to MoySklad API specifications. Used in create, update, and updateStatus operations.
Additional Options A collection of optional parameters:
- Expand: Comma-separated relations to expand in the response.
- Filters: Semicolon-separated filters supporting custom fields (e.g., attributes.name=value).
- Limit: Number specifying max items to return (1-1000).
- Offset: Number specifying the starting point for pagination (min 0).

Output

The node outputs JSON data representing the result of the API call:

  • For updateStatus, the output JSON contains the updated product object as returned by the MoySklad API after applying the status update.
  • In general, the output JSON structure matches the MoySklad API response for the respective operation.
  • No binary data output is produced by this node.

Example output snippet for updateStatus:

{
  "id": "product-id",
  "name": "Product Name",
  "status": {
    "meta": {
      "href": "https://api.moysklad.ru/api/remap/1.2/entity/product/metadata/statuses/active",
      "type": "productstatus",
      "mediaType": "application/json"
    }
  },
  ...
}

Dependencies

  • Requires an API token credential for MoySklad API authentication.
  • Uses Axios HTTP client internally to make REST API calls.
  • Node configuration must include valid MoySklad API credentials with an API token.
  • Network access to https://api.moysklad.ru/api/remap/1.2 is required.

Troubleshooting

  • Missing Credentials Error: If the API token is not provided or invalid, the node throws Missing MoySklad API credentials. Ensure the API token is correctly configured in n8n credentials.
  • HTTP Errors from API: Errors from the MoySklad API are surfaced with messages like MoySklad error <status>: <response>. Common causes include invalid IDs, malformed JSON bodies, or insufficient permissions.
  • Rate Limiting: The node handles HTTP 429 responses by retrying with exponential backoff up to 6 times. Persistent rate limiting may require adjusting API usage or contacting MoySklad support.
  • JSON Parsing Errors: The Body property expects valid JSON. Invalid JSON will cause parsing errors before the request is sent.
  • Invalid Filters or Expand Parameters: Incorrectly formatted filters or expand strings may cause API errors. Verify syntax according to MoySklad API documentation.

Links and References

Discussion