Search for Vendors in a Seller Account

Applies to: Vendors API

Learn how to search for vendors in a seller account and sort them by creation time.

Link to section

Overview

To search for vendors in a seller account, call the SearchVendors endpoint using a query filter. You can filter the result by the vendor's name, status, or both attributes. The search is based on the prefix matching where the specified filter value is matched against the beginning of each phrase in the targeted property value. For example, the name filter value of Vendor finds a match in vendors whose name might be "Vendor", "Vendor A", or "Vendor123".

To sort the returned vendors, set the name or created_at sorter in the input to the SearchVendors call to have the result sorted by the corresponding sort key in an ascending or descending order.

Link to section

Search for vendors by names

To search for vendors by names, use the name filter to specify part or all of the targeted vendor names.

Link to section

Request: Search for vendors by names

The following example searches for vendors whose name starts with "Vendor":

Search vendors

Link to section

Response: Search for vendors by names

The successful response returns the result as a vendors list as shown:

In the previous example, the name filter value is Vendor. The result includes Vendor objects named "Vendor 1", "Vendor 11a", "Vendor 2A", and "Vendor A".

If the name filter is as follows, the result includes only objects named "Vendor 1" and "Vendor 11a" because neither "Vendor 2A" nor "Vendor A" match "Vendor 1":

{ "filter": { "name": ["Vendor 1"] } }

In addition, the string matching isn't case-sensitive. You get the same result if specify the name filter as follows:

{ "filter": { "name": ["vendor 1"] } }
Link to section

Sort searched vendors by creation time

To sort searched vendors by creation time, set the CREATED_AT sorter with either the ascending (ASC) or descending (DESC) order.

Link to section

Request: Sort searched vendors by creation time in ascending order

The following example sorts the searched vendors by creation time in ascending order:

Search vendors

Link to section

Response: Sort searched vendors by creation time in ascending order

The successful response returns the result as a vendors list.