Get Gift Details
This endpoint provides the details of the gifted product, along with any related entities, such as images and texts associated with the gift.
:::tip
The get gift details endpoint has been implemented in the Gifting Web Component , and It's all setup to save developer's time and effort.
:::
Payload
Response
Usage
To perform the action of providing the details of the gifted product, the developer may call the method getGiftDetails()
as follows.
salla.product.getGiftDetails({ product_id: 852369 }).then((response) => {
/* add your code here */
});
Events
This endpoint may trigger two events, the onGiftFetched and onGiftFetchFailed events.
onGiftFetched
This event is triggered when the action of providing the details of the gifted product is done without having any errors coming back from the backend.
salla.product.event.onGiftFetched((response) => {
console.log(response)
});
onGiftFetchFailed
This event is triggered when the action of providing the details of the gifted product is not completed and an error has occurred.
salla.product.event.onGiftFetchFailed((errorMessage) => {
console.log(errorMessage)
});