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 Reader
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:
- GraphQL Query
- GraphQL Variables
- 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 Ping
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
- GraphQL Query
- GraphQL Variables
- Sample API Response
{ping}
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:
- GraphQL Query
- GraphQL Variables
- 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 Readers
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:
- GraphQL Query
- GraphQL Variables
- 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
:
- GraphQL Query
- GraphQL Variables
- 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 Transactions
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:
- GraphQL Query
- 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"]
}
}
}
}'