Skip to main content

Patch a Specific Prize Request

This endpoint patches a specific request for a loyalty prize

info

You can use this endpoint to to change status in an admin list/table interface.

info

This operation requires admin or editor role.

HTTP Request

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

Parameters

NameInTypeRequiredDescription
idpathstringtrueA unique integer value identifying this loyalty prize user
bodybodyLoyalty Prize UserfalseThe request body(loyalty prize user params)

Example Body Parameters

{
"status": "integer"
}

Enumerated Values

ParameterValueDescription
status0pending
status1refused
status2sent

Example Request

const inputBody = '{
"status": "integer"
}';
const headers = {
'Content-Type':'application/x-www-form-urlencoded',
'Accept':'application/json',
'Authorization': 'Bearer {access_token}'
};

fetch('/api/v2/loyalty/request/{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 User

Example responses

{
"id": "integer",
"user": {User},
"prize": {Prize},
"prize_points": "integer",
"pending_at": "string",
"status": "integer",
"status_description": "string"
}