Oculos Integration Platform API (4.1.3)

Download OpenAPI specification:Download

This is the documentation for the current release of the OIP API.

Current release: 2024-06-18 (v.4.1.3)

Overview

Welcome to the Oculos Integration Platform (OIP) API documentation, a resource for better understanding of our integration platform.

This documentation is designed to be accessible and informative for both technical and sales professionals, ensuring that you can fully explore the capabilities and benefits of our API.

For technical experts, this documentation provides in-depth insights into the API endpoints, data structures, and integration possibilities. You'll find detailed explanations, code examples, and best practices to help you integrate our API into your applications and systems.

For sales persons and other non-technical stakeholders, this documentation offers a overview of the API's features, use cases, and potential business advantages.

As the configuration of OIP allows for a flexible request/reponse, only the standard data structures are displayed in this documentation.

If you have a customized configuration and need examples, please contact our support team or your sales person.

The API has two base URL's, one for production and one for testing.

Production: https://api.oculos.no/v4

Staging: https://api.staging.oculos.no/v4

Authentication

Our API is designed to be secure and efficient, and it requires an API key to authenticate your requests. In this short documentation, we'll guide you on how to use our API with the x-api-key header to ensure successful integration.

Step 1: Obtain Your API Key

Before you can start using our API, you'll need to obtain an API key. This key acts as your access pass and is typically provided to you by your contact person. If you haven't received your API key, please reach out to our support team or your sales person.

Step 2: Include the x-api-key Header

To make authenticated requests to our API, you must include the API key in the header of your HTTP requests. Specifically, you should add the "x-api-key" header with your API key as its value.

x-api-key : <API KEY>

Step 3 [OPTIONAL]: White list your IP address(es) for your production environment

Although this step is optional, we strongly encourage you to send us an list of your IP addresses that are in use in your production environment.

This lets us configure OIP to only allow access to your API account from those IP's.

Error Messages

OIP returns a standarized detailed error message where it's possible. The structure of the error message looks like this:

{
  "code" : "409",
  "message" : "Conflict",
  "detailedErrorMessage" : {

  }
}

The detailedErrorMessage is fully dynamic and can contain a simple string aswell as a list of errors'.

Terms Of Use

By accessing or using our API (the "Service"), you agree to comply with these Terms of Use. Please read them carefully, as they govern your usage of our API.

API Usage

You are granted a non-exclusive, non-transferable, limited license to access and use our API in accordance with these terms. You may only use the API for its intended purpose and in compliance with our guidelines and documentation.

API Key

Access to the API requires an API key. Keep your API key secure and do not share it with unauthorized parties. You are responsible for all actions performed using your API key. Ensure that the API key is not visible in any way in your application.

Prohibited Actions

You may not use the API to engage in any illegal, harmful, or abusive activities. You may not decompile, reverse engineer, or attempt to gain unauthorized access to the API or our systems. You may not use the API in a way that could harm or interfere with our services, infrastructure, or other users.

Data Privacy

When using our API, you may have access to user data. Ensure you handle such data in compliance with applicable data protection laws and our privacy policy.

By using our API, you acknowledge that you have read, understood, and agreed to these Terms of Use. Failure to comply with these terms may result in the suspension or termination of your API access.

We reserve the right to update these terms, so it is recommended to review them periodically for any changes.

Troubleshooting & Tips

Coming soon

Rate Limits

OIP API does not have any rate limits, but some external systems integrated with OIP may have.

Exceeding these limits may result in temporary access restrictions.

We strongly recommend implementing a back-off strategy to handle rate limit exceeded responses. This strategy helps you avoid overloading our/external servers and ensures a smoother user experience.

If you are receving one of the following errors it's an indication of an issue with an external system.

{
  "code" : "429",
  "message" : "Too Many Requests",
  "detailedErrorMessage" : {
  }
}
{
  "code" : "502",
  "message" : "Bad Gateway",
  "detailedErrorMessage" : {
    "gateway" : "Connection to backend system failed. System: [system_name]",
    "gatewayMessage" : "Detailed error message here"
  }
}

Tutorials

Coming soon.

Webhooks

A webhook is a way for two different software applications to communicate with each other in real-time. It's like a notification system that triggers actions automatically when certain events occur.

Oculos can configure webhooks on request, please contact our support team for more information.

Change Log

June 2024

2024-06-18

  • Added endpoint for deleting a customer by external id
  • Minor bugfixes in documentation

