Checkout Via API - eBay€¦ · Deepak Sharma Engineering Lead, Developer Ecosystem and Services...

28
Deepak Sharma Engineering Lead, Developer Ecosystem and Services Kevin Cearns Senior PM, Developer Ecosystem and Services Checkout Via API Developer Conference eBay Connect 2017

Transcript of Checkout Via API - eBay€¦ · Deepak Sharma Engineering Lead, Developer Ecosystem and Services...

Page 1: Checkout Via API - eBay€¦ · Deepak Sharma Engineering Lead, Developer Ecosystem and Services Kevin Cearns Senior PM, Developer Ecosystem and Services Checkout Via API Developer

Deepak Sharma Engineering Lead, Developer Ecosystem and Services

Kevin CearnsSenior PM, Developer Ecosystem and Services

Checkout Via API

Developer Conference

eBayConnect2017

Page 2: Checkout Via API - eBay€¦ · Deepak Sharma Engineering Lead, Developer Ecosystem and Services Kevin Cearns Senior PM, Developer Ecosystem and Services Checkout Via API Developer

22

Page 3: Checkout Via API - eBay€¦ · Deepak Sharma Engineering Lead, Developer Ecosystem and Services Kevin Cearns Senior PM, Developer Ecosystem and Services Checkout Via API Developer

33

Overview Buy APIs

Agenda

Technical Look at Buy APIs

Q&A

Page 4: Checkout Via API - eBay€¦ · Deepak Sharma Engineering Lead, Developer Ecosystem and Services Kevin Cearns Senior PM, Developer Ecosystem and Services Checkout Via API Developer

44

Can You Spot the Differences?

Page 5: Checkout Via API - eBay€¦ · Deepak Sharma Engineering Lead, Developer Ecosystem and Services Kevin Cearns Senior PM, Developer Ecosystem and Services Checkout Via API Developer

55

Can You Spot the Differences?

Page 6: Checkout Via API - eBay€¦ · Deepak Sharma Engineering Lead, Developer Ecosystem and Services Kevin Cearns Senior PM, Developer Ecosystem and Services Checkout Via API Developer

6

ContextualExperience

Page 7: Checkout Via API - eBay€¦ · Deepak Sharma Engineering Lead, Developer Ecosystem and Services Kevin Cearns Senior PM, Developer Ecosystem and Services Checkout Via API Developer

7

On a dark

background

On a dark

background

7

Get OrderStatusGet updates

Everything You NeedTo buy items in your experience

Browse and SearchInventoryFind items

6

Secure CheckoutBuy items

Buy on eBay from anywhere online

Page 8: Checkout Via API - eBay€¦ · Deepak Sharma Engineering Lead, Developer Ecosystem and Services Kevin Cearns Senior PM, Developer Ecosystem and Services Checkout Via API Developer

88

How Do You Do It?

Order API

Initiate Checkout

Session

Update Payment

Information

Purchase

Order

Status

Place Order

Page 9: Checkout Via API - eBay€¦ · Deepak Sharma Engineering Lead, Developer Ecosystem and Services Kevin Cearns Senior PM, Developer Ecosystem and Services Checkout Via API Developer

99

Get Paid

Page 10: Checkout Via API - eBay€¦ · Deepak Sharma Engineering Lead, Developer Ecosystem and Services Kevin Cearns Senior PM, Developer Ecosystem and Services Checkout Via API Developer

10

Coming Soon…

Page 11: Checkout Via API - eBay€¦ · Deepak Sharma Engineering Lead, Developer Ecosystem and Services Kevin Cearns Senior PM, Developer Ecosystem and Services Checkout Via API Developer

111110

Page 12: Checkout Via API - eBay€¦ · Deepak Sharma Engineering Lead, Developer Ecosystem and Services Kevin Cearns Senior PM, Developer Ecosystem and Services Checkout Via API Developer

1212

Demo of Buy API Integration

Page 13: Checkout Via API - eBay€¦ · Deepak Sharma Engineering Lead, Developer Ecosystem and Services Kevin Cearns Senior PM, Developer Ecosystem and Services Checkout Via API Developer

13

Sky is the Limit

Page 14: Checkout Via API - eBay€¦ · Deepak Sharma Engineering Lead, Developer Ecosystem and Services Kevin Cearns Senior PM, Developer Ecosystem and Services Checkout Via API Developer

1414

Request HTTP Headers

HTTP Header Description Value

X-EBAY-C-ENDUSERCTXEPN affiliate campaign ID

deviceId={PayPalRiskCorrelationId},affiliateCampa

ignId={ePNCampaingId}PayPal risk ID

Authorization Access token Bearer

v^1.1#i^1#p^1#f^0#I^3#r^0#t^H4shghgiuiuty

X-EBAY-C-MARKETPLACE-ID Marketplace EBAY-US

Page 15: Checkout Via API - eBay€¦ · Deepak Sharma Engineering Lead, Developer Ecosystem and Services Kevin Cearns Senior PM, Developer Ecosystem and Services Checkout Via API Developer

