Actions30
Overview
This node integrates with the MoySklad API v1.2 to manage various resources, including Customer Orders. Specifically, for the Customer Order - Create operation, it allows users to create new customer orders by sending a raw JSON body that conforms to the MoySklad API specification.
Typical use cases include automating order creation workflows in e-commerce or inventory management systems where new customer orders need to be programmatically added to MoySklad. For example, after receiving an order on a website, this node can create the corresponding customer order record in MoySklad automatically.
Properties
| Name | Meaning |
|---|---|
| Body | Raw JSON body representing the customer order details as per the MoySklad API requirements. |
| Additional Options | Collection of optional parameters: |
| Expand | Comma-separated list of related entities to expand in the response. |
| Filters | Semicolon-separated filters to apply when querying (supports custom fields like attributes.name=value). Not typically used in create but available for other operations. |
| Limit | Maximum number of records to return (default 100). |
| Offset | Number of records to skip before starting to collect the result set (default 0). |
Note: For the Create operation, only the Body and optionally Additional Options (mostly expand) are relevant.
Output
The output is a JSON object representing the newly created customer order as returned by the MoySklad API. It contains all the fields of the created order, potentially expanded according to the expand option.
Example output structure (simplified):
{
"id": "string",
"name": "string",
"moment": "datetime",
"state": { /* status info */ },
"positions": [ /* array of order items */ ],
// ... other customer order fields ...
}
No binary data output is produced by this node.
Dependencies
- Requires an API token credential for MoySklad API authentication.
- The node uses the Axios HTTP client to communicate with the MoySklad REST API at
https://api.moysklad.ru/api/remap/1.2. - Network connectivity to MoySklad API endpoint is necessary.
- No additional environment variables are required beyond the API token credential.
Troubleshooting
- Missing Credentials Error: If the API token is not provided or invalid, the node will throw an error indicating missing credentials.
- HTTP Errors from MoySklad: If the API returns an error status (400 or above), the node throws an error with the status code and response data. Common causes include malformed JSON in the
Body, invalid field values, or permission issues. - Rate Limiting: The node handles HTTP 429 responses by retrying with exponential backoff up to 6 times. If rate limits persist, consider reducing request frequency or contacting MoySklad support.
- JSON Parsing Errors: Ensure the
Bodyproperty contains valid JSON. Invalid JSON will cause parsing errors before the API call. - Expand Option Misuse: Providing invalid relations in the
expandparameter may lead to unexpected API errors or incomplete data.
Links and References
- MoySklad API Documentation: https://dev.moysklad.ru/doc/api/remap/1.2/
- Axios HTTP Client: https://axios-http.com/
- n8n Documentation on Creating Custom Nodes: https://docs.n8n.io/integrations/creating-nodes/