May 2024

2024-05-22

2024-05-14

Added new methods
  • Get customer by externalId
  • Update customer by externalId
  • Minor bugfixes
  • Improved performance

April 2024

2024-04-17

Introduced dynamic methods on the customers and promotions endpoints

March 2024

2024-03-19

Release of v4

Abandoned carts

Endpoints for managing abandoned carts

An abandoned cart function helps businesses track when online shoppers add items to their virtual shopping carts but leave the website or app without completing their purchase.

It captures data about these abandoned carts, including the specific products left behind and, when available, the customer's contact information.

Create or update a cart

Creates or updates a cart.

As with many other endpoints, the payload is configurable and can contain additional data in the extendedProperties field.

To update a cart, use the same cartId as an existing cart.

Securityapi_key
Request
Request Body schema: application/json
cartId
required
string

Unique identifier of cart

cartUrl
string

URL to customers cart

contactId
required
string

Customer identifer

externalId
string

External customer identifer

object

Additional properties depending on configuration

Array of objects

List of products/items

Responses
200

OK

400

Bad Request

401

Unauthorized

403

Forbidden - this method requires activation and configuration from Oculos

post/abandonedCarts
Request samples
application/json
{}

Empty cart

Method that allows the client to empty a stored cart

Securityapi_key
Request
Request Body schema: application/json
cartId
string

Cart identifier

Responses
200

OK

400

Bad Request

401

Unauthorized

403

Forbidden - this method requires activation and configuration from Oculos

put/abandonedCarts
Request samples
application/json
{
  • "cartId": "934E2183-5004-45B0-8E75-A5178F1DEEF1"
}

Customers

The customers endpoint allows you to create, update or search for customers through various parameters depending on your configuration.

Depending on your configuration, the API may take or return additional fields in the extendedProperties object.

To get an example of your specific integration, please contact our support team.

Get customer by mobile phone

This method allows the client to search for a customer by a mobile phone number.

Example: +4712345678

The response sample below shows the default response, but depending on your configuration the API may return additional fields in the extendedProperties object.

Securityapi_key
Request
query Parameters
mobilePhone
required
string

The customers mobile phone number

Responses
200

OK

400

Bad Request

401

Unauthorized

404

Customer Not Found

get/customers
Request samples
Response samples
application/json
{
  • "data": {
    },
  • "metaData": {
    }
}

Create new customer

The request sample(s) below shows the default payload and one minimum required payload.

Depending on your configuration, the API may take or return additional fields in the extendedProperties object. For specific examples reach out to your technical contact.

Securityapi_key
Request
Request Body schema: application/json
One of:
object
object
Responses
201

Created

400

Bad Request

401

Unauthorized

409

Conflict

post/customers
Request samples
application/json
{
  • "data": {
    },
  • "source": {
    }
}
Response samples
application/json
{
  • "data": {
    },
  • "metaData": {
    }
}

Update customer

The request sample(s) below shows the default payload and one minimum required payload.

Depending on your configuration, the API may take or return additional fields in the extendedProperties object. For specific examples reach out to your technical contact.

Securityapi_key
Request
Request Body schema: application/json
One of:
object
object
Responses
200

OK

400

Bad Request

401

Unauthorized

409

Conflict

put/customers
Request samples
application/json
{
  • "data": {
    },
  • "source": {
    }
}
Response samples
application/json
{
  • "data": {
    },
  • "metaData": {
    }
}

Update customer by external id

The request sample(s) below shows the default payload and one minimum required payload.

Depending on your configuration, the API may take or return additional fields in the extendedProperties object. For specific examples reach out to your technical contact.

Securityapi_key
Request
Request Body schema: application/json
One of:
object
object
Responses
200

OK

400

Bad Request

401

Unauthorized

409

Conflict

put/customers/externalId
Request samples
application/json
{
  • "data": {
    },
  • "source": {
    }
}
Response samples
application/json
{
  • "data": {
    },
  • "metaData": {
    }
}

Get customer by id

This method allows the client to search for a customer by a unique id

Example: 226B14AF-18A6-44CF-834E-BE4BCA5D64B7

The response sample below shows the default response, but depending on your configuration the API may return additional fields in the extendedProperties object.

Securityapi_key
Request
path Parameters
id
required
string

The customers id

Responses
200

OK

400

Bad Request

401

Unauthorized

404

Customer Not Found

