Introducing Square’s Register API for Android

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.

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 [email protected] and follow @SquareDev on Twitter for more updates about Square’s developer platform and community. Get started today by creating your Android application! Pierre-Yves Ricau (@Piwai) | Twitter The latest Tweets from Pierre-Yves Ricau (@Piwai). Android baker @Square. Paris / San Franciscotwitter.com

Table Of Contents
View More Articles ›