Square icon

Square

Consume Square API

Order → Pay

AI-generated

Overview

This node operation allows users to pay an existing order in the Square system by specifying the order ID and optionally providing approved payment IDs and additional fields such as an idempotency key and order version. It is useful for automating payment processing for orders within workflows, ensuring payments are applied correctly and only once using idempotency keys.

Use Case Examples

  1. Pay an order by providing the order ID and a list of approved payment IDs to apply to the order.
  2. Use the idempotency key to ensure the payment request is not duplicated in case of retries.
  3. Specify the order version to handle concurrency and ensure the correct version of the order is paid.

Properties

Name Meaning
Order ID The ID of the order to pay, used to identify which order to apply the payment to.
Payment IDs Comma-separated list of approved payment IDs to use for this order, specifying which payments to apply.
Additional Fields Optional fields to customize the payment request, including an idempotency key to prevent duplicate payments and the order version to specify the version of the order being paid.

Output

JSON

  • idempotency_key - Unique key to ensure the payment is applied only once.
  • payment_ids - List of payment IDs applied to the order.
  • order_version - Version number of the order being paid.

Dependencies

  • Square API with authentication via an API key credential

Troubleshooting

  • Ensure the Order ID is valid and exists in the Square system to avoid errors.
  • Payment IDs must be approved and valid; otherwise, the payment request will fail.
  • Idempotency key should be unique per payment attempt to prevent duplicate payments.
  • If the order version is specified, it must match the current version of the order to avoid concurrency errors.

Discussion