151514

Initiate

Checkout

Session

Update

Payment

Information

Purchase Order

StatusPlace Order

Page 16: Checkout Via API - eBay€¦ · Deepak Sharma Engineering Lead, Developer Ecosystem and Services Kevin Cearns Senior PM, Developer Ecosystem and Services Checkout Via API Developer

16

https://apix.ebay.com//buy/order/v1/guest_checkout_session/initiate

{

"contactEmail": "[email protected]",

"contactFirstName": "John",

"contactLastName": "Doe",

"shippingAddress": {

"recipient": "John S. Doe",

"phoneNumber": "650 764 2365",

"addressLine1": "234 Bascom Ave., #124",

"city": "San Jose",

"stateOrProvince": "CA",

"postalCode": "95678",

"country": "US"

},

"lineItemInputs": [

{

"quantity": 1,

"itemId": "v1|172451912769|0"

}

]

}

{

"checkoutSessionId": "v1|17926129712|stFxhdK_Qw-",

"lineItems": [

{

"itemId": "v1|172451912769|0", "title": ..,

"shortDescription": "New", "image": { ... }, "seller": { … }, "quantity": 1,

"lineItemId": "27499053596", "baseUnitPrice": {"value": "13.39", "currency": "USD"},

"netPrice": {"value": "13.39","currency": "USD"},

"shippingOptions": [ {

"selected": true, "shippingOptionId": "58498333844",

"shippingServiceName": "Expedited Shipping","shippingServiceCode": "Expedited",

"minEstimatedDeliveryDate": "2017-06-07T07:00:00.000Z",

"maxEstimatedDeliveryDate": "2017-06-07T07:00:00.000Z",

"baseDeliveryCost": {"value": "0.00","currency": "USD"},

...

}

]

}

],

"shippingAddress": { … },

"pricingSummary": {

"priceSubtotal": {"value": "441.11","currency": "USD"},

"priceDiscount": {"value": "0.00","currency": "USD"},

"deliveryCost": {"value": "0.00","currency": "USD"},

"deliveryDiscount": {"value": "0.00", "currency": "USD"},

"tax": {"value": "10.00", "currency": "USD"},"fee": {"value": "0.00","currency": "USD"},

"adjustment": {"label": "OTHERS", "amount": {"value": "0.00", "currency": "USD"}},

"total": {"value": "451.11", "currency": "USD"}

},

}

Initiate Checkout Session

Page 17: Checkout Via API - eBay€¦ · Deepak Sharma Engineering Lead, Developer Ecosystem and Services Kevin Cearns Senior PM, Developer Ecosystem and Services Checkout Via API Developer

171716

Initiate

Checkout

Session

Update

Payment

Information

Purchase Order

StatusPlace Order

Page 18: Checkout Via API - eBay€¦ · Deepak Sharma Engineering Lead, Developer Ecosystem and Services Kevin Cearns Senior PM, Developer Ecosystem and Services Checkout Via API Developer

18

https://apix.ebay.com//buy/order/v1/guest_checkout_session/{checkout

SessoinId}/update_payment_info

{

"creditCard": {

"accountHolderName": "John Doe",

"cardNumber": "1234 5674 4578 8903",

"cvvNumber": "874",

"expireMonth": 01,

"expireYear": 2018,

"brand": "VISA",

"billingAddress": {

"firstName": "John",

"lastName": "Doe",

"addressLine1": "234 Bascom Ave., #124”,

"city": "San Jose",

"stateOrProvince": "CA",

"postalCode": "95678",

"country": "US"

}

}

}

{

"checkoutSessionId": "v1|17926129712|stFxhdK_Qw-",

"lineItems": [

{

"itemId": "v1|172451912769|0", "title": ..,

"shortDescription": "New", "image": { ... }, "seller": { … }, "quantity": 1,

"lineItemId": "27499053596", "baseUnitPrice": {"value": "13.39", "currency": "USD"},

"netPrice": {"value": "13.39","currency": "USD"},

"shippingOptions": [ {

"selected": true, "shippingOptionId": "58498333844",

"shippingServiceName": "Expedited Shipping","shippingServiceCode": "Expedited",

"minEstimatedDeliveryDate": "2017-06-07T07:00:00.000Z",

"maxEstimatedDeliveryDate": "2017-06-07T07:00:00.000Z",

"baseDeliveryCost": {"value": "0.00","currency": "USD"},

...

}

]

}

],

"shippingAddress": { … },

"pricingSummary": {

"priceSubtotal": {"value": "441.11","currency": "USD"},

"priceDiscount": {"value": "0.00","currency": "USD"},

"deliveryCost": {"value": "0.00","currency": "USD"},

"deliveryDiscount": {"value": "0.00", "currency": "USD"},

"tax": {"value": "10.00", "currency": "USD"},"fee": {"value": "0.00","currency": "USD"},

"adjustment": {"label": "OTHERS", "amount": {"value": "0.00", "currency": "USD"}},

"total": {"value": "451.11", "currency": "USD"}

},

}

