Additional API Calls

This section highlights some of the additional API calls that can be made with GraphQL to perform things like reader health/status checks, or querying a list of readers or transaction history, etc...

Ping ReaderAnchorIcon

It is possible to ping a specific reader in order to extract certain information from it, such as whether the reader is offline or online, or what firmware version is running on the reader. To perform this function you would need to ping the reader using the API call shown below:

note

More information on how to structure your reader ping query here. It is important to note that the data returned in the response is not accurate in real-time, it is accurate within several minutes. For building offline transaction request routing logic, we suggest utilizing the reader status returned in the request charge mutation.

  1. GraphQL Query
  2. GraphQL Variables
  3. Sample API Response
query PingInStoreReader($readerId: ID!) {
              pingInStoreReader(readerId: $readerId) {
                  id
                  name
                  status
                  pairedAt
                  lastSeenAt
                  offlineSince
                  softwareVersion
                  location {
                      id
                      name
                      internalName
                      address {
                          streetAddress
                          extendedAddress
                          locality
                          region
                          postalCode
                          countryCode
                      }
                  }
              }
          }

Offline PingAnchorIcon

This API mutation can be used if you would like to validate that you can ping a reader while offline without actually sending a charge request. The result is a simple response that will indicate you can ping the reader using the offline endpoint, example below:

https://readerIPaddress:3030/graphql

  1. GraphQL Query
  2. GraphQL Variables
  3. Sample API Response
{ping}

Query a list of LocationsAnchorIcon

You may want to query a list of locations to retrieve things like locationId or location address info or other info linked to a location. See below example of how you may do this:

  1. GraphQL Query
  2. GraphQL Variables
  3. Sample API Response
query Locations {
              inStoreLocations(first: 100) {
                  pageInfo {
                      hasNextPage
                      hasPreviousPage
                      startCursor
                      endCursor
                  }
                  edges {
                      node {
                          id
                          name
                          internalName
                          geoCoordinates {
                              latitude
                              longitude
                          }
                          qrCodePaymentsEnabled
                          payerId
                          address {
                              streetAddress
                              locality
                              region
                              countryCode
                              postalCode
                          }
                      }
                      cursor
                  }
              }
          }

Query a list of ReadersAnchorIcon

It is possible to query a list of readers that are associated with a specific location or specific merchant account. To do this you can use a query as shown below in the example:

  1. GraphQL Query
  2. GraphQL Variables
  3. Sample API Response
query ($input: InStoreReaderSearchInput!) {
              search {
                  inStoreReaders(input: $input) {
                      pageInfo {
                          hasNextPage
                          hasPreviousPage
                          startCursor
                          endCursor
                      }
                      edges {
                          cursor
                          node {
                              ... on InStoreReader {
                                  id
                                  status
                                  name
                                  softwareVersion
                                  location {
                                      id
                                  }
                                  vendor {
                                      ... on VerifoneVendor {
                                          model
                                          osVersion
                                      }
                                  }
                              }
                          }
                          
                      }
                  }
              }
          }

If you want to query a list of readers that are paired to a specific locationId you may also pass in filters as variables in your request using the below example which uses the "is" filter based on the locationId:

  1. GraphQL Query
  2. GraphQL Variables
  3. Sample API Response
query ($input: InStoreReaderSearchInput!) {
              search {
                  inStoreReaders(input: $input) {
                      pageInfo {
                          hasNextPage
                          hasPreviousPage
                          startCursor
                          endCursor
                      }
                      edges {
                          cursor
                          node {
                              ... on InStoreReader {
                                  id
                                  status
                                  name
                                  softwareVersion
                                  location {
                                      id
                                  }
                                  vendor {
                                      ... on VerifoneVendor {
                                          model
                                          osVersion
                                      }
                                  }
                              }
                          }
                          
                      }
                  }
              }
          }

Query a list of TransactionsAnchorIcon

If you would like to automate/streamline your reconciliation process, one way of doing so is by utilizing a transaction query. There are a few ways of querying transactions, try modifying the variables in your request to alter the results of your search:

note

For more information on how to use the query function to search for transactions or other objects see our documentation here with more specific details on constructing transaction searches

  1. GraphQL Query
  2. Sample API Response
{
              "query": "query Search($input: TransactionSearchInput!) {
                search {
                  transactions(input: $input) {
                    pageInfo {
                      hasNextPage
                      startCursor
                      endCursor
                    },
                    edges {
                      node {
                        id
                        status
                        amount {
                          value
                          currencyIsoCode
                        }
                      }
                    }
                  }
                }
              }",
              "variables": {
                "input": {
                   "amount": {
                     "value": {
                       "greaterThanOrEqualTo": "800.00"
                     }
                   },
                   "status": {
                     "in": ["SETTLED", "VOIDED"]
                   }
                 }
               }
            }'