MoySklad

Interact with MoySklad API v1.2

Overview

This node integrates with the MoySklad API v1.2 to perform operations on various resources, including "Demand". Specifically, for the Demand - Get operation, it retrieves detailed information about a single Demand entity by its ID. This is useful in scenarios where you need to fetch up-to-date data about a specific demand order from your inventory or sales system.

Practical examples include:

  • Fetching details of a particular demand to display in a dashboard.
  • Retrieving demand data before processing or updating it in another workflow.
  • Integrating demand information into reporting or analytics pipelines.

Properties

Name Meaning
ID The unique identifier of the Demand entity to retrieve. Required for get, update, delete, and updateStatus operations.
Additional Options A collection of optional parameters to customize the request:
- Expand Comma-separated list of related entities to expand in the response (e.g., linked documents or metadata).
- Filters Semicolon-separated filters to narrow down results; supports custom fields (e.g., attributes.name=value). Not typically used in single get but available.
- Limit Maximum number of items to return (used mainly in getAll operation). Defaults to 100, min 1, max 1000.
- Offset Number of items to skip before starting to collect the result set (used mainly in getAll operation). Defaults to 0.

Output

The output JSON structure for the Get Demand operation contains the full data object returned by the MoySklad API for the specified Demand ID. This includes all standard and expanded fields as requested via the "Expand" option.

Example output snippet (simplified):

{
  "id": "string",
  "name": "string",
  "moment": "datetime",
  "state": { /* status info */ },
  "positions": [ /* array of demand positions/items */ ],
  "attributes": [ /* custom attributes if any */ ],
  ...
}

If the operation fails, an error is thrown with details from the API.

No binary data output is produced by this operation.

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.
  • Network connectivity to MoySklad API endpoint is required.
  • No additional environment variables are needed beyond the API token credential configured in n8n.

Troubleshooting

  • Missing Credentials Error: If the API token is not provided or invalid, the node will throw an error indicating missing credentials. Ensure the API token is correctly configured in n8n credentials.
  • HTTP Errors (status >= 400): The node throws errors containing the HTTP status code and API response body. Common causes include:
    • Invalid or non-existent Demand ID.
    • Insufficient permissions or expired token.
    • Malformed query parameters.
  • Rate Limiting (429 status): The node implements automatic retries with exponential backoff when receiving rate limit responses. If requests continue to fail due to rate limits, consider reducing request frequency or increasing limits on the MoySklad side.
  • Invalid JSON in Body: For other operations requiring JSON bodies, ensure the JSON is well-formed. Although not applicable for the Get operation, this is relevant for create/update operations.

Links and References

Discussion