MoySklad

Interact with MoySklad API v1.2

Overview

This node integrates with the MoySklad API v1.2 to manage various resources such as products, customer orders, counterparties, supplies, and demands. Specifically, for the Customer Order - Get operation, it retrieves detailed information about a single customer order by its ID.

Common scenarios where this node is beneficial include:

  • Fetching detailed data of a specific customer order for processing or reporting.
  • Integrating MoySklad customer order data into other workflows or systems.
  • Expanding related entities within a customer order (e.g., linked documents or counterparties) for comprehensive data retrieval.

Practical example:

  • A workflow that triggers when a new order is created in another system and uses this node to fetch the full customer order details from MoySklad for further processing or notification.

Properties

Name Meaning
ID The unique identifier of the customer order to retrieve. This is required for the Get operation.
Additional Options 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 attributes).
  Filters Semicolon-separated filters to apply on the query; supports filtering by 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 list operations, default 100).
  Offset Number of items to skip before starting to collect the result set (used mainly in list operations, default 0).

Output

The output JSON structure for the Get Customer Order operation contains the full data object representing the requested customer order as returned by the MoySklad API. This includes all standard fields of the customer order plus any expanded relations if specified.

Example output snippet (simplified):

{
  "id": "order-id",
  "name": "Order #1234",
  "state": {...},
  "positions": [...],
  "customer": {...},
  "attributes": [...],
  ...
}

No binary data output is produced by this operation.

Dependencies

  • Requires an active MoySklad API token credential configured in n8n.
  • Uses the official MoySklad REST API endpoint at https://api.moysklad.ru/api/remap/1.2.
  • Axios HTTP client is used internally for making API requests.
  • The node handles rate limiting by retrying requests with exponential backoff if a 429 status code is received.

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 and response body from MoySklad. Common causes include invalid IDs, insufficient permissions, or malformed requests. Verify the ID and additional options are correct.
  • Rate Limiting (429 Status): The node automatically retries requests after waiting based on the Retry-After header or an exponential backoff strategy. If repeated failures occur, check API usage limits or reduce request frequency.
  • Invalid JSON in Body: For operations requiring a JSON body (not applicable to Get), ensure the JSON is well-formed to avoid parsing errors.

Links and References

Discussion