Square icon

Square

Consume Square API

Overview

This node integrates with the Square API to create a new booking at a specified location. It allows users to schedule appointments by specifying details such as the location, customer, appointment segments (services), and notes from both the customer and seller. This is useful for businesses managing appointments or reservations, such as salons, clinics, or consulting services.

Practical examples:

  • Scheduling a haircut appointment at a specific salon location with assigned staff.
  • Booking a consultation session with a particular team member and service variation.
  • Adding customer notes or special instructions for the booking.

Properties

Name Meaning
Location ID The identifier of the location where the booking will take place.
Additional Fields A collection of optional fields to provide more details about the booking:
- Appointment Segments One or more segments of the appointment, each including:
• Duration Minutes: Length of the segment in minutes.
• Service Variation ID: Identifier of the specific service variation.
• Team Member ID: Staff performing the service.
- Customer ID The identifier of the customer making the booking.
- Customer Note A note or message from the customer regarding the booking.
- Seller Note A note or message from the seller or business about the booking.
- Start At The start time of the booking in RFC 3339 date-time format (e.g., "2024-06-01T10:00:00Z").

Output

The node outputs JSON data representing the created booking object returned by the Square API. This includes all details of the booking such as its unique ID, location, customer information, appointment segments, start time, notes, status, and other metadata provided by Square.

No binary data output is produced by this operation.

Dependencies

  • Requires an active Square API key credential configured in n8n.
  • The node makes HTTP requests to the Square API endpoints, specifically to /bookings for creating bookings.
  • The base URL depends on the environment setting (sandbox or production).

Troubleshooting

  • Missing Required Fields: If the Location ID or required appointment segment details are missing, the API request will fail. Ensure all mandatory fields are provided.
  • Invalid Date Format: The Start At field must be in valid RFC 3339 format; otherwise, the API may reject the request.
  • API Authentication Errors: Ensure the API key credential is correctly set up and has permissions to create bookings.
  • Empty Appointment Segments: If no appointment segments are provided when required, the booking creation might fail or result in incomplete bookings.
  • Error Handling: If the API returns an error, the node can either stop execution or continue based on the "Continue On Fail" setting. Error messages from the API are surfaced to help diagnose issues.

Links and References

Discussion