modulepackage
0.0.0-20210629052820-62a580b06960
Repository: https://github.com/atomicleads/quickbooks-go.git
Documentation: pkg.go.dev
# README
quickbooks-go
quickbooks-go is a Go library that provides access to Intuit's QuickBooks Online API.
NOTE: This library is very incomplete. I just implemented the minimum for my use case. Pull requests welcome :)
Example
Authorization flow
clientId := "<your-client-id>"
clientSecret := "<your-client-secret>"
realmId := "<realm-id>"
qbClient, _ := quickbooks.NewQuickbooksClient(clientId, clientSecret, realmId, false, nil)
// To do first when you receive the authorization code from quickbooks callback
authorizationCode := "<received-from-callback>"
bearerToken, _ := qbClient.RetrieveBearerToken(authorizationCode)
// Save the bearer token inside a db
// When the token expire, you can use the following function
bearerToken, _ = qbClient.RefreshToken(bearerToken.RefreshToken)
// Make a request!
info, _ := qbClient.FetchCompanyInfo()
fmt.Println(info)
// Revoke the token, this should be done only if a user unsubscribe from your app
qbClient.RevokeToken(bearerToken.RefreshToken)
Re-using tokens
clientId := "<your-client-id>"
clientSecret := "<your-client-secret>"
realmId := "<realm-id>"
token := quickbooks.BearerToken{
RefreshToken: "<saved-refresh-token>",
AccessToken: "<saved-access-token>",
}
qbClient, _ := quickbooks.NewQuickbooksClient(clientId, clientSecret, realmId, false, &token)
// Make a request!
info, _ := qbClient.FetchCompanyInfo()
fmt.Println(info)
License
BSD-2-Clause
# Packages
No description provided by the author
# Constants
No description provided by the author
No description provided by the author
DiscoveryProductionEndpoint is for live apps.
DiscoverySandboxEndpoint is for testing.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ProductionEndpoint is for live apps.
No description provided by the author
SandboxEndpoint is for testing.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Structs
AccountBasedExpenseLineDetail.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Client is your handle to the QuickBooks API.
CompanyInfo describes a company account.
Customer represents a QuickBooks Customer object.
Date represents a Quickbooks date.
DiscountLineDetail ...
No description provided by the author
EmailAddress represents a QuickBooks email address.
Failure is the outermost struct that holds an error response.
Invoice represents a QuickBooks Invoice object.
Item represents a QuickBooks Item object (a product type).
Line ...
MemoRef represents a QuickBooks MemoRef object.
MetaData is a timestamp of genesis and last change of a Quickbooks object.
No description provided by the author
PaymentLine ...
PhysicalAddress represents a QuickBooks address.
ReferenceType represents a QuickBooks reference to another object.
No description provided by the author
No description provided by the author
SalesItemLineDetail ...
TaxLineDetail ...
TelephoneNumber represents a QuickBooks phone number.
No description provided by the author
TxnTaxDetail ...
Vendor describes a vendor.
WebSiteAddress represents a Quickbooks Website.
# Type aliases
No description provided by the author
EndpointURL specifies the endpoint to connect to.