Upload Gift Image
This endpoint is used to upload a product image associated with the gifted product.
:::tip
The upload gift image 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 uploading a product image associated with a gifted product, the developer may call the method uploadGiftImage()
as follows.
salla.product.uploadGiftImage({ multipartPayload: my_form }).then((response) => {
/* add your code here */
});
Events
This endpoint may trigger two events, the onGiftImageUploadSucceeded and onGiftImageUploadFailed events.
onGiftImageUploadSucceeded
This event is triggered when uploading a product image associated with a gifted product is done without having any errors coming back from the backend.
salla.product.event.onGiftImageUploadSucceeded((response) => {
console.log(response)
});
onGiftImageUploadFailed
This event is triggered when uploading a product image associated with a gifted product is not completed and an error has occurred.
salla.product.event.onGiftImageUploadFailed((errorMessage) => {
console.log(errorMessage)
});