Skip to content

This is an unofficial Java and Android client for Printful API.

License

Notifications You must be signed in to change notification settings

clayfish/printful4j

Repository files navigation

printful4j

Release

This is an unofficial client of Printful API for Android. This can also be used in any JVM based project to connect to Printful API. It uses semantic versioning so that developers can trust it.

How to download?

Android

To use it, add jitpack repository in your build.gradle file.

repositories {
    jcenter()
    maven { url "https://jitpack.io" }
}

And add following in dependencies,

dependencies {
    compile 'in.clayfish:printful4j:0.2.1'
}

Java

  • Using gradle, compile 'in.clayfish:printful4j:0.2.1'
  • Using Maven, Add following in <repositories>,
<repository>
    <id>jitpack.io</id>
    <url>https://jitpack.io</url>
</repository>

and then use following,

<dependency>
    <groupId>in.clayfish</groupId>
    <artifactId>printful4j</artifactId>
    <version>0.2.1</version>
</dependency>
  • Using sbt, Add following at the end of resolvers in your build.sbt,
resolvers += "jitpack" at "https://jitpack.io"

And add following in the dependencies,

libraryDependencies += "in.clayfish" % "printful4j" % "0.2.1"
  • Using leningen, Add following in your project.clj at the end of repositories,
:repositories [["jitpack" "https://jitpack.io"]]

And add following,

:dependencies [[in.clayfish/printful4j "0.2.1"]]

For more information regarding download or using different build systems, please visit JitPack.

How to use?

There is one interface Client to use all the printful API. First create a variable to keep your client,

Client printfulClient = new CompositeClient("YOUR_API_KEY");

CompositeClient uses multiple specific clients to serve full API, if you want to use a specific API, you can use a specific API client, for example,

Client printfulOrdersClient = new OrdersApiClient("YOUR_API_KEY");

Do remember that OrdersApiClient will have all the methods available, but methods which are not related to Orders API will throw a NotImplementedException.

This client uses HTTPS JSON API provided by Printful as documented here. When using methods, please refer to that documentation. Javadocs are available with builds as well as here.

Currently many methods throw NotImplementedException because this client is in development stage. Please use caution while using this library.