get/customers/id/{id}
Request samples
Response samples
application/json
{
  • "data": {
    },
  • "metaData": {
    }
}

Get customer by external id

This method allows the client to search for a customer by an external Id

Example: B9012E40-1B08-4DC5-84F9-BB8E2653B2A6

The response sample below shows the default response, but depending on your configuration the API may return additional fields in the extendedProperties object.

Securityapi_key
Request
path Parameters
id
required
string

The customers external id

Responses
200

OK

400

Bad Request

401

Unauthorized

404

Customer Not Found

get/customers/externalId/{id}
Request samples
Response samples
application/json
{
  • "data": {
    },
  • "metaData": {
    }
}

Get changed customers

Returns a list of changed customers since given timestamp. Default (empty parameter) is since last day.

Securityapi_key
Request
path Parameters
timestamp
string

Timestamp in format (TODO)

Example: 20240101T2210
Request Body schema: application/json
One of:
object
object
Responses
200

OK

400

Bad Request

401

Unauthorized

409

Conflict

get/customers/changed/{timestamp}
Request samples
application/json
{
  • "data": {
    },
  • "source": {
    }
}
Response samples
application/json
{
  • "data": {
    },
  • "metaData": {
    }
}

Delete customer

Method that let's you delete a customer by Id

Securityapi_key
Request
path Parameters
id
required
string

Id of member

source
required
string

Description of origin for the request.

Example values: ECOM, POS, MyPage etc.

Responses
200

OK

400

Bad Request

401

Unauthorized

404

Member Not Found

delete/customers/id/{id}/source/{source}
Request samples

Delete customer by external id

Method that let's you delete a customer by an external id

Securityapi_key
Request
path Parameters
externalId
required
string

External id of member

source
required
string

Description of origin for the request.

Example values: ECOM, POS, MyPage etc.

Responses
200

OK

400

Bad Request

401

Unauthorized

404

Member Not Found

delete/customers/externalId/{externalId}/source/{source}
Request samples

Dynamic method

This method is fully dynamic both in request/response and is available for specific client customizations on the customer endpoint.

Securityapi_key
Request
path Parameters
function
required
string

Your custom function name provided by Oculos

Responses
200

OK

400

Bad Request

401

Unauthorized

404

Function Not Found

post/customers/dynamic/{function}
Request samples
Response samples
application/json
{
  • "field1": "This is a string",
  • "field2": 123,
  • "field3": "Another string"
}

Consents

Endpoint that lists all available consents for a client.

Depending on your configuration, the API may take or return additional fields in the extendedProperties object.

To get an example of your specific integration, please contact our support team.

Get consents

Returns a list of all available consents

Securityapi_key
Responses
200

OK

400

Bad Request

401

Unauthorized

get/consents
Request samples
Response samples
application/json
[
  • {
    }
]

Data Enrichment

Endpoint that lets you enrich member data .

Enrich and redirect member

This endpoints automatically enriches a member by thats already stored in the MA-system.

The endpoints fetches the member from the MA-system, enriches it's data, updates and redirects back to a pre-configured URL.

Securityapi_key
Request
path Parameters
clientName
required
string

Client identifier, provided by Oculos.

id
required
string

Id of member

Responses
302

Found - the member is found and enriched, redirecting to pre-configured URL.

400

Unauthorized

403

Forbidden - this method requires activation and configuration from Oculos

404

Member not found

get/dataenrichment/forms/{clientName}/{id}
Request samples

Discover member by phone number

Looks up a mobile phone number and tries to discover owner data through 3rd party services.

Securityapi_key
Request
path Parameters
mobilePhone
required
string

Phone number to lookup

Responses
200

OK

400

Bad Request

401

Unauthorized

403

Forbidden - this method requires activation and configuration from Oculos

get/data-enrichment/mobilePhone/{mobilePhone}
Request samples
Response samples
application/json
{
  • "firstName": "firstName",
  • "lastName": "lastName",
  • "address": "Kongens gate 20",
  • "zip": "0010",
  • "city": "Oslo",
  • "gender": "Male",
  • "birthDate": "1955-12-16T00:00:00",
  • "extendedProperties": {
    }
}

Discover member by social security number (SSN)

This method let's you retreive information on a member based on their SSN

Securityapi_key
Request
path Parameters
ssn
required
string

SSN number to lookup

Responses
200

OK

400

Bad Request

401

Unauthorized

403

Forbidden - this method requires activation and configuration from Oculos

