Add Benefit Definition
curl --request POST \
--url https://api.{tenant}.getomneo.com/api/v3/benefits/definitions \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"handle": "<string>",
"period": 123,
"region_id": 123,
"currency": "<string>",
"absolute_expiry": "<string>",
"description": "<string>",
"internal_notes": "<string>",
"meta": [
"<string>"
],
"short_description": "<string>",
"long_description": "<string>",
"terms_conditions": "<string>",
"earn_instructions": "<string>",
"redeem_instructions_store": "<string>",
"redeem_instructions_online": "<string>",
"redeem_code_pos": "<string>",
"redeem_code_online": "<string>",
"icon": "<string>",
"image_url": "<string>",
"max_redemptions": 123,
"is_extendable": true,
"is_assignable": true,
"is_reassignable": true,
"end_at": "2023-11-07T05:31:56Z",
"is_claimable": true,
"claim_period_start_at": "2023-11-07T05:31:56Z",
"claim_period_end_at": "2023-11-07T05:31:56Z",
"max_global_redemptions": 123,
"claim_condition": [
"<string>"
],
"is_reclaimable": true,
"issue_target_id": 123,
"remind_target_id": 123,
"extend_target_id": 123,
"notify_issue_offset_days": 123,
"notify_issue_offset_hour": 123,
"notify_remind_offset_days": 123,
"notify_remind_offset_hour": 123,
"notify_extend_offset_days": 123,
"notify_extend_offset_hour": 123,
"force_allocation": true,
"is_published": true,
"is_archived": true,
"claim_timeframe": [
"<string>"
],
"view_condition": [
"<string>"
],
"visibility_condition": [
"<string>"
],
"allow_user_redeem": true,
"value": 123,
"campaign": "<string>",
"external_id": "<string>",
"tags": [
"<string>"
]
}
'import requests
url = "https://api.{tenant}.getomneo.com/api/v3/benefits/definitions"
payload = {
"name": "<string>",
"handle": "<string>",
"period": 123,
"region_id": 123,
"currency": "<string>",
"absolute_expiry": "<string>",
"description": "<string>",
"internal_notes": "<string>",
"meta": ["<string>"],
"short_description": "<string>",
"long_description": "<string>",
"terms_conditions": "<string>",
"earn_instructions": "<string>",
"redeem_instructions_store": "<string>",
"redeem_instructions_online": "<string>",
"redeem_code_pos": "<string>",
"redeem_code_online": "<string>",
"icon": "<string>",
"image_url": "<string>",
"max_redemptions": 123,
"is_extendable": True,
"is_assignable": True,
"is_reassignable": True,
"end_at": "2023-11-07T05:31:56Z",
"is_claimable": True,
"claim_period_start_at": "2023-11-07T05:31:56Z",
"claim_period_end_at": "2023-11-07T05:31:56Z",
"max_global_redemptions": 123,
"claim_condition": ["<string>"],
"is_reclaimable": True,
"issue_target_id": 123,
"remind_target_id": 123,
"extend_target_id": 123,
"notify_issue_offset_days": 123,
"notify_issue_offset_hour": 123,
"notify_remind_offset_days": 123,
"notify_remind_offset_hour": 123,
"notify_extend_offset_days": 123,
"notify_extend_offset_hour": 123,
"force_allocation": True,
"is_published": True,
"is_archived": True,
"claim_timeframe": ["<string>"],
"view_condition": ["<string>"],
"visibility_condition": ["<string>"],
"allow_user_redeem": True,
"value": 123,
"campaign": "<string>",
"external_id": "<string>",
"tags": ["<string>"]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
handle: '<string>',
period: 123,
region_id: 123,
currency: '<string>',
absolute_expiry: '<string>',
description: '<string>',
internal_notes: '<string>',
meta: ['<string>'],
short_description: '<string>',
long_description: '<string>',
terms_conditions: '<string>',
earn_instructions: '<string>',
redeem_instructions_store: '<string>',
redeem_instructions_online: '<string>',
redeem_code_pos: '<string>',
redeem_code_online: '<string>',
icon: '<string>',
image_url: '<string>',
max_redemptions: 123,
is_extendable: true,
is_assignable: true,
is_reassignable: true,
end_at: '2023-11-07T05:31:56Z',
is_claimable: true,
claim_period_start_at: '2023-11-07T05:31:56Z',
claim_period_end_at: '2023-11-07T05:31:56Z',
max_global_redemptions: 123,
claim_condition: ['<string>'],
is_reclaimable: true,
issue_target_id: 123,
remind_target_id: 123,
extend_target_id: 123,
notify_issue_offset_days: 123,
notify_issue_offset_hour: 123,
notify_remind_offset_days: 123,
notify_remind_offset_hour: 123,
notify_extend_offset_days: 123,
notify_extend_offset_hour: 123,
force_allocation: true,
is_published: true,
is_archived: true,
claim_timeframe: ['<string>'],
view_condition: ['<string>'],
visibility_condition: ['<string>'],
allow_user_redeem: true,
value: 123,
campaign: '<string>',
external_id: '<string>',
tags: ['<string>']
})
};
fetch('https://api.{tenant}.getomneo.com/api/v3/benefits/definitions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.{tenant}.getomneo.com/api/v3/benefits/definitions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'handle' => '<string>',
'period' => 123,
'region_id' => 123,
'currency' => '<string>',
'absolute_expiry' => '<string>',
'description' => '<string>',
'internal_notes' => '<string>',
'meta' => [
'<string>'
],
'short_description' => '<string>',
'long_description' => '<string>',
'terms_conditions' => '<string>',
'earn_instructions' => '<string>',
'redeem_instructions_store' => '<string>',
'redeem_instructions_online' => '<string>',
'redeem_code_pos' => '<string>',
'redeem_code_online' => '<string>',
'icon' => '<string>',
'image_url' => '<string>',
'max_redemptions' => 123,
'is_extendable' => true,
'is_assignable' => true,
'is_reassignable' => true,
'end_at' => '2023-11-07T05:31:56Z',
'is_claimable' => true,
'claim_period_start_at' => '2023-11-07T05:31:56Z',
'claim_period_end_at' => '2023-11-07T05:31:56Z',
'max_global_redemptions' => 123,
'claim_condition' => [
'<string>'
],
'is_reclaimable' => true,
'issue_target_id' => 123,
'remind_target_id' => 123,
'extend_target_id' => 123,
'notify_issue_offset_days' => 123,
'notify_issue_offset_hour' => 123,
'notify_remind_offset_days' => 123,
'notify_remind_offset_hour' => 123,
'notify_extend_offset_days' => 123,
'notify_extend_offset_hour' => 123,
'force_allocation' => true,
'is_published' => true,
'is_archived' => true,
'claim_timeframe' => [
'<string>'
],
'view_condition' => [
'<string>'
],
'visibility_condition' => [
'<string>'
],
'allow_user_redeem' => true,
'value' => 123,
'campaign' => '<string>',
'external_id' => '<string>',
'tags' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.{tenant}.getomneo.com/api/v3/benefits/definitions"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"handle\": \"<string>\",\n \"period\": 123,\n \"region_id\": 123,\n \"currency\": \"<string>\",\n \"absolute_expiry\": \"<string>\",\n \"description\": \"<string>\",\n \"internal_notes\": \"<string>\",\n \"meta\": [\n \"<string>\"\n ],\n \"short_description\": \"<string>\",\n \"long_description\": \"<string>\",\n \"terms_conditions\": \"<string>\",\n \"earn_instructions\": \"<string>\",\n \"redeem_instructions_store\": \"<string>\",\n \"redeem_instructions_online\": \"<string>\",\n \"redeem_code_pos\": \"<string>\",\n \"redeem_code_online\": \"<string>\",\n \"icon\": \"<string>\",\n \"image_url\": \"<string>\",\n \"max_redemptions\": 123,\n \"is_extendable\": true,\n \"is_assignable\": true,\n \"is_reassignable\": true,\n \"end_at\": \"2023-11-07T05:31:56Z\",\n \"is_claimable\": true,\n \"claim_period_start_at\": \"2023-11-07T05:31:56Z\",\n \"claim_period_end_at\": \"2023-11-07T05:31:56Z\",\n \"max_global_redemptions\": 123,\n \"claim_condition\": [\n \"<string>\"\n ],\n \"is_reclaimable\": true,\n \"issue_target_id\": 123,\n \"remind_target_id\": 123,\n \"extend_target_id\": 123,\n \"notify_issue_offset_days\": 123,\n \"notify_issue_offset_hour\": 123,\n \"notify_remind_offset_days\": 123,\n \"notify_remind_offset_hour\": 123,\n \"notify_extend_offset_days\": 123,\n \"notify_extend_offset_hour\": 123,\n \"force_allocation\": true,\n \"is_published\": true,\n \"is_archived\": true,\n \"claim_timeframe\": [\n \"<string>\"\n ],\n \"view_condition\": [\n \"<string>\"\n ],\n \"visibility_condition\": [\n \"<string>\"\n ],\n \"allow_user_redeem\": true,\n \"value\": 123,\n \"campaign\": \"<string>\",\n \"external_id\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.{tenant}.getomneo.com/api/v3/benefits/definitions")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"handle\": \"<string>\",\n \"period\": 123,\n \"region_id\": 123,\n \"currency\": \"<string>\",\n \"absolute_expiry\": \"<string>\",\n \"description\": \"<string>\",\n \"internal_notes\": \"<string>\",\n \"meta\": [\n \"<string>\"\n ],\n \"short_description\": \"<string>\",\n \"long_description\": \"<string>\",\n \"terms_conditions\": \"<string>\",\n \"earn_instructions\": \"<string>\",\n \"redeem_instructions_store\": \"<string>\",\n \"redeem_instructions_online\": \"<string>\",\n \"redeem_code_pos\": \"<string>\",\n \"redeem_code_online\": \"<string>\",\n \"icon\": \"<string>\",\n \"image_url\": \"<string>\",\n \"max_redemptions\": 123,\n \"is_extendable\": true,\n \"is_assignable\": true,\n \"is_reassignable\": true,\n \"end_at\": \"2023-11-07T05:31:56Z\",\n \"is_claimable\": true,\n \"claim_period_start_at\": \"2023-11-07T05:31:56Z\",\n \"claim_period_end_at\": \"2023-11-07T05:31:56Z\",\n \"max_global_redemptions\": 123,\n \"claim_condition\": [\n \"<string>\"\n ],\n \"is_reclaimable\": true,\n \"issue_target_id\": 123,\n \"remind_target_id\": 123,\n \"extend_target_id\": 123,\n \"notify_issue_offset_days\": 123,\n \"notify_issue_offset_hour\": 123,\n \"notify_remind_offset_days\": 123,\n \"notify_remind_offset_hour\": 123,\n \"notify_extend_offset_days\": 123,\n \"notify_extend_offset_hour\": 123,\n \"force_allocation\": true,\n \"is_published\": true,\n \"is_archived\": true,\n \"claim_timeframe\": [\n \"<string>\"\n ],\n \"view_condition\": [\n \"<string>\"\n ],\n \"visibility_condition\": [\n \"<string>\"\n ],\n \"allow_user_redeem\": true,\n \"value\": 123,\n \"campaign\": \"<string>\",\n \"external_id\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.{tenant}.getomneo.com/api/v3/benefits/definitions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"handle\": \"<string>\",\n \"period\": 123,\n \"region_id\": 123,\n \"currency\": \"<string>\",\n \"absolute_expiry\": \"<string>\",\n \"description\": \"<string>\",\n \"internal_notes\": \"<string>\",\n \"meta\": [\n \"<string>\"\n ],\n \"short_description\": \"<string>\",\n \"long_description\": \"<string>\",\n \"terms_conditions\": \"<string>\",\n \"earn_instructions\": \"<string>\",\n \"redeem_instructions_store\": \"<string>\",\n \"redeem_instructions_online\": \"<string>\",\n \"redeem_code_pos\": \"<string>\",\n \"redeem_code_online\": \"<string>\",\n \"icon\": \"<string>\",\n \"image_url\": \"<string>\",\n \"max_redemptions\": 123,\n \"is_extendable\": true,\n \"is_assignable\": true,\n \"is_reassignable\": true,\n \"end_at\": \"2023-11-07T05:31:56Z\",\n \"is_claimable\": true,\n \"claim_period_start_at\": \"2023-11-07T05:31:56Z\",\n \"claim_period_end_at\": \"2023-11-07T05:31:56Z\",\n \"max_global_redemptions\": 123,\n \"claim_condition\": [\n \"<string>\"\n ],\n \"is_reclaimable\": true,\n \"issue_target_id\": 123,\n \"remind_target_id\": 123,\n \"extend_target_id\": 123,\n \"notify_issue_offset_days\": 123,\n \"notify_issue_offset_hour\": 123,\n \"notify_remind_offset_days\": 123,\n \"notify_remind_offset_hour\": 123,\n \"notify_extend_offset_days\": 123,\n \"notify_extend_offset_hour\": 123,\n \"force_allocation\": true,\n \"is_published\": true,\n \"is_archived\": true,\n \"claim_timeframe\": [\n \"<string>\"\n ],\n \"view_condition\": [\n \"<string>\"\n ],\n \"visibility_condition\": [\n \"<string>\"\n ],\n \"allow_user_redeem\": true,\n \"value\": 123,\n \"campaign\": \"<string>\",\n \"external_id\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"name": "<string>",
"handle": "<string>",
"region_id": 123,
"region": {
"id": 123,
"name": "<string>",
"handle": "<string>"
},
"currency": "<string>",
"period": 123,
"period_type": "<string>",
"absolute_expiry": "<string>",
"description": "<string>",
"internal_notes": "<string>",
"meta": [
"<unknown>"
],
"short_description": "<string>",
"long_description": "<string>",
"terms_conditions": "<string>",
"earn_instructions": "<string>",
"redeem_instructions_store": "<string>",
"redeem_instructions_online": "<string>",
"redeem_code_pos": "<string>",
"redeem_code_online": "<string>",
"icon": "<string>",
"image_url": "<string>",
"max_redemptions": 123,
"is_extendable": true,
"is_assignable": true,
"is_reassignable": true,
"is_published": true,
"is_archived": true,
"tags": [
"<string>"
],
"is_claimable": true,
"max_global_redemptions": 123,
"total_global_redemptions_remaining": {},
"total_global_redemptions": 123,
"total_global_created": 123,
"claim_period_start_at": "<string>",
"claim_period_end_at": "<string>",
"claim_condition": [
"<unknown>"
],
"is_reclaimable": true,
"notify_schedule_offset": 123,
"notify_issue_offset_days": 123,
"notify_issue_offset_hour": 123,
"notify_remind_offset_days": 123,
"notify_remind_offset_hour": 123,
"notify_extend_offset_days": 123,
"notify_extend_offset_hour": 123,
"remind_target_id": 123,
"extend_target_id": 123,
"issue_target_id": 123,
"end_at": "<string>",
"total_allocations": null,
"total_allocations_remaining": null,
"force_allocation": true,
"created_at": "<string>",
"updated_at": "<string>",
"claim_timeframe": [
"<unknown>"
],
"view_condition": [
"<unknown>"
],
"visibility_condition": [
"<unknown>"
],
"allow_user_redeem": true,
"value": "<string>",
"type": "<string>",
"campaign": "<string>",
"external_id": "<string>",
"same_campaign_count": 123
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}Benefit Definition
Add Benefit Definition
A POST to the /benefits/definitions endpoint allows your application to create a Benefit Definitions.
POST
/
v3
/
benefits
/
definitions
Add Benefit Definition
curl --request POST \
--url https://api.{tenant}.getomneo.com/api/v3/benefits/definitions \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"handle": "<string>",
"period": 123,
"region_id": 123,
"currency": "<string>",
"absolute_expiry": "<string>",
"description": "<string>",
"internal_notes": "<string>",
"meta": [
"<string>"
],
"short_description": "<string>",
"long_description": "<string>",
"terms_conditions": "<string>",
"earn_instructions": "<string>",
"redeem_instructions_store": "<string>",
"redeem_instructions_online": "<string>",
"redeem_code_pos": "<string>",
"redeem_code_online": "<string>",
"icon": "<string>",
"image_url": "<string>",
"max_redemptions": 123,
"is_extendable": true,
"is_assignable": true,
"is_reassignable": true,
"end_at": "2023-11-07T05:31:56Z",
"is_claimable": true,
"claim_period_start_at": "2023-11-07T05:31:56Z",
"claim_period_end_at": "2023-11-07T05:31:56Z",
"max_global_redemptions": 123,
"claim_condition": [
"<string>"
],
"is_reclaimable": true,
"issue_target_id": 123,
"remind_target_id": 123,
"extend_target_id": 123,
"notify_issue_offset_days": 123,
"notify_issue_offset_hour": 123,
"notify_remind_offset_days": 123,
"notify_remind_offset_hour": 123,
"notify_extend_offset_days": 123,
"notify_extend_offset_hour": 123,
"force_allocation": true,
"is_published": true,
"is_archived": true,
"claim_timeframe": [
"<string>"
],
"view_condition": [
"<string>"
],
"visibility_condition": [
"<string>"
],
"allow_user_redeem": true,
"value": 123,
"campaign": "<string>",
"external_id": "<string>",
"tags": [
"<string>"
]
}
'import requests
url = "https://api.{tenant}.getomneo.com/api/v3/benefits/definitions"
payload = {
"name": "<string>",
"handle": "<string>",
"period": 123,
"region_id": 123,
"currency": "<string>",
"absolute_expiry": "<string>",
"description": "<string>",
"internal_notes": "<string>",
"meta": ["<string>"],
"short_description": "<string>",
"long_description": "<string>",
"terms_conditions": "<string>",
"earn_instructions": "<string>",
"redeem_instructions_store": "<string>",
"redeem_instructions_online": "<string>",
"redeem_code_pos": "<string>",
"redeem_code_online": "<string>",
"icon": "<string>",
"image_url": "<string>",
"max_redemptions": 123,
"is_extendable": True,
"is_assignable": True,
"is_reassignable": True,
"end_at": "2023-11-07T05:31:56Z",
"is_claimable": True,
"claim_period_start_at": "2023-11-07T05:31:56Z",
"claim_period_end_at": "2023-11-07T05:31:56Z",
"max_global_redemptions": 123,
"claim_condition": ["<string>"],
"is_reclaimable": True,
"issue_target_id": 123,
"remind_target_id": 123,
"extend_target_id": 123,
"notify_issue_offset_days": 123,
"notify_issue_offset_hour": 123,
"notify_remind_offset_days": 123,
"notify_remind_offset_hour": 123,
"notify_extend_offset_days": 123,
"notify_extend_offset_hour": 123,
"force_allocation": True,
"is_published": True,
"is_archived": True,
"claim_timeframe": ["<string>"],
"view_condition": ["<string>"],
"visibility_condition": ["<string>"],
"allow_user_redeem": True,
"value": 123,
"campaign": "<string>",
"external_id": "<string>",
"tags": ["<string>"]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
handle: '<string>',
period: 123,
region_id: 123,
currency: '<string>',
absolute_expiry: '<string>',
description: '<string>',
internal_notes: '<string>',
meta: ['<string>'],
short_description: '<string>',
long_description: '<string>',
terms_conditions: '<string>',
earn_instructions: '<string>',
redeem_instructions_store: '<string>',
redeem_instructions_online: '<string>',
redeem_code_pos: '<string>',
redeem_code_online: '<string>',
icon: '<string>',
image_url: '<string>',
max_redemptions: 123,
is_extendable: true,
is_assignable: true,
is_reassignable: true,
end_at: '2023-11-07T05:31:56Z',
is_claimable: true,
claim_period_start_at: '2023-11-07T05:31:56Z',
claim_period_end_at: '2023-11-07T05:31:56Z',
max_global_redemptions: 123,
claim_condition: ['<string>'],
is_reclaimable: true,
issue_target_id: 123,
remind_target_id: 123,
extend_target_id: 123,
notify_issue_offset_days: 123,
notify_issue_offset_hour: 123,
notify_remind_offset_days: 123,
notify_remind_offset_hour: 123,
notify_extend_offset_days: 123,
notify_extend_offset_hour: 123,
force_allocation: true,
is_published: true,
is_archived: true,
claim_timeframe: ['<string>'],
view_condition: ['<string>'],
visibility_condition: ['<string>'],
allow_user_redeem: true,
value: 123,
campaign: '<string>',
external_id: '<string>',
tags: ['<string>']
})
};
fetch('https://api.{tenant}.getomneo.com/api/v3/benefits/definitions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.{tenant}.getomneo.com/api/v3/benefits/definitions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'handle' => '<string>',
'period' => 123,
'region_id' => 123,
'currency' => '<string>',
'absolute_expiry' => '<string>',
'description' => '<string>',
'internal_notes' => '<string>',
'meta' => [
'<string>'
],
'short_description' => '<string>',
'long_description' => '<string>',
'terms_conditions' => '<string>',
'earn_instructions' => '<string>',
'redeem_instructions_store' => '<string>',
'redeem_instructions_online' => '<string>',
'redeem_code_pos' => '<string>',
'redeem_code_online' => '<string>',
'icon' => '<string>',
'image_url' => '<string>',
'max_redemptions' => 123,
'is_extendable' => true,
'is_assignable' => true,
'is_reassignable' => true,
'end_at' => '2023-11-07T05:31:56Z',
'is_claimable' => true,
'claim_period_start_at' => '2023-11-07T05:31:56Z',
'claim_period_end_at' => '2023-11-07T05:31:56Z',
'max_global_redemptions' => 123,
'claim_condition' => [
'<string>'
],
'is_reclaimable' => true,
'issue_target_id' => 123,
'remind_target_id' => 123,
'extend_target_id' => 123,
'notify_issue_offset_days' => 123,
'notify_issue_offset_hour' => 123,
'notify_remind_offset_days' => 123,
'notify_remind_offset_hour' => 123,
'notify_extend_offset_days' => 123,
'notify_extend_offset_hour' => 123,
'force_allocation' => true,
'is_published' => true,
'is_archived' => true,
'claim_timeframe' => [
'<string>'
],
'view_condition' => [
'<string>'
],
'visibility_condition' => [
'<string>'
],
'allow_user_redeem' => true,
'value' => 123,
'campaign' => '<string>',
'external_id' => '<string>',
'tags' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.{tenant}.getomneo.com/api/v3/benefits/definitions"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"handle\": \"<string>\",\n \"period\": 123,\n \"region_id\": 123,\n \"currency\": \"<string>\",\n \"absolute_expiry\": \"<string>\",\n \"description\": \"<string>\",\n \"internal_notes\": \"<string>\",\n \"meta\": [\n \"<string>\"\n ],\n \"short_description\": \"<string>\",\n \"long_description\": \"<string>\",\n \"terms_conditions\": \"<string>\",\n \"earn_instructions\": \"<string>\",\n \"redeem_instructions_store\": \"<string>\",\n \"redeem_instructions_online\": \"<string>\",\n \"redeem_code_pos\": \"<string>\",\n \"redeem_code_online\": \"<string>\",\n \"icon\": \"<string>\",\n \"image_url\": \"<string>\",\n \"max_redemptions\": 123,\n \"is_extendable\": true,\n \"is_assignable\": true,\n \"is_reassignable\": true,\n \"end_at\": \"2023-11-07T05:31:56Z\",\n \"is_claimable\": true,\n \"claim_period_start_at\": \"2023-11-07T05:31:56Z\",\n \"claim_period_end_at\": \"2023-11-07T05:31:56Z\",\n \"max_global_redemptions\": 123,\n \"claim_condition\": [\n \"<string>\"\n ],\n \"is_reclaimable\": true,\n \"issue_target_id\": 123,\n \"remind_target_id\": 123,\n \"extend_target_id\": 123,\n \"notify_issue_offset_days\": 123,\n \"notify_issue_offset_hour\": 123,\n \"notify_remind_offset_days\": 123,\n \"notify_remind_offset_hour\": 123,\n \"notify_extend_offset_days\": 123,\n \"notify_extend_offset_hour\": 123,\n \"force_allocation\": true,\n \"is_published\": true,\n \"is_archived\": true,\n \"claim_timeframe\": [\n \"<string>\"\n ],\n \"view_condition\": [\n \"<string>\"\n ],\n \"visibility_condition\": [\n \"<string>\"\n ],\n \"allow_user_redeem\": true,\n \"value\": 123,\n \"campaign\": \"<string>\",\n \"external_id\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.{tenant}.getomneo.com/api/v3/benefits/definitions")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"handle\": \"<string>\",\n \"period\": 123,\n \"region_id\": 123,\n \"currency\": \"<string>\",\n \"absolute_expiry\": \"<string>\",\n \"description\": \"<string>\",\n \"internal_notes\": \"<string>\",\n \"meta\": [\n \"<string>\"\n ],\n \"short_description\": \"<string>\",\n \"long_description\": \"<string>\",\n \"terms_conditions\": \"<string>\",\n \"earn_instructions\": \"<string>\",\n \"redeem_instructions_store\": \"<string>\",\n \"redeem_instructions_online\": \"<string>\",\n \"redeem_code_pos\": \"<string>\",\n \"redeem_code_online\": \"<string>\",\n \"icon\": \"<string>\",\n \"image_url\": \"<string>\",\n \"max_redemptions\": 123,\n \"is_extendable\": true,\n \"is_assignable\": true,\n \"is_reassignable\": true,\n \"end_at\": \"2023-11-07T05:31:56Z\",\n \"is_claimable\": true,\n \"claim_period_start_at\": \"2023-11-07T05:31:56Z\",\n \"claim_period_end_at\": \"2023-11-07T05:31:56Z\",\n \"max_global_redemptions\": 123,\n \"claim_condition\": [\n \"<string>\"\n ],\n \"is_reclaimable\": true,\n \"issue_target_id\": 123,\n \"remind_target_id\": 123,\n \"extend_target_id\": 123,\n \"notify_issue_offset_days\": 123,\n \"notify_issue_offset_hour\": 123,\n \"notify_remind_offset_days\": 123,\n \"notify_remind_offset_hour\": 123,\n \"notify_extend_offset_days\": 123,\n \"notify_extend_offset_hour\": 123,\n \"force_allocation\": true,\n \"is_published\": true,\n \"is_archived\": true,\n \"claim_timeframe\": [\n \"<string>\"\n ],\n \"view_condition\": [\n \"<string>\"\n ],\n \"visibility_condition\": [\n \"<string>\"\n ],\n \"allow_user_redeem\": true,\n \"value\": 123,\n \"campaign\": \"<string>\",\n \"external_id\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.{tenant}.getomneo.com/api/v3/benefits/definitions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"handle\": \"<string>\",\n \"period\": 123,\n \"region_id\": 123,\n \"currency\": \"<string>\",\n \"absolute_expiry\": \"<string>\",\n \"description\": \"<string>\",\n \"internal_notes\": \"<string>\",\n \"meta\": [\n \"<string>\"\n ],\n \"short_description\": \"<string>\",\n \"long_description\": \"<string>\",\n \"terms_conditions\": \"<string>\",\n \"earn_instructions\": \"<string>\",\n \"redeem_instructions_store\": \"<string>\",\n \"redeem_instructions_online\": \"<string>\",\n \"redeem_code_pos\": \"<string>\",\n \"redeem_code_online\": \"<string>\",\n \"icon\": \"<string>\",\n \"image_url\": \"<string>\",\n \"max_redemptions\": 123,\n \"is_extendable\": true,\n \"is_assignable\": true,\n \"is_reassignable\": true,\n \"end_at\": \"2023-11-07T05:31:56Z\",\n \"is_claimable\": true,\n \"claim_period_start_at\": \"2023-11-07T05:31:56Z\",\n \"claim_period_end_at\": \"2023-11-07T05:31:56Z\",\n \"max_global_redemptions\": 123,\n \"claim_condition\": [\n \"<string>\"\n ],\n \"is_reclaimable\": true,\n \"issue_target_id\": 123,\n \"remind_target_id\": 123,\n \"extend_target_id\": 123,\n \"notify_issue_offset_days\": 123,\n \"notify_issue_offset_hour\": 123,\n \"notify_remind_offset_days\": 123,\n \"notify_remind_offset_hour\": 123,\n \"notify_extend_offset_days\": 123,\n \"notify_extend_offset_hour\": 123,\n \"force_allocation\": true,\n \"is_published\": true,\n \"is_archived\": true,\n \"claim_timeframe\": [\n \"<string>\"\n ],\n \"view_condition\": [\n \"<string>\"\n ],\n \"visibility_condition\": [\n \"<string>\"\n ],\n \"allow_user_redeem\": true,\n \"value\": 123,\n \"campaign\": \"<string>\",\n \"external_id\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"name": "<string>",
"handle": "<string>",
"region_id": 123,
"region": {
"id": 123,
"name": "<string>",
"handle": "<string>"
},
"currency": "<string>",
"period": 123,
"period_type": "<string>",
"absolute_expiry": "<string>",
"description": "<string>",
"internal_notes": "<string>",
"meta": [
"<unknown>"
],
"short_description": "<string>",
"long_description": "<string>",
"terms_conditions": "<string>",
"earn_instructions": "<string>",
"redeem_instructions_store": "<string>",
"redeem_instructions_online": "<string>",
"redeem_code_pos": "<string>",
"redeem_code_online": "<string>",
"icon": "<string>",
"image_url": "<string>",
"max_redemptions": 123,
"is_extendable": true,
"is_assignable": true,
"is_reassignable": true,
"is_published": true,
"is_archived": true,
"tags": [
"<string>"
],
"is_claimable": true,
"max_global_redemptions": 123,
"total_global_redemptions_remaining": {},
"total_global_redemptions": 123,
"total_global_created": 123,
"claim_period_start_at": "<string>",
"claim_period_end_at": "<string>",
"claim_condition": [
"<unknown>"
],
"is_reclaimable": true,
"notify_schedule_offset": 123,
"notify_issue_offset_days": 123,
"notify_issue_offset_hour": 123,
"notify_remind_offset_days": 123,
"notify_remind_offset_hour": 123,
"notify_extend_offset_days": 123,
"notify_extend_offset_hour": 123,
"remind_target_id": 123,
"extend_target_id": 123,
"issue_target_id": 123,
"end_at": "<string>",
"total_allocations": null,
"total_allocations_remaining": null,
"force_allocation": true,
"created_at": "<string>",
"updated_at": "<string>",
"claim_timeframe": [
"<unknown>"
],
"view_condition": [
"<unknown>"
],
"visibility_condition": [
"<unknown>"
],
"allow_user_redeem": true,
"value": "<string>",
"type": "<string>",
"campaign": "<string>",
"external_id": "<string>",
"same_campaign_count": 123
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}Body
application/json
Pattern:
^[A-Z]+$Available options:
days, weeks, months, years, absolute_date, absolute_week, absolute_month Available options:
discount, value, competition, event, gift, voucher, bonus, other Response
App.Http.Resources.BenefitDefinition
Show child attributes
Show child attributes
⌘I