MoySklad

Interact with MoySklad API v1.2

Overview

This node integrates with the MoySklad API v1.2 to manage various resources such as products, orders, counterparties, supplies, and demands. Specifically, for the Supply resource with the Get Many operation, it retrieves multiple supply records from MoySklad.

The node supports filtering, pagination (limit and offset), and expanding related entities in the response. It is useful when you need to fetch a list of supplies with optional filters or relations expanded, for example:

  • Retrieving all supply documents created within a date range.
  • Fetching supplies with specific custom attributes.
  • Getting supplies along with related entities like linked contracts or counterparties.

Properties

Name Meaning
Additional Options A collection of optional parameters:
- Expand Comma-separated list of related entities to expand in the response (e.g., "contract,agent").
- Filters Semicolon-separated filters to narrow down results; supports custom fields (e.g., attributes.name=value).
- Limit Maximum number of supply records to return (1 to 1000).
- Offset Number of records to skip before starting to collect the result set (for pagination).

Output

The output JSON contains a single field:

  • rows: An array of supply objects retrieved from MoySklad. Each object represents a supply document with its properties and optionally expanded related entities depending on the expand parameter.

No binary data is produced by this operation.

Example output structure:

{
  "rows": [
    {
      "id": "string",
      "name": "string",
      "moment": "datetime",
      "state": { /* state details */ },
      "agent": { /* related agent info if expanded */ },
      // ... other supply fields ...
    },
    // more supply objects
  ]
}

Dependencies

  • Requires an API token credential for MoySklad API authentication.
  • The node uses Axios HTTP client internally to communicate with the MoySklad REST API at https://api.moysklad.ru/api/remap/1.2.
  • No additional environment variables are needed beyond the API token credential configured in n8n.

Troubleshooting

  • Missing API credentials error: If the node throws "Missing MoySklad API credentials," ensure that a valid API token credential is configured in n8n.
  • HTTP errors (status >= 400): The node surfaces errors returned by the MoySklad API with status code and message. Common causes include invalid filters, unauthorized access, or malformed requests.
  • Rate limiting (HTTP 429): The node automatically retries requests with exponential backoff if rate limited, but persistent 429 errors may require reducing request frequency or increasing limits.
  • Invalid filter syntax: Filters must be semicolon-separated and correctly formatted; otherwise, the API may reject the request.
  • Large result sets: Use limit and offset options to paginate through large numbers of supplies to avoid timeouts or memory issues.

Links and References

Discussion