> ## Documentation Index
> Fetch the complete documentation index at: https://nango-wari-migrated-bigcommerce-docs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Square

> Integrate your application with the Square API

## 🚀 Quickstart

Connect to Square with Nango and see data flow in 2 minutes.

<Steps>
  <Step title="Create the integration">
    In Nango ([free signup](https://app.nango.dev)), go to [Integrations](https://app.nango.dev/dev/integrations) -> *Configure New Integration* -> *Square*.
  </Step>

  <Step title="Authorize Square">
    Go to [Connections](https://app.nango.dev/dev/connections) -> *Add Test Connection* -> *Authorize*, then log in to Square. Later, you'll let your users do the same directly from your app.
  </Step>

  <Step title="Call the Square API">
    Make your first request to the Square API (e.g. list locations). Replace the placeholders below with your [secret key](https://app.nango.dev/dev/environment-settings), [integration ID](https://app.nango.dev/dev/integrations), and [connection ID](https://app.nango.dev/dev/connections):

    <Tabs>
      <Tab title="cURL">
        ```bash theme={null}
        curl "https://api.nango.dev/proxy/v2/locations" \
          -H "Authorization: Bearer <NANGO-SECRET-KEY>" \
          -H "Provider-Config-Key: <INTEGRATION-ID>" \
          -H "Connection-Id: <CONNECTION-ID>"
        ```
      </Tab>

      <Tab title="Node">
        Install Nango's backend SDK with `npm i @nangohq/node`. Then run:

        ```typescript theme={null}
        import { Nango } from '@nangohq/node';

        const nango = new Nango({ secretKey: '<NANGO-SECRET-KEY>' });

        const res = await nango.get({
            endpoint: '/v2/locations',
            providerConfigKey: '<INTEGRATION-ID>',
            connectionId: '<CONNECTION-ID>'
        });

        console.log(res.data);
        ```
      </Tab>
    </Tabs>

    Or fetch credentials with the [Node SDK](/reference/sdks/node#get-a-connection-with-credentials) or [API](/reference/api/connection/get).

    ✅ You're connected! Check the [Logs](https://app.nango.dev/dev/logs) tab in Nango to inspect requests.
  </Step>

  <Step title="Implement Nango in your app">
    Follow our [Auth implementation guide](/guides/primitives/auth) to integrate Nango in your app.

    To obtain your own production credentials, follow the setup guide linked below.
  </Step>
</Steps>

## 📚 Square Integration Guides

Nango maintained guides for common use cases.

* [How to register your own Square OAuth app](/api-integrations/squareup/how-to-register-your-own-squareup-oauth-app)\
  Register your own OAuth app and configure Square for production use in Nango

Official docs: [Square API documentation](https://developer.squareup.com/reference/square)

## 🧩 Pre-built syncs & actions for Square

Enable them in your dashboard. Extend and customize to fit your needs.

### Others

| Function name                    | Description                                                                                        | Type                                           | Source code                                                                                                                             |
| -------------------------------- | -------------------------------------------------------------------------------------------------- | ---------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| `batch-retrieve-catalog-objects` | Retrieve multiple catalog objects by ID in one call.                                               | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/squareup/actions/batch-retrieve-catalog-objects.ts) |
| `cancel-invoice`                 | Cancel a published, unpaid invoice.                                                                | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/squareup/actions/cancel-invoice.ts)                 |
| `cancel-payment`                 | Cancel (void) a payment that has not yet been captured. Only works on payments in APPROVED status. | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/squareup/actions/cancel-payment.ts)                 |
| `cancel-subscription`            | Cancel a subscription.                                                                             | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/squareup/actions/cancel-subscription.ts)            |
| `create-customer`                | Create a customer.                                                                                 | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/squareup/actions/create-customer.ts)                |
| `create-invoice`                 | Create an invoice.                                                                                 | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/squareup/actions/create-invoice.ts)                 |
| `create-order`                   | Create an order.                                                                                   | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/squareup/actions/create-order.ts)                   |
| `create-payment`                 | Create a payment.                                                                                  | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/squareup/actions/create-payment.ts)                 |
| `create-subscription`            | Create a subscription.                                                                             | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/squareup/actions/create-subscription.ts)            |
| `create-team-member`             | Create a team member.                                                                              | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/squareup/actions/create-team-member.ts)             |
| `delete-catalog-object`          | Delete a catalog object (and its child objects, e.g. variations).                                  | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/squareup/actions/delete-catalog-object.ts)          |
| `delete-customer`                | Delete a customer.                                                                                 | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/squareup/actions/delete-customer.ts)                |
| `delete-invoice`                 | Delete a draft invoice.                                                                            | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/squareup/actions/delete-invoice.ts)                 |
| `get-customer`                   | Retrieve a customer.                                                                               | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/squareup/actions/get-customer.ts)                   |
| `get-invoice`                    | Retrieve an invoice.                                                                               | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/squareup/actions/get-invoice.ts)                    |
| `get-order`                      | Retrieve one or more orders by ID.                                                                 | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/squareup/actions/get-order.ts)                      |
| `get-payment`                    | Retrieve a payment.                                                                                | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/squareup/actions/get-payment.ts)                    |
| `get-refund`                     | Retrieve a refund.                                                                                 | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/squareup/actions/get-refund.ts)                     |
| `get-subscription`               | Retrieve a subscription.                                                                           | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/squareup/actions/get-subscription.ts)               |
| `get-team-member`                | Retrieve a team member.                                                                            | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/squareup/actions/get-team-member.ts)                |
| `list-customers`                 | List customers.                                                                                    | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/squareup/actions/list-customers.ts)                 |
| `list-invoices`                  | List invoices.                                                                                     | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/squareup/actions/list-invoices.ts)                  |
| `list-locations`                 | List locations.                                                                                    | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/squareup/actions/list-locations.ts)                 |
| `list-orders`                    | Search orders.                                                                                     | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/squareup/actions/list-orders.ts)                    |
| `list-payments`                  | List payments.                                                                                     | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/squareup/actions/list-payments.ts)                  |
| `list-refunds`                   | List refunds.                                                                                      | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/squareup/actions/list-refunds.ts)                   |
| `pause-subscription`             | Pause an active subscription.                                                                      | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/squareup/actions/pause-subscription.ts)             |
| `pay-order`                      | Pay an order.                                                                                      | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/squareup/actions/pay-order.ts)                      |
| `publish-invoice`                | Publish a draft invoice, moving it out of DRAFT status and sending it to the recipient.            | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/squareup/actions/publish-invoice.ts)                |
| `refund-payment`                 | Refund a payment.                                                                                  | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/squareup/actions/refund-payment.ts)                 |
| `resume-subscription`            | Resume a paused or deactivated subscription.                                                       | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/squareup/actions/resume-subscription.ts)            |
| `retrieve-catalog-object`        | Retrieve a single catalog object by ID.                                                            | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/squareup/actions/retrieve-catalog-object.ts)        |
| `search-catalog-objects`         | Search catalog objects.                                                                            | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/squareup/actions/search-catalog-objects.ts)         |
| `search-customers`               | Search customers by filters (email, phone, name, etc).                                             | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/squareup/actions/search-customers.ts)               |
| `search-subscriptions`           | Search subscriptions.                                                                              | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/squareup/actions/search-subscriptions.ts)           |
| `search-team-members`            | List/search team members.                                                                          | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/squareup/actions/search-team-members.ts)            |
| `update-customer`                | Update a customer.                                                                                 | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/squareup/actions/update-customer.ts)                |
| `update-invoice`                 | Update a draft or unpaid invoice.                                                                  | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/squareup/actions/update-invoice.ts)                 |
| `update-order`                   | Update an order (e.g. add line items, discounts, service charges).                                 | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/squareup/actions/update-order.ts)                   |
| `update-subscription`            | Update a subscription (e.g. swap card\_id).                                                        | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/squareup/actions/update-subscription.ts)            |
| `update-team-member`             | Update a team member (e.g. name, status, assigned locations).                                      | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/squareup/actions/update-team-member.ts)             |
| `upsert-catalog-object`          | Create/update catalog object.                                                                      | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/squareup/actions/upsert-catalog-object.ts)          |
| `catalog-objects`                | Sync catalog objects                                                                               | [Sync](/guides/functions/syncs/sync-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/squareup/syncs/catalog-objects.ts)                  |
| `customers`                      | Sync customers.                                                                                    | [Sync](/guides/functions/syncs/sync-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/squareup/syncs/customers.ts)                        |
| `invoices`                       | Sync invoices.                                                                                     | [Sync](/guides/functions/syncs/sync-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/squareup/syncs/invoices.ts)                         |
| `locations`                      | Sync locations.                                                                                    | [Sync](/guides/functions/syncs/sync-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/squareup/syncs/locations.ts)                        |
| `orders`                         | Sync orders.                                                                                       | [Sync](/guides/functions/syncs/sync-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/squareup/syncs/orders.ts)                           |
| `payments`                       | Sync payments                                                                                      | [Sync](/guides/functions/syncs/sync-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/squareup/syncs/payments.ts)                         |
| `refunds`                        | Sync refunds.                                                                                      | [Sync](/guides/functions/syncs/sync-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/squareup/syncs/refunds.ts)                          |
| `subscriptions`                  | Sync subscriptions.                                                                                | [Sync](/guides/functions/syncs/sync-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/squareup/syncs/subscriptions.ts)                    |
| `team-members`                   | Sync team members.                                                                                 | [Sync](/guides/functions/syncs/sync-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/squareup/syncs/team-members.ts)                     |

***
