Add and Redeem Benefit Claim
curl --request POST \
--url https://api.{tenant}.getomneo.com/api/v3/profiles/{profile}/benefits/claim-redeem \
--header 'Content-Type: application/json' \
--data '
{
"definition": "<string>",
"timezone": "<string>",
"external_id": "<string>",
"meta": [
"<string>"
]
}
'import requests
url = "https://api.{tenant}.getomneo.com/api/v3/profiles/{profile}/benefits/claim-redeem"
payload = {
"definition": "<string>",
"timezone": "<string>",
"external_id": "<string>",
"meta": ["<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({
definition: '<string>',
timezone: '<string>',
external_id: '<string>',
meta: ['<string>']
})
};
fetch('https://api.{tenant}.getomneo.com/api/v3/profiles/{profile}/benefits/claim-redeem', 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/profiles/{profile}/benefits/claim-redeem",
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([
'definition' => '<string>',
'timezone' => '<string>',
'external_id' => '<string>',
'meta' => [
'<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/profiles/{profile}/benefits/claim-redeem"
payload := strings.NewReader("{\n \"definition\": \"<string>\",\n \"timezone\": \"<string>\",\n \"external_id\": \"<string>\",\n \"meta\": [\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/profiles/{profile}/benefits/claim-redeem")
.header("Content-Type", "application/json")
.body("{\n \"definition\": \"<string>\",\n \"timezone\": \"<string>\",\n \"external_id\": \"<string>\",\n \"meta\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.{tenant}.getomneo.com/api/v3/profiles/{profile}/benefits/claim-redeem")
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 \"definition\": \"<string>\",\n \"timezone\": \"<string>\",\n \"external_id\": \"<string>\",\n \"meta\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": 123,
"profile_id": "<string>",
"profile": {
"first_name": "<string>",
"last_name": "<string>",
"full_name": "<string>",
"email": "<string>",
"statuses": [
"<unknown>"
]
},
"type": "<string>",
"total": "<string>",
"total_localised": "<string>",
"meta": [
"<unknown>"
],
"location_id": 123,
"location": {
"id": 123,
"type": "<string>",
"name": "<string>",
"description": "<string>",
"phone": "<string>",
"email": "<string>",
"external_id": "<string>",
"is_published": true,
"is_permanently_closed": true
},
"transaction_id": "<string>",
"items": [
{
"id": 123,
"type": "<string>",
"value": 123,
"count": 123,
"type_attributes": {
"id": 123,
"profile_id": "<string>",
"creator_profile_id": "<string>",
"staff_id": "<string>",
"location_id": 123,
"name": "<string>",
"credit_definition_id": 123,
"timezone": "<string>",
"recipient_first_name": "<string>",
"recipient_email": "<string>",
"message": "<string>",
"issued_at": "<string>",
"expires_at": "<string>",
"released_at": "<string>",
"extended_at": "<string>",
"value_initial": "<string>",
"value_remaining": "<string>",
"external_id": "<string>",
"external_namespace": "<string>",
"credit_number": "<string>",
"security_code": "<string>",
"source_id": 123,
"source_type": "<string>",
"locked": true,
"lock_expires_at": "<string>",
"has_notified_issue": true,
"has_notified_expiry": true,
"has_notified_release": true,
"has_notified_remind": true,
"has_notified_extend": true,
"meta": [
"<unknown>"
],
"is_imported": true,
"is_system_generated": true,
"created_at": "<string>",
"updated_at": "<string>",
"definition": {
"id": 123,
"name": "<string>",
"handle": "<string>",
"region_id": 123,
"region": {
"id": 123,
"name": "<string>",
"handle": "<string>"
},
"timezone": "<string>",
"period": 123,
"period_type": "<string>",
"absolute_expiry": "<string>",
"release_period": 123,
"release_period_type": "<string>",
"release_period_absolute_expiry": "<string>",
"is_published": true,
"is_archived": true,
"icon": "<string>",
"image_url": "<string>",
"primary_colour": "<string>",
"secondary_colour": "<string>",
"description": "<string>",
"internal_notes": "<string>",
"short_description": "<string>",
"long_description": "<string>",
"terms_conditions": "<string>",
"earn_instructions": "<string>",
"meta": [
"<unknown>"
],
"type": "<string>",
"value": 123,
"max_value": 123,
"currency_id": 123,
"currency": "<string>",
"require_creator": true,
"require_assigned": true,
"is_extendable": true,
"is_assignable": true,
"is_releasable": true,
"is_reassignable": true,
"require_security_code": true,
"extend_days": 123,
"credit_number_range_type": "<string>",
"credit_number_range_start": "<string>",
"credit_number_range_end": "<string>",
"credit_number_length": 123,
"security_code_type": "<string>",
"use_custom_numbers": true,
"notify_schedule_offset": 123,
"issue_target_id": 123,
"expiry_target_id": 123,
"release_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,
"tags": [
"<string>"
],
"created_at": "<string>",
"updated_at": "<string>",
"custom_fields": [
{
"name": "<string>",
"handle": "<string>",
"namespace": "<string>",
"value": "<string>",
"type": "<string>",
"custom_fieldable_type": "<string>",
"custom_fieldable_id": "<string>",
"created_at": "<string>",
"updated_at": "<string>",
"is_index": "<string>"
}
]
}
},
"created_at": "<string>",
"updated_at": "<string>"
}
],
"created_at": "<string>",
"updated_at": "<string>",
"redeem_at": "<string>",
"transaction": {
"external_id": "<string>",
"receipt_ref": "<string>",
"transacted_at": "<string>",
"total": 123,
"location": {
"id": "<string>",
"name": "<string>",
"external_id": "<string>"
}
}
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}Profile Benefit
Add and Redeem Benefit Claim
A POST to the /profiles/{profileId}/benefits/claim-redeem endpoint allows your application to create and immediatly claim a Benefit Redemption.
POST
/
v3
/
profiles
/
{profile}
/
benefits
/
claim-redeem
Add and Redeem Benefit Claim
curl --request POST \
--url https://api.{tenant}.getomneo.com/api/v3/profiles/{profile}/benefits/claim-redeem \
--header 'Content-Type: application/json' \
--data '
{
"definition": "<string>",
"timezone": "<string>",
"external_id": "<string>",
"meta": [
"<string>"
]
}
'import requests
url = "https://api.{tenant}.getomneo.com/api/v3/profiles/{profile}/benefits/claim-redeem"
payload = {
"definition": "<string>",
"timezone": "<string>",
"external_id": "<string>",
"meta": ["<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({
definition: '<string>',
timezone: '<string>',
external_id: '<string>',
meta: ['<string>']
})
};
fetch('https://api.{tenant}.getomneo.com/api/v3/profiles/{profile}/benefits/claim-redeem', 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/profiles/{profile}/benefits/claim-redeem",
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([
'definition' => '<string>',
'timezone' => '<string>',
'external_id' => '<string>',
'meta' => [
'<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/profiles/{profile}/benefits/claim-redeem"
payload := strings.NewReader("{\n \"definition\": \"<string>\",\n \"timezone\": \"<string>\",\n \"external_id\": \"<string>\",\n \"meta\": [\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/profiles/{profile}/benefits/claim-redeem")
.header("Content-Type", "application/json")
.body("{\n \"definition\": \"<string>\",\n \"timezone\": \"<string>\",\n \"external_id\": \"<string>\",\n \"meta\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.{tenant}.getomneo.com/api/v3/profiles/{profile}/benefits/claim-redeem")
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 \"definition\": \"<string>\",\n \"timezone\": \"<string>\",\n \"external_id\": \"<string>\",\n \"meta\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": 123,
"profile_id": "<string>",
"profile": {
"first_name": "<string>",
"last_name": "<string>",
"full_name": "<string>",
"email": "<string>",
"statuses": [
"<unknown>"
]
},
"type": "<string>",
"total": "<string>",
"total_localised": "<string>",
"meta": [
"<unknown>"
],
"location_id": 123,
"location": {
"id": 123,
"type": "<string>",
"name": "<string>",
"description": "<string>",
"phone": "<string>",
"email": "<string>",
"external_id": "<string>",
"is_published": true,
"is_permanently_closed": true
},
"transaction_id": "<string>",
"items": [
{
"id": 123,
"type": "<string>",
"value": 123,
"count": 123,
"type_attributes": {
"id": 123,
"profile_id": "<string>",
"creator_profile_id": "<string>",
"staff_id": "<string>",
"location_id": 123,
"name": "<string>",
"credit_definition_id": 123,
"timezone": "<string>",
"recipient_first_name": "<string>",
"recipient_email": "<string>",
"message": "<string>",
"issued_at": "<string>",
"expires_at": "<string>",
"released_at": "<string>",
"extended_at": "<string>",
"value_initial": "<string>",
"value_remaining": "<string>",
"external_id": "<string>",
"external_namespace": "<string>",
"credit_number": "<string>",
"security_code": "<string>",
"source_id": 123,
"source_type": "<string>",
"locked": true,
"lock_expires_at": "<string>",
"has_notified_issue": true,
"has_notified_expiry": true,
"has_notified_release": true,
"has_notified_remind": true,
"has_notified_extend": true,
"meta": [
"<unknown>"
],
"is_imported": true,
"is_system_generated": true,
"created_at": "<string>",
"updated_at": "<string>",
"definition": {
"id": 123,
"name": "<string>",
"handle": "<string>",
"region_id": 123,
"region": {
"id": 123,
"name": "<string>",
"handle": "<string>"
},
"timezone": "<string>",
"period": 123,
"period_type": "<string>",
"absolute_expiry": "<string>",
"release_period": 123,
"release_period_type": "<string>",
"release_period_absolute_expiry": "<string>",
"is_published": true,
"is_archived": true,
"icon": "<string>",
"image_url": "<string>",
"primary_colour": "<string>",
"secondary_colour": "<string>",
"description": "<string>",
"internal_notes": "<string>",
"short_description": "<string>",
"long_description": "<string>",
"terms_conditions": "<string>",
"earn_instructions": "<string>",
"meta": [
"<unknown>"
],
"type": "<string>",
"value": 123,
"max_value": 123,
"currency_id": 123,
"currency": "<string>",
"require_creator": true,
"require_assigned": true,
"is_extendable": true,
"is_assignable": true,
"is_releasable": true,
"is_reassignable": true,
"require_security_code": true,
"extend_days": 123,
"credit_number_range_type": "<string>",
"credit_number_range_start": "<string>",
"credit_number_range_end": "<string>",
"credit_number_length": 123,
"security_code_type": "<string>",
"use_custom_numbers": true,
"notify_schedule_offset": 123,
"issue_target_id": 123,
"expiry_target_id": 123,
"release_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,
"tags": [
"<string>"
],
"created_at": "<string>",
"updated_at": "<string>",
"custom_fields": [
{
"name": "<string>",
"handle": "<string>",
"namespace": "<string>",
"value": "<string>",
"type": "<string>",
"custom_fieldable_type": "<string>",
"custom_fieldable_id": "<string>",
"created_at": "<string>",
"updated_at": "<string>",
"is_index": "<string>"
}
]
}
},
"created_at": "<string>",
"updated_at": "<string>"
}
],
"created_at": "<string>",
"updated_at": "<string>",
"redeem_at": "<string>",
"transaction": {
"external_id": "<string>",
"receipt_ref": "<string>",
"transacted_at": "<string>",
"total": 123,
"location": {
"id": "<string>",
"name": "<string>",
"external_id": "<string>"
}
}
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}This method is similar to Add Benefit Claim, but in addition to claiming, the benefit is also immediately redeemed against the claiming profile.
This is useful in situations where the benefit must be immediately consumed after a claim
{
"data": {
"id": 16,
"profile_id": "92d7fbd9-1eda-47b5-3312-7b3227ca3b9e",
"external_id": null,
"expires_at": "2021-04-24 23:59:59",
"issued_at": "2021-03-05 00:06:51",
"is_expired": false,
"is_redeemable": true,
"redemptions_remaining": 1,
"total_global_redemptions_remaining": 1,
"definition": {
"id": "3",
"name": "10%OFFDEMO",
"handle": "10offdemo",
"period": 50,
"description": "10% off",
"internal_notes": "demo",
"short_description": "A quick 10% off",
"long_description": "Just another 10% voucher for you",
"terms_conditions": "standard terms and conditions apply",
"earn_instructions": null,
"redeem_instructions_store": null,
"redeem_instructions_online": null,
"redeem_code_pos": "10OFFSTORE",
"redeem_code_online": "10OFFONLINE",
"icon": null,
"image_url": "https://example.com/image.jpeg",
"max_redemptions": 1,
"is_extendable": false,
"is_assignable": true,
"is_reassignable": false,
"is_published": true,
"is_archived": false,
"tags": [
"demo"
],
"is_claimable": true,
"max_global_redemptions": null,
"claim_period_start_at": "2020-12-25 07:00:00",
"claim_period_end_at": "2021-05-08 23:00:00",
"claim_condition": {
"and": [
{
"===": [
"female",
{
"var": "gender"
}
]
}
]
},
"is_reclaimable": true,
"notify_schedule_offset": null,
"notify_issue_offset_days": null,
"notify_issue_offset_hour": null,
"notify_remind_offset_days": null,
"notify_remind_offset_hour": null,
"notify_extend_offset_days": null,
"notify_extend_offset_hour": null,
"remind_target_id": null,
"extend_target_id": null,
"issue_target_id": null,
"end_at": null,
"total_allocations": null,
"total_allocations_remaining": null,
"force_allocation": false,
"created_at": "2021-03-04 03:30:54",
"updated_at": "2021-03-04 03:47:47"
},
"timezone": "Australia/Melbourne",
"claimed_at": "2021-03-05 00:06:51",
"meta": null,
"redeem_code_pos": "10OFFSTORE",
"redeem_code_online": "10OFFONLINE",
"created_at": "2021-03-05 00:06:51",
"updated_at": "2021-03-05 00:06:51"
}
}
| Attribute | Description |
|---|---|
definition STRING | The definition handle of the benefit definition you wish to claim |
timezone TIMEZONE | A valid timezone Where the definition was claimed |
external_id STRING | The external ID of the benefit claim. Usually a reference to the claim in the external client system |
meta ARRAY | An array of metadata attached to the claim |
⌘I