get/data-enrichment/ssn/{ssn}
Request samples
Response samples
application/json
{
  • "firstName": "firstName",
  • "lastName": "lastName",
  • "address": "Kongens gate 20",
  • "zip": "0010",
  • "city": "Oslo",
  • "gender": "Male",
  • "birthDate": "1955-12-16T00:00:00",
  • "extendedProperties": {
    }
}

Health

Endpoint for checking OIP health status.

With these endpoint(s) you can make a request to OIP to get a quick system status.

Ping

Ping OIP with a 200 GET request to check system status.

This endpoint does not require authentication.

Responses
200

Success

404

Not Found

get/health/ping
Request samples

Import

Endpoint that provides methods for importing data, typically in batchers into OIP.

In this endpoint we can receive many formats and types, such as JSON and XML requests.

To get an example of your specific integration, please contact our support team.

Import

Imports data into OIP by the body request, this method accepts various formats such as JSON, XML, CSV etc.

This method may have to be configured by Oculos before usage and the examples below is just an illustration of payload as the endpoint is fully dynamic.

Securityapi_key
Request
Request Body schema: application/json
Array of objects
Responses
200

OK

400

Bad Request

401

Unauthorized

403

Forbidden - this method requires activation and configuration from Oculos

post/import
Request samples
application/json
{
  • "members": [
    ]
}

Form import

Imports data into OIP from a form using the application/x-www-form-urlencoded content type.

The endpoint may have to be configured by Oculos before usage.

Securityapi_key
Responses
200

OK

400

Bad Request

401

Unauthorized

403

Forbidden - this method requires activation and configuration from Oculos

post/import/form
Request samples

Loyalty

Endpoints for manually managing bonuses.

Methods under this endpoint lets you view current campaigns, manually add bonus points etc.

Depending on your configuration, the API may take or return additional fields in the extendedProperties object.

To get an example of your specific integration, please contact our support team.

Return all bonus campaigns

Methods that returns all current bonus campaigns.

The id parameters is optional and can be used to return all campaigns for a specific member.

The return object is dynamic and can vary between clients, the example below shows the most common types of fields.

Securityapi_key
Request
path Parameters
id
string

Id of member

Responses
200

Success

400

Bad Request

401

Unauthorized

403

Forbidden - this method requires activation and configuration from Oculos

404

Member not found

get/loyalty/bonus/campaigns/{id}
Request samples
Response samples
application/json
[
  • {
    }
]

Import activity bonus

Method that allows a third-party to manually import activities and update bonus amount for a member.

Available activites that qualifies for bounus points can be found using the /bonus/rules endpoint.

The request and response can be customer specific and the example below shows only a common type of request body.

Securityapi_key
Request
Request Body schema: application/json
externalId
string

The external identifer, most common is the members mobile phone number.

activity
string

The id of the activity that the customer has performed.

activityDate
string

When whas the activity done.

activityValue
integer

How many points is awarded for the activity.

Responses
200

Success

400

Bad Request

401

Unauthorized

403

Forbidden - this method requires activation and configuration from Oculos

404

Customer or activity not found

post/loyalty/bonus/import
Request samples
application/json
{
  • "externalId": "+4712345678",
  • "activity": "20",
  • "activityDate": "2022-07-01",
  • "activityValue": 10
}
Response samples
application/json
[
  • {
    }
]

Add bonus points

Method that allows you to manually add points to specific member

Securityapi_key
Request
Request Body schema: application/json
points
required
number

Number of points to add

description
required
string

Description of points added

Responses
200

Success

400

Bad Request

401

Unauthorized

403

Forbidden - this method requires activation and configuration from Oculos

post/loyalty/bonus/addRewardPoints
Request samples
application/json
{
  • "points": 1000,
  • "description": "Extra bonus points due to delayed shipment"
}
Response samples
application/json
{
  • "externalId": "+4712345678",
  • "activity": "20",
  • "activityDate": "2022-07-01",
  • "activityValue": 10
}

Return all bonus rules

Methods that returns all the rules and activitys that qualifies to bonuses.

Securityapi_key
Responses
200

OK

400

Bad Request

401

Unauthorized

403

Forbidden - this method requires activation and configuration from Oculos before usage

get/bonus/rules
Request samples
Response samples
application/json
[
  • {
    }
]

Get stampcards

Endpoint that returns a list of active stamp cards for a customer

Securityapi_key
Request
path Parameters
customerId
required
string

