Create a Prize
This endpoint creates a prize
info
This operation requires admin or editor role.
HTTP Request
POST /api/v2/loyalty/prize/
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | Loyalty Prize | false | The request body(loyalty prize params) |
Enumerated Values
Example Body Parameters
- JSON
{
"active": "boolean",
"title": "string",
"description": "string",
"points": "integer",
"link": "string(uri)",
"image": "string"
}
Example Request
- JavaScript
- Bash
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/',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
# You can also use wget
curl -X POST /api/v2/loyalty/prize/ \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access_token}' \
--DATA '{body}'
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
201 | Created | Response status code | LoyaltyPrize |
Example responses
- 200
{
"id": "integer",
"active": "boolean",
"title": "string",
"description": "string",
"points": "integer",
"link": "string(uri)",
"image": "string",
"created_at": "string",
"lastmod_datetime": "string",
"created_by": {User}
}