Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

README.md

Square Java SDK Quickstart

This quickstart sample creates a Square client instance with your Square access token and then lists the locations in your account. The sample is based on the Java SDK Quickstart guide.

Setup

Install Java Guide - If you don't have java already installed on your machine.

Maven Install Guide note: Gradle is also supported but the quickstart here demonstrates using Maven.

Quickstart instructions

  1. Change into the quickstart directory

  2. Copy the example config file in src/main/resources, and place your Square Access Token inside of the new file.

    $ cp src/main/resources/config.properties.example src/main/resources/config.properties
    
  3. Replace PLACE_VERSION_HERE with the latest SDK version from here

  4. Compile the program

    $ mvn package -DskipTests
    
  5. Execute the code

    $ mvn exec:java -Dexec.mainClass="com.square.examples.Quickstart"
    
  6. In your console, you should see output similar to this:

    Location(s) for this account:
    LGJ1WWJ8PSV8Z: Default Test Account, 1600 Pennsylvania Ave NW, Washington
    

Resources

Square Java SDK Guide - details on how to use / configure the Square client.

Maven Repository for Square - Where the package files are hosted

Java SDK Source Code - Github repo with sdk source code