MyPet Stocks icon

MyPet Stocks

Interact with MyPet Stocks quantitative trading system

Overview

This node enables interaction with the "MyPet Stocks" quantitative trading system, specifically allowing management of quantitative accounts. The Delete Account operation under the Quantitative Account resource allows users to delete a specified quantitative account by its ID. This operation is useful for cleaning up inactive or obsolete accounts from the system.

A common scenario for this node is when a user wants to programmatically remove inactive quantitative trading accounts that are no longer needed, ensuring the account list remains current and manageable. For example, after disabling an account in the trading system, the user can use this node to delete it permanently.

Properties

Name Meaning
Account to Delete The ID of the quantitative account to delete. Only inactive accounts can be deleted. If a 404 error occurs, verify the account exists and is inactive.

Output

The output JSON contains confirmation of the deletion operation:

  • message: A success message indicating the account was deleted.
  • accountId: The ID of the deleted account.
  • success: Boolean flag indicating if the deletion was successful (true).

Example output:

{
  "message": "Account deleted successfully",
  "accountId": "123",
  "success": true
}

No binary data is output by this operation.

Dependencies

  • Requires an API key credential for the MyPet Stocks API with appropriate permissions.
  • The node uses HTTP requests to the MyPet Stocks API endpoints.
  • The base URL and authentication credentials must be configured in n8n credentials for this API.
  • Authentication can be done via token or username/password; the node handles obtaining tokens as needed.

Troubleshooting

  • Account ID Required: If the "Account to Delete" property is empty or missing, the node will throw an error stating that the account ID is required.
  • 404 Not Found Error: Indicates the specified account does not exist or the user lacks permission. Verify the account ID is correct and the account exists.
  • 400 Bad Request Error: Usually means the account is active or has dependencies preventing deletion. Only inactive accounts can be deleted. Deactivate the account first before attempting deletion.
  • 403 Forbidden Error: The user does not have permission to delete the specified account. Check API permissions and roles.
  • Authentication Failures: Errors related to invalid or missing credentials will prevent the node from executing. Ensure valid credentials are configured.

Links and References

Discussion