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 Counterparty - Get operation, it retrieves detailed information about a single counterparty by its unique ID.

Typical use cases include:

  • Fetching detailed data of a specific counterparty (e.g., a client or supplier) in your inventory or sales system.
  • Integrating MoySklad counterparty data into workflows for CRM updates, reporting, or further processing.
  • Automating retrieval of counterparty details before performing other operations like order creation or status updates.

Example: You want to get all available information about a particular counterparty by its ID, optionally expanding related entities or applying filters to customize the returned data.

Properties

Name Meaning
ID The unique identifier of the counterparty to retrieve. This is required for the Get operation.
Additional Options A collection of optional parameters to refine the request:
  Expand Comma-separated list of related entities to expand in the response (e.g., linked contacts or addresses).
  Filters Semicolon-separated filters to apply on the data, supporting custom fields (e.g., attributes.name=value).
  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 (default 0).

Output

The output JSON structure for the Get Counterparty operation contains the full data object of the requested counterparty as returned by the MoySklad API. This includes all standard and expanded fields depending on the options used.

Example output snippet (simplified):

{
  "id": "some-unique-id",
  "name": "Counterparty Name",
  "code": "CP123",
  "description": "Description of the counterparty",
  "contacts": [...],          // If expanded
  "attributes": [...],        // Custom fields if any
  ...
}

No binary data is produced by this node.

Dependencies

  • Requires an API token credential for MoySklad API authentication.
  • The node uses the official MoySklad REST API endpoint https://api.moysklad.ru/api/remap/1.2.
  • Network connectivity to MoySklad API is necessary.
  • No additional external libraries beyond Axios (bundled) are required.

Troubleshooting

  • Missing credentials error: If the API token is not provided or invalid, the node will throw an error indicating missing credentials. Ensure you have configured the API token correctly in n8n credentials.
  • HTTP errors from MoySklad API: Errors with status codes >= 400 will be thrown with the status and response body. Common causes include invalid IDs, insufficient permissions, or malformed requests.
  • Rate limiting (HTTP 429): The node implements retry logic with exponential backoff when receiving HTTP 429 responses. If retries exceed limits, the request fails. To mitigate, reduce request frequency or increase delay between calls.
  • Invalid ID: Providing an empty or incorrect ID will cause the API to return an error. Always ensure the ID corresponds to an existing counterparty.
  • Filter syntax errors: Filters must be semicolon-separated and follow the expected format. Incorrect filter strings may cause API errors.

Links and References

Discussion