Skip to main content
PUT
/
v3
/
credits
/
definitions
/
{definition}
Edit Credit Definition
curl --request PUT \
  --url https://api.{tenant}.getomneo.com/api/v3/credits/definitions/{definition} \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "region_id": 123,
  "timezone": "<string>",
  "period": 123,
  "absolute_expiry": "<string>",
  "release_period": 123,
  "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": [
    "<string>"
  ],
  "value": 123,
  "max_value": 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_start": "<string>",
  "credit_number_range_end": "<string>",
  "credit_number_length": 2,
  "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>"
  ],
  "custom_fields": [
    {
      "namespace": "<string>",
      "handle": "<string>",
      "value": "<string>"
    }
  ]
}
'
import requests

url = "https://api.{tenant}.getomneo.com/api/v3/credits/definitions/{definition}"

payload = {
    "name": "<string>",
    "region_id": 123,
    "timezone": "<string>",
    "period": 123,
    "absolute_expiry": "<string>",
    "release_period": 123,
    "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": ["<string>"],
    "value": 123,
    "max_value": 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_start": "<string>",
    "credit_number_range_end": "<string>",
    "credit_number_length": 2,
    "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>"],
    "custom_fields": [
        {
            "namespace": "<string>",
            "handle": "<string>",
            "value": "<string>"
        }
    ]
}
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({
    name: '<string>',
    region_id: 123,
    timezone: '<string>',
    period: 123,
    absolute_expiry: '<string>',
    release_period: 123,
    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: ['<string>'],
    value: 123,
    max_value: 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_start: '<string>',
    credit_number_range_end: '<string>',
    credit_number_length: 2,
    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>'],
    custom_fields: [{namespace: '<string>', handle: '<string>', value: '<string>'}]
  })
};

