Simple, robust Woocommerce API sdk for java and android
Go to file
2019-02-21 06:20:07 +03:00
.idea Modified AuthIntercepter to correctly authenticate requests with parameters that are not oauth 2019-02-19 04:59:29 +03:00
app Added search view and introduced filter icon 2019-02-20 06:51:33 +03:00
gradle/wrapper setup keys and product retrieve test passed 2019-01-27 09:16:52 +03:00
screens better looking demo app 2019-02-04 05:51:16 +03:00
woodroid Added reports API 2019-02-20 05:57:06 +03:00
.gitignore initial commit 2019-01-27 08:39:49 +03:00
build.gradle Added coupon use case for view, update and delete 2019-02-18 05:26:10 +03:00
gradle.properties initial commit 2019-01-27 08:39:49 +03:00
gradlew initial commit 2019-01-27 08:39:49 +03:00
gradlew.bat initial commit 2019-01-27 08:39:49 +03:00
README.md Update README.md 2019-02-21 06:20:07 +03:00
settings.gradle initial commit 2019-01-27 08:39:49 +03:00

Woocommerce Android SDK

This is an android sdk for woocommerce

Under construction, is not ready for use yet. :(

alt text

Built-based on the documentation: http://woocommerce.github.io/woocommerce-rest-api-docs/#introduction

Installation

Please note that files are still being moved around - the project should be stable before end Feb 2019

Maven dependency:

Step 1. Add the JitPack repository to your build file

<repositories>
	<repository>
		<id>jitpack.io</id>
		<url>https://jitpack.io</url>
	</repository>
</repositories>

Step 2. Add the dependency

<dependency>
	<groupId>com.github.gilokimu</groupId>
	<artifactId>woodroid</artifactId>
	<version>0.1.0</version>
</dependency>

Gradle dependency:

Step 1. Add the JitPack repository to your build file

allprojects {
	repositories {
		...
		maven { url 'https://jitpack.io' }
	}
}

Step 2. Add the dependency

dependencies {
	implementation 'com.github.gilokimu:woodroid:0.1.0'
}

Getting started

Generate API credentials (Consumer Key & Consumer Secret) following this instructions http://docs.woocommerce.com/document/woocommerce-rest-api/ .

Check out the WooCommerce API endpoints and data that can be manipulated in https://woocommerce.github.io/woocommerce-rest-api-docs/.

Setup

Setup for the new WP REST API integration (WooCommerce 2.6 or later):

val woocommerce = Woocommerce.Builder()
	.setSiteUrl("http://example.com")
	.setApiVersion(Woocommerce.API_V2)
	.setConsumerKey("ck_XXXXX")
	.setConsumerSecret("cs_XXXX")
	.build()

Usage

Getting products example

woocommerce.ProductRepository().products().enqueue(object : Callback<List<Product>> {
            override fun onResponse(call: Call<List<Product>>, response: Response<List<Product>>) {
                val productsResponse = response.body()
                for (product in productsResponse!!) {
                    products.add(product)
                }

                adapter.notifyDataSetChanged()
            }

            override fun onFailure(call: Call<List<Product>>, t: Throwable) {

            }
        })

API Support Checklist

Method Create Delete Retrieve Update Batch
Coupons N N N N N
Customers N N N N N
Orders N N N N N
Order notes N N N N N
Refunds N N N N N
Products N N N N N
Product variations N N N N N
Product attributes N N N N N
Product attribute terms N N N N N
Product categories N N N N N
Product shipping classes N N N N N
Product tags N N N N N
Product reviews N N N N N
Reports N N N N N
Tax rates N N N N N
Tax classes N N N N N
Webhooks N N N N N
Settings N N N N N
Setting options N N N N N
Payment gateways N N N N N
Shipping zones N N N N N
Shipping zone locations N N N N N
Shipping zone methods N N N N N
Shipping methods N N N N N

TODO

See the trello board for items and progress https://trello.com/b/Muw8vcBb/woocommerce-android-sdk

##Contribution Contributions are highly welcomed, just create a PR