Automate Square with TypeScript

Pro plan

Use every current seller-authorized Square API operation across payments, orders, customers, catalog, inventory, bookings, labor, loyalty, reporting, and more. Start automations from every current Square webhook event.

inspect-square-payments.automation.ts
import { automation } from "automate.ax"
import { square } from "automate.ax/square"

export default automation("Inspect new Square payments", () => {
  const created = square.onPaymentCreated()

  square.getPayment({
    paymentId: created.transform((event) => {
      if (!event.data?.id) throw new Error("Square omitted the payment ID")
      return event.data.id
    }),
  })
})

What you can do

Actions

  • Manage payments, refunds, disputes, payouts, and checkout
  • Manage orders, catalog, inventory, vendors, and locations
  • Manage customers, cards, loyalty, bookings, and labor
  • Query Square reporting metadata and aggregated reports

Triggers

  • Any current Square seller event
  • Payment, refund, dispute, payout, and invoice lifecycle
  • Order, catalog, inventory, customer, and loyalty changes
  • Booking, labor, team, terminal, and vendor changes

Start automating with Square today

Start building