eBay Live Player Event Callback

    eBay Live Player Event Callback


    기사 요약

    eBay Live Player Event Callback



    product object

    KeyTypeDescription
    productIdString
    customerProductIdString
    originalPriceStringProduct's original price. (Not applied to auction item)
    discountPriceStringProduct's discount price. (Not applied to auction item)
    discountRateStringProduct's discount rate. (Not applied to auction item)
    nameString
    brandString
    brandIdentifierString
    descriptionString
    skuString
    currencyStringe.g) "USD"
    urlString
    imageUrlString
    showingNowBool
    stockStatusStringIN_STOCKLOW_IN_STOCKSOLD_OUT
    auctionStatusStringREADYONGOINGENDED | null





    auction object

    KeyTypeDescription
    bidRoundNumber
    bidStatusStringACCEPTED
    REJECTED
    currentPriceNumber
    endedAtNumberTime for auction to completely end
    endingAtNumberEstimated time for auction to end ( can be increased)
    productIdString
    startingPriceNumberThe initial price for bid
    winnerwinner
    winnerCheckoutSchemeString
    winningPriceNumber
    recommendedPricesNumber[]The prices[Array] displayed on Bid button
    leaderleader



    winner object

    KeyTypeDescription
    namestring
    uidstring
    userIdstring



    leader object

    KeyTypeDescription
    namestring
    uidstring
    userIdstring



    Seller object

    KeyTypeDescription
    sellerIdstring
    namestring
    profileUrlstring
    storeUrlstring
    descriptionstring
    schemesSellerSchemes



    SellerSchemes

    KeyTypeDescription
    seeSellerProfilestring
    viewSellerStorestring
    messaeSellerstring
    takeSurveystring
    saveThisSellerstring



    Sample code for iOS/Android

    iOS

    func handleReceivedCommand(_ command: String, with payload: Any?) { print("handleReceivedCommand command: \(command) payload: \(String(describing: payload))") // Please add function to handle payload data // payload type [String: Any?] let payloadData = parsePayload(payload: payload) switch command { case "ON_AUCTION_STARTED": let product = payloadData["product"] let brand = payloadData["brand"] let productId = payloadData["productId"] let auction = payloadData["auction"] let bidStatus = payloadData["bidStatus"] let currentPrice = payloadData["currentPrice"] print("product \(product) brand \(brand) productId \(productId) auction \(auction) bidStatus \(bidStatus) currentPrice \(currentPrice)") break case "ON_BID_RESULT_RECEIVED": break case "ON_BID_STATUS_CHANGED": break case "ON_AUCTION_ENDED": break case "ON_AUCTION_WINNER_DETERMINED": break case "ON_AUCTION_WINNER_CHECKOUT_CLICKED": break default: break } }

    Android

    override fun onReceivedCommand(context: Context, command: String, data: JSONObject) { when(command) { "ON_AUCTION_STARTED" -> { val product = data.getJSONObject("product") val brand = product.getString("brand") val productId = product.getString("productId") val auction = data.getJSONObject("auction") val bidStatus = auction.getString("bidStatus") val currentPrice = auction.getString("currentPrice") Log.d(TAG, "brand=$brand, productId=$productId, bidStatus=$bidStatus, currentPrice=$currentPrice") } "ON_BID_RESULT_RECEIVED" -> { } "ON_BID_STATUS_CHANGED" -> { } "ON_AUCTION_ENDED" -> { } "ON_AUCTION_WINNER_DETERMINED" -> { } "ON_AUCTION_WINNER_CHECKOUT_CLICKED" -> { } } }



    ON_PLAYER_STARTED

    When the Shoplive player is initialized. The player is ready to communicate with the Interface.

    { "campaignKey": String, "isPreview": Boolean }



    CAN_BID_REQUIRED

    When a user who is not eligible for bidding tries to make a bid, CAN_BID_REQUIRED is called with the empty payload.

    {}



    ON_AUCTION_STARTED

    When an auction starts, ON_AUCTION_STARTED event will be called with the following payload.

    { "campaignKey": "2e0bb63b0b18", "product": { "brand": "Shoplive", "currency": "USD", "customerProductId": "shoplive1003", "discountPrice": "4.2", "discountRate": "23%", "name": "Venusaur Pokemon card Japanese No. 003 Base Basic Set Holo K2", "originalPrice": "5.5", "productId": "3751", "sku": "385086202973", "url": "https://www.ebay.com/itm/385086202973?", "imageUrl": "https://image.shoplive.cloud/image.jpeg", "auctionStatus": "ONGOING" }, "auction": { "bidRound": 1, "bidStatus": null, "currentPrice": 5.5, "endedAt": null, "endingAt": 1662111912415, "productId": "3751", "startingPrice": 5.5, "winner": null, "winnerCheckoutScheme": null, "winningPrice": null, "recommendedPrices": [5.5], "leader": null } }



    ON_BID_RESULT_RECEIVED

    When a user makes a bid, ON_BID_RESULT_RECEIVED event will be called with the following payload.

    { "campaignKey": "2e0bb63b0b18", "product": { "brand": "Shoplive", "currency": "USD", "customerProductId": "shoplive1003", "discountPrice": "4.2", "discountRate": "23%", "name": "Venusaur Pokemon card Japanese No. 003 Base Basic Set Holo K2", "originalPrice": "5.5", "productId": "3751", "sku": "385086202973", "url": "https//www.ebay.com/itm/385086202973?", "imageUrl": "https://image.shoplive.cloud/image.jpeg", "auctionStatus": "ONGOING" }, "auction": { "bidRound": 1, "bidStatus": "ACCEPTED", "currentPrice": 5.5, "endedAt": null, "endingAt": 1662111912415, "productId": "3751", "startingPrice": null, "winner": null, "winnerCheckoutScheme": null, "winningPrice": null, "recommendedPrices": [6.5], "leader": {"name": "Joseph", "uid": "165458902895382534", "userId": "khw@shoplive.cloud"}, } }



    ON_BID_STATUS_CHANGED

    Whenever bid status changes (e.g., new leader, new current price), ON_BID_STATUS_CHANGED is called with the following payload.

    { "campaignKey": "2e0bb63b0b18", "product": { "brand": "Shoplive", "currency": "USD", "customerProductId": "shoplive1003", "discountPrice": "4.2", "discountRate": "23%", "name": "Venusaur Pokemon card Japanese No. 003 Base Basic Set Holo K2", "originalPrice": "5.5", "productId": "3751", "sku": "385086202973", "url": "https://www.ebay.com/itm/385086202973?", "imageUrl": "https://image.shoplive.cloud/image.jpeg", "auctionStatus": "ONGOING" }, "auction": { "bidRound": 2, "bidStatus": null, "currentPrice": 6.5, "endedAt": null, "endingAt": 1662111912415, "productId": "3751", "startingPrice": null, "winner": null, "winnerCheckoutScheme": null, "winningPrice": null, "recommendedPrices": [7.5], "leader": {"name": "Joseph", "uid": "165458902895382534", "userId": "khw@shoplive.cloud"}, } }



    ON_AUCTION_ENDED

    When an auction ends, ON_AUCTION_ENDED is called with the following payload.

    { "campaignKey": "2e0bb63b0b18", "product": { "brand": "Shoplive", "currency": "USD", "customerProductId": "shoplive1003", "discountPrice": "4.2", "discountRate": "23%", "name": "Venusaur Pokemon card Japanese No. 003 Base Basic Set Holo K2", "originalPrice": "5.5", "productId": "3751", "sku": "385086202973", "url": "https://www.ebay.com/itm/385086202973?", "imageUrl": "https://image.shoplive.cloud/image.jpeg", "auctionStatus": "ENDED" }, "auction": { "bidRound": 2, "bidStatus": null, "currentPrice": "0", "endedAt": 1662110475797, "endingAt": null, "productId": "3751", "startingPrice": 5.5, "winner": {"name": "Joseph", "uid": "165458902895382534", "userId": "khw@shoplive.cloud"}, "winningPrice": 6.5, "winnerCheckoutScheme": "ebay://livecommerce/callback/checkoutauctionitem?itemid=385086202973&imgurl=https%3A%2F%2Fi.ebayimg.com%2Fimages%2Fg%2Fd1IAAOSwHSxjCZXi%2Fs-l1600.jpg&title=Venusaur%20Pokemon%20card%20Japanese%20No.%20003%20Base%20Basic%20Set%20Holo%20K2&winningprice=6.5&userid=khw@shoplive.cloud", "leader" : null } }



    ON_AUCTION_WINNER_DETERMINED

    When an auction ends and a winner is determined, ON_AUCTION_WINNER_DETERMINED is called with the following payload.

    { "campaignKey": "2e0bb63b0b18", "product": { "brand": "Shoplive", "currency": "USD", "customerProductId": "shoplive1003", "discountPrice": "4.2", "discountRate": "23%", "name": "Venusaur Pokemon card Japanese No. 003 Base Basic Set Holo K2", "originalPrice": "5.5", "productId": "3751", "sku": "385086202973", "url": "https://www.ebay.com/itm/385086202973?", "imageUrl": "https://image.shoplive.cloud/image.jpeg", "auctionStatus": "ENDED" }, "auction": { "bidRound": 2, "bidStatus": null, "currentPrice": 0, "endedAt": 1662110475797, "endingAt": null, "productId": "3751", "startingPrice": 5.5, "winner": {"name": "Joseph", "uid": "165458902895382534", "userId": "khw@shoplive.cloud"}, "winningPrice": 6.5, "winnerCheckoutScheme": "ebay://livecommerce/callback/checkoutauctionitem?itemid=385086202973&imgurl=https%3A%2F%2Fi.ebayimg.com%2Fimages%2Fg%2Fd1IAAOSwHSxjCZXi%2Fs-l1600.jpg&title=Venusaur%20Pokemon%20card%20Japanese%20No.%20003%20Base%20Basic%20Set%20Holo%20K2&winningprice=6.5&userid=khw@shoplive.cloud", "leader": null } }



    ON_AUCTION_WINNER_CHECKOUT_CLICKED

    When a winner clicks the checkout(or pay now) button, ON_AUCTION_WINNER_CHECKOUT_CLICKED is called with the following payload.

    { "campaignKey": "2e0bb63b0b18", "product": { "brand": "Shoplive", "currency": "USD", "customerProductId": "shoplive1003", "discountPrice": "4.2", "discountRate": "23%", "name": "Venusaur Pokemon card Japanese No. 003 Base Basic Set Holo K2", "originalPrice": "5.5", "productId": "3751", "sku": "385086202973", "url": "https://www.ebay.com/itm/385086202973?", "imageUrl": "https://image.shoplive.cloud/image.jpeg", "auctionStatus": "ENDED" }, "auction": { "bidRound": 2, "bidStatus": null, "currentPrice": "0", "endedAt": 1662110475797, "endingAt": null, "productId": "3751", "startingPrice": "5.5", "winner": {"name": "Joseph", "uid": "165458902895382534", "userId": "khw@shoplive.cloud"}, "winningPrice": "6.5", "winnerCheckoutScheme": "ebay://livecommerce/callback/checkoutauctionitem?itemid=385086202973&imgurl=https%3A%2F%2Fi.ebayimg.com%2Fimages%2Fg%2Fd1IAAOSwHSxjCZXi%2Fs-l1600.jpg&title=Venusaur%20Pokemon%20card%20Japanese%20No.%20003%20Base%20Basic%20Set%20Holo%20K2&winningprice=6.5&userid=khw@shoplive.cloud", "leader": null } }



    ON_CHANGED_PRODUCT_LIST

    When product data displayed on the carousel is changed.

    { "campaignKey": String, "productList": [ { product: PRODUCT, auction: AUCTION }, ] }

    ON_CLICK_PRODUCT_CAROUSEL_ITEM

    When a user clicks product on the carousel.

    { "campaignKey": String, "productList": [ { product: PRODUCT, auction: AUCTION }, ] }



    ON_CLICK_PRODUCT_BUY

    When a user clicks 'BUY' button on the product within the carousel

    { "campaignKey": String, "productList": [ { product: PRODUCT, auction: null }, ] }



    ON_CLICK_BID_BUTTON

    When a user clicks 'Bid' button on the product within the carousel. This event only occurs when the 'eBay Auction V2' option is enabled.

    { "campaignKey": String, "productList": [ { product: PRODUCT, auction: null }, ] }



    ON_CLICK_DSA_BUTTON

    When user clicks DSA button.

    { "campaignKey": String, "campaignTitle": String, "campaignStatus": String, "seller": Seller // Seller object }



    ON_CLICK_SELLER

    When user clicks 'Save seller' button.

    { "campaignKey": String, "campaignTitle": String, "campaignStatus": String, "seller": Seller, // Seller object "saved": true }



    ON_CLICK_VIEW_SELLER_STORE

    When user clicks seller's profile next to 'Save seller' button.

    { "campaignKey": String, "campaignTitle": String, "campaignStatus": String, "seller": Seller // Seller object }



    ON_AUCTION_BID_TIME_EXTENDED

    This event for "eBay auction V2" only. When the remaining time of auction is extended

    { "campaignKey": string, "product": Product, "auction": Auction }



    ON_AUCTION_ENDING

    This event for "eBay auction V2" only. The auction has ended, but the winner has not yet been determined.

    { "campaignKey": string, "product": Product, "auction": Auction }



    ON_AUCTION_WINNER_CHECKOUT

    This event for "eBay auction V2" only. This event replaces the display of the Winner Popup.

    { "campaignKey": string, "product": Product, "auction": Auction }



    ON_CLICK_CUSTOM_BID

    This event for "eBay auction V2" only. When user clicks 'Custom' bid button

    { "campaignKey": string, "product": Product, "auction": Auction }



    ON_CLICK_PAYMENT_OPTION

    This event for "eBay auction V2" only. When user clicks 'Credit button'

    { "campaignKey": string }



    ON_CLICK_COUPON

    When user clicks coupon button.

    { "campaignKey": string }