OkCollect Webhook
This webhook allows log user interactions with their OkHi address enabling you to get rich data insights from OkHi.
Create an address interaction
POST
https://sandbox-server.okhi.dev/v5/interactions
Headers
Name | Type | Description |
---|---|---|
api-key | string | Your Server API key to track your app's interactions |
Request Body
Name | Type | Description |
---|---|---|
user | string | OkHi user object, see example below |
value | number | eg. for a checkout this could be the order amount |
id | string | A unique order ID |
useCase | string | for loans this could be "loan". For e-commerce this could be: "e-commerce" |
locationId | string | OkHi location ID |
location | object | OkHi location object would be required if you don't have a location ID. See example below |
properties | object | This is an open field where you can put any business related information related to the interaction for use in analysis later. See an example below. |
If you don't supply a locationId then the user & location parameters are required
Properties Object
A dictionary of information that provides useful details to a given address interaction relevant to your business.
All fields except the ones listed in the table below are open to you to design to suit your business.
Field | Type | Description |
sendToQueue | boolean | Mostly used in e-commerce. Set to true in order to push the checkout details to OkHi Queue app for dispatch management |
paymentMethod | string | Mode of payment used in a checkout context |
dates | date | All dates should be in ISO 8601 format |
brand | string | Your brand name in one word, all lowercase eg acme |
location | string | The outlet location in one word, all lowercase eg. thehub |
value | float | A numeric value associated with the interaction, eg. total basket value |
currency | string | Currency code in ISO 4217 format |
Here's an example of a properties JSON object that you could have in a checkout context:
User Object
This is only required if you don't have an OkHi location ID
Location Object
This is only required if you do not have an OkHi location Id.
You must supply at least one of these fields: a street name, property name, directions, placeId(from OkHi), lat & lng
Field | Type | Description |
propertyName | string | Building name eg. Riverside Villas |
propertyNumber | string | Building number eg 12 |
streetName | string | Street name eg. Peponi Road |
lat | float | Latitude eg. -1.21231 |
lng | float | Longitude eg. 35.123123 |
placeId | string | OkHi place ID that refers to a unique common address in our database |
directions | string | Take a left where the goats used to graze |
otherInformation | string | Useful instructions of how get to the door eg. Call the askari on 072112... |
businessName | string | Business name eg. ACME LTD |
unit | string | Unit identifier eg. APT 12A |
floor | string | Floor number |
An example of an OkHi location JSON object, only required if you don't have a location ID
Full example payload for an ecommerce transaction:
IMPORTANT: For production please switch this endpoint to https://server.okhi.co/v5/interactions