The Square API opens up a realm of possibilities for merchants to effortlessly manage their sales, inventory, customers, and payments. With Pipedream, you can automate actions based on events in Square, such as new transactions, updated orders, or customer profile changes. Craft custom workflows that react in real-time, sync data across platforms, or streamline reporting. Through Pipedream's serverless platform, you can connect Square with countless other apps without writing extensive code, turning manual tasks into automated, efficient processes.
import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
square: {
type: "app",
app: "square",
}
},
async run({steps, $}) {
return await axios($, {
method: "post",
url: `https://connect.squareup.com/oauth2/token/status`,
headers: {
Authorization: `Bearer ${this.square.$auth.oauth_access_token}`,
},
})
},
})
Sales Data Syncing: Automatically sync new sales data from Square to a Google Sheet. Each time a sale occurs, Pipedream captures the transaction details and appends them to a designated Google Sheet, offering real-time sales tracking and simplified accounting.
Customer Relationship Management: Enhance customer engagement by linking Square customer creation to a CRM like Salesforce. Whenever a new customer profile is added in Square, Pipedream triggers a workflow that adds or updates the customer's details in Salesforce, ensuring your CRM always has the latest information.
Inventory Level Alerts: Create an inventory alert system by leveraging Square's inventory tracking. When inventory levels for a product fall below a certain threshold, Pipedream sends a notification through Slack or email, prompting immediate restocking actions to avoid potential sales losses.
Creates a new customer for a business. Must provide at least one of the following: Given Name, Family Name, Company Name, Email Address, or Phone Number. See the docs.
Creates a draft invoice for an order. You must send (publish) the invoice before Square can process it. See the documentation.
Creates a new order that can include information about products for purchase. See docs here.
Square uses OAuth authentication. When you connect your Square account, Pipedream will open a popup window where you can sign into Square and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any Square API.
Pipedream requests the following authorization scopes when you connect your account:
CUSTOMERS_READ
CUSTOMERS_WRITE
PAYMENTS_READ
PAYMENTS_WRITE
ORDERS_READ
ORDERS_WRITE
SUBSCRIPTIONS_READ
SUBSCRIPTIONS_WRITE
ITEMS_READ
ITEMS_WRITE
INVOICES_READ
INVOICES_WRITE
LOYALTY_READ
LOYALTY_WRITE
EMPLOYEES_READ
EMPLOYEES_WRITE
MERCHANT_PROFILE_READ
BANK_ACCOUNTS_READ
SETTLEMENTS_READ
DEVELOPER_APPLICATION_WEBHOOKS_WRITE
APPOINTMENTS_ALL_READ
APPOINTMENTS_READ
GET
https://connect.squareup.com/oauth2/authorize
?
client_id={{oauth.client_id}}
&
redirect_uri={{oauth.redirect_uri}}
&
state={{oauth.state}}
&
response_type=code
&
scope={{oauth.space_separated_scopes}}
POST
https://connect.squareup.com/oauth2/token
content-type: application/x-www-form-urlencoded
accept: application/json
client_id={{oauth.client_id}}
&
client_secret={{oauth.client_secret}}
&
redirect_uri={{oauth.redirect_uri}}
&
grant_type=authorization_code
&
code={{oauth.code}}
POST
https://connect.squareup.com/oauth2/token
content-type: application/x-www-form-urlencoded
accept: application/json
client_id={{oauth.client_id}}
&
client_secret={{oauth.client_secret}}
&
grant_type=refresh_token
&
refresh_token={{oauth.refresh_token}}