Ometria - Library Document

Written By Devin O'Neill ()

Updated at April 16th, 2025

Ometria Library functions

$url='https://api.ometria.com/v2/contacts/default?limit=250&offset=0';
$getContacts=$ometrialibrary->getContacts(array("url"=>$url));

Functions used for particular standard use case

Push Contacts

  • Function: pushContacts($dataArray=array())
  • In this function, pass two parameters.
  1. Payload:
$payload=[
 [
 "@add_to_lists"=> [5550],
 "@type"=> "contact",
 "@collection"=> "default",
 "id"=> "annexsc.sa.sca.inttest@test.com",
 "email"=> "annexsc.sa.sca.inttest@test.com",
 "phone_number"=> "+919090909091",
 "customer_id"=> "annexsc.sa.sca.inttest@test.com",
 "prefix"=> "Mrs",
 "firstname"=> "test",
 "middlename"=> "V",
 "lastname"=> "Annexcloud"
 ]
 ];
  1. Api: $url=’https://api.ometria.com/v2/push’;
  2. Based on the below format, you have to call the function:
    1. $pushContacts=$ometrialibrary->pushContacts(array("data"=>$payload,"url"=>$url));

Get All Contacts

  1. Function: getContacts($dataArray=array())
  2. For this function, pass one parameter.
$url='https://api.ometria.com/v2/contacts/default?limit=250&offset=0';
$getContacts=$ometrialibrary->getContacts(array("url"=>$url));

Get All Contact With ID

  1. Function: getContacts($dataArray=array()) :
  2. For this function, pass one parameter.
$id='annexsc.sa.sca.int1@test.com';
$url='https://api.ometria.com/v2/contacts/default/'.$id;
$getContact=$ometrialibrary->getContacts(array("url"=>$url));

Get All Segment List

  1. Function: getSegments($dataArray=array()):
  2. For this function, pass one parameter.
$url='https://api.ometria.com/v2/lists';
$getSegments=$ometrialibrary->getSegments(array("url"=>$url));

Create Order By Email

  1. Function: createOrder($dataArray=array()):
  2. Payload:
$payload=[
 [
 "customer"=> [
 "id"=> "annexsc.sa.sca.int1@test.com",
 "email"=> "annexsc.sa.sca.int1@test.com",
 "firstname"=> "Test",
 "lastname"=> "Annexcloud"
 ],
 "channel"=> "online",
 "shipping_address"=> [
 "city"=> "London",
"state"=> "Greater London",
 "postcode"=> "W1K 4TG",
 "country_code"=> "GB"
 ],
 "billing_address"=> [
 "city"=> "London",
 "state"=> "Greater London",
 "postcode"=> "W1K 4TG",
 "country_code"=> "GB"
 ],
 "@type"=> "order",
 "id"=> "123558",
 "timestamp"=> "2022-08-31T09:00:00+00",
 "subtotal"=> 83.33,
 "discount"=> -5,
 "shipping"=> 2,
 "tax"=> 16.07,
 "currency"=> "GBP",
 "@merge"=> true,
 "status"=> "complete",
 "is_valid"=> true,
 "ip_address"=> "127.0.0.1",
 "store"=> "example.com/en",
 "payment_method"=> "card",
 "shipping_method"=> "standard",
 "coupon_code"=> "FJ45-TJ5Y-5YK3-T894",
 "grand_total"=> 97,
 "web_id"=> "891743"
 ]
];
  1. Api: $url=’https://api.ometria.com/v2/push’;
  2. Like below format you have to call function:
    $createOrder=$ometrialibrary->createOrder(array("data"=>$payload,"url"=>$url));

Get Order By ID

  1. Function: getOrderById($dataArray=array())
  2. For this function, pass one parameter.
$id=123558;
$url='https://api.ometria.com/v2/orders/'.$id.'?limit=10&offset=0';
$getOrder=$ometrialibrary->getOrderById(array("url"=>$url));

All Orders

  1. Function: getAllOrders($dataArray=array())
  2. For this function, pass one parameter.
$url='https://api.ometria.com/v2/orders';
$getAllOrders=$ometrialibrary->getAllOrders(array("url"=>$url));

All Orders with Date

  1. Function: getAllOrdersWithDate($dataArray=array())
  2. For this function, pass one parameter.
$url='https://api.ometria.com/v2/orders?limit=5&offset=0&since=2022-09-
0100%3A00%3A00&before=2022-09-0200%3A00%3A00';
$getOrdersWithDate=$ometrialibrary->getAllOrdersWithDate(array("url"=>$url));

Get List Collections

  1. Function: getListCollection($dataArray=array())
  2. For this function, pass one parameter.
$url='https://api.ometria.com/v2/contacts?limit=250&offset=0';
$getListCollection=$ometrialibrary->getListCollection(array("url"=>$url));

Get Specific Segment Details

  1. Function: getSegmentWithId($dataArray=array())
  2. For this function, pass one parameter.
$id='963fbf9f2ab2';
$url='https://api.ometria.com/v2/lists/'.$id;
$getSegmentWithId=$ometrialibrary->getSegmentWithId(array("url"=>$url));

Get Profile UpdateSince

  1. Function: getProfileUpdateSince($dataArray=array())
  2. For this function, pass one parameter.
$url='https://api.ometria.com/v2/profiles/?limit=10&offset=0&updateSince=2022-09-
0100%3A00%3A00';
$getProfileUpdateSince=$ometrialibrary->getProfileUpdateSince(array("url"=>$url));

Get Profile List

  1. Function: getProfileList($dataArray=array())
  2. For this function, pass one parameter.