fmasites / omeda
Omeda API client and utilities for Laravel
v0.2.1
2026-03-18 21:22 UTC
Requires
- php: ^8.3
- illuminate/cache: ^11.0|^12.0
- illuminate/http: ^11.0|^12.0
- illuminate/support: ^11.0|^12.0
Requires (Dev)
- orchestra/testbench: ^10.0
- phpunit/phpunit: ^11.0
README
A Laravel package for interacting with the Omeda API.
Requirements
- PHP 8.3+
- Laravel 11 or 12
Installation
composer require fmasites/omeda
Configuration
Add the following to your .env file:
OMEDA_APP_ID= OMEDA_BASE_API_URL= OMEDA_BRAND= OMEDA_CLIENT= OMEDA_CLIENT_BASE_API_URL= OMEDA_INPUT_ID=
| Variable | Description |
|---|---|
OMEDA_APP_ID |
Your Omeda application ID |
OMEDA_BASE_API_URL |
Base URL for the Omeda brand API |
OMEDA_BRAND |
Your Omeda brand abbreviation |
OMEDA_CLIENT |
Your Omeda client abbreviation |
OMEDA_CLIENT_BASE_API_URL |
Base URL for client-level API endpoints |
OMEDA_INPUT_ID |
Input ID used for POST requests |
Usage
OmedaApi
use FMASites\Omeda\OmedaApi; $api = new OmedaApi();
You can also inject custom base URLs directly, which is useful in tests:
$api = new OmedaApi(baseApiUrl: 'https://...', clientBaseApiUrl: 'https://...');
Available methods
// Brand $api->brandComprehensiveLookup(); // Cached for 8 hours // Customer $api->customerComprehensiveLookup($id); $api->customerLookupByEmail($email); // Orders & Transactions $api->storeCustomerAndOrder($data); $api->transactionLookup($transactionId); $api->runProcessor($transactionIds); // Utility API // Postal $api->postalInfoLookup($zipCode); // Utility API // Email $api->emailOptinQueue($email, $deploymentTypeId, $options);
GET methods return array|false — false indicates a non-successful response (404, 300, etc.). POST methods return an Illuminate\Http\Client\Response instance.
DataAdapter
Utilities for transforming brand comprehensive lookup data:
use FMASites\Omeda\DataAdapter; // Filter demographics down to specific type IDs DataAdapter::filterByDemographicTypes($brandData, [1, 2, 3]); // Simplify the full brand lookup response to a smaller structure DataAdapter::simplifyBrandComprehensiveLookupData($brandData); // Remove specific demographic value options by ID DataAdapter::removeDemographicValueOptionsById($brandData, [10, 11]); // Simplify a products array DataAdapter::simplifyProductData($products);
Enums
The package includes enums for common Omeda constants:
| Enum | Description |
|---|---|
AddressContactType |
Address contact type codes |
EmailContactType |
Email contact type codes |
PhoneContactType |
Phone contact type codes |
MarketingClassCode |
Marketing classification codes |
ProductType |
Product type codes |
SubscriptionClassCode |
Subscription classification codes |
LocationCodes |
Country, US state, Canadian province, and Mexican state codes |
Testing
composer install ./vendor/bin/phpunit