Login to leave a review
Support
How to set up (on MyAdmin)
These are the workflows required to implement the solution.
- In MyAdmin, follow this guide to Create a New User
- Follow the guidelines in the Service Account documentation
NOTE: You will need to do so with account with the appropriate permisi
How to set up (on Quickbooks)
- Follow the Getting Started workflow using a Developer account.
NOTE: Use a sandbox environment when testing!- Select “Create an App”
- Select the “Accounting” scope from the on-screen flow
- Create your Client ID and Client Secret for your App
- Validate that your API credentials are configured appropriately by making the following cURL call or testing with Postman
curl -X GET 'https://quickbooks.api.intuit.com/v3/company/REPLACE_WITH_COMPANY_ID/companyinfo/REPLACE_WITH_COMPANY_ID?minorversion=12' \
-H 'accept: application/json' \
-H 'authorization:Bearer REPLACE_WITH_ACCESS_TOKEN' \
-H 'content-type: application/json'
- Ensure that at least one Account object exists
How to set up Middleware
- Starts by establishing connections to both Geotab and QuickBooks APIs.
- For Geotab MyAdmin, pass user credentials into an Authenticate() call to generate an ApiKey and SessionId to pass into subsequent calls.
- For Quickbooks, use the Access Token generated with the Client Id and Secret
- OPTIONAL:
It is possible to stream data from a MyGeotab database to a relational database in your environment. Integrations might choose to do this to cache data, or to repurpose data for other needs. Using this method, the Middleware would call the relevant data from the environment instead of making a Geotab API call. See the MyGeotab API Adapter documentation for more details.
- Pull transactions from the Geotab’s MyAdmin SDK using the ApiDeviceContractTransaction API.
This example call returns the first 1000 records. To make subsequent calls, store the last nextId and make the call again to return the next 1000. If there are less than 1000 results, those will be the most recent added devices.
curl -X POST 'https://your_myadmin_api_endpoint' \
-H 'Content-Type: application/json' \
-d '{
"apiKey": "YOUR_API_KEY",
"forAccount": "YOUR_ACCOUNT",
"monthFilter": MONTH_NUMBER,
"sessionId": "YOUR_SESSION_ID",
"yearFilter": YEAR_NUMBER,
"nextId": 0
}'
Example return JSON object, an array of ApiDeviceContractTransaction objects.
[
{
"accountNo": "ACC123456",
"assignedPurchaseOrderNo": "PO-987654",
"currencyCode": "USD",
"endDate": "2023-11-30T23:59:59Z",
"id": 1234567,
"periodFrom": "2023-11-01T00:00:00Z",
"periodTo": "2023-11-30T23:59:59Z",
"quantity": 30,
"quantityFraction": 1,
"quantityInDays": 30,
"ratePlanName": "ProPlus",
"reference": "REF-123456",
"region": {
"id": 1001,
"name": "North America"
},
"serialNo": "G9XXXXXXXX",
"simCardNo": "SIM-654321",
"startDate": "2023-11-01T00:00:00Z",
"userContact": "John Doe",
"userContactId": 2001,
"valueLocal": 100.00,
"valueUsd": 100.00
},
// ... next ApiDeviceContractTransaction
]
- Filter on the Add only transactions not already present in QuickBooks already. This can be done using the Query Bill API call passing the list generated from step 2.
curl -X GET 'https://quickbooks.api.intuit.com/v3/company/<companyID>/query?query=SELECT * FROM Bill WHERE Id IN ([INSERT_YOUR_LIST_OF_IDs)' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <YourAccessToken>'
- Remove each of the transaction objects from your working array that are returned from the query in 3.
- Create Quickbooks Bill object from the MyAdmin transaction.
This example assumes that a Geotab is set up as a vendor with the reference value of “56”, and the AccountRef is set for the end-customer to be billed.
curl -X POST 'https://quickbooks.api.intuit.com/v3/company/<companyID>/bill' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <YourAccessToken>' \
-d '{
"Line": [
{
"DetailType": "AccountBasedExpenseLineDetail",
"Amount": <ApiDeviceContractTransaction.valueUsd>,
"Id": <ApiDeviceContractTransaction.id>,
"AccountBasedExpenseLineDetail": {
"AccountRef": {
"value": "7"
}
}
}
],
"VendorRef": {
"value": "56"
}
}'
- Validate the log creation by ensuring that the response returns the Bill object that was created.
Login to leave a review
Free solution