Update PaymentInformation

Page 19: Checkout Via API - eBay€¦ · Deepak Sharma Engineering Lead, Developer Ecosystem and Services Kevin Cearns Senior PM, Developer Ecosystem and Services Checkout Via API Developer

191918

Initiate

Checkout

Session

Update

Payment

Information

Purchase Order

StatusPlace Order

Page 20: Checkout Via API - eBay€¦ · Deepak Sharma Engineering Lead, Developer Ecosystem and Services Kevin Cearns Senior PM, Developer Ecosystem and Services Checkout Via API Developer

20

https://apix.ebay.com//buy/order/v1/guest_checkout_session/{checkout

SessoinId}/place_order

{

"purchaseOrderId": "234567776542",

"purchaseOrderHref":

"https://apix.ebay.com/buy/order/v1/guest_purchase_order/234567776542",

"purchaseOrderPaymentStatus": "PAID"

}

Place Order

Page 21: Checkout Via API - eBay€¦ · Deepak Sharma Engineering Lead, Developer Ecosystem and Services Kevin Cearns Senior PM, Developer Ecosystem and Services Checkout Via API Developer

212120

Initiate

Checkout

Session

Update

Payment

Information

Purchase Order

StatusPlace Order

Page 22: Checkout Via API - eBay€¦ · Deepak Sharma Engineering Lead, Developer Ecosystem and Services Kevin Cearns Senior PM, Developer Ecosystem and Services Checkout Via API Developer

22

https://api.ebay.com//buy/order/v1/guest_purchase_order/{purchase

OrderId}

{

"purchaseOrderId": "234567776542",

"purchaseOrderCreationDate": "2017-05-31T01:18:47.000Z",

"lineItems": [

{

"itemId": "v1|110176314017|410073129397",

...

},

"seller": ...,

"quantity": 1,

"netPrice": {

"value": "441.11",

"currency": "USD"

},

"lineItemPaymentStatus": "PAID",

"lineItemStatus": "FULFILLMENT_IN_PROGRESS",

"shippingDetail": {

"shippingServiceName": "Economy Shipping",

"shippingServiceCode": "Economy Shipping",

"minEstimatedDeliveryDate": "2017-06-02T07:00:00.492Z",

"maxEstimatedDeliveryDate": "2017-06-02T07:00:00.492Z"

}

}

],

"pricingSummary": {

...

"total": {

"value": "451.11",

"currency": "USD"

}

},

"purchaseOrderStatus": "FULFILLMENT_IN_PROGRESS",

"purchaseOrderPaymentStatus": "PAID",

"refundedAmount": {

"value": "0.00",

"currency": "USD"

}

}

Get Purchase Order

Page 23: Checkout Via API - eBay€¦ · Deepak Sharma Engineering Lead, Developer Ecosystem and Services Kevin Cearns Senior PM, Developer Ecosystem and Services Checkout Via API Developer

2323

Authorization

Server

API

OAuth 2.0: Client Credentials Authorization

api.ebay.com

1.Get access token

with client ID and client

Application

Redirection

Endpoint

API

Endpoint

Token

Endpoint

Authorization

Endpoint

2.Call the API with access token

Page 24: Checkout Via API - eBay€¦ · Deepak Sharma Engineering Lead, Developer Ecosystem and Services Kevin Cearns Senior PM, Developer Ecosystem and Services Checkout Via API Developer

2424

Authorization

Server

API

OAuth 2.0: Authorization Code Flow

api.ebay.com

3.Authorization

code and redirect

4. Get access token

with client ID and secret

5.Call the API with access token

2.Request authorization code

[ User authentication and consent]

1.Login widget

Application

Redirection

Endpoint

API

Endpoint

Token

Endpoint

Authorization

Endpoint

Page 25: Checkout Via API - eBay€¦ · Deepak Sharma Engineering Lead, Developer Ecosystem and Services Kevin Cearns Senior PM, Developer Ecosystem and Services Checkout Via API Developer

2525

Page 26: Checkout Via API - eBay€¦ · Deepak Sharma Engineering Lead, Developer Ecosystem and Services Kevin Cearns Senior PM, Developer Ecosystem and Services Checkout Via API Developer

26

• Already PCI compliant? You are good.

• Not PCI compliant? Vault Service Provider,

eg. Braintree (forwarding API)

A Word on PCI Compliance

Page 27: Checkout Via API - eBay€¦ · Deepak Sharma Engineering Lead, Developer Ecosystem and Services Kevin Cearns Senior PM, Developer Ecosystem and Services Checkout Via API Developer

27

A Word on Risk

• PayPal risk library integration

Page 28: Checkout Via API - eBay€¦ · Deepak Sharma Engineering Lead, Developer Ecosystem and Services Kevin Cearns Senior PM, Developer Ecosystem and Services Checkout Via API Developer

Thank you