Checkout Via API - eBay€¦ · Deepak Sharma Engineering Lead, Developer Ecosystem and Services...
Transcript of Checkout Via API - eBay€¦ · Deepak Sharma Engineering Lead, Developer Ecosystem and Services...
Deepak Sharma Engineering Lead, Developer Ecosystem and Services
Kevin CearnsSenior PM, Developer Ecosystem and Services
Checkout Via API
Developer Conference
eBayConnect2017
22
33
Overview Buy APIs
Agenda
Technical Look at Buy APIs
Q&A
44
Can You Spot the Differences?
55
Can You Spot the Differences?
6
ContextualExperience
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
88
How Do You Do It?
Order API
Initiate Checkout
Session
Update Payment
Information
Purchase
Order
Status
Place Order
99
Get Paid
10
Coming Soon…
111110
1212
Demo of Buy API Integration
13
Sky is the Limit
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
151514
Initiate
Checkout
Session
Update
Payment
Information
Purchase Order
StatusPlace Order
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
171716
Initiate
Checkout
Session
Update
Payment
Information
Purchase Order
StatusPlace Order
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
191918
Initiate
Checkout
Session
Update
Payment
Information
Purchase Order
StatusPlace Order
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
212120
Initiate
Checkout
Session
Update
Payment
Information
Purchase Order
StatusPlace Order
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
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
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
2525
26
• Already PCI compliant? You are good.
• Not PCI compliant? Vault Service Provider,
eg. Braintree (forwarding API)
A Word on PCI Compliance
27
A Word on Risk
• PayPal risk library integration
Thank you