MoySklad

Interact with MoySklad API v1.2

Overview

This node integrates with the MoySklad API v1.2 to manage "Demand" resources, specifically supporting the Update operation in this context. It allows users to update existing Demand entities by specifying their ID and providing a JSON body with the updated data.

Typical use cases include:

  • Modifying details of an existing demand order in inventory or sales workflows.
  • Automating updates to demand records based on external triggers or business logic.
  • Synchronizing demand data between MoySklad and other systems.

For example, you might update the quantity or status of a demand after receiving new information from a warehouse system.

Properties

Name Meaning
ID The unique identifier of the Demand entity to update.
Body Raw JSON object representing the fields and values to update on the Demand entity as per API spec.
Additional Options Optional parameters to customize the request:
- Expand Comma-separated list of related entities to expand in the response.
- Filters Semicolon-separated filters for querying (not typically used in update 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 (default 0).

Output

The node outputs the updated Demand entity as a JSON object in the json field of the output item. This JSON reflects the state of the Demand resource after the update operation, including any expanded relations if requested.

No binary data is produced by this operation.

Example output structure snippet:

{
  "id": "some-demand-id",
  "name": "Updated Demand Name",
  "status": { /* status object */ },
  "attributes": [ /* array of attributes */ ],
  // ... other fields as returned by MoySklad API
}

Dependencies

  • Requires an API token credential for MoySklad API authentication.
  • Uses Axios HTTP client internally to communicate with the MoySklad REST API at https://api.moysklad.ru/api/remap/1.2.
  • The node expects valid JSON input for the body property matching the MoySklad API schema for Demand updates.

Troubleshooting

  • Missing API credentials: The node will throw an error if the required API token is not configured.
  • Invalid ID or non-existent Demand: If the specified ID does not exist, the API will return an error which the node surfaces.
  • Malformed JSON body: Providing invalid JSON in the Body property will cause parsing errors or API rejection.
  • API rate limiting (HTTP 429): The node implements retry logic with exponential backoff; however, excessive requests may still fail.
  • Error messages: Errors are reported with HTTP status codes and API response details, e.g., MoySklad error 400: {...}. Review the message for invalid fields or permissions issues.

To resolve common errors:

  • Verify API token validity and permissions.
  • Ensure the Demand ID exists and is correct.
  • Validate the JSON body against the MoySklad API documentation.
  • Respect API rate limits and reduce request frequency if needed.

Links and References

Discussion