Edit Benefit
curl --request PUT \
--url https://api.{tenant}.getomneo.com/api/v3/benefits/{benefit} \
--header 'Content-Type: application/json' \
--data '
{
"external_id": "<string>",
"meta": [
"<string>"
],
"expires_at": "<string>",
"redeem_code_pos": "<string>",
"redeem_code_online": "<string>",
"value": 123
}
'import requests
url = "https://api.{tenant}.getomneo.com/api/v3/benefits/{benefit}"
payload = {
"external_id": "<string>",
"meta": ["<string>"],
"expires_at": "<string>",
"redeem_code_pos": "<string>",
"redeem_code_online": "<string>",
"value": 123
}
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
external_id: '<string>',
meta: ['<string>'],
expires_at: '<string>',
redeem_code_pos: '<string>',
redeem_code_online: '<string>',
value: 123
})
};
fetch('https://api.{tenant}.getomneo.com/api/v3/benefits/{benefit}', 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/{benefit}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'external_id' => '<string>',
'meta' => [
'<string>'
],
'expires_at' => '<string>',
'redeem_code_pos' => '<string>',
'redeem_code_online' => '<string>',
'value' => 123
]),
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/{benefit}"
payload := strings.NewReader("{\n \"external_id\": \"<string>\",\n \"meta\": [\n \"<string>\"\n ],\n \"expires_at\": \"<string>\",\n \"redeem_code_pos\": \"<string>\",\n \"redeem_code_online\": \"<string>\",\n \"value\": 123\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.{tenant}.getomneo.com/api/v3/benefits/{benefit}")
.header("Content-Type", "application/json")
.body("{\n \"external_id\": \"<string>\",\n \"meta\": [\n \"<string>\"\n ],\n \"expires_at\": \"<string>\",\n \"redeem_code_pos\": \"<string>\",\n \"redeem_code_online\": \"<string>\",\n \"value\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.{tenant}.getomneo.com/api/v3/benefits/{benefit}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"external_id\": \"<string>\",\n \"meta\": [\n \"<string>\"\n ],\n \"expires_at\": \"<string>\",\n \"redeem_code_pos\": \"<string>\",\n \"redeem_code_online\": \"<string>\",\n \"value\": 123\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": 123,
"profile_id": "<string>",
"external_id": "<string>",
"expires_at": "<string>",
"issued_at": "<string>",
"is_expired": "<string>",
"is_redeemable": "<string>",
"redemptions_remaining": "<string>",
"total_global_redemptions_remaining": {},
"definition": {
"id": "<string>",
"name": "<string>",
"handle": "<string>",
"type": "<string>",
"region_id": 123,
"region": {
"id": 123,
"name": "<string>",
"handle": "<string>"
},
"currency": "<string>",
"period": 123,
"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,
"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>"
],
"allow_user_redeem": true,
"same_campaign_count": 123
},
"timezone": "<string>",
"claimed_at": "<string>",
"meta": [
"<unknown>"
],
"redeem_code_pos": "<string>",
"redeem_code_online": "<string>",
"created_at": "<string>",
"updated_at": "<string>",
"value": "<string>",
"combine_meta": [
"<unknown>"
],
"is_combined": true,
"extended_at": "<string>",
"source_id": 123,
"source_type": "<string>"
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}Benefit
Edit Benefit
A PUT to the /benefits/{benefitId} endpoint allows your application to edit benefit.
PUT
/
v3
/
benefits
/
{benefit}
Edit Benefit
curl --request PUT \
--url https://api.{tenant}.getomneo.com/api/v3/benefits/{benefit} \
--header 'Content-Type: application/json' \
--data '
{
"external_id": "<string>",
"meta": [
"<string>"
],
"expires_at": "<string>",
"redeem_code_pos": "<string>",
"redeem_code_online": "<string>",
"value": 123
}
'import requests
url = "https://api.{tenant}.getomneo.com/api/v3/benefits/{benefit}"
payload = {
"external_id": "<string>",
"meta": ["<string>"],
"expires_at": "<string>",
"redeem_code_pos": "<string>",
"redeem_code_online": "<string>",
"value": 123
}
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
external_id: '<string>',
meta: ['<string>'],
expires_at: '<string>',
redeem_code_pos: '<string>',
redeem_code_online: '<string>',
value: 123
})
};
fetch('https://api.{tenant}.getomneo.com/api/v3/benefits/{benefit}', 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/{benefit}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'external_id' => '<string>',
'meta' => [
'<string>'
],
'expires_at' => '<string>',
'redeem_code_pos' => '<string>',
'redeem_code_online' => '<string>',
'value' => 123
]),
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/{benefit}"
payload := strings.NewReader("{\n \"external_id\": \"<string>\",\n \"meta\": [\n \"<string>\"\n ],\n \"expires_at\": \"<string>\",\n \"redeem_code_pos\": \"<string>\",\n \"redeem_code_online\": \"<string>\",\n \"value\": 123\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.{tenant}.getomneo.com/api/v3/benefits/{benefit}")
.header("Content-Type", "application/json")
.body("{\n \"external_id\": \"<string>\",\n \"meta\": [\n \"<string>\"\n ],\n \"expires_at\": \"<string>\",\n \"redeem_code_pos\": \"<string>\",\n \"redeem_code_online\": \"<string>\",\n \"value\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.{tenant}.getomneo.com/api/v3/benefits/{benefit}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"external_id\": \"<string>\",\n \"meta\": [\n \"<string>\"\n ],\n \"expires_at\": \"<string>\",\n \"redeem_code_pos\": \"<string>\",\n \"redeem_code_online\": \"<string>\",\n \"value\": 123\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": 123,
"profile_id": "<string>",
"external_id": "<string>",
"expires_at": "<string>",
"issued_at": "<string>",
"is_expired": "<string>",
"is_redeemable": "<string>",
"redemptions_remaining": "<string>",
"total_global_redemptions_remaining": {},
"definition": {
"id": "<string>",
"name": "<string>",
"handle": "<string>",
"type": "<string>",
"region_id": 123,
"region": {
"id": 123,
"name": "<string>",
"handle": "<string>"
},
"currency": "<string>",
"period": 123,
"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,
"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>"
],
"allow_user_redeem": true,
"same_campaign_count": 123
},
"timezone": "<string>",
"claimed_at": "<string>",
"meta": [
"<unknown>"
],
"redeem_code_pos": "<string>",
"redeem_code_online": "<string>",
"created_at": "<string>",
"updated_at": "<string>",
"value": "<string>",
"combine_meta": [
"<unknown>"
],
"is_combined": true,
"extended_at": "<string>",
"source_id": 123,
"source_type": "<string>"
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}⌘I