Skip to main content

Update a Specific Prize

This endpoint updates a specific prize

info

This operation requires admin or editor role.

HTTP Request

PUT /api/v2/loyalty/prize/{id}/

Parameters

NameInTypeRequiredDescription
idpathstringtrueA unique integer value identifying this loyalty prize
bodybodyLoyalty PrizefalseThe request body(loyalty prize params)

Example Body Parameters

{
"active": "boolean",
"title": "string",
"description": "string",
"points": "integer",
"link": "string(uri)",
"image": "string",
}

Example Request

const inputBody = '{
"active": "boolean",
"title": "string",
"description": "string",
"points": "integer",
"link": "string(uri)",
"image": "string",
}';
const headers = {
'Content-Type':'application/x-www-form-urlencoded',
'Accept':'application/json',
'Authorization': 'Bearer {access_token}'
};

fetch('/api/v2/loyalty/prize/{id}/',
{
method: 'PUT',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});

Responses

StatusMeaningDescriptionSchema
200OKResponse status codeLoyalty Prize

Example responses

{
"id": "integer",
"active": "boolean",
"title": "string",
"description": "string",
"points": "integer",
"link": "string(uri)",
"image": "string",
"created_at": "string",
"lastmod_datetime": "string",
"created_by": {User}
}