fetch('https://api.{tenant}.getomneo.com/api/v3/credits/definitions/{definition}', 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/credits/definitions/{definition}",
  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([
    'name' => '<string>',
    'region_id' => 123,
    'timezone' => '<string>',
    'period' => 123,
    'absolute_expiry' => '<string>',
    'release_period' => 123,
    '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' => [
        '<string>'
    ],
    'value' => 123,
    'max_value' => 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_start' => '<string>',
    'credit_number_range_end' => '<string>',
    'credit_number_length' => 2,
    '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>'
    ],
    'custom_fields' => [
        [
                'namespace' => '<string>',
                'handle' => '<string>',
                'value' => '<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/credits/definitions/{definition}"

	payload := strings.NewReader("{\n  \"name\": \"<string>\",\n  \"region_id\": 123,\n  \"timezone\": \"<string>\",\n  \"period\": 123,\n  \"absolute_expiry\": \"<string>\",\n  \"release_period\": 123,\n  \"release_period_absolute_expiry\": \"<string>\",\n  \"is_published\": true,\n  \"is_archived\": true,\n  \"icon\": \"<string>\",\n  \"image_url\": \"<string>\",\n  \"primary_colour\": \"<string>\",\n  \"secondary_colour\": \"<string>\",\n  \"description\": \"<string>\",\n  \"internal_notes\": \"<string>\",\n  \"short_description\": \"<string>\",\n  \"long_description\": \"<string>\",\n  \"terms_conditions\": \"<string>\",\n  \"earn_instructions\": \"<string>\",\n  \"meta\": [\n    \"<string>\"\n  ],\n  \"value\": 123,\n  \"max_value\": 123,\n  \"currency\": \"<string>\",\n  \"require_creator\": true,\n  \"require_assigned\": true,\n  \"is_extendable\": true,\n  \"is_assignable\": true,\n  \"is_releasable\": true,\n  \"is_reassignable\": true,\n  \"require_security_code\": true,\n  \"extend_days\": 123,\n  \"credit_number_range_start\": \"<string>\",\n  \"credit_number_range_end\": \"<string>\",\n  \"credit_number_length\": 2,\n  \"use_custom_numbers\": true,\n  \"notify_schedule_offset\": 123,\n  \"issue_target_id\": 123,\n  \"expiry_target_id\": 123,\n  \"release_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  \"tags\": [\n    \"<string>\"\n  ],\n  \"custom_fields\": [\n    {\n      \"namespace\": \"<string>\",\n      \"handle\": \"<string>\",\n      \"value\": \"<string>\"\n    }\n  ]\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/credits/definitions/{definition}")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"<string>\",\n  \"region_id\": 123,\n  \"timezone\": \"<string>\",\n  \"period\": 123,\n  \"absolute_expiry\": \"<string>\",\n  \"release_period\": 123,\n  \"release_period_absolute_expiry\": \"<string>\",\n  \"is_published\": true,\n  \"is_archived\": true,\n  \"icon\": \"<string>\",\n  \"image_url\": \"<string>\",\n  \"primary_colour\": \"<string>\",\n  \"secondary_colour\": \"<string>\",\n  \"description\": \"<string>\",\n  \"internal_notes\": \"<string>\",\n  \"short_description\": \"<string>\",\n  \"long_description\": \"<string>\",\n  \"terms_conditions\": \"<string>\",\n  \"earn_instructions\": \"<string>\",\n  \"meta\": [\n    \"<string>\"\n  ],\n  \"value\": 123,\n  \"max_value\": 123,\n  \"currency\": \"<string>\",\n  \"require_creator\": true,\n  \"require_assigned\": true,\n  \"is_extendable\": true,\n  \"is_assignable\": true,\n  \"is_releasable\": true,\n  \"is_reassignable\": true,\n  \"require_security_code\": true,\n  \"extend_days\": 123,\n  \"credit_number_range_start\": \"<string>\",\n  \"credit_number_range_end\": \"<string>\",\n  \"credit_number_length\": 2,\n  \"use_custom_numbers\": true,\n  \"notify_schedule_offset\": 123,\n  \"issue_target_id\": 123,\n  \"expiry_target_id\": 123,\n  \"release_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  \"tags\": [\n    \"<string>\"\n  ],\n  \"custom_fields\": [\n    {\n      \"namespace\": \"<string>\",\n      \"handle\": \"<string>\",\n      \"value\": \"<string>\"\n    }\n  ]\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.{tenant}.getomneo.com/api/v3/credits/definitions/{definition}")

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  \"name\": \"<string>\",\n  \"region_id\": 123,\n  \"timezone\": \"<string>\",\n  \"period\": 123,\n  \"absolute_expiry\": \"<string>\",\n  \"release_period\": 123,\n  \"release_period_absolute_expiry\": \"<string>\",\n  \"is_published\": true,\n  \"is_archived\": true,\n  \"icon\": \"<string>\",\n  \"image_url\": \"<string>\",\n  \"primary_colour\": \"<string>\",\n  \"secondary_colour\": \"<string>\",\n  \"description\": \"<string>\",\n  \"internal_notes\": \"<string>\",\n  \"short_description\": \"<string>\",\n  \"long_description\": \"<string>\",\n  \"terms_conditions\": \"<string>\",\n  \"earn_instructions\": \"<string>\",\n  \"meta\": [\n    \"<string>\"\n  ],\n  \"value\": 123,\n  \"max_value\": 123,\n  \"currency\": \"<string>\",\n  \"require_creator\": true,\n  \"require_assigned\": true,\n  \"is_extendable\": true,\n  \"is_assignable\": true,\n  \"is_releasable\": true,\n  \"is_reassignable\": true,\n  \"require_security_code\": true,\n  \"extend_days\": 123,\n  \"credit_number_range_start\": \"<string>\",\n  \"credit_number_range_end\": \"<string>\",\n  \"credit_number_length\": 2,\n  \"use_custom_numbers\": true,\n  \"notify_schedule_offset\": 123,\n  \"issue_target_id\": 123,\n  \"expiry_target_id\": 123,\n  \"release_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  \"tags\": [\n    \"<string>\"\n  ],\n  \"custom_fields\": [\n    {\n      \"namespace\": \"<string>\",\n      \"handle\": \"<string>\",\n      \"value\": \"<string>\"\n    }\n  ]\n}"

response = http.request(request)
puts response.read_body
{
  "data": {
    "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>"
      }
    ]
  }
}
{
  "message": "<string>"
}
{
  "message": "<string>"
}
{
  "message": "<string>"
}
{
  "message": "<string>",
  "errors": {}
}

Path Parameters

definition
integer
required

The definition ID

Body

application/json
name
string
region_id
integer | null
timezone
string
period
integer
period_type
enum<string>
Available options:
days,
weeks,
months,
years,
absolute_date,
absolute_week,
absolute_month
absolute_expiry
string | null
release_period
integer | null
release_period_type
enum<string> | null
Available options:
days,
weeks,
months,
years,
absolute_date,
absolute_week,
absolute_month
release_period_absolute_expiry
string | null
is_published
boolean
is_archived
boolean
icon
string | null
image_url
string<uri> | null
primary_colour
string | null
Pattern: ^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$
secondary_colour
string | null
Pattern: ^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$
description
string | null
internal_notes
string | null
short_description
string | null
long_description
string | null
terms_conditions
string | null
earn_instructions
string | null
meta
string[] | null
type
enum<string>
Available options:
gift_card,
store_credit,
refund,
allowance,
voucher,
other
value
number | null
max_value
number | null
currency
string | null
Pattern: ^[A-Z]+$
require_creator
boolean
require_assigned
boolean
is_extendable
boolean
is_assignable
boolean
is_releasable
boolean
is_reassignable
boolean
require_security_code
boolean
extend_days
integer | null
credit_number_range_type
enum<string> | null
Available options:
sequential,
random,
other
credit_number_range_start
string | null
Pattern: ^\d+$
credit_number_range_end
string | null
Pattern: ^\d+$
credit_number_length
integer | null
Required range: x >= 1
security_code_type
enum<string> | null
Available options:
pin4,
pin6,
alnum6,
other
use_custom_numbers
boolean
notify_schedule_offset
integer | null
issue_target_id
integer | null
expiry_target_id
integer | null
release_target_id
integer | null
remind_target_id
integer | null
extend_target_id
integer | null
notify_issue_offset_days
integer | null
notify_issue_offset_hour
integer | null
notify_remind_offset_days
integer | null
notify_remind_offset_hour
integer | null
tags
string[]
custom_fields
object[]

Response

CreditDefinition

data
CreditDefinition · object
required