Actions30
Overview
This node integrates with the MoySklad API v1.2 to manage entities such as Counterparties, Products, Orders, and more. Specifically, the Counterparty - Update operation allows users to update an existing counterparty's details by providing its ID and a JSON body describing the changes.
Common scenarios for this node include:
- Updating contact information or attributes of a business partner in MoySklad.
- Modifying custom fields or metadata related to counterparties.
- Automating synchronization of counterparty data from other systems into MoySklad.
Practical example: A user wants to update the address and phone number of a specific counterparty identified by its ID. They provide the updated data as a JSON object, and the node sends this update to MoySklad via the API.
Properties
| Name | Meaning |
|---|---|
| ID | The unique identifier of the counterparty to update. Required for update operations. |
| Body | Raw JSON string representing the data to update on the counterparty, following MoySklad API schema. |
| Additional Options | Collection of optional parameters: |
| Expand | Comma-separated list of related entities to expand in the response (e.g., linked documents). |
| Filters | Semicolon-separated filters to apply when querying (supports custom fields, e.g., attributes.name=value). |
| Limit | Maximum number of items to return when fetching multiple records (default 100, max 1000). |
| Offset | Number of items to skip when fetching multiple records (default 0). |
Output
The output is a JSON object representing the updated counterparty entity as returned by the MoySklad API. It contains all fields of the counterparty after the update, including any expanded relations if requested.
Example output structure (simplified):
{
"id": "string",
"name": "string",
"code": "string",
"attributes": [...],
"meta": {...},
...
}
No binary data output is produced by this operation.
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 the API token to be configured in n8n credentials under a generic API key credential.
Troubleshooting
- Missing Credentials Error: If the API token is not set or invalid, the node will throw an error indicating missing credentials. Ensure the API token is correctly configured in n8n.
- HTTP Errors (Status >= 400): The node throws errors containing the HTTP status code and response data from MoySklad. Common causes include:
- Invalid or missing ID for the counterparty.
- Malformed JSON in the Body property.
- Insufficient permissions or expired API token.
- Rate Limiting (429 Status): The node implements retry logic with exponential backoff if the API returns a rate limit error. If retries exceed limits, the operation fails.
- JSON Parsing Errors: Ensure the Body input is valid JSON. Invalid JSON will cause parsing errors before sending the request.