Id of customer.

Responses
200

OK

400

Bad Request

401

Unauthorized

403

Forbidden - this method requires activation and configuration from Oculos

404

Not Found

get/loyalty/stampcards/{customerId}
Request samples
Response samples
application/json
[
  • {
    }
]

Update stampcard

A method that allows the client to manually add clips/stamps to a customers stamp cards which can be useful i scenarions where live updates are not possible.

Depending on your configuration, the API may take or return additional fields in the extendedProperties object.

Securityapi_key
Request
Request Body schema: application/json
id
required
string

The id of the stamp card.

memberId
required
string

The members unique id.

Depending on your OIP configuration this could be a internal guid (id), mobile phone or other external id.

storeId
required
string

The store id

cashierId
required
string

The id of cashier/employee

itemCount
integer

Number of clips/stamps to add to the customers stamp card

object

Additional properties depending on configuration

Responses
200

OK

400

Bad Request

401

Unauthorized

409

Conflict

put/loyalty/stampcards
Request samples
application/json
{
  • "id": "2457B03E-9925-45E9-B551-25F10D7BD4F2",
  • "memberId": "+4712345678",
  • "storeId": "STORE-001",
  • "cashierId": 123,
  • "itemCount": 1,
  • "extendedProperties": {
    }
}

Get stampcard campaigns

Endpoint that return all products that qualifies for a count in each stampcard.

Depending on your OIP configuration, the API may return additional fields in the extendedProperties object.

Securityapi_key
Responses
200

OK

400

Bad Request

401

Unauthorized

403

Forbidden - this method requires activation and configuration from Oculos

get/loyalty/stampcards/campaigns
Request samples
Response samples
application/json
[
  • {
    }
]

Get bonus transactions

Returns all transactions for a customer that qualifies for a bonus.

Securityapi_key
Request
path Parameters
customerId
required
string

Id of customer, could be either the id or the externalId.

Responses
200

OK

400

Bad Request

401

Unauthorized

403

Forbidden - this method requires activation and configuration from Oculos

get/loyalty/transactions/customerId/{customerId}
Request samples
Response samples
application/json
{
  • "transactions": [
    ]
}

Messaging

Endpoint that lets yoy send different types of messages and manually trigger automations that send SMS.

In this endpoint you will also find a complete set of methods to create a 2F verfication solution by SMS.

Send SMS

Sends an SMS with a given sender name.

Securityapi_key
Request
Request Body schema: application/json
phoneNumber
string

The receivers phone number. Must contain country code prefix.

message
string

The message you want to send

sender
string

The name of sender

Responses
200

OK

400

Bad Request

401

Unauthorized

403

Forbidden - this method requires activation and configuration from Oculos

post/messaging/sms
Request samples
application/json
{
  • "phoneNumber": "+4712345678",
  • "message": "This is a text message",
  • "sender": "Oculos"
}

Create Code

Creates and sends an SMS with a unique code that can be used in 2 factor logins or customer verification processes.

The sender, length and expiration time is configurable.

Securityapi_key
Request
path Parameters
phoneNumber
required
string

Receivers mobile phone number. Must contain country code

Responses
200

OK

400

Bad Request

401

Unauthorized

403

Forbidden - this method requires activation and configuration from Oculos

get/messaging/sms/code/create/{phoneNumber}
Request samples

Verify code

Verifies the SMS code recevied in the Create Code endpoint.

Securityapi_key
Request
path Parameters
phoneNumber
required
string

Mobile phone number to verify. Must contain country code prefix.

Example: +4712345678
code
required
string

The verification code received from the create code endpoint.

Example: 123456
Responses
200

OK

400

Bad Request

401

Unauthorized

403

Forbidden - this method requires activation and configuration from Oculos

get/messaging/sms/code/verify/{phoneNumber}/{code}
Request samples

Trigger sms

Triggers the send out of a pre-defined message. This message has to be configured by Oculos in advance.

Securityapi_key
Request
path Parameters
customerId
required
string

Member identifier, depending on your OIP configuration this can typically be a internal guid, mobile phone or other external id.

Example: 50EF2EA3-E804-404E-B65B-73AB6B9D7F05
id
required
string

Id of message to trigger

Example: welcomeSMS
Responses
200

OK

400

Bad Request

401

Unauthorized

get/messaging/sms/trigger/{customerId}/{id}
Request samples

Payment Cards

TODO

Attach payment card token to member

