Skip to main content

Patch a Specific Prize

This endpoint patches a specific prize

info

You can use this endpoint to edit a single field passing only the id and the needed field (without mandatory fields).

For example to change active flag in an admin list/table interface.

info

This operation requires admin or editor role.

HTTP Request

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

Parameters

NameInTypeRequiredDescription
idpathstringtrueA unique integer value identifying this loyalty prize
bodybodyLoyaltyPrizefalseThe 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: 'PATCH',
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}
}