Square Connect 2.8.0 SDKs

Richard Moot
Square Corner Blog
Published in
2 min readJul 5, 2018

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

We’ve got some new and useful features with the latest version of our SDKs. If you haven’t already implemented, you’re in luck, and if you already have, read on about the cool new features you can get by upgrading.

What’s in this release

  • We added sorting functionality to the Connect v2 Customer API
  • Updated the Connect v1 Payments API to include information about surcharges
  • Made improvements to the Item data type.

New feature: Sorting for ListCustomer (Connect v2)

ListCustomers endpoint now provides the ability to sort customers by their creation date using the sort_field and sort_order parameters. Previously, ListCustomers returned customers in alphabetical order sorted by their family name with their given name as secondary sort key. You can now use the sort_field parameter to specify CREATED_AT (sort by date and time the customer was created) or DEFAULT (sort alphabetically by name). In addition, you can specify sort_order (ASC for ascending, DESC for descending).

Some PHP sample code that lists customers by creation date in descending order:

Example output:

>>Karlson, Carl created at 2018–06–11T03:44:22.323Z>>Victoria, Erin created at 2018–06–11T03:43:44.775Z>>Buckingham, Bill created at 2018–06–11T03:43:12.57Z>>Addison, Adrian created at 2018–06–11T03:42:51.657Z>>Thomson, Tim created at 2018–02–20T21:36:07.207Z>>Thomson, Frances created at 2018–02–19T04:02:19.612Z

New feature: Surcharge Detail in Payments (Connect v1)

The Payments API now returns information about surcharges applied to payments. Before this API release, the surcharge contributed to the sale total but was not broken out. Now you can explicitly read an applied surcharge placed on a payment and do the calculation needed.

The new functionality introduces the following new data types:

  • SurchargeMoney datatype: The total of all surcharges applied to the payment.
  • Surcharges datatype: A list of all surcharges associated with the payment.
  • Surcharge datatype: A surcharge that is applied to the payment. One example of a surcharge is auto-gratuity, which is a fixed-rate surcharge applied to every payment, often based on party size.

When you call the ListPayments and RetrievePayment APIs, they will return payment objects containing surcharge information.

Improvement: Item (Connect v1)

Item will now provide two new properties:

  • category_id : Indicates the item’s category (if any)
  • available_for_pickup:Indicates if an item can be added to pickup orders from the merchant’s online store.

When and where are these new SDKs available?

Now and GitHub.

Find the latest SDKs and their documentation on GitHub:

PHP: https://github.com/square/connect-php-sdk

C#/.Net: https://github.com/square/connect-csharp-sdk

Ruby: https://github.com/square/connect-ruby-sdk

Python: https://github.com/square/connect-python-sdk

JavaScript (Node): https://github.com/square/connect-javascript-sdk

Java: https://github.com/square/connect-java-sdk

Want more? Sign up for our monthly developer newsletter or come say hi in the Square dev Slack channel!

--

--

Richard Moot
Square Corner Blog

Developer Evangelist @ Square. I know way too much about shipping & payments. I have a love/hate relationship with JavaScript.