Giter VIP home page Giter VIP logo

shopee4j's Introduction

shopee4j

Shopee4J is a fluent Java client for Shopee Open Platform.

Configure Lombok

  • Download lombok version 1.18.2 or later and configure it for Eclipse
  • Because in this project some of the experimental features like @Superbuilder are used, Intellij IDEA Lombok plugin is not suppoerted which will show some errors in Editor, but complie and running with no error.

Maven

Using Shopee4J with the OkHttp Connector with 1.0.0-Snapshot

<dependency>
    <groupId>com.salesmore.yak</groupId>
    <artifactId>salesmore-integration-shopee</artifactId>
    <version>${project.version}</version>
</dependency>

Quick Usage Guide

Below are some examples of the API usage.

New Client:

//Client Example
    protected static final String TEST_SERVER_ENDPOINT = "https://partner.uat.shopeemobile.com/api/v1";
    protected static final long PARTNER_ID = 100421;
    protected static final String PARTNER_KEY = "f44262e6ef143ca4cff63d3f2a8dabfada3a5581abfbef7a8b52197da4148c9a";
    protected static final long SHOP_ID = 205753;
    private static final ShopeeClient shopeeClient = ShopeeClientFactory.newClient(PARTNER_ID, PARTNER_KEY, SHOP_ID, TEST_SERVER_ENDPOINT);
    

Get Service and API call

//Build Request
private ShopInfoUpdate shopInfoUpdate() {
      	BaseRequest baseRequest = client().baseRequest();
      	return ShopInfoUpdate.builder().timestamp(baseRequest.getTimestamp())
      			.shopId(baseRequest.getShopId())
      			.partnerId(baseRequest.getPartnerId())
      			.shopName("uatsellercenter.sg")
      			.shopDescription("This is a test shop with right ok")
      			.image("http://gtms01.alicdn.com/tps/i1/TB1wKlhFVXXXXcdaXXXEPxnHXXX-170-90.png")
      			.disableMakeOffer(0)
      			.enableDisplayUnitno(true)
      			.build();
      }
      
//Init Api Call
ShopInfoUpdatedResult result = client().shops().updateShopInfo(shopInfoUpdate());
    	logger.info("updated result: {}", result);
    	assertEquals(result.getShopName(), "uatsellercenter.sg");

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.