Bidding (DEPRECATED)
This widget is deprecated and might be removed in the future. Please use the bidding ribbon instead.
Last updated
This widget is deprecated and might be removed in the future. Please use the bidding ribbon instead.
Last updated
The bidding widget can be used by customers to bid on a listing. This widget has to be placed in the frontend. There is however also an endpoint available for a backend service to check whether or not TheNextBid has a bidding widget available for the given listing. Using this endpoint is optional.
First load the SDK of TheNextBid on to the website. This will provide the window.TNB
function to initialise the bidding widget. To call this function you should first create a container element into which the widget should be placed.
Please note that we only provide the content of the widget and not the styling of the container. The widget is responsive and already has padding and a white background included, but it does not have margin, border or shadow. Feel free to add these properties yourself and tweak them in the style of your website.
methodName: string - the name of the SDK method to be called. For creating this widget this must be "renderBidding"
.
settings: an object containing the following keys
element: HTMLElement|JQuery - the container element for the widget.
sourceName: string - a static name for the API providing information about the desired listing. The value of this field will be provided by TheNextBid. For example all listings served by the API of "Voorbeeld Makelaar B.V." will be stored at TheNextBid with a sourceName of "voorbeeldmakelaar". The value provided to the widget should correspond this value. Check out this link for more information.
objectId: string|number - just like the sourceName serves as an identifier for the entire API, objectId serves as an identifier to specify the right listing. This should correspond to the object ID provided by the API. Check out this link for more information.
showLoadingState (optional): boolean default false - display a loading screen while the listing is being loaded. If false the widget will be empty until the listing is entirely loaded.
showUnavailableState (optional): boolean default false - display a screen stating that the widget is unavailable when this is the case. If false the widget will be empty when the widget is loaded and the listing is unavailable.
onChangeAvailability (optional): function(available: boolean) - will be called when the availability state of the listing changes. The function will be called with a boolean which has the value true if the listing is available. This function will also be called once the listing is loaded, also with the current availability as parameter.
destroy (optional): function(destroyFunction: function) - use this key if you need to remove the widget from the DOM and free up all memory being used (garbage collection). The provided function will be called immediately after initialising with the actual destroyFunction as first parameter. This destroyFunction can then be stored so that it can be called when needed.
void
It might happen that the widget above will be loaded without information available for the given listing. The widget might have been deactivated by the owner of the listing. Prior to generating the HTML page the following endpoint can be used to perform a check to see whether the bidding widget for a listing is available or not.
GET
https://thenextbid.com/api/bids/checkWidgetAvailability
Checks whether the widget is active or not.
Name | Type | Description |
---|---|---|
sourceName
string
a static name used to specify the API providing information about the desired listing
objectId
string
the identifier used to specify the listing