How to Get List Of vendors by using GrapghQL API

Hi,

I am trying to get list of vendors from Shiphero by using GraghQL API, but I am getting error message,

query {
account {
request_id
complexity
data {
vendors {
id
legacy_id
account_id
identifier
profile
}
}
}
}

Response getting:

{
“errors”: [
{
“message”: “Cannot query field “vendors” on type “Account”.”,
“locations”: [
{
“line”: 6,
“column”: 7
}
]
}
]
}

Thanks
Mangesh

Hi @Mangesh !
For that, you will need to use the vendors query. Something like this

query {
  vendors {
    request_id
    complexity
    data(first: 10) {
      edges {
        node {
          id
          legacy_id
          name
          email
          account_number
          account_id
          address {
            name
            address1
            address2
            city
            state
            country
            zip
            phone
          }
          currency
          internal_note
          default_po_note
          logo
          partner_vendor_id
          created_at
        }
      }
    }
  }
}

Let me know if this doesn’t help
Thanks!
Tom

Thanks Tom, It works very well.

May I know how do you find this query because I have checked teh shiphero API documents but didn’t find any. Can you please share the document link that are you using it or preparing the API.

Thanks
Mangesh

Hey @Mangesh! Sure!
Are you using a specific IDE to access the API? (Something like Altair, Insomnia, GraphQL Playground)
In that case you can navigate through the schema and docs using one of those Client IDEs

We have some docs about this and a couple of videos at: https://developer.shiphero.com/getting-started/#schemaanddocs

Let me know if that doesn’t help,
Thanks again!
Tom