Petstore icon

Petstore

Interact with Petstore API

Overview

This node integrates with the Petstore API to add a new pet entry. It is useful in scenarios where you want to programmatically manage pets in an online store or database, such as adding new animals for sale or adoption. For example, an animal shelter could use this node to automate adding new pets to their online catalog.

Properties

Name Meaning
Id Numeric identifier of the pet.
Name Name of the pet (required).
Category JSON object representing the category of the pet, e.g., {"id":1,"name":"Dogs"}.
Photo Urls JSON array of URLs pointing to photos of the pet.
Tags JSON array of tag objects associated with the pet.
Status Current status of the pet in the store. Options: Available, Pending, Sold.

Output

The node outputs JSON data representing the response from the Petstore API after adding the pet. This typically includes the full details of the newly added pet, including all properties sent and any additional metadata assigned by the API. The node does not output binary data.

Dependencies

  • Requires access to the Petstore API at https://petstore3.swagger.io/api/v3.
  • Needs an API key credential configured in n8n for authentication with the Petstore API.
  • Uses standard HTTP headers for JSON content (Accept and Content-Type set to application/json).

Troubleshooting

  • Invalid JSON in Category, Photo Urls, or Tags: Since these fields expect JSON input, malformed JSON will cause errors. Ensure valid JSON syntax is used.
  • Missing Required Fields: The Name and Photo Urls fields are required. Omitting them will likely result in API errors.
  • API Authentication Errors: If the API key is missing or invalid, the request will fail. Verify that the API key credential is correctly set up.
  • Status Field Validation: Only "available", "pending", or "sold" are accepted values. Using other values may cause rejection by the API.

Links and References

Discussion