Skip to content

gittigidiyor/ebay-sdk-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

eBay Java SDK

This is multi module Java SDK for eBay APIs. Currently, only core and order module are developed, any contribution on other modules will be very welcomed.

Order SDK

In this module, you can perform calls to Order APIs described here

Initiate Checkout

In order to call initiate checkout endpoint, you need to get an auth token first. Please refer here for details.

EbayOrder ebayOrder = new EbayOrderClient("<your_auth_token>");
InitiateCheckoutSessionRequest initiateCheckoutSessionRequest = new InitiateCheckoutSessionRequest();

Address shippingAddress = new Address();
shippingAddress.setAddressLine1("Barbaros Mh. Cigdem Sk. 1/14");
shippingAddress.setCity("Istanbul");
shippingAddress.setStateOrProvince("Atasehir");
shippingAddress.setPostalCode("34000");
shippingAddress.setCountry("TR");
shippingAddress.setRecipient("GG Technology");
shippingAddress.setPhoneNumber("111 222 33 44");

List<LineItemInput> lineItemInputs = new ArrayList<>();
LineItemInput lineItemInput = new LineItemInput();
lineItemInput.setQuantity(1);
lineItemInput.setItemId("v1|112086208159|411034601062");
lineItemInputs.add(lineItemInput);

initiateCheckoutSessionRequest.setShippingAddress(shippingAddress);
initiateCheckoutSessionRequest.setLineItemInputs(lineItemInputs);

CheckoutSessionResponse checkoutSessionResponse = ebayOrder.initiateCheckoutSession(initiateCheckoutSessionRequest);