eBay Console - Shoplive messages

    eBay Console - Shoplive messages


    The content is currently unavailable in English. You are viewing the default Korean version.
    Article summary

    eBay Console - Shoplive messages



    Shoplive messages

    Add an event listener on your page. For example,

    const onReceiveMessage = (e) => { if (e.data?.shopliveMessage) { const { shopliveMessage, payload } = e.data; console.log(shopliveMessage, payload); } } window.addEventListener("message", onReceiveMessage);



    ON_CAMPAIGN_STATUS_CHANGED

    { shopliveMessage: "ON_CAMPAIGN_STATUS_CHANGED", payload: CampaignBriefs }



    ON_CLICK_ADJUST_PRICE

    { shopliveMessage: "ON_CLICK_ADJUST_PRICE", payload: { product: Product, auction: Auction | undefined // If it is a BIN product, this is undefined } }



    ON_AUCTION_STARTED

    { shopliveMessage: "ON_AUCTION_STARTED", payload: { product: Product, auction: Auction } }



    ON_AUCTION_ENDED

    { shopliveMessage: "ON_AUCTION_ENDED", payload: { product: Product, auction: Auction } }



    eBay - Auction V2



    ON_CLICK_AUCTION_START

    { shopliveMessage: "ON_CLICK_AUCTION_START", payload: { product: Product, auction: Auction } }



    ON_CLICK_AUCTION_END

    { shopliveMessage: "ON_CLICK_AUCTION_END", payload: { product: Product, auction: Auction } }



    ON_CLICK_AUCTION_RESET

    { shopliveMessage: "ON_CLICK_AUCTION_RESET", payload: { product: Product, auction: Auction } }



    Payload objects



    CampaignBriefs

    KeyTypeDescription
    campaignKeyStringAutomatically generated key (max 32bytes and alphanumeric). This key is used to specify a campaign in the API call.
    campaignIdStringAutomatically generated identifier of the campaign. (numeric)
    campaignStatusString"READY" | "REHEARSAL" | "ONAIR" | "ENDED"
    titleStringTitle of the campaign



    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
    bidDurationNumberAuction running time in seconds
    extendedDurationBooleanAllow duration extended of auction.
    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



    Full examples

    <html> <head> <title>Shoplive - Console event example</title> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, viewport-fit=cover, shrink-to-fit=no" /> <style> html, body { margin: 0; padding: 0 4px; background-color: #eee; } iframe { display: block; width: 95vw; height: 90vh; margin: auto; border: 1px solid gray; } </style> <script> const onReceiveMessage = (e) => { if (e.data?.shopliveMessage) { const { shopliveMessage, payload } = e.data; document.querySelector("#message").innerText = shopliveMessage; document.querySelector("#payload").innerText = JSON.stringify(payload); } }; window.addEventListener("message", onReceiveMessage); </script> </head> <body> <h1 id="message">Message</h1> <p id="payload">payload</p> <iframe id="console"></iframe> <script> const src = new URLSearchParams(location.search).get("src") || "https://admin.shoplive.cloud"; document.querySelector("#console").src = src; </script> </body> </html>