Petstore icon

Petstore

Interact with Petstore API

Overview

This node interacts with the Petstore API to update an existing pet's information. It is useful in scenarios where you need to modify details of a pet already registered in the store, such as changing its name, category, photos, tags, or status. For example, you might use this node to update a pet's availability status after it has been sold or to add new photos to the pet's profile.

Properties

Name Meaning
Id The unique identifier of the pet to update.
Name The new name for the pet.
Category The category object describing the pet's classification (e.g., Dogs).
Photo Urls An array of URLs pointing to photos of the pet.
Tags An array of tag objects associated with the pet for additional metadata or categorization.
Status The current status of the pet in the store. Options: Available, Pending, Sold.

Output

The node outputs JSON data representing the updated pet object as returned by the Petstore API. This typically includes all the pet's properties such as id, name, category, photo URLs, tags, and status reflecting the latest state after the update operation.

No binary data output is involved.

Dependencies

  • Requires access to the Petstore API endpoint at https://petstore3.swagger.io/api/v3.
  • Needs an API key credential or other authentication method configured in n8n to authorize requests to the Petstore API.
  • The node uses standard HTTP headers for JSON content (Accept and Content-Type set to application/json).

Troubleshooting

  • Invalid or missing Id: Ensure the Id property corresponds to an existing pet; otherwise, the API may return a "not found" error.
  • Malformed JSON in Category, Photo Urls, or Tags: These fields expect valid JSON strings. Invalid JSON will cause parsing errors before sending the request.
  • Authentication errors: Verify that the API key or authentication token is correctly configured and has sufficient permissions.
  • Status value errors: Only the predefined status options ("available", "pending", "sold") are accepted. Using other values will result in validation errors.
  • Network issues: Check connectivity to the Petstore API endpoint if requests time out or fail.

Links and References

Discussion