Use this endpoint for adding a card token to an existing member.

This method requires an integration with a payment provider.

Securityapi_key
Request
Request Body schema: application/json
memberId
required
string

The members Id

token
required
string

Card token to add to members list of payment cards

Responses
200

OK

400

Bad Request

401

Unauthorized

403

Forbidden - this method requires activation and configuration from Oculos before usage

409

Conflict

post/payment-cards
Request samples
application/json
{
  • "memberId": "15BE85AB-CD61-4A23-8C22-0981AD35DBD1S2010",
  • "token": "2A9ACDD0-9113-4EF4-8EA9-FD343E040EE9"
}

Get member by payment card token

Retrives a member by card token

This method requires an integration with a payment provider.

Securityapi_key
Request
path Parameters
token
required
string

Card token

Responses
200

OK

400

Bad Request

401

Unauthorized

403

Forbidden - this method requires activation and configuration from Oculos before usage

get/payment-cards/token/{token}
Request samples
Response samples
application/json
{
  • "data": {
    },
  • "metaData": {
    }
}

Get all payment cards by customerId

Method that returns a list of all payment cards attached to a member. If there are no cards attached to the member, an empty list will be returned.

This method requires an integration with a payment provider.

Securityapi_key
Request
path Parameters
customerId
required
string

Id of member

Responses
200

OK

400

Bad Request

401

Unauthorized

403

Forbidden - this method requires activation and configuration from Oculos before usage

get/payment-cards/customerId/{customerId}
Request samples
Response samples
application/json
{
  • "data": [
    ],
  • "metaData": {
    }
}

Delete payment card

Method used for deleting card attached to member

Securityapi_key
Request
path Parameters
customerId
required
string

Id of member

cardId
required
string

Id of card

Responses
200

OK

400

Bad Request

401

Unauthorized

403

Forbidden - this method requires activation and configuration from Oculos before usage'

delete/payment-cards/{customerId}/{cardId}
Request samples

Create payment card signature

Method used to create a payload that can be used to trigger a new card registration process.

This metod requires addional services, please contact your advisor for more information.

Securityapi_key
Request
Request Body schema: application/json
source
required
string

String that identifies the client by name that makes the request

provider
required
string

Which provider should be used (default is Verifone)

object
Responses
200

OK

400

Bad Request

401

Unauthorized

403

Forbidden - this method requires activation and configuration from Oculos

post/payment-cards/signature
Request samples
application/json
{
  • "source": "ECOM",
  • "provider": "Verifone",
  • "data": {
    }
}

Plugins

TODO

Calculate new price on cart

Endpoint used for calculating a new price on a cart based on current campaigns and/or a members available:

  • Bonus
  • Coupons
  • Vouchers

As both the request and response is fully dynamic, the format of the data exchanged has to be agreed upon before activating.

Securityapi_key
Request
Request Body schema: application/json
cartId
string

Cart identifier

Responses
200

OK

400

Bad Request

401

Unauthorized

403

Forbidden - this method requires activation and configuration from Oculos

post/plugins/cart/price
Request samples
application/json
{
  • "cartId": "934E2183-5004-45B0-8E75-A5178F1DEEF1"
}

Extenda Plugin endpoint

Endpoint used for calculating a new price on a cart based on current campaigns and/or a members available:

  • Bonus
  • Coupons
  • Vouchers

As both the request and response is fully dynamic, the format of the data exchanged has to be agreed upon before activating.

Securityapi_key
Request
Request Body schema: application/json
cartId
string

Cart identifier

Responses
200

OK

400

Bad Request

401

Unauthorized

403

Forbidden - this method requires activation and configuration from Oculos

post/plugins/pos/extenda
Request samples
application/json
{
  • "cartId": "934E2183-5004-45B0-8E75-A5178F1DEEF1"
}

Promotions

TODO

Get promotions

Returns a list of all available promotions for a member.

Securityapi_key
Request
path Parameters
customerId
required
string

Id of member.

The type of id parameter is configurable where the most common types are id, mobile phone or an external id.

Responses
200

Success

400

Bad Request

403

Forbidden - this method requires activation and configuration from Oculos

404

Not Found - no coupons available

get/promotions/customerId/{customerId}
Request samples
Response samples
application/json
[
  • {
    }
]

Get promotions by phone number

Returns a list of all available promotions for a member by using the mobile phone number

Securityapi_key
Request
query Parameters
mobilePhone
required
string

