Add Custom Field
curl --request POST \
--url https://api.{tenant}.getomneo.com/api/v3/custom-fields/{model}/{id} \
--header 'Content-Type: application/json' \
--data '
{
"namespace": "<string>",
"handle": "<string>",
"value": "<string>",
"name": "<string>",
"is_index": "<string>"
}
'import requests
url = "https://api.{tenant}.getomneo.com/api/v3/custom-fields/{model}/{id}"
payload = {
"namespace": "<string>",
"handle": "<string>",
"value": "<string>",
"name": "<string>",
"is_index": "<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({
namespace: '<string>',
handle: '<string>',
value: '<string>',
name: '<string>',
is_index: '<string>'
})
};
fetch('https://api.{tenant}.getomneo.com/api/v3/custom-fields/{model}/{id}', 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/custom-fields/{model}/{id}",
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([
'namespace' => '<string>',
'handle' => '<string>',
'value' => '<string>',
'name' => '<string>',
'is_index' => '<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/custom-fields/{model}/{id}"
payload := strings.NewReader("{\n \"namespace\": \"<string>\",\n \"handle\": \"<string>\",\n \"value\": \"<string>\",\n \"name\": \"<string>\",\n \"is_index\": \"<string>\"\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/custom-fields/{model}/{id}")
.header("Content-Type", "application/json")
.body("{\n \"namespace\": \"<string>\",\n \"handle\": \"<string>\",\n \"value\": \"<string>\",\n \"name\": \"<string>\",\n \"is_index\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.{tenant}.getomneo.com/api/v3/custom-fields/{model}/{id}")
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 \"namespace\": \"<string>\",\n \"handle\": \"<string>\",\n \"value\": \"<string>\",\n \"name\": \"<string>\",\n \"is_index\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"name": "<string>",
"handle": "<string>",
"namespace": "<string>",
"value": "<string>",
"type": "<string>",
"custom_fieldable_type": "<string>",
"custom_fieldable": {
"id": "<string>",
"external_id": "<string>",
"profile_id": "<string>",
"meta": "<string>",
"total": "<string>",
"total_original": "<string>",
"rounding": "<string>",
"margin": "<string>",
"is_void": "<string>",
"transacted_at": "<string>",
"timezone": "<string>",
"payments": "<string>",
"receipt_is_email": "<string>",
"receipt_ref": "<string>",
"linked_receipt_ref": "<string>",
"claimed_at": "<string>",
"receipt_email": "<string>",
"currency_id": "<string>",
"currency_rate": "<string>",
"currency": "<string>",
"type": "<string>",
"status": "<string>",
"order_number": "<string>",
"order_id": "<string>",
"external_order_id": "<string>",
"created_at": "<string>",
"updated_at": "<string>"
},
"created_at": "<string>",
"updated_at": "<string>",
"is_index": 123
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}{
"errors": [
"<string>"
]
}Custom Field
Add Custom Field
A POST to the /custom-fields/{model}/{id} endpoint allows your application to create custom field.
POST
/
v3
/
custom-fields
/
{model}
/
{id}
Add Custom Field
curl --request POST \
--url https://api.{tenant}.getomneo.com/api/v3/custom-fields/{model}/{id} \
--header 'Content-Type: application/json' \
--data '
{
"namespace": "<string>",
"handle": "<string>",
"value": "<string>",
"name": "<string>",
"is_index": "<string>"
}
'import requests
url = "https://api.{tenant}.getomneo.com/api/v3/custom-fields/{model}/{id}"
payload = {
"namespace": "<string>",
"handle": "<string>",
"value": "<string>",
"name": "<string>",
"is_index": "<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({
namespace: '<string>',
handle: '<string>',
value: '<string>',
name: '<string>',
is_index: '<string>'
})
};
fetch('https://api.{tenant}.getomneo.com/api/v3/custom-fields/{model}/{id}', 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/custom-fields/{model}/{id}",
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([
'namespace' => '<string>',
'handle' => '<string>',
'value' => '<string>',
'name' => '<string>',
'is_index' => '<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/custom-fields/{model}/{id}"
payload := strings.NewReader("{\n \"namespace\": \"<string>\",\n \"handle\": \"<string>\",\n \"value\": \"<string>\",\n \"name\": \"<string>\",\n \"is_index\": \"<string>\"\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/custom-fields/{model}/{id}")
.header("Content-Type", "application/json")
.body("{\n \"namespace\": \"<string>\",\n \"handle\": \"<string>\",\n \"value\": \"<string>\",\n \"name\": \"<string>\",\n \"is_index\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.{tenant}.getomneo.com/api/v3/custom-fields/{model}/{id}")
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 \"namespace\": \"<string>\",\n \"handle\": \"<string>\",\n \"value\": \"<string>\",\n \"name\": \"<string>\",\n \"is_index\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"name": "<string>",
"handle": "<string>",
"namespace": "<string>",
"value": "<string>",
"type": "<string>",
"custom_fieldable_type": "<string>",
"custom_fieldable": {
"id": "<string>",
"external_id": "<string>",
"profile_id": "<string>",
"meta": "<string>",
"total": "<string>",
"total_original": "<string>",
"rounding": "<string>",
"margin": "<string>",
"is_void": "<string>",
"transacted_at": "<string>",
"timezone": "<string>",
"payments": "<string>",
"receipt_is_email": "<string>",
"receipt_ref": "<string>",
"linked_receipt_ref": "<string>",
"claimed_at": "<string>",
"receipt_email": "<string>",
"currency_id": "<string>",
"currency_rate": "<string>",
"currency": "<string>",
"type": "<string>",
"status": "<string>",
"order_number": "<string>",
"order_id": "<string>",
"external_order_id": "<string>",
"created_at": "<string>",
"updated_at": "<string>"
},
"created_at": "<string>",
"updated_at": "<string>",
"is_index": 123
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}{
"errors": [
"<string>"
]
}Body
application/json
Response
CustomField
Show child attributes
Show child attributes
⌘I