Petstore icon

Petstore

Interact with Petstore API

Overview

This node allows users to place an order in a store system, specifically for pet-related products. It is designed to interact with a Petstore API to create new orders by specifying details such as the pet ID, quantity, shipping date, status, and completion state. This node is useful in scenarios where automated order placement is needed, such as integrating e-commerce workflows, managing inventory, or automating customer purchases.

Practical examples include:

  • Automatically placing an order when a customer selects a pet product on a website.
  • Scheduling bulk orders for pets with specific shipping dates.
  • Updating order statuses programmatically based on external triggers.

Properties

Name Meaning
Id The unique identifier of the order.
Pet Id The identifier of the pet being ordered.
Quantity The number of items/pets to order.
Ship Date The date when the order should be shipped (string format).
Status The current status of the order. Options: Placed, Approved, Delivered.
Complete Boolean indicating whether the order is complete or not.

Output

The node outputs JSON data representing the placed order. This typically includes all the order details sent in the request along with any additional information returned by the Petstore API, such as confirmation IDs or timestamps. The output does not explicitly mention binary data, so it is assumed to be purely JSON structured.

Dependencies

  • Requires access to the Petstore API at https://petstore3.swagger.io/api/v3.
  • Needs an API key or authentication token configured in n8n credentials to authorize requests to the Petstore API.
  • Uses standard HTTP headers for JSON content (Accept: application/json, Content-Type: application/json).

Troubleshooting

  • Common issues:

    • Invalid or missing API credentials can cause authorization failures.
    • Incorrect property values (e.g., invalid pet ID or date format) may result in API errors.
    • Network connectivity problems could prevent successful API calls.
  • Error messages:

    • Authorization errors typically indicate missing or incorrect API keys; verify credential setup.
    • Validation errors from the API suggest checking the input properties for correctness.
    • Timeout or connection errors require checking network settings or API availability.

Links and References

Discussion