Customers mobile phone number

The type of id parameter is configurable where the most common types are id, mobile phone or an external id.

Responses
200

Success

400

Bad Request

403

Forbidden - this method requires activation and configuration from Oculos

404

Not Found - no coupons available

get/promotions/mobilePhone
Request samples
Response samples
application/json
[
  • {
    }
]

Redeem promotion

Method that redeems a promotion for a customer.

Securityapi_key
Request
Request Body schema: application/json
id
required
string

Unique identifier of promotion

storeId
required
string

Id of store that makes the redeem

cashRegisterId
string

Id of cash register in store that makes the redeem

cashierId
string

Id of casher/employee that makes the redeem

customerId
string

Id of customer to validate the promotion against. Depending on configuration in OIP, this can be a internalId, mobile phone, externalId etc.

receiptId
string

Id of reciept that the promotion i applied to. Should be the same Id as the receipt sent to OIP after the purchase.

object

Additional properties depending on configuration

Responses
200

OK

400

Bad Request

401

Unauthorized

403

Forbidden - this method requires activation and configuration from Oculos

404

Not Found - promotion was not found

post/promotions/redeem
Request samples
application/json
{
  • "id": "71E8AC01-152D-4B2E-956A-3656CD3396AE",
  • "storeId": "STORE-001",
  • "cashRegisterId": "POS-001",
  • "cashierId": "123",
  • "customerId": "3477B4C3-5E2E-4007-9C26-41E60FECB016",
  • "receiptId": "RECEIPT_001",
  • "extendedProperties": {
    }
}

Get Redeemed Promotions

Method that returns a list of redeemed promotions for a customer.

Example of usage; ??

Securityapi_key
Request
path Parameters
customerId
required
string

Id of customer

Request Body schema: application/json
Array
couponId
string

Unique id of coupon

description
string

Short description of coupon

Responses
200

OK

400

Bad Request

401

Unauthorized

403

Forbidden - this method requires activation and configuration from Oculos

404

Not Found - coupon was not found

get/promotions/redeem/history/customerId/{customerId}
Request samples
application/json
[
  • {
    }
]

Dynamic method

This method is fully dynamic both in request/response and is available for specific client customizations on the promotions endpoint.

Securityapi_key
Request
path Parameters
function
required
string

Your custom function name provided by Oculos

Responses
200

OK

400

Bad Request

401

Unauthorized

404

Function Not Found

post/promotions/dynamic/{function}
Request samples
Response samples
application/json
{
  • "field1": "This is a string",
  • "field2": 123,
  • "field3": "Another string"
}

Reports

Endpoint that provides method(s) for returning various types of reports. Reports could be either of standard type or could be individually configured for clients.

Examples of reports:

  • New customers last 24 hours
  • Deleted customers last 24 hours
  • Bonus transactions made by customer
  • +++

Some reports that have a high volume response, may return the result in pages. This requires the client to iterate through each page to fetch the entire result.

In reports with paging functionality, a metaData object will contain paging information:

{
  "metaData": {
      "reportType": "customers",
      "totalRecords": 12,
      "totalPages": 1,
      "activePage": 1
    }  
}
  • totalRecords = Number of records available through all pages
  • totalPages = How many pages available containing data
  • activePage = Which page the client is on

To control wich page to fetch data from and how many records that should be return on each page use querystring parameters.

  • page = from wich page should the dataset be fetched from (default = 1)
  • rowsPage = how many results per page that should be returned (default = 25)

Please contact us for further information on your possiblites.

Get reports

Method that returns different types of reports based on input parameters and/or querys. Input parameters and/or querys are fully dynamic and can vary between clients.

For a complete list of parameters and example of response in your implemenation, please contact our support team.

Securityapi_key
Request
path Parameters
reportType
required
string

Type (id) of report that should be returned

Responses
200

OK

400

Bad Request

401

Unauthorized

403

Forbidden - this method requires activation and configuration from Oculos

get/reports/{reportType}
Request samples

Stores

Endpoint for Stores

Get Stores

Endpoint for getting all client stores, both physical and online.

Default properties are id and name.

Depending on the clients data, there may be additional data available under the extendedProperties object.

Securityapi_key
Responses
200

OK

400

Unauthorized

get/stores
Request samples
Response samples
application/json
[
  • {
    }
]

Transactions

Endpoint for transactions

Get Transactions

Returns all transactions for a member.

Securityapi_key
Request
path Parameters
customerId
required
string

