Another Square

Flutter package for Square REST Apis.

Square APIs

FeatureSupportedURL
PaymentsYhttps://developer.squareup.com/reference/square/payments-api
TerminalYhttps://developer.squareup.com/reference/square/terminal-api
OrderYhttps://developer.squareup.com/reference/square/orders-api
SubscriptionYhttps://developer.squareup.com/reference/square/subscriptions-api
InvoiceYhttps://developer.squareup.com/reference/square/invoices-api
CatalogYhttps://developer.squareup.com/reference/square/catalog-api
InventoryYhttps://developer.squareup.com/reference/square/inventory-api
CustomerYhttps://developer.squareup.com/reference/square/customers-api
LoyaltyYhttps://developer.squareup.com/reference/square/loyalty-api
Gift CardsYhttps://developer.squareup.com/reference/square/gift-cards-api
BookingsYhttps://developer.squareup.com/reference/square/bookings-api
BusinessYhttps://developer.squareup.com/reference/square/merchants-api
TeamYhttps://developer.squareup.com/reference/square/team-api
FinancialYhttps://developer.squareup.com/reference/square/bank-accounts-api
OnlineYhttps://developer.squareup.com/reference/square/sites-api
TokenYhttps://developer.squareup.com/reference/square/oauth-api

Credentials

In order to interact with Square you'll need a developer account and the clientId and clientSecret https://developer.squareup.com/apps

final squareClient = SquareClient(
    applicationId: applicationId,
    clientId: clientId,
    clientSecret: clientSecret,
    environmentType: EnvironmentType.Sandbox);
// Initialize the client.        
await squareClient.initialize();

// Use this to prompt the user to authorize your app
var authUrl = squareClient.getAuthorizationPageUrl(
        scopes: [Scope.CustomerWrite,Scope.CustomerRead,],         
        redirectUrl: <your redirect url>, 
        state: "state123")

// On authorization success use the params to get the access token.
var autoToken = squareClient.getAuthToken(
        code: <code from redirect url>,
        redirectUrl: <redirect url>);
        
// Note: The token can be refreshed when it expires using the refreshToken
String token = (await squareClient.refreshToken(
        refreshToken: autoToken.refresh_token
    )).accessToken

Bother Hackathon

Feel free to use any of my GitHub repositories in your apps. You should also consider attending the free Brother Hackathon happening this year. You get a free Brother QL-1110NWB, a PT-P910BT, and possibly an awesome DS-940DW mobile scanner. Visit brotherhackathon.com for more information. I will be teaching workshops, and they are free. You can ask me any questions. Thank you.

Libraries

another_square
authentication_service
backend_extensions
bank_account_service
bookings_service
catalog_service
customer_service
giftcard_service
inventory_service
invoice_service
loyalty_service
merchant_service
oder_service
online_service
payments_service
square_models
subscription_service
team_service
terminal_service