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...
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:
More information on how to structure your reader ping query . 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 request routing logic, we suggest utilizing the reader status returned in the .
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
}
}
}
}
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
{ping}
{
"readerId": "Your reader ID"
}
{
"data": {
"ping": "pong"
}
}
Query a list of Locations
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:
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
}
}
}
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:
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:
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 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: