Events
Events are designed as a way to track changes to individual resources throughout the OmniFund application. Resources can be thought of as the different type of objects/records that are created/updated/deleted within the app. Some examples of a resource would be: Transaction, Customer, PaymentAccount, or Invoice. Each one of this may have one or more events happen to it during its lifetime.
End-Point | Methods | Description |
---|---|---|
/api/events | GET | Return a collection of events. |
/api/events/{id} | GET | Return a single event by its ID. |
API Authentication
All API end-points require an authentication header to included with the request. See API Authentication
The Event Object
Field | Type | Description |
---|---|---|
id | string | Unique identifier for the event. |
owner | string | Account owner of the resource |
resource | string | Identifier for the application resource that the event applies to |
location | string | Location where the event was initiated |
type | string | Type of event |
eventData | object | Object containing the information associated with the resource. |
createdAt | int | Time at which the object was created. Measured in seconds since the Unix epoch. UTC |
{ "id": "025a161c5863e5645e8e997a4", "owner": "merch_123456", "resource": "cust_5c991e6774567", "source": "test-user", "location": "dashboard", "type": "customer.updated", "createdAt": 1553538663, "eventData": { "object": { "id": "5c991e6774567", "object": "customer", "customerRef": "123-7784", "displayName": "Test Customer", "company": "", "firstName": "Test", "lastName": "Customer", "displayAs": "contact", "address1": "123 main st.", "address2": "", "city": "Somewhere", "state": "CO", "zip": "12345", "country": "US", "phone": "1-555-123-34567", "phoneExt": "", "email": "test-customer@omnifund.com", "dateAdded": "2019-03-25", "notes": "", "active": "1" }, "previousAttributes": { "phone": "" } } }
List All Events
Argument | Type | Description | |
---|---|---|---|
type | string | Name of the event type to filter by. Optionally, multiple events can be filtered by using type[] | # filter based on a single event type GET /api/events?type=customer.updated # filter based on multiple event types GET /api/events?type[]=customer.created&type[]=customer.updated |
createdAt | string | Unix timestamp to filter based on the createdAt Event field. The value can be a string with an integer timestamp, or it can be a represented with the following options:
| # filter based on a single timestamp GET /api/events?createdAt=1553538663 # filter events between two timestamps GET /api/events?createdAt[between]=1553538663..1553638663 # filter events greater than or equal to a timestamp GET /api/events?createdAt[gte]=1553538663 |
Related
Retrieve an Event
Retrieves the details of a single event based on the supplied unique identifier.
Argument | Type | Description | |
---|---|---|---|
id | string | Required. The event identifier to be retrieved. | # retrieve event GET /api/events/f4244e2e8b29426b9c490597f21e6b51 |
Event Types
Event | Description | Event Objects |
---|---|---|
account.autoupdate | Details an event involving the auto-update of a payment account based on information received from the processing bank. | |
transaction.ach_process_error | ACH process error events triggered when ACH transactions are declined by the processor. | See: Transaction Event Object |