Square Corner Blog
Published in

Square Corner Blog

Introducing Square’s Register API for Android

Developers can now build custom Android point-of-sale applications that take swipe, dip, or tap payments through Square hardware, and integrate with Square’s software and services.

Written by Pierre-Yves Ricau.

Heads up, we’ve moved! If you’d like to continue keeping up with the latest technical content from Square please visit us at our new home https://developer.squareup.com/blog

Following our launch of Register API for iOS in March, beginning today, developers can now build custom Android point-of-sale applications that take swipe, dip, or tap payments through Square hardware, and integrate with Square’s software and services. This builds on our existing API offerings for Square Register and eCommerce.

Register API for Android

The Square Register API lets you focus on what you do best: creating an amazing point-of-sale experience for your merchants while Square takes care of moving the money. You can build a custom point of sale with specific features for your business’ needs, or start a technology company for a new point of sale and sell it to businesses. Get started today by creating your Android application!

Maybe you will build a custom point of sale for lawn care service companies, an in-store on-floor retail business checkout, an optimized cart and membership funnel for wineries, a self checkout for doggie daycares — your imagination is the limit! Your app doesn’t have to handle any payments information, which makes PCI compliance a non-event. And you won’t need to think for a second about integrating with hardware card readers. Build your custom app and distribute it like normal on the Play Store. When it is time for your app to initiate a payment, call our SDK with an amount to start the Square Register app on the payment screen. The buyer completes the payment in Register (by swiping, tapping, dipping, or keying in the card) and then focus and control automatically returns back to your app with the result of the charge. Thanks to Square Register, all the money movement heavy lifting is taken care of. Android Register API supports all our hardware, including the new Square Contactless + Chip Reader.

To start taking payments, it’s as simple as three lines of code:

ChargeRequest chargeRequest = new ChargeRequest.Builder(1_00, USD).build();
Intent chargeIntent = registerClient.createChargeIntent(chargeRequest);
startActivityForResult(chargeIntent, CHARGE_REQUEST_CODE);

Square Register will come to the foreground and complete the payment on your behalf. Once that’s done, we’ll return the payment result to your app.

@Override protected void onActivityResult(int requestCode, int resultCode, 
Intent data) {
if (requestCode == CHARGE_REQUEST_CODE) {
if (resultCode == Activity.RESULT_OK) {
ChargeRequest.Success success = registerClient.parseChargeSuccess(data);
onTransactionSuccess(success);
} else {
ChargeRequest.Error error = registerClient.parseChargeError(data);
onTransactionError(error);
}
} else {
super.onActivityResult(requestCode, resultCode, data);
}
}

Pricing is the same as other payments completed using Square Register. The Register API for Android is currently only available in the US and Canada, with other markets to quickly follow.

We are busy building out Square’s commerce platform, to give merchants solutions to help them easily run their business. We’re eager to hear your feedback! You can reach us at developers@squareup.com and follow @SquareDev on Twitter for more updates about Square’s developer platform and community. Get started today by creating your Android application!

--

--

--

Buying and selling sound like simple things - and they should be. Somewhere along the way, they got complicated. At Square, we're working hard to make commerce easy for everyone.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Square Engineering

Square Engineering

The official account for @Square Engineering.

More from Medium

Ads Adapter Wrapper for Android Application

Find the introduction Sliders and Huawei Account Kit Integration in Money Management Android app…

Chat implementation in Android with Firebase Cloud Firestore database

Top 10 iPhone applications when traveling in van — App iOS News