Member identifier, depending on configuration one of the following identifers could be in use:

  • Mobile phone
  • Unique id (oipId or externalSystemId)
Responses
200

OK

400

Bad Request

401

Unauthorized

403

Forbidden - this method requires activation and configuration from Oculos

404

Member Not Found

get/transactions/customerId/{customerId}
Request samples
Response samples
application/json
[
  • {
    }
]

Create transaction

Endpoint used for inserting transactions into OIP.

It is recommended to send in a list/batch of transactions instead of sending multiple single transactions. The maximum recommended items per batch is around 400 transactions/items.

Returns

To make a transaction be processed as a return, you have to do the following:
  • Set the transactionType field on item level to 'RETURN'
  • Set the quantity value to a negative value.

Example of transaction flagged as a return:

{
"ReceiptRequests": [
  {
    "Header": {
      "StoreId": "001",
      "ReceiptId": "9999258836",
      "TimeStamp": "2023-10-13T14:50:05",
      "ConsumerId": "9ae37ad3-8a55-4bb5-81fd-b08f00b684ed",
      "GrossAmount": 1817.8,
      "Vat": 363.56
    },
    "Items": [
      {
        "ReceiptId": "Id of receipt",
        "LineNo": 1,
        "Quantity": -1,
        "ProductId": "VR1722775",
        "ProductName": "MINI CHRISTMAS THREE WITH LED LIGHTS",
        "GrossAmount": 1817.8,
        "Vat": 363.56,
        "NetAmount": 1454.24,
        "TransactionType": "RETURN"
      }
    ]
  }
]
}
Securityapi_key
Request
Request Body schema: application/json
One of:
Array of objects
Responses
200

OK

400

Bad Request

401

Unauthorized

403

Forbidden - this method requires activation and configuration from Oculos

post/transactions
Request samples
application/json
{
  • "ReceiptRequests": [
    ]
}

Triggers

Endpoints that enables triggering automations through the API.

Automations is a feature that simplifies and speeds up repetitive tasks. It helps marketers send emails, post on social media, and manage customer data more efficiently

Trigger automation by member id

Methods available to trigger automations.

The automation that should be triggered also has to be configured in the marketing automation system.

As the payload can vary between triggers, the request is fully dynamic and should be posted as dictionary with key/value.

Securityapi_key
Request
path Parameters
id
required
string

id of trigger

customerId
required
string

The members id

Request Body schema: application/json
data
string
Responses
200

Success

400

Bad Request

401

Unauthorized

403

Forbidden - this method requires activation and configuration from Oculos

404

Trigger not found

post/triggers/{id}/customer/{customerId}
Request samples
application/json
{
  • "data": "test data"
}
Response samples
application/json
"string"

Trigger automation by mobile phone number

Methods available to trigger automations by a configurable identificator, for example mobile phone.

The automation that should be triggered also has to be configured in the marketing automation system.

As the payload can vary between triggers, the request is fully dynamic and should be posted as dictionary with key/value.

Securityapi_key
Request
path Parameters
id
required
string

Id of trigger

mobilePhone
required
string

Members mobile phone number

Request Body schema: application/json
data
string
Responses
200

Success

400

Bad Request

401

Unauthorized

403

Forbidden - this method requires activation and configuration from Oculos

404

Trigger not found

post/triggers/{id}/customer/mobilePhone/{mobilePhone}
Request samples
application/json
{
  • "data": "test data"
}
Response samples
application/json
"string"

Vipps

Endpoint for Vipps integration

Trigger recruitment by SMS

Starts the recruitment process from a code word

Securityapi_key
Request
path Parameters
phone
required
string

Customers mobile phone, only norwegian number without country code.

Example: 91234567
Responses
200

OK

400

Bad Request

401

Unauthorized

403

Forbidden - this method requires activation and configuration from Oculos

get/vipps/codeword/{phone}
Request samples

Trigger recruitment from POS

This method allows POS to trigger the Vipps recruitment process and OIP to collect store recruitment statistics.

Securityapi_key
Request
Request Body schema: application/json
mobilePhone
string
storeId
string
sourceName
string
Responses
200

OK

400

Bad Request

401

Unauthorized

403

Forbidden - this method requires activation and configuration from Oculos

409

Conflict

post/vipps
Request samples
application/json
{
  • "mobilePhone": "91345678",
  • "storeId": "STORE-001",
  • "sourceName": "POS"
}