MoySklad

Interact with MoySklad API v1.2

Overview

This node interacts with the MoySklad API v1.2 to retrieve multiple "Demand" entities based on specified criteria. The "Get Many" operation fetches a list of demand records, supporting filtering, pagination, and expansion of related data.

Common scenarios where this node is beneficial include:

  • Retrieving a batch of demand orders for reporting or analysis.
  • Filtering demands by custom attributes or standard fields.
  • Paginating through large sets of demand data.
  • Expanding related entities (e.g., linked customers or products) inline with each demand record.

Practical example:

  • A user wants to get all demand orders created in the last month, limited to 200 results, including expanded details about the associated customer and product information.

Properties

Name Meaning
Additional Options Collection of optional parameters:
- Expand Comma-separated relations to expand (e.g., customer,product)
- Filters Semicolon-separated filters, supports custom fields (e.g., attributes.name=value)
- Limit Number of records to return (minimum 1, maximum 1000), default is 100
- Offset Number of records to skip before starting to collect the result set, default is 0

Output

The output JSON contains a single field:

  • rows: An array of demand objects retrieved from the MoySklad API. Each object represents a demand entity with its properties as returned by the API, potentially including expanded related entities if requested.

No binary data output is produced by this operation.

Example output structure:

{
  "rows": [
    {
      "id": "string",
      "name": "string",
      "moment": "datetime",
      "state": { /* state object */ },
      "agent": { /* linked counterparty */ },
      // ... other demand fields ...
    },
    // more demand objects
  ]
}

Dependencies

  • Requires an API token credential for authenticating with the MoySklad API.
  • The node uses the Axios HTTP client internally to make requests to https://api.moysklad.ru/api/remap/1.2.
  • No additional environment variables are required beyond the API token credential.

Troubleshooting

  • Missing Credentials: If the API token is not provided or invalid, the node will throw an error indicating missing credentials.
  • API Rate Limiting: The node handles HTTP 429 responses by retrying with exponential backoff up to 6 times. If rate limits persist, consider reducing request frequency or increasing limits.
  • Invalid Filters or Parameters: Incorrect filter syntax or unsupported filter fields may cause API errors. Ensure filters follow the documented format (semicolon-separated key=value pairs).
  • HTTP Errors: Any HTTP status code >= 400 from the API will cause the node to throw an error with the status code and response body. Check the API documentation for error meanings and adjust requests accordingly.
  • JSON Parsing Errors: When providing raw JSON bodies for other operations, ensure valid JSON syntax to avoid parsing failures.

Links and References

Discussion