• Example searches: “transaction”, “CreateOrder”, “/v2/locations”, “inventory”, “delete customer”

You are viewing an old version of the API
Search vendors BETA

POST /v2/vendors/search

Searches for vendors using a filter against supported Vendor properties and a supported sorter.


Permissions
VENDOR_READ
Guide
Search for vendors
Try in API Explorer
Name Description
filter
SearchVendorsRequestFilter

Specifies a filter used to search for vendors.

sort
SearchVendorsRequestSort

Specifies a sorter used to sort the returned vendors.

cursor
string

A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for the original query.

See the Pagination guide for more information.

Response Fields

Name Description
errors
Error [ ]

Errors encountered when the request fails.

vendors
Vendor [ ]

The Vendor objects matching the specified search filter.

cursor
string

The pagination cursor to be used in a subsequent request. If unset, this is the final response.

See the Pagination guide for more information.

Examples

You are viewing an old version of the API
POST /v2/vendors/search
cURL
  • cURL
  • Ruby
  • Python
  • C#
  • Java
  • PHP
  • Node.js
curl https://connect.squareup.com/v2/vendors/search \
  -X POST \
  -H 'Square-Version: 2022-05-12' \
  -H 'Authorization: Bearer ACCESS_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "query": {
      "filter": {
        "name": [
          "Joe'\''s Fresh Seafood",
          "Hannah'\''s Bakery"
        ],
        "status": [
          "ACTIVE"
        ]
      },
      "sort": {
        "field": "CREATED_AT",
        "order": "ASC"
      }
    }
  }'
Response JSON
{
  "errors": [],
  "vendors": [
    {
      "id": "INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4",
      "created_at": "2022-03-16T10:21:54.859Z",
      "updated_at": "2022-03-16T10:21:54.859Z",
      "name": "Joe's Fresh Seafood",
      "address": {
        "address_line_1": "505 Electric Ave",
        "address_line_2": "Suite 600",
        "locality": "New York",
        "administrative_district_level_1": "NY",
        "postal_code": "10003",
        "country": "US"
      },
      "contacts": [
        {
          "id": "INV_VC_FMCYHBWT1TPL8MFH52PBMEN92A",
          "name": "Joe Burrow",
          "email_address": "joe@joesfreshseafood.com",
          "phone_number": "1-212-555-4250"
        }
      ],
      "account_number": "4025391",
      "note": "a vendor",
      "version": 1,
      "status": "ACTIVE"
    }
  ]
}