Self Service

Introduction

Welcome to the CRM.COM Application Programming Interface (API) documentation

The CRM.COM API is designed around REST, allowing you to manage subscription and/or rewards commerce in a simple, programmatic way using intuitive URL endpoints, conventional HTTP requests, response codes, authentication and verbs.

Self-Service API is designed with the main focus on developers of Mobile or Web based Applications, while being secure and performant.

For the management API please refer to the Back-Office API documentation that provides access and extensibilty to the functionality found in the CRM.COM.

API Documentation
API Reference

CRM.COM API is organized around REST. Our API has specific resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses and uses standard HTTP response codes, authentication & verbs.

You can use the entire API in test mode, which does not affect your live data. The API Key used to authenticate any of your requests will determine whether the request is on live mode or test mode.

The API may differ based on each CRM.COM release. For every new release with noticable changes that might alter backwards compatibility, a new version will be created.

Authentication

The CRM.COM Self Service API uses a JWT token that is returned from a contact authentication call either using username & password or one time password request.

SECURITY NOTICE

All API requests must be made over HTTPS. Any request made over plain HTTP or without authentication will fail. A pubic api key should be provided as part of the header for application identification.

API KEY AUTHORIZATION HEADER EXAMPLE

curl -X $HTTP_METHOD -H "api_key: 2189341e-981e-9ad5-9912-11101670314a" 

AUTH TOKEN AUTHORIZATION HEADER EXAMPLE

curl -X $HTTP_METHOD -H "authorization: Bearer JWT_TOKEN" 
Requests

API requests should be made using the HTTPS protocol so that traffic is encrypted. The interface responds to different methods depending on the action required.

Method Usage
POST To create a new object, your request should specify the POST method. The POST request includes all of the attributes necessary to create a new object to the targeted endpoint.
PUT To update the information on an existing object, the PUT method should be used. This will update the specified object if it is found using the provided values, regardless of their current values. If it is not found, the operation will return a response indicating that the object was not found. This idempotency means that you do not have to check for a resource’s availability prior to issuing an update command, the final state will be the same regardless of its existence. Requests using the PUT method do not need to check the current attributes of the object.
DELETE To remove an existing object from your environment, the DELETE method should be used. Similar to PUT method, the DELETE method is idempotent.
GET For retrieving information about customers, purchases or orders, the GET method should be used. Any requested information will be returned as a JSON object. The attributes defined by the JSON object can be used to form additional requests. Any request using the GET method is read-only and will not affect any of the retrieved objects.
Responses

Along with the HTTP methods that the API responds to, CRM.COM uses conventional HTTP response codes and human-readable messages in JSON format to indicate the success or failure of an API request.

In the event of a problem, the status will contain the error code, while the body of the response will usually contain additional information about the problem that was encountered.

HTTP Status Description
2XX Return codes in the 200 range indicate that the request was fulfilled successfully and that no error was encountered.
4XX Return codes in the 400 range, typically, indicate that there was an issue with the request that was sent. Most common reasons could be an invalid authentication method, unauthorised requests or the object that you are requesting does not exist.
5XX Return codes in the 500 range indicate that there is a server-side problem and CRM.COM cannot fulfill your request at the moment.

Most of our 4XX range errors that could be handled programmatically contain all the necessary details for a better integration handling. Such details are

  • HTTP Status Code & Error are used for programmatic consumption
  • Message is human-readable and can be used as a default error message
  • Parameters are used for programmatic consumption and can be used for enhancing the interface error message with additional information

4XX ERROR RESPONSE EXAMPLE

An example of a customer not found error is as follows

HTTP/1.1 400 Bad Request
    {
        "status": 400,
        "message": "Record not found.",
        "error": "CRM.EXCEPTIONS.NOTFOUNDEXCEPTION",
        "parameters": [
            "contact",
            "789dacae-cf71-414f-9483-ca88acaa46432"
        ]
    }
Response Codes

Below is a list of our common HTTP response codes that can be returned.

200 OK

The request has succeeded

400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Responsive Images

The concept of responsive images is utilized, offering single images that can respond to changes in any screen resolution on any mobile or web-based applications.

DEV TIP

In order to achieve that applications should use an <img> atttribute named srcset. The srcset defines multiple sizes of the same image, allowing the browser to select the appropriate image source based on its current resolution.

Example 1
<img 
    srcset="small.jpg 256w,
            medium.jpg 512w,
            large.jpg 1024w"
    sizes="(max-width: 30em) 25em, 100vw"
    src="medium.jpg"
    alt="responsive image"
/>
Operations
Approvals
GET /contacts/{id}/approval_requests
PUT /approval_requests/{id}/actions
GET /approval_requests/{token}
List Approval Requests
GET /contacts/{id}/approval_requests

Retrieve a list of approval requests based on search criteria for a specific contact (e.g. all pending approval requests)

Path variables

id
string GUID required

The contact (identifier) for whom approval requests will be retrieved

Example:
b2157d75-7959-83dc-fdfa-cacba764d4d4

Request parameters

state
string optional

Filter based on approval request state

Enumeration:
PENDING
APPROVED
REJECTED
entity_types
array of string optional

Filter based on the entity type that such requests are applied to

Collection format: csv
Unique items: YES
sort
string optional

Defines on which attribute the results should be sorted

Allow empty value: true
Examples:
CREATED_DATEUPDATED_DATENAMEPOSTED_DATE
order
string optional

Defines how the results will be ordered

Allow empty value: true
Enumeration:
ASC
DESC
Default:
DESC
page
integer optional

The page number that should be retrieved

Default:
1
Example:
20
size
string optional

The size (total records) of each page

Default:
10
Example:
20

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 OK

The request has succeeded

Body
Object
content
Array
Object
id
string GUID

The approval request identifier

Example:
8dfc2223-edca-f05d-820b-dc96ba9df2c2
state
string

The approval request state

Enumeration:
PENDING
APPROVED
REJECTED
entity
Object

Details about the entity that such approval request was applied to

id
string GUID

The entity identifier

Example:
cf010c72-a2cb-48f8-a9fa-1ed99c8d6ec0
type
string

The approval entity type

Enumeration:
ORDER
SERVICE_REQUEST
reference
string

The entity reference name/code/number

Example:
CO1234
paging
Object

Information that can be used in order to display large pages

page
integer

The page number

Example:
2
size
integer

The number of records per page

Default:
10
Example:
20
total
integer

The total number of records. If “include_total” is not specified, then this total is null. If “include_total” is specified, total has a value but it is accurate up to 10K records.

Example:
1124
has_more
boolean

Shows if there are more records available to fetch

Example:
true
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
GET https://sandbox.crm.com/self-service/v2/contacts/b2157d75-7959-83dc-fdfa-cacba764d4d4/approval_requests HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "content": [
        {
            "id": "8dfc2223-edca-f05d-820b-dc96ba9df2c2",
            "state": "APPROVED",
            "entity": {
                "id": "cf010c72-a2cb-48f8-a9fa-1ed99c8d6ec0",
                "type": "ORDER",
                "reference": "CO1234"
            }
        }
    ],
    "paging": {
        "page": 2,
        "size": 20,
        "total": 1124
    }
}
Approval Requests Actions
PUT /approval_requests/{id}/actions

Perform actions on existing approval request (e.g. approve request)

Path variables

id
string GUID required

The approval request (identifier) that will be updated

Example:
a6ecbc14-5622-0e30-b629-b1289963f7d2

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Request body

Object
action
string

The response for the approval request

Enumeration:
APPROVE
REJECT

Responses

200 OK

The request has succeeded

Body
Object
id
string GUID

The approval request identifier

Example:
a6ecbc14-5622-0e30-b629-b1289963f7d2
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
PUT https://sandbox.crm.com/self-service/v2/approval_requests/a6ecbc14-5622-0e30-b629-b1289963f7d2/actions HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "action": "ACCEPT"
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "a6ecbc14-5622-0e30-b629-b1289963f7d2"
}
Approval Request (Approve/Reject) Respond
GET /approval_requests/{token}

Accept or reject a pending approval request (using an action link send via a communication)

Path variables

token
string required

The token that will verify that the client is trusted and will approve/reject the related request

Example:
2fa42de0-38a0-1e86-b813-d370c35b082c

Responses

200 OK

The request has succeeded

Body

An HTML based landing page is returned and rendered

400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
GET https://sandbox.crm.com/self-service/v2/approval_requests/2fa42de0-38a0-1e86-b813-d370c35b082c HTTP/1.1 

HTTP/1.1 200 OK 
Attachment Files & Media
Attachment Files
POST /files
DELETE /files/{id}
GET /files/{id}
Upload File
POST /files

Create an upload signature for a file

Notes

FILE UPLOAD FLOW

Integrating file upload should be based on the following APIs

  1. Upload file signature
  2. Connect file to a module (entity), such as service requests

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Request body

Object
file
string required nullable

File contents provided via multipart/form-data

Example:
file object
Examples

Responses

201 Created

The request has succeeded

Body
Object
id
string GUID

The file identifier that will be used for connecting the file with a module

Example:
7279fecf-b0a6-0aab-6bcd-37881fe8c10e
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
POST https://sandbox.crm.com/self-service/v2/files HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "file": "file object"
}

HTTP/1.1 201 Created 

Content-Type: application/json

{
    "id": "7279fecf-b0a6-0aab-6bcd-37881fe8c10e"
}
Delete File
DELETE /files/{id}

Delete a file

Path variables

id
string GUID required

The file identifier to be deleted

Example:
8dfc2223-edca-f05d-820b-dc96ba9df2c2

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

204 No Content

The request has succeeded

400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
DELETE https://sandbox.crm.com/self-service/v2/files/8dfc2223-edca-f05d-820b-dc96ba9df2c2 HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 204 No Content 
Get File
GET /files/{id}

Retrieve a specific file

Path variables

id
string GUID required

The file identifier to be retrieved

Example:
3ae9d64a-8a3b-f1e1-eed6-05b307f926fb

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 OK

The request has succeeded

Body
application/json
Object
id
string

The identifier of the file retrieved

Example:
3ae9d64a-8a3b-f1e1-eed6-05b307f926fb
mime
string

Information about the creative type

Enumeration:
csv
doc
docx
xls
xlsx
pdf
log
txt
png
jpg
jpeg
svg
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
GET https://sandbox.crm.com/self-service/v2/files/3ae9d64a-8a3b-f1e1-eed6-05b307f926fb HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "3ae9d64a-8a3b-f1e1-eed6-05b307f926fb",
    "mime": "docx"
}
Authentication

Ability to authenticate customers via a Mobile App or a Portal

POST /contacts/authenticate
POST /contacts/refresh
POST /contacts/{id}/wifi/authorize
POST /contacts/otp
POST /contacts/validate_otp
POST /contacts/request_email_verification
GET /contacts/verify_email/{token}
POST /contacts/forgot_password
POST /contacts/change_password
POST /contacts/{id}/sign_out
Contact Authentication
POST /contacts/authenticate

Authenticate a contact and provide a token that needs to be used for subsequent API requests

Request headers

api_key
string required

The publishable api key for application identification

Example:
ab5f8b2e-092f-4848-8f46-31df1c014060

Request body

Object
provider
string

The contact’s identity provider

Enumeration:
EMAIL
FACEBOOK
GOOGLE
MW4

CRM.COM auth server

PHONE
MAC_ADDRESS

WiFi Platforms Authentication

username
string required nullable

The contact’s username (applicable for EMAIL providers). If password not provided then OTP request is triggered.

Example:
johndoe@crm.com
password
string required nullable

The contact’s password (applicable for EMAIL providers)

Example:
password1234
token
string required nullable

The token taken from the oAUTH service provider (applicable for Facebook/Google/MW4 providers)

Example:
234er43ergt34eett34
mac_address
string required nullable

The contact’s device mac address (applicable for MAC_ADDRESS providers)

Example:
01-23-45-67-89-AB
phone
Object required nullable

The contact’s phone

country_code
string required

The contact’s phone country code

Example:
CYP
number
string required

The contact’s phone number

Example:
99000000
application_id
string GUID nullable

The application (identifier), used for app stores verification (i.e. Apple Store requests a demo contact for verifying CRM.COM applications before publishing it over to their store; demo contacts can be specified from the CRM.COM application configuration settings)

Example:
a9c09878-bf26-4969-8a35-61899d64302d
Examples

Responses

200 OK

The request has succeeded

Body
Object
access_token
string

The token that can be used in subsequent API calls

Example:
eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhMjc4ZDNlNS05YjhlLTQzNmUtOTIzMC03MGYzZTJkZjFjYTUiLCJleHAiOjE1Njg1NTQxMjJ9.LemqPPThkqfakkKS6CdkNvV1Lnc88CWirEpHOPnWjJPQz02zgkKSwfbvrEsl3OmR2LUhDILsOXf4x-GPFmNJCg
refresh_token
string

The token that can be used to generate a new access token (when previous is expired)

Example:
eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhMjc4ZDNlNS05YjhlLTQzNmUtOTIzMC03MGYzZTJkZjFjYTUiLCJleHAiOjE1Njg1NTQxMjJ9.LemqPPThkqfakkKS6CdkNvV1Lnc88CWirEpHOPnWjJPQz02zgkKSwfbvrEsl3OmR2LUhDILsOXf4x-GPFmNJCg
expiration_date
string epoch

The token expiration date

Example:
1572530655
contact
Object

The authorised contact details

id
string GUID

The contact’s identifier

Example:
2f2f9afe-4399-59b7-cbb8-da18c2255064
first_name
string

The contact’s first name

Example:
John
last_name
string

The contact’s last name

Example:
Doe
is_verified
boolean

Defines whether the used identity is verified

Example:
false
organisations
Array

Details about the organisations that the contact has joined

Object
id
string GUID

The organisation identifier

Example:
QWERTY12345671234567324ETFTGBY78
type
string

The organisation type

Enumeration:
SERVICE_OWNER
ORGANISATION
name
string

The organisation name

Example:
CRMdotCOM
communities
Array

Details about the contact communities that the contact is a member of

Object
id
string GUID

The contact identifier

Example:
be4113e5-0fb5-7116-7d48-6901a6f7ddad
name
string

The contact name

Example:
CRM-NIC
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
Example 2
Example 3
Example 4

Authenticate contact using email and password

POST https://sandbox.crm.com/self-service/v2/contacts/authenticate HTTP/1.1 

api_key: 8c54d563-b991-4b76-8a83-557c08166f95
Content-Type: application/json

{
    "provider": "EMAIL",
    "username": "johndoe@crm.com",
    "password": "password1234"
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "access_token": "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhMjc4ZDNlNS05YjhlLTQzNmUtOTIzMC03MGYzZTJkZjFjYTUiLCJleHAiOjE1Njg1NTQxMjJ9.LemqPPThkqfakkKS6CdkNvV1Lnc88CWirEpHOPnWjJPQz02zgkKSwfbvrEsl3OmR2LUhDILsOXf4x-GPFmNJCg",
    "exp": "1572530655",
    "contact": {
        "title": "Mr",
        "first_name": "John",
        "last_name": "Doe",
        "avatar": "avatar",
        "is_verified": "false"
    },
    "organisations": [
        {
            "external_id": "QWERTY12345671234567324ETFTGBY78",
            "org_type": "SERVICE_OWNER",
            "org_relationship": "MERCHANT",
            "name": "CRMdotCOM"
        }
    ]
}

Authenticate contact using MAC address

POST https://sandbox.crm.com/self-service/v2/contacts/authenticate HTTP/1.1 

api_key: ab5f8b2e-092f-4848-8f46-31df1c014060
Content-Type: application/json

{
    "provider": "MAC_ADDRESS",
    "mac_address": "01-23-45-67-89-AB"
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "access_token": "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhMjc4ZDNlNS05YjhlLTQzNmUtOTIzMC03MGYzZTJkZjFjYTUiLCJleHAiOjE1Njg1NTQxMjJ9.LemqPPThkqfakkKS6CdkNvV1Lnc88CWirEpHOPnWjJPQz02zgkKSwfbvrEsl3OmR2LUhDILsOXf4x-GPFmNJCg",
    "refresh_token": "",
    "exp": "1572530655",
    "contact": {
        "id": "",
        "title": "Mr",
        "first_name": "John",
        "last_name": "Doe",
        "company_name": "",
        "avatar": "avatar",
        "is_verified": "false"
    },
    "organisations": [
        {
            "external_id": "QWERTY12345671234567324ETFTGBY78",
            "org_type": "SERVICE_OWNER",
            "name": "CRMdotCOM"
        }
    ]
}

Authenticate contact using MW4

POST https://sandbox.crm.com/self-service/v2/contacts/authenticate HTTP/1.1 

api_key: ab5f8b2e-092f-4848-8f46-31df1c014060
Content-Type: application/json

{
    "provider": "MW4",
    "token": "234er43ergt34eett34"
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "access_token": "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhMjc4ZDNlNS05YjhlLTQzNmUtOTIzMC03MGYzZTJkZjFjYTUiLCJleHAiOjE1Njg1NTQxMjJ9.LemqPPThkqfakkKS6CdkNvV1Lnc88CWirEpHOPnWjJPQz02zgkKSwfbvrEsl3OmR2LUhDILsOXf4x-GPFmNJCg",
    "refresh_token": "",
    "exp": "1572530655",
    "contact": {
        "id": "2f2f9afe-4399-59b7-cbb8-da18c2255064",
        "title": "Mr",
        "first_name": "John",
        "last_name": "Doe",
        "company_name": "CRM",
        "avatar": "avatar",
        "is_verified": "false"
    },
    "organisations": [
        {
            "external_id": "QWERTY12345671234567324ETFTGBY78",
            "org_type": "SERVICE_OWNER",
            "name": "CRMdotCOM"
        }
    ]
}

Authenticate contact using phone

POST https://sandbox.crm.com/self-service/v2/contacts/authenticate HTTP/1.1 

api_key: ab5f8b2e-092f-4848-8f46-31df1c014060
Content-Type: application/json

{
    "provider": "PHONE",
    "phone_number": "22265566",
    "country_code": "CYP"
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "access_token": "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhMjc4ZDNlNS05YjhlLTQzNmUtOTIzMC03MGYzZTJkZjFjYTUiLCJleHAiOjE1Njg1NTQxMjJ9.LemqPPThkqfakkKS6CdkNvV1Lnc88CWirEpHOPnWjJPQz02zgkKSwfbvrEsl3OmR2LUhDILsOXf4x-GPFmNJCg",
    "refresh_token": "",
    "exp": "1572530655",
    "contact": {
        "id": "2f2f9afe-4399-59b7-cbb8-da18c2255064",
        "title": "Mr",
        "first_name": "John",
        "last_name": "Doe",
        "company_name": "CRM",
        "avatar": "avatar",
        "is_verified": "false"
    },
    "organisations": [
        {
            "external_id": "QWERTY12345671234567324ETFTGBY78",
            "org_type": "ORGANISATION",
            "name": "CRMdotCOM"
        }
    ]
}
Refresh Contact Token
POST /contacts/refresh

Refresh the contact session based on a “refresh” token and provide an access token that will be used for subsequent API requests

Request headers

Authorization
string required

The refresh token that will be used for re-authenticating a contact without signing in again

Example:
eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhMjc4ZDNlNS05YjhlLTQzNmUtOTIzMC03MGYzZTJkZjFjYTUiLCJleHAiOjE1Njg1NTQxMjJ9.LemqPPThkqfakkKS6CdkNvV1Lnc88CWirEpHOPnWjJPQz02zgkKSwfbvrEsl3OmR2LUhDILsOXf4x-GPFmNJCg

Responses

200 OK

The request has succeeded

Body
Object
access_token
string

The token that can be used in subsequent API calls

Example:
eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhMjc4ZDNlNS05YjhlLTQzNmUtOTIzMC03MGYzZTJkZjFjYTUiLCJleHAiOjE1Njg1NTQxMjJ9.LemqPPThkqfakkKS6CdkNvV1Lnc88CWirEpHOPnWjJPQz02zgkKSwfbvrEsl3OmR2LUhDILsOXf4x-GPFmNJCg
refresh_token
string

The token that can be used to generate a new access token (when previous is expired)

Example:
eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhMjc4ZDNlNS05YjhlLTQzNmUtOTIzMC03MGYzZTJkZjFjYTUiLCJleHAiOjE1Njg1NTQxMjJ9.LemqPPThkqfakkKS6CdkNvV1Lnc88CWirEpHOPnWjJPQz02zgkKSwfbvrEsl3OmR2LUhDILsOXf4x-GPFmNJCg
expiration_date
string epoch

The token expiration date

Example:
1572530655
contact
Object

The authorised contact details

id
string GUID

The contact’s identifier

Example:
2f2f9afe-4399-59b7-cbb8-da18c2255064
first_name
string

The contact’s first name

Example:
John
last_name
string

The contact’s last name

Example:
Doe
is_verified
boolean

Defines whether the used identity is verified

Example:
false
organisations
Array

Details about the organisations that the contact has joined

Object
id
string GUID

The organisation identifier

Example:
QWERTY12345671234567324ETFTGBY78
type
string

The organisation type

Enumeration:
SERVICE_OWNER
ORGANISATION
name
string

The organisation name

Example:
CRMdotCOM
communities
Array

Details about the contact communities that the contact is a member of

Object
id
string GUID

The contact identifier

Example:
be4113e5-0fb5-7116-7d48-6901a6f7ddad
name
string

The contact name

Example:
CRM-NIC
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
POST https://sandbox.crm.com/self-service/v2/contacts/refresh HTTP/1.1 

Authorization: eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhMjc4ZDNlNS05YjhlLTQzNmUtOTIzMC03MGYzZTJkZjFjYTUiLCJleHAiOjE1Njg1NTQxMjJ9.LemqPPThkqfakkKS6CdkNvV1Lnc88CWirEpHOPnWjJPQz02zgkKSwfbvrEsl3OmR2LUhDILsOXf4x-GPFmNJCg

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "access_token": "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhMjc4ZDNlNS05YjhlLTQzNmUtOTIzMC03MGYzZTJkZjFjYTUiLCJleHAiOjE1Njg1NTQxMjJ9.LemqPPThkqfakkKS6CdkNvV1Lnc88CWirEpHOPnWjJPQz02zgkKSwfbvrEsl3OmR2LUhDILsOXf4x-GPFmNJCg",
    "refresh_token": "",
    "exp": "1572530655",
    "contact": {
        "id": "2f2f9afe-4399-59b7-cbb8-da18c2255064",
        "title": "Mr",
        "first_name": "John",
        "last_name": "Doe",
        "company_name": "CRM",
        "avatar": "avatar",
        "is_verified": "false"
    },
    "organisations": [
        {
            "external_id": "QWERTY12345671234567324ETFTGBY78",
            "org_type": "ORGANISATION",
            "name": "CRMdotCOM"
        }
    ]
}
Contact WiFi Authorization
POST /contacts/{id}/wifi/authorize

Authorize a contact over to a WiFi platform for usage allowance consumption

Path variables

id
string GUID required

The contact (identifier) that will be authorized over to a WiFi platform

Example:
eab82829-b65e-ee5a-b0f8-33b8ad48e04e

Request headers

api_key
string required

The publishable api key for application identification

Example:
ab5f8b2e-092f-4848-8f46-31df1c014060

Request body

Object
mac_address
string required

The contat’s device MAC address

Example:
01-23-45-67-89-AB
estimation_id
string GUID required

The usage estimation (identifier) that the contact is authorized for

Example:
0ba7de75-8a68-c19a-3d3a-f4708723a1a4
site_id
string required

The site (organisation’s WiFi network) that the contact is authorized against

Example:
onwuq8y1

Responses

204 No Content

The request has succeeded

400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter OR client has already signed in from anotyher device (ClientAlreadyAuthorizedException)

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
POST https://sandbox.crm.com/self-service/v2/contacts/eab82829-b65e-ee5a-b0f8-33b8ad48e04e/wifi/authorize HTTP/1.1 

api_key: ab5f8b2e-092f-4848-8f46-31df1c014060
Content-Type: application/json

{
    "mac_address": "01-23-45-67-89-AB",
    "estimation_id": "0ba7de75-8a68-c19a-3d3a-f4708723a1a4",
    "site_id": "onwuq8y1"
}

HTTP/1.1 204 No Content 
Request One Time Password
POST /contacts/otp

Request an one time password based on a contact’s details

Notes

One Time Password

Requesting an one time password will identify a contact based on the provided details (credentials) and once a single contact is found, an outbound communication (SMS or Email) will be send with a 6-digit number that can be used for verifying a contact

Request headers

api_key
string required

The publishable api key for application identification

Example:
ab5f8b2e-092f-4848-8f46-31df1c014060

Request body

Object
credentials
Array required

Defines how a contact will be identified

Object
name
string required

The predetermined information that will be used to identify the contact

Enumeration:
BIRTHDATE

Lookup on contact details

PASSPORT

Lookup on contact details

ID_NUMBER

Lookup on contact details

CARD

Lookup on contact customer identification medium (if enabled) and then on contact details

PHONE

Lookup on contact identity, then on customer identification medium (if enabled) and last on contact details

EMAIL

Lookup on contact identity, then on customer identification medium (if enabled) and last on contact details

LOYALTY_IDENTIFIER

Lookup on customer identification medium (if enabled) and last on contact details

GIFT_PASS

Lookup on customer identification medium (if enabled) and last on contact details

CONTACT_IDENTITY

Lookup on contact identity

value
string required

The value of the credential to check

Example:
1234567
gift_pass
Object nullable

The gift pass information to check (applicable only if type is “GIFT_PASS”)

email
string nullable

The email address that will receive the one-time-password (email or phone must be provided)

Example:
johndoe@crm.com
phone
Object nullable

The contact’s phone

country_code
string required

The contact’s phone country code

Example:
CYP
number
string required

The contact’s phone number

Example:
99000000
pin
string nullable

The gift pass pin (pin or last_spend_amount must be provided)

Example:
132435
last_spend_amount
number nullable

The last spend amount performed, semi-optional - either pin or last_spend_amount must be provided

Example:
2.5

Responses

200 OK

The request has succeeded

Body
Object
obfuscated_value
string

The obfuscated method that one-time password is sent to

Example:
+35799***834
auth_otp
string

The one time password authentication identifier that is generated as per otp request and will be used for validating such otp

Example:
47c7-318202dbe45d
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
POST https://sandbox.crm.com/self-service/v2/contacts/otp HTTP/1.1 

api_key: ab5f8b2e-092f-4848-8f46-31df1c014060
Content-Type: application/json

{
    "credentials": [
        {
            "name": "LOYALTY_IDENTIDIER",
            "value": "1234567"
        },
        {
            "name": "ID_NUMBER",
            "value": "100995471"
        }
    ]
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "obfuscated_value": "+35799***834",
    "auth_otp": "731e4023-4c04-4278-8eb5-240651317e46"
}
Validate One Time Password
POST /contacts/validate_otp

Verifies that the one time password that was requested is valid

Request headers

api_key
string required

The publishable api key for application identification

Example:
ab5f8b2e-092f-4848-8f46-31df1c014060

Request body

Object
auth_otp
string required

The one time password authentication identifier that is generated as per otp request and will be used for validating such otp

Example:
47c7-318202dbe45d
code
string required

The one time password that was sent to the contact and should be used for verification purposes

Example:
123456

Responses

200 OK

The request has succeeded

Body
Object
access_token
string

The token that can be used in subsequent API calls

Example:
eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhMjc4ZDNlNS05YjhlLTQzNmUtOTIzMC03MGYzZTJkZjFjYTUiLCJleHAiOjE1Njg1NTQxMjJ9.LemqPPThkqfakkKS6CdkNvV1Lnc88CWirEpHOPnWjJPQz02zgkKSwfbvrEsl3OmR2LUhDILsOXf4x-GPFmNJCg
refresh_token
string

The token that can be used to generate a new access token (when previous is expired)

Example:
eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhMjc4ZDNlNS05YjhlLTQzNmUtOTIzMC03MGYzZTJkZjFjYTUiLCJleHAiOjE1Njg1NTQxMjJ9.LemqPPThkqfakkKS6CdkNvV1Lnc88CWirEpHOPnWjJPQz02zgkKSwfbvrEsl3OmR2LUhDILsOXf4x-GPFmNJCg
expiration_date
string epoch

The token expiration date

Example:
1572530655
contact
Object

The authorised contact details

id
string GUID

The contact’s identifier

Example:
2f2f9afe-4399-59b7-cbb8-da18c2255064
first_name
string

The contact’s first name

Example:
John
last_name
string

The contact’s last name

Example:
Doe
is_verified
boolean

Defines whether the used identity is verified

Example:
false
organisations
Array

Details about the organisations that the contact has joined

Object
id
string GUID

The organisation identifier

Example:
QWERTY12345671234567324ETFTGBY78
type
string

The organisation type

Enumeration:
SERVICE_OWNER
ORGANISATION
name
string

The organisation name

Example:
CRMdotCOM
communities
Array

Details about the contact communities that the contact is a member of

Object
id
string GUID

The contact identifier

Example:
be4113e5-0fb5-7116-7d48-6901a6f7ddad
name
string

The contact name

Example:
CRM-NIC
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
POST https://sandbox.crm.com/self-service/v2/contacts/validate_otp HTTP/1.1 

api_key: ab5f8b2e-092f-4848-8f46-31df1c014060
Content-Type: application/json

{
    "auth_otp": "47c7-318202dbe45d",
    "code": "123456"
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "access_token": "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhMjc4ZDNlNS05YjhlLTQzNmUtOTIzMC03MGYzZTJkZjFjYTUiLCJleHAiOjE1Njg1NTQxMjJ9.LemqPPThkqfakkKS6CdkNvV1Lnc88CWirEpHOPnWjJPQz02zgkKSwfbvrEsl3OmR2LUhDILsOXf4x-GPFmNJCg",
    "refresh_token": "",
    "exp": "1572530655",
    "contact": {
        "id": "2f2f9afe-4399-59b7-cbb8-da18c2255064",
        "title": "Mr",
        "first_name": "John",
        "last_name": "Doe",
        "company_name": "CRM",
        "avatar": "avatar",
        "is_verified": "false"
    },
    "organisations": [
        {
            "external_id": "QWERTY12345671234567324ETFTGBY78",
            "org_type": "ORGANISATION",
            "name": "CRMdotCOM"
        }
    ]
}
Request Email Verification
POST /contacts/request_email_verification

Request another email verification for a contact after an email verification has been sent, but not verified

Request headers

api_key
string required

The publishable api key for application identification

Example:
ab5f8b2e-092f-4848-8f46-31df1c014060

Request body

Object
email_address
string required

The email address that verification will be sent to

Example:
johndoe@crm.com

Responses

204 No Content

The request has succeeded

400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
POST https://sandbox.crm.com/self-service/v2/contacts/resend_email_verification HTTP/1.1 

api_key: ab5f8b2e-092f-4848-8f46-31df1c014060
Content-Type: application/json

{
    "credentials": [
        {
            "name": "EMAIL",
            "value": "johndoe@crm.com"
        }
    ]
}

HTTP/1.1 204 No Content 
Verify Contact Email
GET /contacts/verify_email/{token}

Verify a contact’s email address after an email verification request has been sent to the contact (contact should perform an email verification request, where a communication will be sent to the contact with the email verification link, and upon opening such link then this action should be performed)

Path variables

token
string required

The token that will used for verifying the contact’s email address

Example:
ABCTKN123456798VGP2020

Responses

200 OK

The request has succeeded

Body

An HTML based landing page is returned and rendered

400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
GET https://sandbox.crm.com/self-service/v2/contacts/verify_email/ABCTKN123456798VGP2020 HTTP/1.1 

HTTP/1.1 200 OK 
Forgot Password
POST /contacts/forgot_password

Requests a password reset for an existing contact, who forgot his/her password and cannot sign in

Request headers

api_key
string required

The publishable api key for application identification

Example:
ab5f8b2e-092f-4848-8f46-31df1c014060

Request body

Object
username
string required

The username that will be used to request a new password reset link

Example:
johndoe@crm.com
Examples

Responses

204 No Content

The request has succeeded

400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
POST https://sandbox.crm.com/self-service/v2/contacts/forgot_password HTTP/1.1 

api_key: ab5f8b2e-092f-4848-8f46-31df1c014060
Content-Type: application/json

{
    "username": "johndoe@crm.com"
}

HTTP/1.1 204 No Content 
Change Forgotten Password
POST /contacts/change_password

Changes a contact’s password after a password reset request (contact should perform a password reset, where a communication will be sent with a password reset link, and when opening such link and providing new password then this action should be performed)

Request body

Object
token
string required

The token that will verify that the client (that performs such action) is trusted

Example:
j677enty-23sfsfsf23456798vgp
password
string required

The new password

Example:
wsxcde421qadfg
Examples

Responses

204 No Content

The request has succeeded

400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
POST https://sandbox.crm.com/self-service/v2/contacts/change_password HTTP/1.1 

Content-Type: application/json

{
    "token": "j677enty-23sfsfsf23456798vgp",
    "password": "wsxcde421qadfg"
}

HTTP/1.1 204 No Content 
Sign Out Contact
POST /contacts/{id}/sign_out

Signs out a contact by terminating his/her session, such contact will not be able to access the client (application) and should sign in again in order to do so

Path variables

id
string GUID required

The contact (identifier) that will be signed out

Example:
9781d1db-38db-598f-2bb5-a3de3fbc2730

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

204 No Content

The request has succeeded

400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
POST https://sandbox.crm.com/self-service/v2/contacts/9781d1db-38db-598f-2bb5-a3de3fbc2730/sign_out HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 204 No Content 
Communications
GET /contacts/{id}/communications
GET /communications/{id}
PUT /communications/{id}/actions
List Communications
GET /contacts/{id}/communications

Get a list of a contact’s communications

Path variables

id
string GUID required

The contact (identifier) for which the related communications will be retrieved

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD

Request parameters

sort
string optional

Defines on which attribute the results should be sorted

Allow empty value: true
Examples:
CREATED_DATEUPDATED_DATENAMEPOSTED_DATE
order
string optional

Defines how the results will be ordered

Allow empty value: true
Enumeration:
ASC
DESC
Default:
DESC
page
integer optional

The page number that should be retrieved

Default:
1
Example:
20
size
string optional

The size (total records) of each page

Default:
10
Example:
20
channel
string optional

The type of the communications to be retrieved

Enumeration:
SMS
EMAIL
DEVICE
INAPP
archived
boolean optional

If set to TRUE, only archived communications will be retrieved

Example:
true
viewed
boolean optional

If set to TRUE, only viewed communications will be retrieved

Example:
true

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 200

The request has succeeded

Body
application/json
Object
content
Array

Information about the retrieved communication records

Object
id
string GUID

The communication identifier

Example:
6A24D2B5E44F44B28451FE021FCAD51E
life_cycle_state
string

The state of the communication

Enumeration:
PENDING
COMPLETED
REJECTED
contact_id
string GUID

The contact identifier that communication was sent to

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
channel
string

The channel that the communication is sent through

Enumeration:
SMS
EMAIL
DEVICE
INAPP
is_viewed
boolean

Defines whether the communication has been viewed

Example:
false
viewed_on
integer epoch

The datetime that the recipient viewed the communication

Example:
1583846865
is_archived
boolean

Defines whether the communication has been archived

Example:
true
clicked_on
integer epoch

The date links in the communication where first clicked by the recipient

language
string

The language tha the communication was sent in

Example:
ENG
sender
string

The default sender

Example:
dev@crm.com
recipient
string

The email or number of the recipient

Example:
jon@crm.com
subject
string

The actual subject of the communication sent (if applicable)

Example:
Subject Sample
content
string

The actual content of the communication sent

Example:
Content Sample
name
string

The name of the communication plan in case the communication was created from a plan

Example:
Happy Birthday
paging
Object

Information that can be used in order to display large pages

page
integer

The page number

Example:
2
size
integer

The number of records per page

Default:
10
Example:
20
total
integer

The total number of records. If “include_total” is not specified, then this total is null. If “include_total” is specified, total has a value but it is accurate up to 10K records.

Example:
1124
has_more
boolean

Shows if there are more records available to fetch

Example:
true
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
GET https://sandbox.crm.com/self-service/v1/contacts/CAD1E31269B76D7A65ACCE45B2E68DFD/communications HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "content": [
        {
            "id": "6A24D2B5E44F44B28451FE021FCAD51E",
            "life_cycle_state": "PENDING",
            "contact_id": "CAD1E31269B76D7A65ACCE45B2E68DFD",
            "channel": "EMAIL",
            "is_viewed": true,
            "viewed_on": 1583846865,
            "is_archived": true,
            "clicked_on": 1,
            "language": "ENG",
            "sender": "dev@crm.com",
            "recipient": "jon@crm.com",
            "content": "",
            "subject": "",
            "name": "Happy Birthday"
        }
    ],
    "paging": {
        "page": 2,
        "size": 20,
        "total": 1124
    }
}
Get Communications
GET /communications/{id}

Get a specific contact’s communication

Path variables

id
string GUID required

The communication identifier that should be returned

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 200

The request has succeeded

Body
application/json
Object
life_cycle_state
string

The state of the communication

Enumeration:
PENDING
COMPLETED
REJECTED
contact
Object

Details about the communication contact

id
string GUID

The unique identifier of the contact

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
name
string

The full name of the contact

Example:
John Johnson
code
string

The unique code of the contact

Example:
C123
channel
string

The channel that the communication is sent through

Enumeration:
SMS
EMAIL
DEVICE
INAPP
is_viewed
boolean

Defines whether the communication has been viewed

Example:
false
viewed_on
integer epoch

The datetime that the recipient viewed the communication

Example:
1583846865
is_archived
boolean

Defines whether the communication has been archived

Example:
true
clicked_on
integer epoch

The date links in the communication where first clicked by the recipient

language
string

The language tha the communication was sent in

Example:
ENG
sender
string

The default sender

Example:
dev@crm.com
recipient
string

The communication’s recipient information

Example:
jon@crm.com
subject
string

The actual subject of the communication sent (if applicable)

Example:
Award Provided
content
string

The actual content of the communication sent

Example:
You have been awarded!
name
string

The name of the communication plan in case that the communication was created based on a plan

Example:
Happy Birthday
created_on
integer epoch

The date and time that the communication was created

Example:
1583846865
title
string

Title of push notification (applicable for INAPP channels)

Example:
New Festive Beverages
subtitle
string

Subtitle (iOS only) of push notification (applicable for INAPP channels)

Example:
20% discount for December
in_app_image_url
string

Image for push notification

in_app_click_link_url
string

Push notification URL (deep linking)

400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
GET https://sandbox.crm.com/self-service/v1/communications/CAD1E31269B76D7A65ACCE45B2E68DFD HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "life_cycle_state": "PENDING",
    "contact": {
        "id": "CAD1E31269B76D7A65ACCE45B2E68DFD",
        "name": "John Johnson",
        "code": "C123"
    },
    "channel": "EMAIL",
    "is_viewed": true,
    "viewed_on": 1583846865,
    "is_archived": true,
    "clicked_on": 1,
    "language": "ENG",
    "sender": "dev@crm.com",
    "recipient": "jon@crm.com",
    "subject": "Award Provided",
    "content": "You have been awarded!",
    "name": "Happy Birthday",
    "created_on": 1583846865,
    "title": "New Festive Beverages",
    "subtitle": "20% discount for December",
    "in_app_image_url": "",
    "in_app_click_link_url": ""
}
Communications Actions
PUT /communications/{id}/actions

Mark an existing communication as viewed and/or archived

Path variables

id
string GUID required

The communication identifier

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Request body

Object
viewed
boolean required nullable

Sets the communication as viewed

Example:
true
archived
boolean required nullable

Sets the communication as archived

Example:
true

Responses

200 200

The request has succeeded

Body
application/json
Object
id
string GUID

The communication identifier

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
PUT https://sandbox.crm.com/self-service/v1/communications/CAD1E31269B76D7A65ACCE45B2E68DFD/actions HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "viewed": "true"
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "CAD1E31269B76D7A65ACCE45B2E68DFD"
}
Printout
POST /printout
Printout
POST /printout

Request (and retrieve) a printout for an invoice or order

Notes

PRINTOUT FLOW

Integrating printout export for Contacts should be based on the following APIs

  1. Printout
  2. Get (Printout) File

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Request body

Object
format
string required

Defines the format on which the printout will be created to

Enumeration:
PDF

Printout will be generated as pdf

EMAIL

Printout will be sent to the contact’s email address

entity
Object required

Defines the entity based on which the printout will be created

type
string required

The entity type

Enumeration:
INVOICE
ORDERS
PAYMENT
CREDIT_NOTE
REFUND
PAYOUT
Example:
ORDER
id
string GUID required

The entity identifier

Example:
1d014e8e-4e13-20e9-3727-071f0cef5cb6

Responses

201 Created

The request has succeeded (applicable if printout is PDF based)

Body
Object
id
string GUID

The printout identifier that will be exported

Example:
e1c67e12-6bae-53c7-f1a1-0a26aa4b27a2
204 No Content

The request has succeeded (applicable if printout is EMAIL based)

400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
POST https://sandbox.crm.com/self-service/v2/printout HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "format": "EMAIL",
    "entity": {
        "type": "ORDER",
        "id": "1d014e8e-4e13-20e9-3727-071f0cef5cb6"
    }
}

HTTP/1.1 204 No Content 
Contacts

Contacts are the customers of an organisation, the centre point of CRM.COM, and the starting point of any business flow.

POST /contacts/register
DELETE /contacts/{id}
PUT /contacts/{id}
GET /contacts/{id}
Register Contact
POST /contacts/register

Create a new contact of type ‘person’. A contact is created as part of the contact registration process via an app or portal. Contacts can register and authenticate their registration using one of the following methods subject to configuration:

  • email & password
  • email & OTP
  • phone & OTP
  • Facebook
  • Google

Request headers

api_key
string required

The publishable api key for application identification

Example:
ab5f8b2e-092f-4848-8f46-31df1c014060

Request body

Object
first_name
string required nullable

The contact’s first name (required when registering using email/password, email/OTP or phone/OTP)

Example:
John
last_name
string required nullable

The contact’s last name (required when registering using email/password, email/OTP or phone/OTP)

Example:
Doe
identification
Object required

Details about how the contact will be identified based on app/portal configuration

provider
string required

The contact’s identity provider

Enumeration:
EMAIL
FACEBOOK
GOOGLE
MW4

CRM.COM auth server

PHONE
email
string required nullable

The contact’s email, (required for email/password or email/OTP registraion). If password is not provided then an OTP request is triggered.

Example:
johndoe@crm.com
password
string nullable

The contact’s password (required for email/password registration)

Example:
123456
phone
Object nullable

Contact’s phone details. Required for phone/OTP registration to trigger an OTP request

country_code
string

ISO 3-char country code of phone number

Example:
CYP
number
string

Phone number

Example:
99123456
application_id
string required nullable

Application id - required when registering with Facebook

Example:
3c33dcc6-3958-4e7d-ae0e-592948627711
token
string nullable

The access token returned from the OAuth service provider (required for Facebook and Google registration)

Example:
YOJDAKEb9l1U0sUzrskM6X4emzrSeXqb
accept_terms_&_conditions
boolean nullable

Has the contact accepted the business terms & conditions?

Default:
true
Example:
true
email_opt_out
boolean nullable

Has the contact opted out from receiving emails?

Default:
false
Example:
true
sms_opt_out
boolean nullable

Has the contact opted out from receiving text messages (sms)?

Default:
false
Example:
true
referral_code
string nullable

The referral code of the contact who referred this contact (applicable only in cases where a new contact has been referred by another). This may trigger an award for the referrring contact subject to configuration

Example:
3M5Y1P
country_agreement
string nullable

3-char country code of the contact based on locale, this will be used to determine pricing and taxes

Example:
CYP
custom_fields
Array nullable
Object
key
string

The custom field’s unique key

Example:
custom_key
value
string

The custom field’s value

Example:
0001-345
pass_code
string

Pass code to be redeemed - optionally used on Landing page registration flow, if pass code is invalid then contact registration will not proceed

Example:
HHNSU32LNK
Examples

Responses

200 OK

The request has succeeded

Body
Object
access_token
string

The access token that can be used in subsequent API calls

Example:
eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhMjc4ZDNlNS05YjhlLTQzNmUtOTIzMC03MGYzZTJkZjFjYTUiLCJleHAiOjE1Njg1NTQxMjJ9.LemqPPThkqfakkKS6CdkNvV1Lnc88CWirEpHOPnWjJPQz02zgkKSwfbvrEsl3OmR2LUhDILsOXf4x-GPFmNJCg
expiration
string epoch

The access token expiration date/time

Example:
1572530655
contact
Object

Information about the authorised contact

first_name
string

The contact’s first name

Example:
John
last_name
string

The contact’s last name

Example:
Doe
is_verified
boolean

Defines whether the identity used has been verified

organisations
Array

Details about the organisations that the contact has joined

Object
external_id
string GUID

The organisation’s external identifier

Example:
QWERTY12345671234567324ETFTGBY78
org_type
string

The organisation type

Example:
ORGANISATION
org_relationship
string

The organisation relationship

Example:
MERCHANT
name
string

The organisation name

Example:
CRMdotCOM
obfuscated_value
string

The obfuscated send method value (applicable only when provider is EMAIL or PHONE and an OTP is generated)

Examples:
+35799***834so****@gmail.com
auth_otp
string

The one time password auth id (applicable only when provider is EMAIL or PHONE and an OTP is generated)

Example:
731e4023-4c04-4278-8eb5-240651317e46
204 No Content

The request has succeeded (applicable only if verficiation will be required)

400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
Example 2
POST https://sandbox.crm.com/self-service/v2/contacts/register HTTP/1.1 

api_key: ab5f8b2e-092f-4848-8f46-31df1c014060
Content-Type: application/json

{
    "first_name": "John",
    "last_name": "Doe",
    "identification": {
        "provider": "FACEBOOK",
        "email": "johndoe@crm.com",
        "password": "123456",
        "phone": {
            "country_code": "CYP",
            "number": "99123456"
        },
        "application_id": "3c33dcc6-3958-4e7d-ae0e-592948627711",
        "token": "YOJDAKEb9l1U0sUzrskM6X4emzrSeXqb"
    },
    "accept_terms_&_conditions": "true",
    "email_opt_out": "true",
    "sms_opt_out": "true",
    "referral_code": "3M5Y1P",
    "country_agreement": "CYP",
    "custom_fields": [
        {
            "key": "custom_key",
            "value": "0001-345"
        }
    ]
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "access_token": "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhMjc4ZDNlNS05YjhlLTQzNmUtOTIzMC03MGYzZTJkZjFjYTUiLCJleHAiOjE1Njg1NTQxMjJ9.LemqPPThkqfakkKS6CdkNvV1Lnc88CWirEpHOPnWjJPQz02zgkKSwfbvrEsl3OmR2LUhDILsOXf4x-GPFmNJCg",
    "expiration": "1572530655",
    "contact": {
        "first_name": "John",
        "last_name": "Doe",
        "is_verified": true
    },
    "organisations": [
        {
            "external_id": "QWERTY12345671234567324ETFTGBY78",
            "org_type": "ORGANISATION",
            "org_relationship": "MERCHANT",
            "name": "CRMdotCOM"
        }
    ],
    "obfuscated_value": "so****@gmail.com",
    "auth_otp": "731e4023-4c04-4278-8eb5-240651317e46"
}
POST /contacts/register HTTP/1.1 

api_key: ab5f8b2e-092f-4848-8f46-31df1c014060
Content-Type: application/json

{
    "first_name": "John",
    "last_name": "Doe",
    "identity": {
        "provider": "PHONE",
        "phone_number": "22265577",
        "country_code": "CYP"
    },
    "service_acceptance": "true",
    "email_opt_out": "true",
    "sms_opt_out": "true"
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "obfuscated_value": "+35799***834",
    "auth_otp": "731e4023-4c04-4278-8eb5-240651317e46"
}
Unregister Contact
DELETE /contacts/{id}

Unregisters a contact from an organisation

Path variables

id
string GUID required

The id of the contact to unregister

Example:
e18ee2bc-c6f3-49e1-8e05-763386378017

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 OK

The request has succeeded

400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1

Remove an existing contact address

DELETE https://sandbox.crm.com/self-service/v2/contacts/e18ee2bc-c6f3-49e1-8e05-763386378017 HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A
Update Contact
PUT /contacts/{id}

Update information for an existing contact

Path variables

id
string GUID required

The unique id of the contact to be updated

Example:
e2ade504-9b90-92be-0adb-3258475ff695

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Request body

Object
first_name
string

Contact’s first name

Example:
John
middle_name
string

Contact’s middle name

Example:
Patrick
last_name
string

Contact’s last name

Example:
Smith
language_code
string nullable

The contact’s selected language, used for communications, translations etc.

Example:
ENG
email
string nullable

The contact’s email address

Example:
john.smith@gmail.com
demographics
Object
gender
string nullable

Contact’s gender information

Enumeration:
MALE
FEMALE
date_of_birth
Object nullable

Contact’s date of birth

day
integer

Day

Example:
1
month
integer

Month

Example:
3
year
integer

Year

Example:
1948
name_day
Object nullable

Contact’s nameday information

day
integer

Day

Example:
6
month
integer

Month

Example:
8
sms_opt_out
boolean nullable

Has the contact opted out from receiving text messages (sms)?

Example:
false
email_opt_out
boolean nullable

Has the contact opted out from receiving emails?

Example:
false
custom_fields
Array nullable
Object
key
string

The custom field’s unique key

Example:
custom_key
value
string

The custom field’s value

Example:
0001-345

Responses

200 OK

The request has succeeded

Body
Object
id
string GUID

The contact identifier

Example:
e2ade504-9b90-92be-0adb-3258475ff695
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1

Update contact

PUT https://sandbox.crm.com/self-service/v2/contacts/e2ade504-9b90-92be-0adb-3258475ff695 HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "first_name": "John",
    "middle_name": "Patrick",
    "last_name": "Smith",
    "language_code": "ENG",
    "email": "john.smith@gmail.com",
    "demographics": {
        "gender": "FEMALE",
        "date_of_birth": {
            "day": 1,
            "month": 3,
            "year": 1948
        },
        "name_day": {
            "day": 6,
            "month": 8
        }
    },
    "sms_opt_out": "false",
    "email_opt_out": "false",
    "custom_fields": [
        {
            "key": "custom_key",
            "value": "0001-345"
        }
    ]
}

HTTP/1.1 200 OK 

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "e2ade504-9b90-92be-0adb-3258475ff695"
}
Get Contact
GET /contacts/{id}

Retrieve basic information for a specific contact

Path variables

id
string GUID required

The id of the contact whose information will be retrieved

Example:
6e2f83ca-69e9-4ea4-96c5-73a4c641979d

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 OK

The request has succeeded

Body
Object
id
string GUID

The contact identifier

Example:
6e2f83ca-69e9-4ea4-96c5-73a4c641979d
code
string

The contact code

Example:
100000001908
first_name
string

The contact’s first name

Example:
John
middle_name
string

The contact’s middle name

Example:
Alias
last_name
string

The contact’s last name

Example:
Doe
language_code
string

The contact’s selected language for communications and translations

Example:
ENG
email
string

The contact’s email address

Example:
john.smith@crm.com
phone
Object

Contact phone information

country_code
string

The phone country code

Example:
CYP
number
string

The phone number

Example:
99123456
demographics
Object
gender
string nullable

Contact’s gender information

Enumeration:
MALE
FEMALE
date_of_birth
Object nullable

Contact’s date of birth

day
integer

Day

Example:
1
month
integer

Month

Example:
3
year
integer

Year

Example:
1948
name_day
Object nullable

Contact’s nameday information

day
integer

Day

Example:
6
month
integer

Month

Example:
8
referral_code
string

The contact referral code used when referring friends

Example:
REF123
sms_opt_out
boolean

Has the contact opted-out for receiving text messages (sms)?

Example:
false
email_opt_out
boolean

Has the contact opted-out for receiving emails?

Example:
true
country_of_agreement
string

3-char country code of the contact based on locale, this will be used to determine pricing and taxes

Example:
CYP
loyalty_identifier
Array

The loyalty identifiers used to identify the contact (e.g. a loyalty card number from an external system)

Object
identifier
string

The contact loyalty identifier

Example:
100000001908
custom_fields
Array
Object
key
string

The custom field’s unique key

Example:
custom_key
value
string

The custom field’s value

Example:
0001-345
wallet
Object

Contact wallet information

id
string

Unique wallet id

Example:
1a6a85ac-aacf-4175-8de2-a7d701186d96
code
string

Wallet code

Example:
0872805556185711
sales_model
Object

The sales model is the unique identifier used to classify a product’s price

id
string

The sales model unique identifier

Example:
caf332bc-4e90-47b5-a05d-142b264897b9
name
string

The sales model name

Example:
Retail
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
GET https://sandbox.crm.com/self-service/v2/contacts/6e2f83ca-69e9-4ea4-96c5-73a4c641979d HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "6e2f83ca-69e9-4ea4-96c5-73a4c641979d",
    "code": "100000001908",
    "first_name": "John",
    "middle_name": "Alias",
    "last_name": "Doe",
    "language_code": "ENG",
    "email": "john.smith@crm.com",
    "phone": {
        "country_code": "CYP",
        "number": "99123456"
    },
    "demographics": {
        "gender": "MALE",
        "date_of_birth": {
            "day": 1,
            "month": 3,
            "year": 1948
        },
        "name_day": {
            "day": 6,
            "month": 8
        }
    },
    "referral_code": "REF123",
    "sms_opt_out": "false",
    "email_opt_out": "true",
    "country_of_agreement": "CYP",
    "loyalty_identifier": [
        {
            "identifier": "100000001908"
        }
    ],
    "custom_fields": [
        {
            "key": "custom_key",
            "value": "0001-345"
        }
    ],
    "wallet": {
        "id": "1a6a85ac-aacf-4175-8de2-a7d701186d96",
        "code": "0872805556185711"
    },
    "sales_model": {
        "id": "caf332bc-4e90-47b5-a05d-142b264897b9",
        "name": "Retail"
    }
}
Addresses

Manage the addresses of a contact

POST /contacts/{id}/addresses
PUT /contacts/{id}/addresses/{address_id}
DELETE /contacts/{id}/addresses/{address_id}
GET /contacts/{id}/addresses
Add Contact Address
POST /contacts/{id}/addresses

Add a new address to an existing contact. A contact can have multiple addresses.

Path variables

id
string GUID required

The id of the contact for which an address will be added

Example:
1a6a85ac-aacf-4175-8de2-a7d701186d96

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Request body

Object
address_type
string required

The address type

Enumeration:
HOME
BUSINESS
address_name
string nullable

A short name for the address allowing easy recognition in a list

Example:
Engomi Office
address_line_1
string required

The address line 1

Example:
21 Elia Papakyriakou Street
address_line_2
string nullable

The address line 2

Example:
7 Stars Tower
state_province_county
string nullable

The address state/provice/county

Example:
Engomi
town_city
string nullable

The address town/city

Example:
Nicosia
postal_code
string nullable

The address post code

Example:
2415
country_code
string required

The 3-char address country code

Example:
CYP
is_primary
boolean nullable

Defines whether the address is the primary address for the contact

Example:
true
lat
number nullable

The address geolocation latitude

Example:
35.1573573816456
lon
number nullable

The address geolocation longtitude

Example:
33.31386910877576
google_place_id
string nullable

The Google textual identifier that uniquely identifies an address

Example:
ChIJycpqW10a3hQRzhmrPbzuZGU

Responses

200 OK

The request has succeeded

Body
Object
id
string GUID

The updated address identifier

Example:
1a6a85ac-aacf-4175-8de2-a7d701186d96
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
POST /contacts/CAD1E31269B76D7A65ACCE45B2E68DFD/addresses HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "address_type": "BUSINESS",
    "address_line_1": "Elia Papakyriakou",
    "address_line_2": "Tower Star",
    "state_province_county": "Egkomi",
    "town_city": "Nicosia",
    "postal_code": "2000",
    "country_code": "CY",
    "is_primary": true
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "CAD1E31269B76D7A65ACCE45B2E68DFD"
}
Update Contact Address
PUT /contacts/{id}/addresses/{address_id}

Update one of the contact’s existing addresses

Path variables

id
string GUID required

The contact identifier for which an address will be updated

Example:
1a6a85ac-aacf-4175-8de2-a7d701186d96
address_id
string GUID required

The address identifier that will be updated

Example:
cadbf723-fdc6-4598-8156-f6288e61f356

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Request body

Object
address_name
string nullable

A short name for the address allowing it to be easily recognised in a list

Example:
Engomi Office
address_line_1
string nullable

The address line 1

Example:
21 Elia Papakyriakou Street
address_line_2
string nullable

The address line 2

Example:
7 Stars Tower
state_province_county
string nullable

The address state/provice/county

Example:
Engomi
town_city
string nullable

The address town/city

Example:
Nicosia
postal_code
string nullable

The address post code

Example:
2415
country_code
string nullable

The address 3-char country code

Example:
CYP
is_primary
boolean nullable

Defines whether the address is the primary address for the contact

Example:
true
lat
number nullable

The address geolocation latitude

Example:
35.1573573816456
lon
number nullable

The address geolocation longtitude

Example:
33.31386910877576
google_place_id
string nullable

The Google textual identifier that uniquely identifies an address

Example:
ChIJycpqW10a3hQRzhmrPbzuZGU

Responses

200 OK

The request has succeeded

Body
Object
id
string GUID

The updated address identifier

Example:
cadbf723-fdc6-4598-8156-f6288e61f356
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
PUT /contacts/CAD1E31269B76D7A65ACCE45B2E68DFD/addresses/CAD1E31269B76D7A65ACCE45B2E68DFD HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "address_line_1": "Elia Papakyriakou",
    "address_line_2": "Tower Star",
    "state_province_county": "Egkomi",
    "town_city": "Nicosia",
    "postal_code": "2000",
    "country_code": "CY",
    "care_of": "",
    "is_primary": true
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "CAD1E31269B76D7A65ACCE45B2E68DFD"
}
Delete Contact Address
DELETE /contacts/{id}/addresses/{address_id}

Remove an existing address from a specific contact

Path variables

id
string GUID required

The contact id for which an address will be deleted

Example:
1a6a85ac-aacf-4175-8de2-a7d701186d96
address_id
string GUID required

The id of the address to be deleted

Example:
cadbf723-fdc6-4598-8156-f6288e61f356

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 OK

The request has succeeded

400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1

Remove an existing contact address

DELETE /contacts/CAD1E31269B76D7A65ACCE45B2E68DFD/addresses/CAD1E31269B76D7A65ACCE45B2E68DFD HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 
List Contact Addresses
GET /contacts/{id}/addresses

Retrieve all the addresses of a specific contact

Path variables

id
string GUID required

The contact identifier whose addresses will be retrieved

Example:
1a6a85ac-aacf-4175-8de2-a7d701186d96

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 OK

The request has succeeded

Body
Object
content
Array

Address information retrieved

Object
id
string GUID

The address identifier

Example:
8500c80c-1b67-b3c9-6a36-c00611093f58
address_type
string

The address type

Enumeration:
HOME
BUSINESS
address_name
string

A short name allowing the address to be easily recognised in a list

Example:
Engomi Office
address_line_1
string

The address line 1

Example:
21 Elia Papakyriakou Street
address_line_2
string

The address line 2

Example:
7 Stars Tower
state_province_county
string

The address state/provice/county

Example:
Engomi
town_city
string

The address town/city

Example:
Nicosia
postal_code
string

The address post code

Example:
2415
country_code
string

The 3-char country code of the address

Example:
CYP
lat
number

The address geolocation latitude

Example:
35.1573573816456
lon
number

The address geolocation longitude

Example:
33.31386910877576
google_place_id
string

The Google textual identifier that uniquely identifies an address

Example:
ChIJrTLr-GyuEmsRBfy61i59si0
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
GET /contacts/CAD1E31269B76D7A65ACCE45B2E68DFD/addresses HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "content": [
        {
            "id": "4AD9C84FA60F9FE407140E20F707726A",
            "type": "HOME",
            "address_line_1": "Elia Papakyriakou 1",
            "address_line_2": "Tower Star",
            "state_province_county": "Egkomi",
            "town_city": "Nicosia",
            "postal_code": "2000",
            "country_code": "CY",
            "is_primary": "true"
        }
    ]
}
Attachments
POST /contacts/{id}/attachments
DELETE /contacts/{id}/attachments/{attachment_id}
GET /contacts/{id}/attachments
Add Contact Attachment
POST /contacts/{id}/attachments

Upload an attachment for a contact

Path variables

id
string GUID required

The contact (identifier) for which a file will be attached

Example:
6b888b83-b418-752f-604d-0653cf65885d

Notes

FILE UPLOAD FLOW

Integrating file upload for Contacts should be based on the following APIs

  1. Upload file signature
  2. Add Contact Attachment

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Request body

Object
file_id
string GUID required nullable

The file identifier to be attached

Example:
30526723-24a3-e4e3-1a75-b26b1b41f05c
url
string required nullable

The file (URL) to be attached

Example:
https://crm.com
description
string nullable

The file description

Example:
see more details on attached file

Responses

201 Created

The request has succeeded

Body
Object
id
string GUID

The attachment identifier

Example:
8dfc2223-edca-f05d-820b-dc96ba9df2c2
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
POST https://sandbox.crm.com/self-service/v1/contacts/6b888b83-b418-752f-604d-0653cf65885d/attachments HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "file_id": "30526723-24a3-e4e3-1a75-b26b1b41f05c",
    "description": "Image 1"
}

HTTP/1.1 201 Created 

Content-Type: application/json

{
    "id": "8dfc2223-edca-f05d-820b-dc96ba9df2c2"
}
Delete Contact Attachment
DELETE /contacts/{id}/attachments/{attachment_id}

Delete an attachment file for a contact

Path variables

id
string GUID required

The contact (identifier) for which attachment file will be deleted

Example:
6b888b83-b418-752f-604d-0653cf65885d
attachment_id
string required

The attachment file (identifier) to be deleted

Example:
8dfc2223-edca-f05d-820b-dc96ba9df2c2

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

204 No Content

The request has succeeded

400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
DELETE https://sandbox.crm.com/self-service/v2/contacts/6b888b83-b418-752f-604d-0653cf65885d/attachments/8dfc2223-edca-f05d-820b-dc96ba9df2c2 HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 204 No Content 
List Contact Attachments
GET /contacts/{id}/attachments

Retrieve all attachment files for a specific contact

Path variables

id
string GUID required

The contact (identifier) for whom attachment files will be retrieved

Example:
6b888b83-b418-752f-604d-0653cf65885d

Request parameters

sort
string optional

Defines on which attribute the results should be sorted

Allow empty value: true
Examples:
CREATED_DATEUPDATED_DATENAMEPOSTED_DATE
order
string optional

Defines how the results will be ordered

Allow empty value: true
Enumeration:
ASC
DESC
Default:
DESC
page
integer optional

The page number that should be retrieved

Default:
1
Example:
20
size
string optional

The size (total records) of each page

Default:
10
Example:
20

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 OK

The request has succeeded

Body
Object
content
Array
Object

The attachment details

id
string GUID

The attachment identifier

Example:
af748ada-0521-0503-fc25-b67635a7d14d
description
string

The attachment description

Example:
contact's attachement
file
Object

The file details

id
string GUID

The file identifier

Example:
0317868f-28f8-9f56-d248-5a78718b38cc
mime
string

Information about the creative type

Enumeration:
csv
doc
docx
xls
xlsx
pdf
log
txt
png
jpg
jpeg
svg
name
string

The file name

Example:
image1.png
url
string

The file URL endpoint

Example:
https://crm.com
paging
Object

Information that can be used in order to display large pages

page
integer

The page number

Example:
2
size
integer

The number of records per page

Default:
10
Example:
20
total
integer

The total number of records. If “include_total” is not specified, then this total is null. If “include_total” is specified, total has a value but it is accurate up to 10K records.

Example:
1124
has_more
boolean

Shows if there are more records available to fetch

Example:
true
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
GET https://sandbox.crm.com/self-service/v2/contacts/6b888b83-b418-752f-604d-0653cf65885d/attachments HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "content": [
        {
            "id": "af748ada-0521-0503-fc25-b67635a7d14d",
            "file": {
                "id": "0317868f-28f8-9f56-d248-5a78718b38cc",
                "mime": "jpeg",
                "name": "image1.png"
            }
        }
    ],
    "paging": {
        "page": 2,
        "size": 20,
        "total": 1124
    }
}
Devices
POST /contacts/{id}/devices
GET /contacts/{id}/devices
Register Device
POST /contacts/{id}/devices

Register a new device to a specific contact

Path variables

id
string GUID required

The contact (identifier) that will register a device

Example:
cb4e9a83-9ad6-a837-238b-0238d0fa1236

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Request body

Object
serial_number
string nullable

The device’s serial number or device id

Example:
2049-3630
mac_address
string nullable

The device’s MAC address

Example:
00-D0-56-F2-B5-12
electronic_id
string nullable

The device electronic id

Example:
I243WER
platform
string nullable

The device’s operation platform

Enumeration:
MOBILE
BROWSER
OTHER
registration_token
string nullable

The device’s registration token for push notifications

Example:
4e11bef819b8ae9af08d
product_id
string GUID nullable

The product (identifier) that contact brought as his/her own

Example:
7f45ad8a-b164-2a67-eb93-8651c0f1b101
application_id
string GUID nullable

The application identifier that usage will be set

Example:
3a69e9df-ada3-3979-84b9-8b77159e026a

Responses

201 Created

The request has succeeded

Body
Object
id
string GUID

The device identifier

Example:
d94cbb99-dd1a-a696-23e8-ff98402606eb
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
POST https://sandbox.crm.com/self-service/v2/contacts/cb4e9a83-9ad6-a837-238b-0238d0fa1236/devices HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "platform": "BROWSER",
    "mac_address": "00-D0-56-F2-B5-12",
    "serial_number": "2049-3630",
    "registration_token": "4e11bef819b8ae9af08d",
    "product_id": "7f45ad8a-b164-2a67-eb93-8651c0f1b101",
    "application_id": "3a69e9df-ada3-3979-84b9-8b77159e026a",
    "electronic_id": "I243WER"
}

HTTP/1.1 201 Created 

Content-Type: application/json

{
    "id": "d94cbb99-dd1a-a696-23e8-ff98402606eb"
}
List Devices
GET /contacts/{id}/devices

Get a list of devices

Path variables

id
string GUID required

The contact (identifier) whom devices will be retrieved

Example:
679bb0ea-c938-bcb3-3128-5f640d0b9a65

Request parameters

search_value
string optional

Search for devices using their serial number or electronic ID

Example:
serial001
serial_number
string optional

Filter based on serial number

Example:
SN-123-23WE
electronic_id
string optional

Filter based on electronic id

Example:
I243WER
owned_by_contact
boolean optional

Filters only the devices owned/brought by contact

Example:
true
rented_by_contact
boolean optional

Filters only the devices rented by contact

Example:
true
sort
string optional

Defines on which attribute the results should be sorted

Allow empty value: true
Examples:
CREATED_DATEUPDATED_DATENAMEPOSTED_DATE
order
string optional

Defines how the results will be ordered

Allow empty value: true
Enumeration:
ASC
DESC
Default:
DESC
page
integer optional

The page number that should be retrieved

Default:
1
Example:
20
size
string optional

The size (total records) of each page

Default:
10
Example:
20
include_custom_fields
boolean optional

Determines whether custom fields should be retrieved or not

Example:
true
custom_fields
string optional

Filters based on custom fields (key/value set should be semicolon separated)

Example:
key;value;key;value

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 OK

The request has succeeded

Body
Object
content
Array
Object
id
string GUID

The device identifier

Example:
af748ada-0521-0503-fc25-b67635a7d14d
mac_address
string

The device’s MAC address

Example:
00:00:5e:00:53:af
platform
string

The device’s operation platform

Enumeration:
MOBILE
BROWSER
OTHER
serial_number
string

The device’s serial number

Example:
2049-3630
electronic_id
string

The device eletronic id

Example:
I243WER
registration_token
string

The device’s registration token for push notifications

Example:
4e11bef819b8ae9af08d
registration_date
integer epoch

The date that such device was registered by the contact

Example:
1642758418
product
Object

Details about the product that defines such device

id
string GUID

The product’s identifier

Example:
813a27c7-df65-8a6f-fa6a-75d38dc326ec
sku
string

The product’s SKU code

Example:
SKU-001
name
string

The product’s name

Example:
Set-top Box
custom_fields
Array
Object
key
string

The custom field’s unique key

Example:
custom_key
value
string

The custom field’s value

Example:
0001-345
paging
Object

Information that can be used in order to display large pages

page
integer

The page number

Example:
2
size
integer

The number of records per page

Default:
10
Example:
20
total
integer

The total number of records. If “include_total” is not specified, then this total is null. If “include_total” is specified, total has a value but it is accurate up to 10K records.

Example:
1124
has_more
boolean

Shows if there are more records available to fetch

Example:
true
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
GET https://sandbox.crm.com/self-service/v2/contacts/679bb0ea-c938-bcb3-3128-5f640d0b9a65/devices HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "content": [
        {
            "id": "af748ada-0521-0503-fc25-b67635a7d14d",
            "mac_address": "00:00:5e:00:53:af",
            "platform": "BROWSER",
            "serial_number": "2049-3630",
            "registration_token": "4e11bef819b8ae9af08d",
            "registration_date": 1642758418,
            "product": {
                "id": "813a27c7-df65-8a6f-fa6a-75d38dc326ec",
                "sku": "SKU-001",
                "name": "Set-top Box"
            },
            "custom_fields": [
                {
                    "key": "custom_key",
                    "value": "0001-345"
                }
            ],
            "electronic_id": ""
        }
    ],
    "paging": {
        "page": 2,
        "size": 20,
        "total": 1124
    }
}
Organisation Operations
POST /contacts/{id}/organisations
GET /contacts/{id}/organisations
POST /contacts/{id}/preferences
GET /contacts/{id}/preferences
Sign Up/Out Organisation
POST /contacts/{id}/organisations

Sign-up or sign-out a contact from an existing organisation, used in cases where a Service Owner owns a contact registry.

Path variables

id
string GUID required

The contact (registry) id to action

Example:
49144508-5520-48e7-8e64-6a1907afbb26

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Request body

Object
action
string required

The action to be taken

Enumeration:
SIGNUP

Contact requests to sign-up to the organisation

SIGNOFF

Contact requests to sign-off from the organisation

organisation_id
string GUID required

The organisation identifier which the action will be applied

Example:
9086dd6b-2b9f-4fba-85ff-1b89143a56da
accept_terms_&_conditions
boolean nullable

Has the contact has accepted the business terms & conditions? (applicable only if action = SIGNUP)

Default:
true
Example:
true
email_opt_out
boolean nullable

Has the contact opted-out from receiving emails? (applicable only if action = SIGNUP)

Default:
false
Example:
true
sms_opt_out
boolean nullable

Has the contact opted-out from receiving sms? (applicable only if action = SIGNUP)

Default:
false
Example:
true
referral_code
string nullable

The code that will be used for awarding referral events (applicable only if action = SIGNUP)

Example:
IX4B0M
Examples

Responses

200 OK

The request has succeeded

400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
Example 2
POST https://sandbox.crm.com/self-service/v1/contacts/49144508-5520-48e7-8e64-6a1907afbb26/organisations HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "action": "SIGNUP",
    "organisation_id": "9086dd6b-2b9f-4fba-85ff-1b89143a56da",
    "service_acceptance": "true",
    "email_opt_out": "true",
    "sms_opt_out": "true",
    "consent_state": "PENDING",
    "referral_code": "1234"
}

HTTP/1.1 200 OK 
POST https://sandbox.crm.com/self-service/v1/contacts/49144508-5520-48e7-8e64-6a1907afbb26/organisations HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "action": "SIGNOFF",
    "organisation_id": "9086dd6b-2b9f-4fba-85ff-1b89143a56da"
}

HTTP/1.1 200 OK 
Get Contact Organisations
GET /contacts/{id}/organisations

Retrieves all (business) organisations that the contact has signed-up to

Path variables

id
string GUID required

The (registry) contact (identifier) whose joined organisations will be retrieved

Example:
49144508-5520-48e7-8e64-6a1907afbb26

Request parameters

name
string optional

The organisation name (should behave as like)

Example:
Coffee Brew
include_wallet
boolean optional

Whether to include the wallet information of the contact for each organisation

Example:
true
sort
string optional

Defines on which attribute the results should be sorted

Allow empty value: true
Examples:
CREATED_DATEUPDATED_DATENAMEPOSTED_DATE
order
string optional

Defines how the results will be ordered

Allow empty value: true
Enumeration:
ASC
DESC
Default:
DESC
page
integer optional

The page number that should be retrieved

Default:
1
Example:
20
size
string optional

The size (total records) of each page

Default:
10
Example:
20

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 OK

The request has succeeded

Body
Object
content
Array

Response content

Object
id
string GUID

The organisation identifier

Example:
442428dc-c817-41a7-8a3e-b49070696d6f
name
string

The organisation name

Example:
Coffee Brew
creatives
Array

Creatives images for marketing includes the primary image and scaled versions to create a srcset

Object
id
string GUID

The creative identifier

Example:
a3f1f6b3-8d49-3a72-e48e-617dd6004d41
usage_type
string

Information about the creative type

Enumeration:
LOGO
BACKGROUND
MARKETING
ATTACHMENT
width
integer

The creative width

Example:
2159
height
integer

The creative height

Example:
3075
format
string

The creative format

Example:
jpg
url
string

The creative content URL

Example:
https://assets.crm.com/image/offer.jpg
public_id
string

The creative public identifier

Example:
crm-com/image
media
Array

Details about creative transformations

Object
width
integer

The transformed creative width

Example:
200
height
integer

The transformed creative height

Example:
300
url
string

The transformed creative URL

Example:
https://asset.crm.com/image/offer/c_scale,w_200/offer.jpg
wallet
Object

Contact wallet information for the organisation

wallet_id
string GUID

The wallet identifier

Example:
038af54e-282c-40ad-ae5d-cc74f2c80f40
balance
string

Total of the open balance + commerce balance of the wallet

Example:
9.99
currency_code
string

The currency code

Example:
EUR
paging
Object

Information that can be used in order to display large pages

page
integer

The page number

Example:
2
size
integer

The number of records per page

Default:
10
Example:
20
total
integer

The total number of records. If “include_total” is not specified, then this total is null. If “include_total” is specified, total has a value but it is accurate up to 10K records.

Example:
1124
has_more
boolean

Shows if there are more records available to fetch

Example:
true
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
GET https://sandbox.crm.com/self-service/v2/contacts/49144508-5520-48e7-8e64-6a1907afbb26/organisations?include_wallet=true HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "content": [
        {
            "id": "442428dc-c817-41a7-8a3e-b49070696d6f",
            "name": "BrewCoffee",
            "creatives": [
                {
                    "id": "a3f1f6b3-8d49-3a72-e48e-617dd6004d41",
                    "usage_type": "ATTACHMENT",
                    "width": 2159,
                    "height": 3075,
                    "format": "jpg",
                    "url": "https://assets.crm.com/image/offer.jpg",
                    "public_id": "crm-com/image",
                    "media": [
                        {
                            "width": 200,
                            "height": 300,
                            "url": "https://asset.crm.com/image/offer/c_scale,w_200/offer.jpg"
                        }
                    ]
                }
            ]
        }
    ],
    "wallet": {
        "wallet_id": "038af54e-282c-40ad-ae5d-cc74f2c80f40",
        "balance": "9.99",
        "currency_code": "EUR"
    },
    "paging": {
        "page": 2,
        "size": 20,
        "total": 1124
    }
}
Add Contact Preferred Organisation
POST /contacts/{id}/preferences

Set the preferred organisation for a Contact

Path variables

id
string GUID required

The contact (registry) identifier whose preferred organisation will be set

Example:
49144508-5520-48e7-8e64-6a1907afbb26

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Request body

Object
organisation_id
string GUID required

The organisation identifier

Example:
1a6a85ac-aacf-4175-8de2-a7d701186d96
type
string required
Enumeration:
ORDERS
REWARDS

Responses

200 OK
Body
Object
id
string GUID

The contact identifier

Example:
49144508-5520-48e7-8e64-6a1907afbb26
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Get Contact Preferred Organisations
GET /contacts/{id}/preferences

Retrieves the preferred organisations for a Contact

Path variables

id
string GUID required

The contact (registry) identifier whose preferred organisation will be retrieved

Example:
49144508-5520-48e7-8e64-6a1907afbb26

Request headers

Authorization
string optional

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 OK

The request has succeeded

Body
Object
organisations
Array

Preferred organisation information

Object
type
string
Enumeration:
ORDERS
REWARDS
id
string GUID

The organisation identifier

Example:
1a6a85ac-aacf-4175-8de2-a7d701186d96
name
string

The organisation name

Example:
Down Town Burgers
creatives
Array

Creatives images for marketing includes the primary image and scaled versions to create a srcset

Object
id
string GUID

The creative identifier

Example:
a3f1f6b3-8d49-3a72-e48e-617dd6004d41
usage_type
string

Information about the creative type

Enumeration:
LOGO
BACKGROUND
MARKETING
ATTACHMENT
width
integer

The creative width

Example:
2159
height
integer

The creative height

Example:
3075
format
string

The creative format

Example:
jpg
url
string

The creative content URL

Example:
https://assets.crm.com/image/offer.jpg
public_id
string

The creative public identifier

Example:
crm-com/image
media
Array

Details about creative transformations

Object
width
integer

The transformed creative width

Example:
200
height
integer

The transformed creative height

Example:
300
url
string

The transformed creative URL

Example:
https://asset.crm.com/image/offer/c_scale,w_200/offer.jpg
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
GET https://sandbox.crm.com/self-service/v1/contacts/49144508-5520-48e7-8e64-6a1907afbb26/preferences HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "organisations": [
        {
            "type": "ORDERS",
            "id": "49144508-5520-48e7-8e64-6a1907afbb26",
            "name": "Big Boy Burgers",
            "creatives": [
                {
                    "id": "CA123456789AQWSXZAQWS1236547896541",
                    "usage_type": "ATTACHMENT",
                    "width": 2159,
                    "height": 3075,
                    "format": "jpg",
                    "url": "https://assets.crm.com/image/offer.jpg",
                    "public_id": "crm-com/image",
                    "media": [
                        {
                            "width": 200,
                            "height": 300,
                            "url": "https://asset.crm.com/image/offer/c_scale,w_200/offer.jpg"
                        }
                    ]
                }
            ]
        }
    ]
}
Payment Methods
POST /contacts/{id}/payment_methods
PUT /contacts/{id}/payment_methods/{payment_method_id}
DELETE /contacts/{id}/payment_methods/{payment_method_id}
GET /contacts/{id}/payment_methods
Add Payment Method
POST /contacts/{id}/payment_methods

Add a new payment method for a contact. Card, Account Debits and Wallet payment methods are supported.

Path variables

id
string GUID required

The contact identifier for which a payment method will be added

Example:
514e4f18-51c0-4287-b167-265db61a6caf

Notes

JCC Merchant Gateway

  • Perform Fingerprint to retrieve the card masked & hashed numbers and the country of issue
  • Set the retrieved masked number, hashed number and country of issue on the related “card” collection

Settle Gateway

  • Set the phone country code, phone number and msisdn (phone country + number) on the related “phone” collection

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Request body

Object
name
string

A name providing a small description for the payment method. For cases of Wallet payment method types, use the Payment Gateway’s name instead

Example:
PayPal
payment_method_type
string required

The payment method that will be related to the contact

Enumeration:
CARD
WALLET
ACCOUNT_DEBIT
ELECTRONIC_TRANSFER
is_primary
boolean nullable

Mark the payment method as the contact’s primary payment method?

Example:
true
is_backup
boolean nullable

Mark the payment method as the backup payment method?

Example:
false
notes
string nullable

Notes related to te payment method

Example:
Lorem Ipsum
card
Object required nullable

The card details (required and applicable if the payment method is set to CARD)

name
string nullable

The card name

Example:
Default Card
brand
string nullable

The card brand

Example:
VISA
first6
string required nullable

The first 6 digits of the card. Either the card number or the first 6 and last 4 digits must be specified

Example:
424242
last4
string required nullable

The last 4 digits of the card. Either the card number or the first 6 and last 4 digits must be specified

Example:
4242
expiration_month
integer required nullable

The card expiration month

Example:
2
expiration_year
integer required nullable

The card expiration year

Example:
2020
country_of_issue
string nullable

The card issue country (3 char country code)

Example:
CYP
card_holder_details
Object nullable

Information about the card holder

card_holder_name
string required

The name of the card holder

Example:
John Alias Doe
address_line_1
string nullable

The address related to the card

Example:
Elia Papakyriakou
address_line_2
string nullable

Additional address information related to the card

Example:
Tower Stars
address_city
string nullable

The city related to the card

Example:
Nicosia
address_zip
string nullable

The zip code related to the card address

Example:
2000
address_state
string nullable

The state related to the card address

Example:
Egkomi
address_country
string nullable

The country related to the card address

Example:
CYP
use_billing_address
boolean nullable

If set to True, then the card holder’a address is automatically set using the account’s billing address

Example:
true
gateway_token
Array
Object
gateway
string required nullable

The payment gateway that tokenized the card. Applicable only for Payment Gateways implemented within CRM.COM

Enumeration:
JCC
JCC_MERCHANT
SETTLE
CRM_WALLET
integration_id
string required nullable

The payment gateway’s integration identifier which is embeded in the front end

token
string

The tokenised information as this was returned by the payment gateway

wallet
Object nullable

The phone details (required and applicable if the payment method is set to PHONE)

phone_details
Object nullable

Either phone details or email should be specified

name
string

The phone name

Example:
Primary phone
country_code
string required

The phone country code

Example:
00357
number
string

Tthe phone number

Example:
91000000
msisdn
string

The phone msisdn (only country code and phone number, not special characters)

Example:
35791000000
email
string nullable

Either phone details or email should be specified

gateway_token
Array
Object
gateway
string required nullable

The payment gateway that tokenized the card. Applicable only for Payment Gateways implemented within CRM.COM

Enumeration:
JCC
JCC_MERCHANT
SETTLE
CRM_WALLET
integration_id
string required nullable

The payment gateway’s integration identifier which is embeded in the front end

token
string

The tokenised information as this was returned by the payment gateway

account_debit
Object nullable

The bank details (required and applicable if the payment method is set to BANK)

account_name
string
account_number
string nullable

The bank account number. Either the bank account number or IBAN must be specified

Example:
001002001
iban
string required nullable

The IBAN code. Either the bank account number or IBAN must be specified

Example:
SE3550000000054910000003
bank
string nullable

The identifier of the bank

Example:
Barclays
bank_code
string nullable

The bank code

Example:
102491
branch
string nullable

The identifier of the bank branch

Example:
Ascot
swift
string nullable

The bank account swift number

Example:
12345678
sort_code
string nullable
country
string nullable

The country the bank account is located in.

Example:
CY
currency
string

3-character currency code

Example:
EUR
account_type
string
Enumeration:
SAVINGS
CHECKING
BUINESS_CHECKING
mandate
Object
refernece
string
sign_date
integer
type
string

The mandate (sequence) type

Enumeration:
FIRST
RECURRING
FINAL
ONEOFF
account_holder_details
Object
account_holder_name
string
address_line_1
string
address_line_2
string
address_city
string
address_zip
string
address_state
string
address_country
string
use_billing_address
boolean
gateway_token
Array
Object
gateway
string required nullable

The payment gateway that tokenized the card. Applicable only for Payment Gateways implemented within CRM.COM

Enumeration:
JCC
JCC_MERCHANT
SETTLE
CRM_WALLET
integration_id
string required nullable

The payment gateway’s integration identifier which is embeded in the front end

token
string

The tokenised information as this was returned by the payment gateway

Examples

Responses

200 OK

The request has succeeded

Body
Object
id
string GUID

The id of the newly created contact payment method

Example:
b1f06abf-27b0-40e2-bd4e-201b36badf59
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 2
POST https://sandbox.crm.com/self-service/v1/contacts/CAD1E31269B76D7A65ACCE45B2E68DFD/payment_methods HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "name": "PayPal",
    "payment_method_type": "WALLET",
    "is_primary": "true",
    "is_backup": "false",
    "notes": "Lorem Ipsum",
    "card": {
        "name": "Default Card",
        "brand": "VISA",
        "first6": "424242",
        "last4": "4242", 
        "expiration_month": 2,
        "expiration_year": 2020,
        "country_of_issue": "CYP",
        "card_holder_details": {
            "card_holder_name": "John Alias Doe",
            "address_line_1": "Elia Papakyriakou",
            "address_line_2": "Tower Stars",
            "address_city": "Nicosia",
            "address_zip": "2000",
            "address_state": "Egkomi",
            "address_country": "CYP",
            "use_billing_address": "true"
        },
        "gateway_token": [
            {
                "gateway": "SETTLE",
                "integration_id": "",
                "token": ""
            }
        ]
    },
    "wallet": {
        "phone_details": {
            "name": "Primary phone",
            "country_code": "00357",
            "number": "91000000",
            "msisdn": "35791000000"
        },
        "email": "",
        "gateway_token": [
            {
                "gateway": "JCC_MERCHANT",
                "integration_id": "",
                "token": ""
            }
        ]
    },
    "account_debit": {
        "account_name": "",
        "account_number": "001002001",
        "iban": "SE3550000000054910000003",
        "bank": "Barclays",
        "bank_code": "102491",
        "branch": "Ascot",
        "swift": "12345678",
        "sort_code": "",
        "country": "CY",
        "currency": "EUR",
        "account_type": "CHECKING",
        "mandate": {
            "refernece": "",
            "sign_date": 1
        },
        "account_holder_details": {
            "account_holder_name": "",
            "address_line_1": "",
            "address_line_2": "",
            "address_city": "",
            "address_zip": "",
            "address_state": "",
            "address_country": "",
            "use_billing_address": true
        },
        "gateway_token": [
            {
                "gateway": "JCC",
                "integration_id": "",
                "token": ""
            }
        ]
    }
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "CAD1E31269B76D7A65ACCE45B2E68DFD"
}
Update Payment Method
PUT /contacts/{id}/payment_methods/{payment_method_id}

Update an existing payment method for a contact

Path variables

id
string GUID required

The contact identifier whose payment method will be updated

Example:
514e4f18-51c0-4287-b167-265db61a6caf
payment_method_id
string GUID required

The id of the payment method to be updated

Example:
b1f06abf-27b0-40e2-bd4e-201b36badf59

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Request body

Object
name
string nullable

A name providing a small description for the payment method. For cases of Wallet payment method types, use the Payment Gateway’s name instead

Example:
PayPal
is_primary
boolean nullable

Mark the payment method as the contact’s primary payment method?

Example:
true
is_backup
boolean nullable

Mark the payment method as the backup payment method?

Example:
false
notes
string nullable

Any relevant payment method notes

Example:
Lorem Ipsum
Examples

Responses

200 OK

The request has succeeded

Body
Object
id
string GUID

The payment method identifier

Example:
b1f06abf-27b0-40e2-bd4e-201b36badf59
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
PUT https://sandbox.crm.com/self-service/v1/contacts/CAD1E31269B76D7A65ACCE45B2E68DFD/payment_methods/CAD1E31269B76D7A65ACCE45B2E68DFD HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "name": "",
    "is_primary": "true",
    "is_backup": "false",
    "notes": "Lorem Ipsum"
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "CAD1E31269B76D7A65ACCE45B2E68DFD"
}
Remove Payment Method
DELETE /contacts/{id}/payment_methods/{payment_method_id}

Remove an existing payment method for a specific contact

Path variables

id
string GUID required

The id of the contact whose payment method will be removed

Example:
514e4f18-51c0-4287-b167-265db61a6caf
payment_method_id
string GUID required

The id of the payment method to be removed

Example:
b1f06abf-27b0-40e2-bd4e-201b36badf59

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 OK

The request has succeeded

400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
DELETE /contacts/CAD1E31269B76D7A65ACCE45B2E68DFD/payment_methods/CAD1E31269B76D7A65ACCE45B2E68DFD HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 
List Payment Methods
GET /contacts/{id}/payment_methods

Retrieves a list of payment methods for a contact.

Path variables

id
string GUID required

The id of the contact whose payment methods will be retrieved

Example:
514e4f18-51c0-4287-b167-265db61a6caf

Request parameters

type
string optional

Filter using the type of payment method

Enumeration:
CARD
ACCOUNT_DEBIT
WALLET
ELECTRONIC_TRANSFER
Default:
CARD
Example:
CARD
sort
string optional

Defines on which attribute the results should be sorted

Allow empty value: true
Examples:
CREATED_DATEUPDATED_DATENAMEPOSTED_DATE
order
string optional

Defines how the results will be ordered

Allow empty value: true
Enumeration:
ASC
DESC
Default:
DESC
page
integer optional

The page number that should be retrieved

Default:
1
Example:
20
size
string optional

The size (total records) of each page

Default:
10
Example:
20

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 OK

The request has succeeded

Body
Object
content
Array

Information related to the payment methods

Object
id
string GUID

The payment method identifier

Example:
b1f06abf-27b0-40e2-bd4e-201b36badf59
name
string

A name providing a small description for the payment method. For cases of Wallet payment method types, the Payment Gateway’s name is used instead

payment_method_type
string
Enumeration:
CARD
ACCOUNT_DEBIT
WALLET
ELECTRONIC_TRANSFER
Default:
CARD
Example:
CARD
is_primary
boolean

Indicates whether the payment mehod is the contact’s primary payment method

Example:
true
is_backup
boolean

Indicates whether the payment mehod is the contact’s backup oayment method

Example:
false
notes
string

Notes related to the payment method

Example:
Lorem Ipsum
card
Object

The card details (applicable if the payment method is set to CARD)

name
string

The card name

Example:
Default Card
brand
string

The card brand

Example:
VISA
first6
string

The first 6 digits of the card

Example:
42424242
last4
string

The last 4 digits of the card

Example:
4242
country_of_issue
string

3 char country code

Example:
CYP
expiration_month
integer

The card expiration month

Example:
6
expiration_year
integer

The card expiration year

Example:
2021
card_holder_details
Object

Information about the card holder

card_holder_name
string

The name of the card holder

Example:
John Alias Doe
address_line_1
string

The address related to the card

Example:
Elia Papakyriakou
address_line_2
string

Additional address information related to the card

Example:
Tower Stars
address_city
string

The city related to the card

Example:
Nicosia
address_zip
string

The zip code related to the card address

Example:
2000
address_state
string

The state related to the card address

Example:
Egkomi
address_country
string

The country related to the card address

Example:
CY
gateway_token
Array
Object
gateway
string nullable

Legacy payment gateways

Enumeration:
JCC
JCC_MERCHANT
SETTLE
integration
Object nullable

Th epayment gateway integration information

id
string

Integration unique identifier

name
string

Integration name

Example:
PayPal
token
string required

The token of the payment method as this was generated by the payment gateway

wallet
Object

The phone details (applicable if the payment method is set to PHONE)

phone
Object nullable

Applicable only for Settle Payment Gateway

name
string
country_code
string
number
string
msisdn
string
email
string nullable

Applicable only for Settle Payment Gateway

gateway_token
Array
Object
gateway
string nullable

Legacy payment gateways

Enumeration:
JCC
JCC_MERCHANT
SETTLE
integration
Object nullable

Th epayment gateway integration information

id
string

Integration unique identifier

name
string

Integration name

Example:
PayPal
token
string required

The token of the payment method as this was generated by the payment gateway

account_debit
Object

The bank details (applicable if the payment method is set to BANK)

account_name
string

The account name

Example:
John Doe
account_number
string

The bank account number. Either the bank account number or IBAN must be specified

Example:
001002001
iban
string

The IBAN code. Either the bank account number or IBAN must be specified

Example:
SE3550000000054910000003
bank
string

The identifier of the bank

Example:
Barclays
bank_code
string
branch
string

The identifier of the bank branch

Example:
Ascot
swift
string

The bank account swift number

Example:
12345678
sort_code
string

The bank sort code

Example:
102491
country
string

The country the bank account is located in.

Example:
CY
currency
string
Example:
EUR
account_type
string
Enumeration:
SAVINGS
CHECKING
BUSINESS_CHECKING
mandate
Object
reference
string
sign_date
string
type
string

The mandate (sequence) type

Enumeration:
FIRST
FINAL
RECURRING
ONEOFF
account_holder_details
Object
account_holder_name
string
address_line_1
string
address_line_2
string
address_city
string
address_zip
string
address_state
string
address_country
string
gateway_token
Array
Object
gateway
string nullable

Legacy payment gateways

Enumeration:
JCC
JCC_MERCHANT
SETTLE
integration
Object nullable

Th epayment gateway integration information

id
string

Integration unique identifier

name
string

Integration name

Example:
PayPal
token
string required

The token of the payment method as this was generated by the payment gateway

paging
Object

Information that can be used in order to display large pages

page
integer

The page number

Example:
2
size
integer

The number of records per page

Default:
10
Example:
20
total
integer

The total number of records. If “include_total” is not specified, then this total is null. If “include_total” is specified, total has a value but it is accurate up to 10K records.

Example:
1124
has_more
boolean

Shows if there are more records available to fetch

Example:
true
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
GET https://sandbox.crm.com/self-service/v1/contacts/CAD1E31269B76D7A65ACCE45B2E68DFD/payment_methods HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "content": [ 
        {
            "id": "CAD1E31269B76D7A65ACCE45B2E68DFD",
            "name": "",
            "payment_method_type": "CARD",
            "is_primary": "true",
            "is_backup": "false",
            "notes": "Lorem Ipsum",
            "card": {
                "name": "Default Card",
                "brand": "VISA",
                "first6": "42424242",
                "last4": "4242",
                "country_of_issue": "CYP",
                "expiration_month": 6,
                "expiration_year": 2021,
                "card_holder_details": {
                    "card_holder_name": "John Alias Doe",
                    "address_line_1": "Elia Papakyriakou",
                    "address_line_2": "Tower Stars",
                    "address_city": "Nicosia",
                    "address_zip": "2000",
                    "address_state": "Egkomi",
                    "address_country": "CY"
                },
                "gateway_token": [
                    {
                        "gateway": "JCC_MERCHANT",
                        "integration": {
                            "id": "",
                            "name": "PayPal"
                        },
                        "token": ""
                    }
                ]
            },
            "wallet": {
                "phone": {
                    "name": "",
                    "country_code": "",
                    "number": "",
                    "msisdn": ""
                },
                "email": "",
                "gateway_token": [
                    {
                        "gateway": "JCC_MERCHANT",
                        "integration": {
                            "id": "",
                            "name": "PayPal"
                        },
                        "token": ""
                    }
                ]
            },
            "account_debit": {
                "account_name": "John Doe",
                "account_number": "001002001",
                "iban": "SE3550000000054910000003",
                "bank": "Barclays",
                "bank_code": "",
                "branch": "Ascot",
                "swift": "12345678",
                "sort_code": "102491",
                "country": "CY",
                "currency": "EUR",
                "account_type": "SAVINGS",
                "mandate": {
                    "reference": "",
                    "sign_date": ""
                },
                "account_holder_details": {
                    "account_holder_name": "",
                    "address_line_1": "",
                    "address_line_2": "",
                    "address_city": "",
                    "address_zip": "",
                    "address_state": "",
                    "address_country": ""
                },
                "gateway_token": [
                    {
                        "gateway": "JCC",
                        "integration": {
                            "id": "",
                            "name": "PayPal"
                        },
                        "token": ""
                    }
                ]
            }
        }
    ],
    "paging": {
        "page": 2,
        "size": 20,
        "total": 1124
    }
}
Communities
POST /contacts/{id}/switch
POST /contacts/{id}/people
PUT /contacts/{id}/people/{people_id}
DELETE /contacts/{id}/people/{people_id}
GET /contacts/{id}/people
Contact Switch
POST /contacts/{id}/switch

Switch a contact to another contact that is related to, being part of such contact’s community

Path variables

id
string GUID required

The related contact (identifier) that will be switched to

Example:
0362aa5b-4438-deb0-b56b-1974f6a27c7f

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 OK

The request has succeeded

Body
Object
access_token
string

The token that can be used in subsequent API calls

Example:
eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhMjc4ZDNlNS05YjhlLTQzNmUtOTIzMC03MGYzZTJkZjFjYTUiLCJleHAiOjE1Njg1NTQxMjJ9.LemqPPThkqfakkKS6CdkNvV1Lnc88CWirEpHOPnWjJPQz02zgkKSwfbvrEsl3OmR2LUhDILsOXf4x-GPFmNJCg
refresh_token
string

The token that can be used to generate a new access token (when previous is expired)

Example:
eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhMjc4ZDNlNS05YjhlLTQzNmUtOTIzMC03MGYzZTJkZjFjYTUiLCJleHAiOjE1Njg1NTQxMjJ9.LemqPPThkqfakkKS6CdkNvV1Lnc88CWirEpHOPnWjJPQz02zgkKSwfbvrEsl3OmR2LUhDILsOXf4x-GPFmNJCg
expiration_date
string epoch

The token expiration date

Example:
1572530655
contact
Object

The authorised contact details

id
string GUID

The contact’s identifier

Example:
2f2f9afe-4399-59b7-cbb8-da18c2255064
first_name
string

The contact’s first name

Example:
John
last_name
string

The contact’s last name

Example:
Doe
is_verified
boolean

Defines whether the used identity is verified

Example:
false
organisations
Array

Details about the organisations that the contact has joined

Object
id
string GUID

The organisation identifier

Example:
QWERTY12345671234567324ETFTGBY78
type
string

The organisation type

Enumeration:
SERVICE_OWNER
ORGANISATION
name
string

The organisation name

Example:
CRMdotCOM
communities
Array

Details about the contact communities that the contact is a member of

Object
id
string GUID

The contact identifier

Example:
be4113e5-0fb5-7116-7d48-6901a6f7ddad
name
string

The contact name

Example:
CRM-NIC
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
POST https://sandbox.crm.com/self-service/v2/contacts/0362aa5b-4438-deb0-b56b-1974f6a27c7f/switch HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "access_token": "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhMjc4ZDNlNS05YjhlLTQzNmUtOTIzMC03MGYzZTJkZjFjYTUiLCJleHAiOjE1Njg1NTQxMjJ9.LemqPPThkqfakkKS6CdkNvV1Lnc88CWirEpHOPnWjJPQz02zgkKSwfbvrEsl3OmR2LUhDILsOXf4x-GPFmNJCg",
    "refresh_token": "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhMjc4ZDNlNS05YjhlLTQzNmUtOTIzMC03MGYzZTJkZjFjYTUiLCJleHAiOjE1Njg1NTQxMjJ9.LemqPPThkqfakkKS6CdkNvV1Lnc88CWirEpHOPnWjJPQz02zgkKSwfbvrEsl3OmR2LUhDILsOXf4x-GPFmNJCg",
    "expiration_date": "1572530655",
    "contact": {
        "id": "2f2f9afe-4399-59b7-cbb8-da18c2255064",
        "first_name": "John",
        "last_name": "Doe",
        "is_verified": "false"
    },
    "organisations": [
        {
            "id": "QWERTY12345671234567324ETFTGBY78",
            "type": "ORGANISATION",
            "name": "CRMdotCOM"
        }
    ],
    "relationships": [
        {
            "id": "be4113e5-0fb5-7116-7d48-6901a6f7ddad",
            "name": "CRM-NIC"
        }
    ]
}
Add Community Person
POST /contacts/{id}/people

Add a new person to a contact’s community

Path variables

id
string GUID required

The contact (identifier) whose community will be updated by adding a new person

Example:
41531d41-2a77-fc41-5643-d84dfbefc1ff

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Request body

Object
email
string required nullable

Invite a contact using an email address (email or phone should be specified)

Example:
johndoe@crm.com
phone
Object required nullable

Invite a contact using a phone (email or phone should be specified)

country_code
string required

The phone country code

Example:
CYP
number
string required

The phone number

Example:
99123456
relation_id
string GUID required

The community relation (identifier) that will be assigned to the new contact member

Example:
ce27a6f8-bb1c-ee1a-d0ab-292ba154d8e4
is_admin
boolean required nullable

Defines whether the new contact member will have full permissions

permissions
Array required nullable

Defines the (explicit) allowed permissions that the new contact member will have

string
Example:
VIEW_CONTACTS

Responses

201 Created

The request has succeeded

Body
Object
id
string GUID

The community relation identifier

Example:
ccc945d8-1bda-a11c-d378-23c29947c2a3
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
POST https://sandbox.crm.com/self-service/v2/contacts/people HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "email": "johndoe@crm.com",
    "contact_group_id": "ce27a6f8-bb1c-ee1a-d0ab-292ba154d8e4"
}

HTTP/1.1 201 Created 

Content-Type: application/json

{
    "id": "ccc945d8-1bda-a11c-d378-23c29947c2a3"
}
Update Community Person
PUT /contacts/{id}/people/{people_id}

Update an existing person in a contact’s community

Path variables

id
string GUID required

The contact (identifier) whose community will be updated

Example:
ccc945d8-1bda-a11c-d378-23c29947c2a3
people_id
string GUID required

The community person (identifier) that will be updated

Example:
ccc945d8-1bda-a11c-d378-23c29947c2a3

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Request body

Object
relation_id
string GUID nullable

The community relation (identifier) that will be assigned to the existing contact member

Example:
ce27a6f8-bb1c-ee1a-d0ab-292ba154d8e4
is_admin
boolean nullable

Defines whether the existing contact member will have full permissions

Example:
false
permissions
Array nullable

Defines the (explicit) allowed permissions that the existing contact member will have

string
Example:
VIEW_CONTACTS

Responses

200 OK

The request has succeeded

Body
Object
id
string GUID

The community relation identifier

Example:
ccc945d8-1bda-a11c-d378-23c29947c2a3
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
PUT https://sandbox.crm.com/self-service/v2/contacts/ccc945d8-1bda-a11c-d378-23c29947c2a3/people/ccc945d8-1bda-a11c-d378-23c29947c2a3 HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "relation_id": "ce27a6f8-bb1c-ee1a-d0ab-292ba154d8e4",
    "is_admin": "false",
    "permissions": [
        "VIEW_CONTACTS"
    ]
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "ccc945d8-1bda-a11c-d378-23c29947c2a3"
}
Delete Community Person
DELETE /contacts/{id}/people/{people_id}

Delete an existing person from a contact’s community

Path variables

id
string GUID required

The contact (identifier) whose community will be updated, by removing an existing member

Example:
5096c4d4-c387-9888-d631-80e74546e2db
people_id
string GUID required

The community person (identifier) that will be deleted

Example:
ccc945d8-1bda-a11c-d378-23c29947c2a3

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

204 No Content

The request has succeeded

400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
DELETE https://sandbox.crm.com/self-service/v2/contacts/5096c4d4-c387-9888-d631-80e74546e2db/people/ccc945d8-1bda-a11c-d378-23c29947c2a3 HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 204 No Content 
List Community People
GET /contacts/{id}/people

Lists all people that a contact’s community has

Path variables

id
string GUID required

The contact (identifier) whose community people will be retrieved

Example:
323a12a6-90e4-fa30-caa4-63e9552ffb10

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 OK

The request has succeeded

Body
Object
content
Array
Object
id
string GUID

The contact member relation identifier

Example:
8ba91f97-fcd2-1ac8-0584-d1210c67e8ef
contact
Object

The contact member

id
string GUID

The contact identifier

Example:
b22e6e44-2c3c-af17-27ac-bacad6cf7181
first_name
string

The contact first name

Example:
John
last_name
string

The contact last name

Example:
Doe
email
string

The contact email address

Example:
johndoe@crm.com
phone
Object

The contact phone

country_code
string

The phone country code

Example:
CYP
number
string

The phone number

Example:
99123456
relation
Object

The community relation that the contact has

id
string GUID

The community relation identifier

Example:
4a0bef80-a03d-3fb4-3c79-72c356e77813
name
string

The community relation name

Example:
Employees
is_admin
boolean

Defines whether the contact member will have full permissions

Example:
false
permissions
Array

Defines the (explicit) allowed permissions that the new contact member will have

string
Example:
VIEW_CONTACTS
paging
Object

Information that can be used in order to display large pages

page
integer

The page number

Example:
2
size
integer

The number of records per page

Default:
10
Example:
20
total
integer

The total number of records. If “include_total” is not specified, then this total is null. If “include_total” is specified, total has a value but it is accurate up to 10K records.

Example:
1124
has_more
boolean

Shows if there are more records available to fetch

Example:
true
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
GET https://sandbox.crm.com/self-service/v2/contacts/323a12a6-90e4-fa30-caa4-63e9552ffb10/people HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "content": [
        {
            "id": "8ba91f97-fcd2-1ac8-0584-d1210c67e8ef",
            "contact": {
                "id": "b22e6e44-2c3c-af17-27ac-bacad6cf7181",
                "first_name": "John",
                "last_name": "Doe",
                "email": "johndoe@crm.com",
                "phone": {
                    "country_code": "CYP",
                    "number": "99123456"
                }
            },
            "relation": {
                "id": "4a0bef80-a03d-3fb4-3c79-72c356e77813",
                "name": "Employees"
            },
            "is_admin": "false",
            "permissions": [
                "VIEW_CONTACTS"
            ]
        }
    ],
    "paging": {
        "page": 2,
        "size": 20,
        "total": 1124
    }
}
Phones
POST /contacts/{id}/phones
PUT /contacts/{id}/phones/{phone_id}
DELETE /contacts/{id}/phones/{phone_id}
GET /contacts/{id}/phones
Add Contact Phone
POST /contacts/{id}/phones

Add a new phone to an existing contact. A contact can have multiple phones

Path variables

id
string GUID required

The contact (id) for which a phone will be added

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Request body

Object
phone_type
string required

The phone type that should be added

Enumeration:
LANDLINE
MOBILE
number
string required

The phone number

Example:
91000000
country_code
string required nullable

The country that the phone is registered to

Example:
CYP
is_primary
boolean nullable

Defines whether the phone will be the primary one

Example:
true
verification_required
boolean

Defines whether phone verification process must be triggered

Example:
true

Responses

200 OK

The request has succeeded

Body
Object
id
string GUID

The phone number record identifier

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
POST /contacts/CAD1E31269B76D7A65ACCE45B2E68DFD/phones HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "phone_type": "MOBILE",
    "is_primary": true,
    "number": "91000000",
    "country_code": "CY"
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "CAD1E31269B76D7A65ACCE45B2E68DFD"
}
Update Contact Phone
PUT /contacts/{id}/phones/{phone_id}

Update an existing phone form an existing contact

Path variables

id
string GUID required

The contact (id) for which a phone should be updated

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
phone_id
string GUID required

The phone identifier that should be updated

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Request body

Object
is_primary
boolean nullable

Defines whether the phone will be the primary one

Example:
true
number
string required

The phone number

Example:
91000000
country_code
string required nullable

The country that the phone is registered to

Example:
CY
verification_required
boolean

Defines whether phone verification process must be triggered

Example:
true

Responses

200 OK

The request has succeeded

Body
Object
id
string GUID

The phone number record identifier

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
PUT /contacts/CAD1E31269B76D7A65ACCE45B2E68DFD/phones/CAD1E31269B76D7A65ACCE45B2E68DFD HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "is_primary": true,
    "number": "91000000",
    "country_code": "CY"
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "CAD1E31269B76D7A65ACCE45B2E68DFD"
}
Remove Contact Phone
DELETE /contacts/{id}/phones/{phone_id}

Removes a contact phone. A single phone can be removed at a time

Path variables

id
string GUID required

The contact (id) for which a phone should be deleted

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
phone_id
string GUID required

The phone identifier that should be deleted

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 OK

The request has succeeded

400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
DELETE /contacts/CAD1E31269B76D7A65ACCE45B2E68DFD/phones/CAD1E31269B76D7A65ACCE45B2E68DFD HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 
List Contact Phones
GET /contacts/{id}/phones

Retrieves phones of an existing contact

Path variables

id
string GUID required

The contact ID for which the phones will be retrieved

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 OK

The request has succeeded

Body
Object
content
Array
Object
id
string GUID

The phone identifier

Example:
6c38316b-d871-a01e-afbb-d6bca3b27b01
phone_type
string

The phone type that should be added

Enumeration:
LANDLINE
MOBILE
is_primary
boolean

Defines whether the phone will be the primary one

Example:
true
number
string

The phone number

Example:
91000000
country_code
string

The country that the phone is registered to

Example:
CY
is_verified
boolean

Defines whther the phone has been verified with one-time-password

Example:
true
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
GET /contacts/CAD1E31269B76D7A65ACCE45B2E68DFD/phones HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "content": [
        {
            "id": "fab9c379-d6b3-0162-8ac1-ca0bfe0c2f1e",
            "phone_type": "LANDLINE",
            "is_primary": "true",
            "number": "91000000",
            "country_code": "CY"
        }
    ]
}
Statement
POST /contacts/{id}/export_statement
Export Statement
POST /contacts/{id}/export_statement

Request (and retrieve) a contact statement

Path variables

id
string GUID required

The contact (identifier) that statement actions will be applied

Example:
b2490476-fc6b-604c-e3f9-5ddd0777efbe

Notes

STATEMENT FLOW

Integrating statement export for Contacts should be based on the following APIs

  1. Statement
  2. Get (Statement) File

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Request body

Object
format
string required

Defines the format on which the statement will be exported to

Enumeration:
PDF

Statement(s) will be generated as pdf(s)

EMAIL

Statement(s) will be sent to the contact’s email address

account_id
string GUID nullable

The account (identifier) based on which statement will be generated (if not specified, then for each account a statement will be generated)

Example:
4c0ea630-2972-7714-a5d1-7576b8dc9c22
from_month
integer required

Statement period starting month

Example:
12
to_month
integer required

Statement period starting year

Example:
12
from_year
integer required

Statement period ending month

Example:
2021
to_year
integer required

Statement period ending year

Example:
2022

Responses

201 Created

The request has succeeded (applicable if statement will be pdf based)

Body
Object
id
string GUID

The statement identifier that will be exported

Example:
1fc220c8-41c5-87db-3eae-3020e7e976c9
204 No Content

The request has succeeded (applicable if statement will be EMAIL based)

400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
POST https://sandbox.crm.com/self-service/v2/contacts/b2490476-fc6b-604c-e3f9-5ddd0777efbe/export_statement HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "format": "PDF",
    "account_id": "4c0ea630-2972-7714-a5d1-7576b8dc9c22",
    "from_month": 12,
    "to_month": 12,
    "from_year": 2021,
    "to_year": 2022
}

HTTP/1.1 201 Created 

Content-Type: application/json

{
    "id": "1fc220c8-41c5-87db-3eae-3020e7e976c9"
}
Tokens
POST /contacts/{id}/tokens
GET /contacts/{id}/tokens
Request Contact Token
POST /contacts/{id}/tokens

Request to create a contact token

Path variables

id
string GUID required

The id of the contact to create a token for

Example:
33749faa-4ef0-426d-f9f0-83b91bf5ab3f

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Request body

Object
intent
string required

The intent for which such token is requested

Enumeration:
SPEND
spend_amount
number nullable

The amount requested to be spent. If not specified, then spend as much as possible (applicable if intent = SPEND)

Example:
14.52

Responses

200 OK

The request has succeeded

Body
Object
id
string GUID

The contact token identifier

Example:
0b2f69e7-a9a6-2e6f-b1f2-0a643d9ca6b7
value
string

The requested token

Example:
123456
expiration
integer epoch

The token expiration date

Example:
1596714307
spend_amount
number

The requested spend amount (if not specified will return null)

Example:
2.21
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
POST https://sandbox.crm.com/self-service/v1/contacts/33749faa-4ef0-426d-f9f0-83b91bf5ab3f/tokens HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "intent": "SPEND",
    "spend_amount": 14.52
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "0b2f69e7-a9a6-2e6f-b1f2-0a643d9ca6b7",
    "value": "123456",
    "expiration": 1596714307
}
List Contact Tokens
GET /contacts/{id}/tokens

List all contact tokens for a specific contact

Path variables

id
string GUID required

The id of the contact whose tokens will be retrieved

Example:
33749faa-4ef0-426d-f9f0-83b91bf5ab3f

Request parameters

intent
string optional

Filter based on the intent that tokens were requested

Enumeration:
SPEND

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 OK

The request has succeeded

Body
Object
content
Array
Object
id
string GUID

The contact token identifier

Example:
0b2f69e7-a9a6-2e6f-b1f2-0a643d9ca6b7
value
string

The contact token value

Example:
123456
expiration
integer epoch

The contact token expiration date

Example:
1596714307
spend_amount
number

The amount requested to be spent

Example:
1.99
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
GET https://staging.crm.com/self-service/v1/contacts/33749faa-4ef0-426d-f9f0-83b91bf5ab3f/tokens HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "content": [
        {
            "id": "0b2f69e7-a9a6-2e6f-b1f2-0a643d9ca6b7",
            "value": "123456",
            "expiration": 1596714307
        }
    ]
}
Identities
POST /contacts/{id}/identities
POST /contacts/{id}/identities/{identity_id}/change_username
PUT /contacts/{id}/identities/{identity_id}/change_username
PUT /contacts/{id}/identities/{identity_id}/change_password
GET /contacts/{id}/identities
Add Contact Identity
POST /contacts/{id}/identities

Create a new identity for a contact

Path variables

id
string GUID required

The contact (identifier) whose a new identity will be created

Example:
1a6a85ac-aacf-4175-8de2-a7d701186d96

Request headers

Authorization
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Request body

Object
provider
string required

The contact’s identity provider

Enumeration:
EMAIL
FACEBOOK
GOOGLE
MW4

CRM.COM auth server

PHONE
email
string required nullable

The contact’s email, (required for email/password or email/OTP verification). If password is not provided then an OTP request is triggered.

Example:
johndoe@crm.com
password
string required nullable

The contact’s password (required if OTP is not supported)

Example:
1123123rerwr
phone
Object required nullable

The contact’s phone, (required for phone/password or phone/OTP verification). If password is not provided then an OTP request is triggered.

country_code
string required

The phone country code

Example:
CYP
number
string required

The phone number

Example:
99123456
application_id
string required nullable

Applicable if using Facebook credentials

Example:
sdfsdfsdfwef
token
string required nullable

The access token returned from the OAuth service provider (required for Facebook and Google authorisation)

Example:
YOJDAKEb9l1U0sUzrskM6X4emzrSeXqb

Responses

201 Created

The request has succeeded

Body
Object
id
string GUID

The contact identity identifier

Example:
1a6a85ac-aacf-4175-8de2-a7d701186d96
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
POST https://sandbox.crm.com/self-service/v2/contacts/1a6a85ac-aacf-4175-8de2-a7d701186d96/identities HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "provider": "EMAIL",
    "email": "johndoe@crm.com",
    "password": "1123123rerwr"
}

HTTP/1.1 201 Created 

Content-Type: application/json

{
    "id": "1a6a85ac-aacf-4175-8de2-a7d701186d96"
}
Request Username Change
POST /contacts/{id}/identities/{identity_id}/change_username

Request username change for a contact’s identity

Path variables

id
string GUID required

The contact (identifier) who requested to change username

Example:
ec23261f-cde9-0671-ec41-6db9acf4d9c5
identity_id
string GUID required

The contact identity (identifier) that its username will be changed

Example:
6627f691-461e-5754-7349-1680376b7bb1

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

204 No Content

The request has succeeded

400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
POST https://sandbox.crm.com/self-service/v2/contacts/ec23261f-cde9-0671-ec41-6db9acf4d9c5/identities/6627f691-461e-5754-7349-1680376b7bb1/change_username HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 204 No Content 
Change Username
PUT /contacts/{id}/identities/{identity_id}/change_username

Changes the username for a contact’s identity

Path variables

id
string GUID required

The contact (identifier) who requested to change username

Example:
ec23261f-cde9-0671-ec41-6db9acf4d9c5
identity_id
string GUID required

The contact identity (identifier) that its username will be changed

Example:
6627f691-461e-5754-7349-1680376b7bb1

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Request body

Object
username
Object required

The (new) username that will be set (email or phone should be specified)

email
string required nullable

The contact’s (new) email that will be used as username

Example:
j_doe@crm.com
phone
Object required nullable

The contact’s (new) phone that will be used as username

country_code
string required

The phone country code

Example:
CYP
number
string required

The phone number

Example:
99654321
password
string required nullable

The contact’s (current) password that will be used for verification (required only if contact identity is password based)

Example:
123456
otp
string required nullable

The contact’s (temp) OTP that will be used for verification (required only if contact identity is OTP based)

Example:
123456

Responses

200 OK

The request has succeeded

Body
Object
auth_otp
string

The one time password auth id

Example:
731e4023-4c04-4278-8eb5-240651317e46
obfuscated_value
string

The obfuscated send method value

Example:
john****@gmail.com
204 No Content

The request has succeeded

400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
PUT https://sandbox.crm.com/self-service/v2/contacts/ec23261f-cde9-0671-ec41-6db9acf4d9c5/change_username HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "username": {
        "email": "j_doe@crm.com"
    },
    "otp": "123456"
}

HTTP/1.1 200 OK 
Change Password
PUT /contacts/{id}/identities/{identity_id}/change_password

Changes a contact’s password (contact should be already signed-in to an application in order to perform such action)

Path variables

id
string GUID required

The contact (identifier) whose password will be changed

Example:
0980af1d-3c24-6379-9eb9-a40e3a3f5208
identity_id
string GUID required

The contact identity (identifier) which will be changed

Example:
828a78b4-04a4-e6e6-5ba9-f9f3e668e3ac

Request headers

Authorization
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Request body

Object
password
string required

The new password

Example:
Crm.com1999!

Responses

204 No Content

The request has succeeded

400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
PUT https://sandbox.crm.com/self-service/v2/contacts/0980af1d-3c24-6379-9eb9-a40e3a3f5208/identities/828a78b4-04a4-e6e6-5ba9-f9f3e668e3ac/change_password HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "password": "Crm.com1999!"
}

HTTP/1.1 204 No Content 
List Contact Identities
GET /contacts/{id}/identities

Retrieve a list of contact identities based on search criteria (e.g. all contact identities)

Path variables

id
string GUID required

The contact (identifier) whose identities will be retrieved

Example:
939a41e4-2410-171b-2ae5-ee7fdc255d34

Request parameters

sort
string optional

Defines on which attribute the results should be sorted

Allow empty value: true
Examples:
CREATED_DATEUPDATED_DATENAMEPOSTED_DATE
order
string optional

Defines how the results will be ordered

Allow empty value: true
Enumeration:
ASC
DESC
Default:
DESC
page
integer optional

The page number that should be retrieved

Default:
1
Example:
20
size
string optional

The size (total records) of each page

Default:
10
Example:
20

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 OK

The request has succeeded

Body
Object
content
Array
Object
id
string GUID

The contact identity identifier

Example:
5555acf1-5bed-eeac-e104-389fb053c34b
type
string

The contact identity type

Enumeration:
EMAIL_PASSWORD
EMAIL_OTP
PHONE_OTP
email
string

The contact identity email (if supported)

Example:
johndoe@crm.com
phone
Object

The contact identity phone (if supported)

country_code
string

The phone country code

Example:
CYP
number
string

The phone number

Example:
99000000
paging
Object

Information that can be used in order to display large pages

page
integer

The page number

Example:
2
size
integer

The number of records per page

Default:
10
Example:
20
total
integer

The total number of records. If “include_total” is not specified, then this total is null. If “include_total” is specified, total has a value but it is accurate up to 10K records.

Example:
1124
has_more
boolean

Shows if there are more records available to fetch

Example:
true
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
GET https://sandbox.crm.com/self-service/v2/contacts/939a41e4-2410-171b-2ae5-ee7fdc255d34/identities HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "content": [
        {
            "id": "5555acf1-5bed-eeac-e104-389fb053c34b",
            "type": "PHONE_OTP",
            "phone": {
                "country_code": "CYP",
                "number": "99000000"
            }
        }
    ],
    "paging": {
        "page": 2,
        "size": 20,
        "total": 1124
    }
}
Contact Accounts

Group of various operations that can be performed on a contact’s account. The account consolidates the contact’s financial transactions such as Invoice and Payments. A contact owns multiple accounts each account having a different currency. Per contact, there’s a single account marked as the primary one

POST /contacts/{id}/accounts
GET /contacts/{id}/accounts
GET /accounts/{id}/
PUT /accounts/{id}
GET /accounts/{id}/journals
GET /journals/{id}/
Add Account for Contact
POST /contacts/{id}/accounts

Add a new account for an existing contact. If the contact has other accounts too, then the newly created account must use a different currency. Only one of the contact’s accounts can be set as the primary account.

Path variables

id
string GUID required

The contact identifier for which a new account will be added

Example:
4dc0809f-ed91-4b68-b912-5bd6064d901e

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Request body

Object
is_primary
boolean nullable

If set to true, then the new account will be set as the primary one, thus removing the indictor from another account

Default:
false
Example:
false
currency_code
string required
Min length: 3
Max length: 3
Pattern: 3-letter ISO 4217 currency code.
Example:
EUR
classification_id
string GUID nullable

The account’s classification identifier

Example:
4dc0809f-ed91-4b68-b912-5bd6064d901e
billing_address_id
string GUID nullable

The unique id of a contact address which will be set as the billing address of the account

Example:
b1f06abf-27b0-40e2-bd4e-201b36badf59
Examples

Responses

201 Created

The response succeeded

Body
Object
id
string GUID

The id of the newly created account

Example:
a8008e06-48d4-4bd0-961c-a917fcf10a7f
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
POST https://sandbox.crm.com/self-service/v1/contacts/4dc0809f-ed91-4b68-b912-5bd6064d901e/accounts HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "is_primary": "false",
    "currency_code": "EUR",
    "classification_id": "4dc0809f-ed91-4b68-b912-5bd6064d901e",
    "billing_address_id": "4dc0809f-ed91-4b68-b912-5bd6064d901e"
}

HTTP/1.1 201 Created 

Content-Type: application/json

{
    "id": "4dc0809f-ed91-4b68-b912-5bd6064d901e"
}
List Contact Accounts
GET /contacts/{id}/accounts

Retrieve a list of accounts for a Contact. Normally a contact will have a single account but multiple accounts can be used to service different currencies, or different spending profiles. All accounts of a contact are returned by default, including any terminated ones.

Path variables

id
string GUID required

The id of the contact whose accounts will be retrieved

Example:
4dc0809f-ed91-4b68-b912-5bd6064d901e

Request parameters

sort
string optional

Defines on which attribute the results should be sorted

Allow empty value: true
Examples:
CREATED_DATEUPDATED_DATENAMEPOSTED_DATE
order
string optional

Defines how the results will be ordered

Allow empty value: true
Enumeration:
ASC
DESC
Default:
DESC
page
integer optional

The page number that should be retrieved

Default:
1
Example:
20
size
string optional

The size (total records) of each page

Default:
10
Example:
20
is_primary
string optional

If set to true, then only the primary account of the contact will get retrieved

Default:
false
Example:
true
state
array of Account State (Enum) optional

Filter accounts based on whether they are Active, Suspended and or Terminated. If not specified then all contact accounts are retrieved, even terminated ones.

Collection format: csv
Example:
[
    "ACTIVE"
]

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 OK

The request has succeeded

Body
Object
content
Array
Object
id
string

The unique identifier of the account

Example:
4dc0809f-ed91-4b68-b912-5bd6064d901e
is_primary
boolean

Identifies whether the account is the primary account of the contact

Example:
true
name
string

The account name

Example:
AC123456 John Smith
number
string

The account number

Example:
AC123456
state
string
Enumeration:
ACTIVE

Contact is able to perform transactions

SUSPENDED

Contact blocked from ordering/purchases but still allowed to make Payments

TERMINATED

Contact can no longer perform any kind of transactions using this account(financial, ordering, rewards etc)

Example:
ACTIVE
currency_code
string
Min length: 3
Max length: 3
Pattern: 3-letter ISO 4217 currency code.
Example:
EUR
paging
Object

Information that can be used in order to display large pages

page
integer

The page number

Example:
2
size
integer

The number of records per page

Default:
10
Example:
20
total
integer

The total number of records. If “include_total” is not specified, then this total is null. If “include_total” is specified, total has a value but it is accurate up to 10K records.

Example:
1124
has_more
boolean

Shows if there are more records available to fetch

Example:
true
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
GET https://sandbox.crm.com/self-service/v2/contacts/4dc0809f-ed91-4b68-b912-5bd6064d901e/accounts HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "content": [
        {
            "id": "4dc0809f-ed91-4b68-b912-5bd6064d901e",
            "is_primary": true,
            "name": "AC123456 John Smith",
            "number": "AC123456",
            "state": "ACTIVE",
            "currency_code": "EUR"
        }
    ],
    "paging": {
        "page": 2,
        "size": 20,
        "total": 1124
    }
}
Get Account
GET /accounts/{id}/

Retrieve details and financial information for an account

Path variables

id
string GUID required

The unique identification of the account to be retrieved

Example:
4dc0809f-ed91-4b68-b912-5bd6064d901e

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 OK

The request has succeeded

Body
Object
name
string

The account’s name

Example:
John Smith AC00123456
number
string

The account’s number

Example:
AC00123456
is_primary
string

Indictes whether the account is the primary account for the contact

Example:
true
state
string

The account status

Enumeration:
ACTIVE
SUSPENDED
TERMINATED
currency_code
string
Min length: 3
Max length: 3
Pattern: 3-letter ISO 4217 currency code.
Example:
EUR
balance
number

The account running balance

Example:
1.21
overdue_amount
number

The account unpaid amount that is passed its due date

Example:
100.5
credit_limit
number

The account credit limit

Example:
100
payment_terms
Object

The account payment terms

id
string

Payment terms unique identifier

Example:
b1f06abf-27b0-40e2-bd4e-201b36badf59
name
string

Payment terms name

Example:
Net 7
classification
Object

Details about the related classification

id
string GUID

The classification identifier

Example:
138318d2-ab1e-5443-ff49-5ef6a3f52873
name
string

The classification name

Example:
VIP
billing_address
Object
id
string GUID

The address identifier

Example:
8500c80c-1b67-b3c9-6a36-c00611093f58
address_type
string

The address type

Enumeration:
HOME
BUSINESS
address_name
string

A short name allowing the address to be easily recognised in a list

Example:
Engomi Office
address_line_1
string

The address line 1

Example:
21 Elia Papakyriakou Street
address_line_2
string

The address line 2

Example:
7 Stars Tower
state_province_county
string

The address state/provice/county

Example:
Engomi
town_city
string

The address town/city

Example:
Nicosia
postal_code
string

The address post code

Example:
2415
country_code
string

The 3-char country code of the address

Example:
CYP
lat
number

The address geolocation latitude

Example:
35.1573573816456
lon
number

The address geolocation longitude

Example:
33.31386910877576
google_place_id
string

The Google textual identifier that uniquely identifies an address

Example:
ChIJrTLr-GyuEmsRBfy61i59si0
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
GET https://sandbox.crm.com/self-service/v2/accounts/4dc0809f-ed91-4b68-b912-5bd6064d901e/ HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "name": "John Smith AC00123456",
    "number": "AC00123456",
    "is_primary": "true",
    "state": "ACTIVE",
    "currency_code": "EUR",
    "balance": 1.21,
    "overdue_amount": 100.5,
    "credit_limit": 100,
    "payment_terms": {
        "id": "4AD9C84FA60F9FE407140E20F707726A",
        "name": "Net 7"
    },
    "classification": {
        "id": "138318d2-ab1e-5443-ff49-5ef6a3f52873",
        "name": "VIP"
    },
    "billing_address": {
        "id": "8500c80c-1b67-b3c9-6a36-c00611093f58",
        "address_type": "HOME",
        "address_name": "My Home",
        "address_line_1": "Elia Papakyriakou 21",
        "address_line_2": "Tower Star",
        "state_province_county": "Egkomi",
        "town_city": "Nicosia",
        "postal_code": "2000",
        "country_code": "CYP",
        "lat": 32.15,
        "lon": 35.15,
        "google_place_id": "ChIJrTLr-GyuEmsRBfy61i59si0"
    }
}
Update Account
PUT /accounts/{id}

Update an existing account of a contact

Path variables

id
string GUID required

The account identifier that will be updated

Example:
4dc0809f-ed91-4b68-b912-5bd6064d901e

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Request body

Object
is_primary
boolean nullable

If set to true, then the account will be set as the primary account of the contact

Default:
false
Example:
true
classification_id
string GUID nullable

The account’s classification id

Example:
4dc0809f-ed91-4b68-b912-5bd6064d901e
billing_address_id
string GUID nullable

The unique id of a contact address which will be set as the billing address of the account

Example:
b1f06abf-27b0-40e2-bd4e-201b36badf59

Responses

200 OK

The response succeeded

Body
Object
id
string GUID

The account identifier

Example:
4dc0809f-ed91-4b68-b912-5bd6064d901e
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
PUT https://sandbox.crm.com/self-service/v1/accounts/4dc0809f-ed91-4b68-b912-5bd6064d901e HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "is_primary": "true",
    "classification_id": "4dc0809f-ed91-4b68-b912-5bd6064d901e",
    "billing_address_id": "4dc0809f-ed91-4b68-b912-5bd6064d901e"
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "4dc0809f-ed91-4b68-b912-5bd6064d901e"
}
List Account Journals
GET /accounts/{id}/journals

Retrieve a list of account journals. Only journals of Posted transactions are returned. By default, accounts journals of the last 12 months are retrieved.

Path variables

id
string GUID required

The account identifier whose journals will be retrieved

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD

Request parameters

posted_on
string optional

Filter journals based on the posted date, which may fall within a given date range, default is one year prior to today. The value can be a string with a date in epoch format, each option must also include an operator. Use up to two options based on the required search (e.g. posted_on[gte]=1618395497&posted_on[lte]=1618395497).

Enumeration:
posted_on[gt]

Returns results where the posted date is greater than this value

posted_on[gte]

Returns results where the posted date is greater than or equal to this value

posted_on[lt]

Returns results where the posted date is less than this value

posted_on[lte]

Returns results where the posted date is less then or equal to this value

transaction_type
string optional

Filter by journal type

Enumeration:
INVOICE

Triggered by an order or an invoice, created to charge a Contact

CREDIT_NOTE

Credits the account, e.g. for an invoice correction

PAYMENT

A contact payment for an invoice or an external debit

REFUND

Full or partial refund for a payment

PAYOUT

Money returned to a contact’s account

TOP_UP

Adds money to an account or wallet

TRANSFER

Transfer of funds to another account/wallet of the same contact, or another contact’s account/wallet

MANUAL_JOURNAL

Financial transaction manually created, crediting/debiting a contact’s account/wallet

Example:
CARD
sort
string optional

Defines on which attribute the results should be sorted

Allow empty value: true
Examples:
CREATED_DATEUPDATED_DATENAMEPOSTED_DATE
order
string optional

Defines how the results will be ordered

Allow empty value: true
Enumeration:
ASC
DESC
Default:
DESC
page
integer optional

The page number that should be retrieved

Default:
1
Example:
20
size
string optional

The size (total records) of each page

Default:
10
Example:
20

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 OK

The request has succeeded

Body
Object
content
Array
Object
id
string

Journal id

Example:
4dc0809f-ed91-4b68-b912-5bd6064d901e
number
string

The number/code of the journal’s related financial transaction

Example:
INV12659
issued_date
integer

Date journal was issued

Example:
1650436799
posted_date
integer

Date journal was posted

Example:
1651127996
transaction_type
string
Enumeration:
INVOICE

Triggered by an order or an invoice, created to charge a Contact

CREDIT_NOTE

Credits the account, e.g. for an invoice correction

PAYMENT

A contact payment for an invoice or an external debit

REFUND

Full or partial refund for a payment

PAYOUT

Money returned to a contact’s account

TOP_UP

Adds money to an account or wallet

TRANSFER

Transfer of funds to another account/wallet of the same contact, or another contact’s account/wallet

MANUAL_JOURNAL

Financial transaction manually created, crediting/debiting a contact’s account/wallet

Example:
CARD
type
string

Journal account type

Enumeration:
CREDIT
DEBIT
Example:
DEBIT
currency_code
string
Min length: 3
Max length: 3
Pattern: 3-letter ISO 4217 currency code.
Example:
EUR
amount
number

Journal amount

Example:
84.99
invoice
Object

Invoice related details, applicable for invoices only

due_date
integer

Invoice due date

Example:
1651074662
overdue_amount
number

Invoice overdue amount

Example:
10.39
unpaid_amount
number

Invoice unpaid amount, i.e. invoice due date not yet reached

Example:
4.5
paging
Object

Information that can be used in order to display large pages

page
integer

The page number

Example:
2
size
integer

The number of records per page

Default:
10
Example:
20
total
integer

The total number of records. If “include_total” is not specified, then this total is null. If “include_total” is specified, total has a value but it is accurate up to 10K records.

Example:
1124
has_more
boolean

Shows if there are more records available to fetch

Example:
true
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
GET https://sandbox.crm.com/self-service/v2/accounts/CAD1E31269B76D7A65ACCE45B2E68DFD/journals HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "content": [
        {
            "id": "4dc0809f-ed91-4b68-b912-5bd6064d901e",
            "number": "INV12659",
            "issued_date": 1650436799,
            "posted_date": 1651127996,
            "transaction_type": "CARD",
            "type": "DEBIT",
            "currency_code": "EUR",
            "amount": 84.99,
            "invoice": {
                "due_date": 1651074662,
                "overdue_amount": 10.39,
                "unpaid_amount": 4.5
            }
        }
    ],
    "paging": {
        "page": 2,
        "size": 20,
        "total": 1124
    }
}
Get Account Journal
GET /journals/{id}/

Retrieve information and details lines for a single account journal

Path variables

id
string GUID required

The journal id to retrieve information for

Example:
4dc0809f-ed91-4b68-b912-5bd6064d901e

Request parameters

include_lines
boolean optional

Includes financial transation lines in response if set to True. By deault lines are not retireved

Default:
false
Example:
false

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 OK

The request has succeeded

Body
Object
id
string GUID

The journal identifier

Example:
7156b6b0-ab00-46c8-8411-c515c20d4e19
number
string

The number/code of the journal entry

Example:
INV00123
issed_date
integer epoch

The date that the financial transaction was issued

Example:
1643611106
posted_date
integer epoch

Date of posting financial transaction

Example:
1646289507
currency_code
string
Min length: 3
Max length: 3
Pattern: 3-letter ISO 4217 currency code.
Example:
EUR
invoice
Object

Invoice related details. applicabe only for Invoices

due_date
integer epoch

Date due for invoice payment

Example:
1646116707
overdue_amount
number

Invoice overdue amount i.e. due date exceeded

Example:
10.99
unpaid_amount
number

Invoice unpaid amount, i.e. invoice due date not yet reached

Example:
53
net
number

Total transaction net amount

Example:
103.59
discount
number

Total transaction discount amount

Example:
0
tax
number

Total transaction tax amount

Example:
13
sub_total
number

Total amount before discounts

Example:
103.59
total
number

Transaction amount

Example:
103.59
payment_method
Object
type
string
Enumeration:
CASH
CARD
ACCOUNT_DEBIT
WALLET
CRM_WALLET
CHEQUE
ELECTRONIC_TRANSFER
Example:
CARD
identity
Object

The payment method’s details that include the contact’s payment method plus important information about the payment method. Applicable only for Cards, Accunt Debits and Wallet payment method types

id
string

Unique identifier of the payment method

Example:
9837ee37-a1ab-4a27-9b4b-663c9025a205
identifier
string

A short description of the payment method. Depending on the payment method’s type different information is returned:

  • Card: the brand, followed by the last 4 digits of the card plus expiration month/year
  • Account debit: Name: Bank code followed by the first 5 and the last 9 digits of the account number/IBAN
  • Wallet: Name: Email and/or phone used on registration
Example:
Visa ****1234
lines
Array

Transaction line information

Object
product
Object

Product information

id
string

Product unique id

Example:
4dc0809f-ed91-4b68-b912-5bd6064d901e
sku
string

Product SKU

Example:
STB009342
name
string

Product name

Example:
Set Top Box
description
string

Product description

Example:
STB C800PA HD MPEG 4
quantity
integer

Product quantity

Example:
1
unit_price
number

Unit price of produc

Example:
15.99
net
number

Net unit price

Example:
14
discount
number

Product discount amount

Example:
0
tax
number

Product tax amount

Example:
1.32
sub_total
number

Financial transaction line sub total (amount before discount)

Example:
15.99
period
Object

Applicable only when the line item includes a termed service and denotes the invoiced/credited period

from
integer epoch

Period start date

Example:
1646116707
to
integer epoch

Period end date

Example:
1654065506
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
GET https://sandbox.crm.com/self-service/v2/journals/4dc0809f-ed91-4b68-b912-5bd6064d901e/ HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "7156b6b0-ab00-46c8-8411-c515c20d4e19",
    "number": "INV00123",
    "issed_date": 1643611106,
    "posted_date": 1646289507,
    "currency_code": "EUR",
    "invoice": {
        "due_date": 1646116707,
        "overdue_amount": 10.99,
        "unpaid_amount": 53
    },
    "net": 103.59,
    "discount": 1,
    "tax": 13,
    "sub_total": 103.59,
    "total": 103.59,
    "payment_method": {
        "type": "CARD",
        "identity": { 
            "id": "",
            "identifier": "Visa ****1234"
        }
    },
    "lines": [
        {
            "product": {
                "id": "4dc0809f-ed91-4b68-b912-5bd6064d901e",
                "sku": "STB009342",
                "name": "Set Top Box",
                "description": "STB C800PA HD MPEG 4"
            },
            "quantity": 1,
            "unit_price": 15.99,
            "net": 14,
            "discount": 1,
            "tax": 1.32,
            "sub_total": 15.99,
            "period": {
                "from": 1646116707,
                "to": 1654065506
            }
        }
    ]
}
Contact Financials
POST /contacts/{id}/intents
GET /contacts/{id}/client_token
PUT /payment_intents/actions
Create Intent
POST /contacts/{id}/intents

Set up a new intent for a specific contact, the response will vary depending on the gateway type

Path variables

id
string GUID required

The contact identifier for which a Payment Intent will be set up

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD

Notes

JCC Merchant returns data (app_id, client_app_key, scheme) necessary to use JCC Merchant services for submitting a card hash request

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Request body

Object
payment_gateway
string nullable

Legacy payment gateways

Enumeration:
JCC
JCC_MERCHANT
Example:
JCC
integration_id
string GUID nullable

The id of the payment gateway plugin

Example:
2BD9C84FA60F9FE407140E20F707726A
payment_method_id
string GUID required

The contact’s payment method

Example:
3BD9C84FA60F9FE407140E20F707726A
amount
number required

The amount to be paid

Example:
9.99
currency
string required

The payment’s currency. If not speified, then it defaults to the contact’s account currency

Example:
EUR
capture
string
Enumeration:
ON_HOLD
Example:
ON_HOLD
statement_info
string

Details to add to the contact statement for the payment

Example:
Payment for Order O125435 - Date 01.01.2010

Responses

200 OK

The request has succeeded

Body
Object
client_secret
string

Payment intent’s client secret

Example:
2BD9C84FA60F9FE407140E20F707726A
state
string
Enumeration:
PENDING
COMPLETED
REJECTED
REQUIRES_CAPTURING
CANCELLED
Example:
PENDING
parameters
Array

A list of parameters that might be included in the payment intent. Applicable only for JCC Merchant gateway.

Object
key
string

The name of the parameter

Example:
app_id
value
string

The value of the parameter

Example:
0fe90e81-b943-7d66-8e09-d4a3a62674d9
error_code
string
error_description
string
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
POST https://sandbox.crm.com/self-service/v1/contacts/CAD1E31269B76D7A65ACCE45B2E68DFD/intents HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "payment_gateway": "JCC",
    "integration_id": "2BD9C84FA60F9FE407140E20F707726A",
    "payment_method_id": "3BD9C84FA60F9FE407140E20F707726A",
    "amount": 9.99,
    "currency": "EUR",
    "session_type": "ON_SESSION",
    "capture": "ON_HOLD",
    "reference": "032434333-11",
    "statement_info": "Payment for Order O125435 - Date 01.01.2010",
    "entity": {
        "type": "INVOICE",
        "id": ""
    }
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "client_secret": "2BD9C84FA60F9FE407140E20F707726A",
    "parameters": [
        {
            "key": "app_id",
            "value": "0fe90e81-b943-7d66-8e09-d4a3a62674d9"
        }
    ]
}
Get Client Token
GET /contacts/{id}/client_token

Client-side is responsible for generating a client token from the payment gateway. The client token includes configuration required for a successfull communication with the gateway, as well as authenticating and authorising the client to communicate with the gateway.

Path variables

id
string required

Request parameters

integration_id
string required

Id of integration to be used

Example:
b1f06abf-27b0-40e2-bd4e-201b36badf59

Responses

200 OK
Body
Object
client_token
string

Generated token

Example:
4AD9C84FA60F9FE407140E20F707726A
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
GET https://sandbox.crm.com/self-service/v1/contacts/{id}/client_token HTTP/1.1 

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "client_token": ""
}
Payment Intent Processing
PUT /payment_intents/actions

Confirms a payment in the payment gateway, with optional Account / Wallet id

Request body

Object
client_secret
string required

Unique intent identifier from Intents API

Example:
b1f06abf-27b0-40e2-bd4e-201b36badf59
integration_id
string GUID required

The integration’s unique identifier

Example:
daf66d67-146d-0761-4e80-af34e64200c7
action
string required

Action to be taken

Enumeration:
CONFIRM
CANCEL

roadmap

Default:
CONFIRM
Example:
CONFIRM

Responses

200 OK
401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
Example 2
POST https://sandbox.crm.com/self-service/v1/payments HTTP/1.1 

Content-Type: application/json

{
    "integration_id": "",
    "client_secret": "",
    "account_id": "",
    "wallet_id": ""
}

HTTP/1.1 201 Created 
POST https://sandbox.crm.com/self-service/v1/payments HTTP/1.1 

Content-Type: application/json

{
    "integration_id": "",
    "client_secret": "",
    "account_id": "",
    "wallet_id": ""
}

HTTP/1.1 201 Created 
Retrieve JCC Card Hosted Page
GET /jcc/form

Retrieve the JCC Card Hosted Page

Request parameters

action
string required

The action that should be performed in regards to payment method

Enumeration:
CREATE
UPDATE
payment_method_id
string GUID optional

The payment method identifier that will be affected

Example:
2301a540-8f81-e4d2-7418-dfa714ac53ee

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 OK

The request has succeeded

text/html
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Contact Rewards
GET /contacts/{id}/rewards
POST /contacts/{id}/reward_schemes
GET /contacts/reward_schemes/verification
GET /contacts/{id}/rewards/balances
Get Contact Rewards
GET /contacts/{id}/rewards

Retrieve a contact’s reward details

Path variables

id
string GUID required

The contact (identifier) whose rewards details should be retrieved

Example:
72f02951-264d-a380-1899-05c06569aff3

Request headers

Authorization
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 OK

The request has succeeded

Body
Object
signed_up
Object

Details about contact first sign up to rewards

date
integer epoch

The date when the contact was signed up for the first time

Example:
1647852771
spend_blocked
Object

Details about whether the contact can spend or not

status
boolean

Defines whether the contact can spend or not

Example:
true
date
integer epoch

The date that the spend blocked status was updated

Example:
1647605852
reward_schemes
Array

Information about the signed up reward schemes

Object
id
string GUID

The reward scheme identifier

Example:
0b01295f-ce8c-29f3-b00a-a22969f6cd72
name
string

The reward scheme name

Example:
CRMdotCOM Scheme
signed_up_on
integer epoch

The date when the contact was signed up on the specific reward scheme

Example:
1583846865
email_address
string

The email address that was used during sign up (applicable if the reward scheme is a close loop scheme based on email domains)

Example:
johndoe@crm.com
reward_tier
Object

Information about the reward tier

id
string GUID

The tier identifier

Example:
6883441e-194a-b92b-c6c0-2f0e869e4c65
name
string

The tier name

Example:
Red
color
string

The tier (marketing) color

Example:
#d4af37
achieved_date
integer epoch

The date that the tier was reached

Example:
1615996441
period_value_units
number

The value units collected during the current period

Example:
2000
lifetime_value_units
number

The lifetime (total) value units collected overall

Example:
12543
creatives
Array

Creatives images for marketing includes the primary image and scaled versions to create a srcset

Object
id
string GUID

The creative identifier

Example:
a3f1f6b3-8d49-3a72-e48e-617dd6004d41
usage_type
string

Information about the creative type

Enumeration:
LOGO
BACKGROUND
MARKETING
ATTACHMENT
width
integer

The creative width

Example:
2159
height
integer

The creative height

Example:
3075
format
string

The creative format

Example:
jpg
url
string

The creative content URL

Example:
https://assets.crm.com/image/offer.jpg
public_id
string

The creative public identifier

Example:
crm-com/image
media
Array

Details about creative transformations

Object
width
integer

The transformed creative width

Example:
200
height
integer

The transformed creative height

Example:
300
url
string

The transformed creative URL

Example:
https://asset.crm.com/image/offer/c_scale,w_200/offer.jpg
maintain_tier
Object

Details on how to maintain the current tier

points_needed
number

The number of value units needed to maintain current tier

Example:
200
collected_by
integer epoch

The date up to which value units must be collected by in order to maintain the current tier

Example:
1615996441
progress
Object

Details about the next tier progression

id
string GUID

The next tier identifier

Example:
6883441e-194a-b92b-c6c0-2f0e869e4c65
name
string

The next tier name

Example:
Gold
points_needed
string

The value units needed to progress to next tier

Example:
1400
collected_by
integer epoch

The date up to which points must be collected in order to progress to next tier

Example:
1615996441
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
GET https://sandbox.crm.com/self-service/v2/contacts/72f02951-264d-a380-1899-05c06569aff3/rewards HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "signed_up": {
        "date": 1647852771
    },
    "spend_blocked": {
        "status": "true",
        "date": 1647605852
    },
    "reward_schemes": [
        {
            "id": "0b01295f-ce8c-29f3-b00a-a22969f6cd72",
            "name": "CRMdotCOM Scheme",
            "signed_up_on": 1583846865,
            "email_address": "johndoe@crm.com"
        }
    ],
    "reward_tier": {
        "id": "6883441e-194a-b92b-c6c0-2f0e869e4c65",
        "name": "Red",
        "color": "#d4af37",
        "achieved_date": 1615996441,
        "period_value_units": 2000,
        "lifetime_value_units": 12543,
        "maintain_tier": {
            "points_needed": 200,
            "collected_by": 1615996441
        },
        "progress": {
            "id": "6883441e-194a-b92b-c6c0-2f0e869e4c65",
            "name": "Gold",
            "points_needed": "1400",
            "collected_by": 1615996441
        },
        "creatives": [
            {
                "id": "a3f1f6b3-8d49-3a72-e48e-617dd6004d41",
                "usage_type": "ATTACHMENT",
                "width": 2159,
                "height": 3075,
                "format": "jpg",
                "url": "https://assets.crm.com/image/offer.jpg",
                "public_id": "crm-com/image",
                "media": [
                    {
                        "width": 200,
                        "height": 300,
                        "url": "https://asset.crm.com/image/offer/c_scale,w_200/offer.jpg"
                    }
                ]
            }
        ]
    }
}
Contact Reward Schemes Actions
POST /contacts/{id}/reward_schemes

Sign up/out a contact from/to a reward scheme

Path variables

id
string GUID required

The contact (identifier) that will be signed up/out to/from a reward scheme

Example:
4d5fc8ea-5bc4-5c25-d557-a531da3e9193

Notes

SELF SIGN-UP SCHEMES
  • Signing up to a self sign-up reward scheme requires the SIGN_UP action and Reward Scheme attributes.
  • Signing out from a self sign-up reward scheme requires the SIGN_OUT action and Reward Scheme attributes.
CLOSED LOOP SCHEMES based on EMAIL DOMAIN
  • Request to sign up to a closed loop reward scheme based on specific email domains should be made via the Contact Reward Schemes Actions API, providing the SIGN_UP action, the Reward Scheme and Email Address attributes.
  • Any requests made for signing up such reward schemes should be verified via Closed Loop Sign Up Verification API.
  • Signing out from a closed loop reward scheme requires the SIGN_OUT action and Reward Scheme attributes.

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Request body

Object
action
string required

The action that should be applied for the reward scheme

Enumeration:
SIGN_UP

Request to sign-up to a scheme

SIGN_OUT

Request to sign-off from a scheme

reward_scheme_id
string GUID required

The reward scheme that the contact has signed up/out

Example:
835bbd30-917e-526f-aea4-33cacfb61903
email_address
string nullable

The email address of the contact requestng to sign uo to a reward scheme based on supported domains

Example:
johndoe@crm.com
sign_up_code
string nullable

The code that will verify that the contact is allowed to sign up to a closed loop reward scheme

Example:
ABCTKN123456798VGP2020
Examples

Responses

201 Created

The request has succeeded

Body
Object
id
string GUID

The reward scheme identifier

Example:
81828ecf-10d5-188f-c9e5-b9bc7fe2930c
204 No Content

The request has succeeded

400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
Example 2
Example 3

Sign up to a reward scheme of type self-sign up

POST https://sandbox.crm.com/self-service/v2/contacts/4d5fc8ea-5bc4-5c25-d557-a531da3e9193/reward_schemes HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "action": "SIGNUP",
    "reward_scheme_id": "835bbd30-917e-526f-aea4-33cacfb61903"
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "CAD1E31269B76D7A65ACCE45B2E68DFD"
}

Sign out from a reward scheme

POST https://sandbox.crm.com/self-service/v2/contacts/4d5fc8ea-5bc4-5c25-d557-a531da3e9193/reward_schemes HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "action": "SIGNOUT",
    "reward_scheme_id": "835bbd30-917e-526f-aea4-33cacfb61903"
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "CAD1E31269B76D7A65ACCE45B2E68DFD"
}

Sign up to a reward scheme of type closed loop based on email address

POST https://sandbox.crm.com/self-service/v2/contacts/4d5fc8ea-5bc4-5c25-d557-a531da3e9193/reward_schemes HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "action": "SIGNUP",
    "reward_scheme_id": "835bbd30-917e-526f-aea4-33cacfb61903",
    "email_address": "johndoe@crm.com"
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "51b9e2ca-44db-5a6f-769c-5c4fa21ba8f9"
}
Closed Loop Sign Up Verification
GET /contacts/reward_schemes/verification

Verify a contact’s request to sign up to a closed loop reward scheme

Notes

CLOSED LOOP SCHEMES based on EMAIL DOMAIN

Request parameters

sign_up_code
string optional

The code that will verify that the customer is allowed to sign up to a closed loop reward scheme based on email domains

Example:
SUC1234

Responses

200 OK

The request has succeeded

Body

An HTML based landing page is returned and rendered

400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
GET https://sandbox.crm.com/self-service/v1/contacts/verify_sign_up?sign_up_code=SUC1234 HTTP/1.1 

HTTP/1.1 200 OK 
Get Contact Reward Balances
GET /contacts/{id}/rewards/balances

Retrieve a contact’s reward award/spend balances

Path variables

id
string GUID required

The contact (identifier) whose rewards balances should be retrieved

Example:
72f02951-264d-a380-1899-05c06569aff3

Request parameters

period
string optional

Filter total awards/spends based on period

Enumeration:
DAILY

Any amount attributes will be filtered based on the current day

WEEKLY

Any amount attributes will be filtered based on the current week

MONTHLY

Any amount attributes will be filtered based on the current month

YEARLY

Any amount attributes will be filtered based on the current year

OVERALL

Any amount attributes will be filtered based on the registration date

Request headers

Authorization
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 OK

The request has succeeded

Body
Object
award
string

The contact’s total awarded amount

Example:
123.23
redeem
string

The contact’s total redeemed amount

Example:
23.02
spend
string

The contact’s total spent amount

Example:
43.56
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
GET https://sandbox.crm.com/self-service/v2/contacts/72f02951-264d-a380-1899-05c06569aff3/rewards/balances HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "award": "123.23",
    "redeem": "23.02",
    "spend": "43.56"
}
Customer Events
Purchases
GET /contacts/{id}/purchases
POST /purchases/reclaim
Search Contact Purchases
GET /contacts/{id}/purchases

Retrieve a list of contact’s purchase events based on search criteria (e.g. all purchases)

Path variables

id
string GUID required

The contact (identifier) for which purchase events should be returned

Example:
2194281e-f804-c0f7-757d-d66cb133caa0

Request parameters

date
string optional

Filter based on the performed date, which may fall within a given date range. The value can be a string with a date in epoch format. Each option must also include an operator. Use up to two options based on the required search (e.g. performed_on[gte]=1618395497&performed_on[lt]=1618395497).

Enumeration:
date[gt]

Returns results where the performed date is greater than this value

date[gte]

Returns results where the performed date is greater than or equal to this value

date[lt]

Returns results where the performed date is less than this value

date[lte]

Returns results where the performed date is less then or equal to this value

is_ad_hoc_return
boolean optional

Filter based on whether purchases have an ad hoc return was applied on them

Example:
true
sort
string optional

Defines on which attribute the results should be sorted

Examples:
CREATED_DATEUPDATED_DATEPERFORMED_ON
order
string optional

Defines how the results will be ordered

Allow empty value: true
Enumeration:
ASC
DESC
Default:
DESC
page
integer optional

The page number that should be retrieved

Default:
1
Example:
20
size
string optional

The size (total records) of each page

Default:
10
Example:
20

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 OK

The request has succeeded

Body
Object
content
Array
Object
id
string GUID

The purchase event identifier

Example:
b4e01c67-4921-b5e1-36a6-8effb92dbd5a
reference_number
string

The purchase event reference number

Example:
0012345
state
string

The purchase event state

Enumeration:
POSTED
CANCELLED
payment_medium_identifier
string

The unique identifier of the payment medium used on the purchase (e.g. a credit card’s first 6 digits)

Example:
424242
transaction_amounts
Object

The net amount of the retrieved purchase event

net
number

The total net amount (all products’ net amount or total transaction net amount)

Example:
1
tax
number

The total tax amount (all products’ tax amount or total transaction tax amount)

Example:
0.5
discount
number

The purchase’s discount amount

Example:
0.5
total
number

The purchase’s total amount (net + tax) after discount

Example:
1
spent_request
Object

Details about spend request for a specific amount (as requested by contact)

amount
number

The requested spend amount

Example:
2.96
date
integer epoch

The date that the purchase event was performed

Example:
1572534147
classification
Object

Details about customer event classification

id
string GUID

The event classification identifier

Example:
18670ca7-0bc4-45d7-8464-91afab817bbe
name
string

The event classification name

Example:
Delivery
pass
Object

Details about the pass redeemd on purchase

id
string GUID

The pass identifier

Example:
89136fa9-0dc9-451d-833a-d22bf9d8b947
code
string

The pass code

Example:
13456789
organisation
Object

Information about the organisation that owns the reward offer

id
string GUID

The organisation identifier

Example:
e66d45b4-2673-0a0e-5a06-d6088a324b3f
name
string

The organisation name

Example:
Pizza Yummy
creatives
Array

Creatives images for marketing includes the primary image and scaled versions to create a srcset

Object
id
string GUID

The creative identifier

Example:
a3f1f6b3-8d49-3a72-e48e-617dd6004d41
usage_type
string

Information about the creative type

Enumeration:
LOGO
BACKGROUND
MARKETING
ATTACHMENT
width
integer

The creative width

Example:
2159
height
integer

The creative height

Example:
3075
format
string

The creative format

Example:
jpg
url
string

The creative content URL

Example:
https://assets.crm.com/image/offer.jpg
public_id
string

The creative public identifier

Example:
crm-com/image
media
Array

Details about creative transformations

Object
width
integer

The transformed creative width

Example:
200
height
integer

The transformed creative height

Example:
300
url
string

The transformed creative URL

Example:
https://asset.crm.com/image/offer/c_scale,w_200/offer.jpg
parent_organisation
Object

Information about the organisation that owns the reward offer

id
string GUID

The organisation identifier

Example:
e66d45b4-2673-0a0e-5a06-d6088a324b3f
name
string

The organisation name

Example:
Pizza Yummy
creatives
Array

Creatives images for marketing includes the primary image and scaled versions to create a srcset

Object
id
string GUID

The creative identifier

Example:
a3f1f6b3-8d49-3a72-e48e-617dd6004d41
usage_type
string

Information about the creative type

Enumeration:
LOGO
BACKGROUND
MARKETING
ATTACHMENT
width
integer

The creative width

Example:
2159
height
integer

The creative height

Example:
3075
format
string

The creative format

Example:
jpg
url
string

The creative content URL

Example:
https://assets.crm.com/image/offer.jpg
public_id
string

The creative public identifier

Example:
crm-com/image
media
Array

Details about creative transformations

Object
width
integer

The transformed creative width

Example:
200
height
integer

The transformed creative height

Example:
300
url
string

The transformed creative URL

Example:
https://asset.crm.com/image/offer/c_scale,w_200/offer.jpg
ad_hoc_return
Object

Information about ad hoc return of goods

reference_number
string

The ad hoc return reference number

Example:
ARP001
date
integer epoch

The date that ad hoc retun of goods was applied

Example:
1589987160
amount
number

The amount that the customer was debited due to ad hoc return of goods

Example:
20.99
return_amount
number

The amount that was returned

Example:
1.99
rewards
Object

Details about rewards

award
number

The award amount

Example:
121.99
redeem
number

The redeem amount

Example:
12.22
spend
number

The spend amount

Example:
2.22
fees
Object

Details about applied fees

total
number

The total fee amount (sum of all fee amounts)

Example:
1.99
credit_fee
number

The fee that was applied on awards (credit wallet)

Example:
0.98
debit_fee
number

The fee that was applied on spends (credit wallet)

Example:
1.01
paging
Object

Information that can be used in order to display large pages

page
integer

The page number

Example:
2
size
integer

The number of records per page

Default:
10
Example:
20
total
integer

The total number of records. If “include_total” is not specified, then this total is null. If “include_total” is specified, total has a value but it is accurate up to 10K records.

Example:
1124
has_more
boolean

Shows if there are more records available to fetch

Example:
true
401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
GET https://sandbox.crm.com/self-service/v2/contacts/2194281e-f804-c0f7-757d-d66cb133caa0/purchases HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "content": [
        {
            "id": "b4e01c67-4921-b5e1-36a6-8effb92dbd5a",
            "reference_number": "0012345",
            "state": "POSTED",
            "payment_medium_identifier": "424242",
            "transaction_amounts": {
                "net": 1,
                "tax": 0.5,
                "discount": 0.5,
                "total": 1
            },
            "spent_request": {
                "amount": 2.96
            },
            "date": 1572534147,
            "classification": {
                "id": "18670ca7-0bc4-45d7-8464-91afab817bbe",
                "name": "Delivery"
            },
            "pass": {
                "id": "89136fa9-0dc9-451d-833a-d22bf9d8b947",
                "code": "13456789"
            },
            "organisation": {
                "id": "716906be-d716-99b4-1eb0-afdd88a25a55",
                "name": "CRMdotCOM Nicosia",
                "creatives": [
                    {
                        "id": "a3f1f6b3-8d49-3a72-e48e-617dd6004d41",
                        "usage_type": "MARKETING",
                        "width": 2159,
                        "height": 3075,
                        "format": "jpg",
                        "url": "https://assets.crm.com/image/offer.jpg",
                        "public_id": "crm-com/image",
                        "media": [
                            {
                                "width": 200,
                                "height": 300,
                                "url": "https://asset.crm.com/image/offer/c_scale,w_200/offer.jpg"
                            }
                        ]
                    }
                ]
            },
            "parent_organisation": {
                "id": "716906be-d716-99b4-1eb0-afdd88a25a55",
                "name": "CRMdotCOM Nicosia",
                "creatives": [
                    {
                        "id": "a3f1f6b3-8d49-3a72-e48e-617dd6004d41",
                        "usage_type": "LOGO",
                        "width": 2159,
                        "height": 3075,
                        "format": "jpg",
                        "url": "https://assets.crm.com/image/offer.jpg",
                        "public_id": "crm-com/image",
                        "media": [
                            {
                                "width": 200,
                                "height": 300,
                                "url": "https://asset.crm.com/image/offer/c_scale,w_200/offer.jpg"
                            }
                        ]
                    }
                ]
            }
            "rewards": {
                "award": 121.99,
                "redeem": 12.22,
                "spend": 2.22
            },
            "fees": {
                "total": 1.99,
                "credit_fee": 0.98,
                "debit_fee": 1.01
            }
        }
    ],
    "paging": {
        "page": 2,
        "size": 20,
        "total": 1124
    }
}
Reclaim Purchase to Contact
POST /purchases/reclaim

Reclaim a purchase customer event to a contact

Notes

QR/BARCODE FORMAT

QR CODE FORMAT

QR Code should include the following attributes (order is important & should be semicolon separated)

  • receipt number
  • merchant number
  • venue number
  • purchase amount (x100)

Scanning a QR Code, the app should interpret such attributes and call ‘POST purchases/reclaim’ as follows

  • receipt_code = receipt number (mapped to CRM’s purchase id)
  • merchant_tap_code = merchant number (if provided)
  • venue_tap_code = venue number (if provided)
  • total_amount = purchase amount / 100

BARCODE FORMAT

Barcode should include the following attributes (order is important & should be semicolon separated)

  • merchant number
  • receipt number
  • purchase amount (x100)
  • venue number

Scanning a Barcode, the app should interpret such attributes and call ‘POST purchases/reclaim’ as follows

  • receipt_code = receipt number (mapped to CRM’s purchase id)
  • merchant_tap_code = merchant number
  • venue_tap_code = venue number (if provided)
  • total_amount = purchase amount / 100

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Request body

Object
id
string GUID required

The receipt code (receipt number) that identifies the purchase (purchase id)

Example:
sdfsdfsdf4-43-r-few-f-wf-r3443;1234
organisation
Object nullable

Details about the organisation that submitted such purchase

merchant_tap
Object required nullable

Details about merchant tap

code
string required nullable

The tap code

Example:
MT001
venue_tap
Object required nullable

Details about venue tap

code
string required nullable

The tap code

Example:
VT001
transaction_amounts
Object nullable

Details about purchase amounts

total
number required nullable

The purchase total amount

Example:
1.99
transaction_code
string nullable

The human readable code that a contact can reclaim a purchase event

Example:
9215mp124

Responses

200 OK
Body
Object
id
string GUID

The purchase event identifier that was claimed (claim purchase)

Example:
f248292d-2950-2175-851a-9be073b71c5b
201 Created

The request has succeeded

Body
Object
id
string GUID

The purchase event identifier that was created (self-submit purchase)

Example:
f248292d-2950-2175-851a-9be073b71c5b
204 No Content

The request has succeeded

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
Example 2
Example 3
POST https://sandbox.crm.com/self-service/v2/purchases/reclaim HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "id": "sdfsdfsdf4-43-r-few-f-wf-r3443;1234",
    "organisation": {
        "merchant_tap": {
            "code": "MT001"
        },
        "venue_tap": {
            "code": "VT001"
        }
    }
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "f248292d-2950-2175-851a-9be073b71c5b"
}
POST https://sandbox.crm.com/self-service/v2/purchases/reclaim HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "organisation": {
        "venue_tap": {
            "code": "VT001"
        }
    },
    "transaction_amounts": {
        "total": 1.99
    }
}

HTTP/1.1 201 Created 

Content-Type: application/json

{
    "id": "f248292d-2950-2175-851a-9be073b71c5b"
}
POST https://sandbox.crm.com/self-service/v2/purchases/reclaim HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "id": "sdfsdfsdf4-43-r-few-f-wf-r3443;1234",
    "organisation": {
        "merchant_tap": {
            "code": "MT001"
        },
        "venue_tap": {
            "code": "VT001"
        }
    }
}

HTTP/1.1 204 No Content 
Referrals
POST /referrals
POST /referrals/actions
Create Referral
POST /referrals

Create a referral customer event

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Request body

Object
code
string required

The referral code

Example:
REF123

Responses

201 Created

The request has succeeded

Body
Object
id
string GUID

The customer event identifier

Example:
fe7bcab9-59cf-4906-a100-482396f5bf3f
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
POST https://sandbox.crm.com/self-service/v2/referrals HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "code": "REF123"
}

HTTP/1.1 201 Created 

Content-Type: application/json

{
    "id": "fe7bcab9-59cf-4906-a100-482396f5bf3f"
}
Referral Actions
POST /referrals/actions

Perform referral actions, such as send referrals to contacts inviting them to sign up to a business and in return to award their referred by contact

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Request body

Object
action
string required

Defines the referral action to be performed

Enumeration:
SEND
recipients
Array required nullable

The email address or phone numbers that referrals will be sent to (applicable if action = SEND)

Unique items: YES
string
Examples:
j_doe@crm.com0035722265566992655663579922265566

Responses

204 No Content

The request has succeeded

400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
POST https://sandbox.crm.com/self-service/v2/referrals/actions HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "action": "SEND",
    "recipients": [
        "0035722265566"
    ]
}

HTTP/1.1 204 No Content 
Estimates
POST /estimates/allowance
POST /estimates/billing
POST /estimates/invoicing
POST /estimates/order_fulfillment
POST /estimates/orders
GET /products/recommendation
POST /estimates/service_delivery
Authorise Usage Consumption
POST /estimates/allowance

Returns an estimation on whether the customer is allowed to consume usage allowance and if yes, the remainng one.

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Request body

Object
contact_id
string GUID required

The contact (identifier) that will be authorised

Example:
ba48e7d3-d00a-0d28-4f9f-02b1a5b226bc
product_id
string required
service
Object
id
string
classification
string
Enumeration:
ONE_TIME_SERVICE
TERMED_SERVICE
organisation_id
string GUID
Example:
2f2a7993-6bbb-bd77-cbc8-8a2a774ef4f2
cash_amount
number nullable
currency_code
string
usage_amount
number nullable

Responses

200 OK
Body
Object
estimation_id
string GUID

The estimation identifier

Example:
784efd68-3d22-3682-fd86-f28fe270dbe3
services
Array
Object
authorise_consumption
boolean
Example:
true
currency_code
string

The currency code used in usage allowance cash amount limits

Example:
EUR
service
Object
id
string
classification
string
Example:
ONE_TIME
product
Object
id
string
sku
string
name
string
accumulated_allowance
Object
cash_amounts
Object
per_transaction
number
Example:
9.99
per_day
number
Example:
19.99
per_billing_cycle
number
Example:
59.99
products_allowance
Array
Object
item_type
string
Example:
PRODUCT
item_id
string
name
string
remaining_cash
Object
per_transaction
number
Example:
9.99
per_day
number
Example:
19.99
per_billing_cycle
number
Example:
59.99
remaining_usage
Object
per_transaction
number
Example:
9.99
per_day
number
Example:
19.99
per_billing_cycle
number
Example:
59.99
measurement_unit
Object
id
string
name
string
dsiplay_name
string
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
POST https://sandbox.crm.com/self-service/v1/estimates/allowance HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "contact_id": "ba48e7d3-d00a-0d28-4f9f-02b1a5b226bc",
    "product_id": "",
    "service": {
        "id": "",
        "classification": "ONE_TIME_SERVICE"
    },
    "organisation_id": "2f2a7993-6bbb-bd77-cbc8-8a2a774ef4f2",
    "cash_amount": 1,
    "currency_code": "",
    "usage_amount": 1
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "estimation_id": "",
    "services": [
        {
            "authorise_consumption": true,
            "currency_code": "EUR",
            "service": {
                "id": "",
                "classification": "ONE_TIME",
                "product": {
                    "id": "",
                    "sku": "",
                    "name": ""
                }
            },
            "accumulated_allowance": {
                "cash_amounts": {
                    "per_transaction": 9.99,
                    "per_day": 19.99,
                    "per_billing_cycle": 59.99
                }
            },
            "products_allowance": [
                {
                    "item_type": "PRODUCT",
                    "item_id": "",
                    "name": "",
                    "remaining_cash": {
                        "per_transaction": 9.99,
                        "per_day": 19.99,
                        "per_billing_cycle": 59.99
                    },
                    "remaining_usage": {
                        "per_transaction": 9.99,
                        "per_day": 19.99,
                        "per_billing_cycle": 59.99
                    },
                    "measurement_unit": {
                        "id": "",
                        "name": "",
                        "dsiplay_name": ""
                    }
                }
            ]
        }
    ]
}
Billing
POST /estimates/billing

Returns an estimation of a customer’s upcoming billing

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A
api_key
string required

The publishable api key for application identification

Example:
ab5f8b2e-092f-4848-8f46-31df1c014060

Request body

Object
contact_id
string
account_id
string
as_of_date
integer
Example:
1234567
upcoming_billing_cycles
integer
Example:
3

Responses

201 Created
Body
Object
billing_estimate
Array
Object
billing_date
integer
Example:
12345678
billed_period
Object
from_date
integer
Example:
12345678
to_date
integer
Example:
12345678
account
Object
id
string
number
string
name
string
totals
Object
total_amount
number
Example:
9.99
tax_amount
number
Example:
1.99
net_amount
number
Example:
1.99
discount_amount
number
Example:
1.99
invoicing
Array
Object
issued_date
integer
Example:
123456789
due_date
integer
Example:
123456789
currency_code
string
Example:
EUR
is_credit
boolean
Example:
true
wallet_funds_amount
number
Example:
5.99
total_net_amount
integer
Example:
1
total_discount_amount
integer
Example:
1
total_discount_incl_tax
integer
Example:
1
total_tax_amount
number
Example:
0.99
total_price
integer
Example:
1
total_amount
number
Example:
9.99
amount_due
string
amount_to_collect
integer
Example:
1
taxes_breakdown
Array
Object
tax_amount
number
Example:
0.99
tax_rate
Object
id
string
name
string
tax_code
string
Example:
VAT
percentage
integer
Example:
1
line_items
Array
Object
quantity
integer
Example:
1
unit_price
number
Example:
9.99
net_amount
number
Example:
9.99
discount_amount
integer
Example:
1
sub_total
number
Example:
9.99
pricing
number
Example:
11.99
product
Object
id
string
Example:
ba603bdc-f18f-1d4e-dd07-ad6b57c6e565
sku
string
Example:
DEC1234
name
string
Example:
Decoder
classification
string
Example:
TRACEABLE_PHYSICAL_GOOD
discount
Object
discount_amount
number
Example:
0.96
discount_percentage
number
Example:
1.5
discount_incl_tax
number
Example:
0.98
applied_taxes
Array
Object
tax_amount
number
Example:
0.99
tax_exempt_reason
string
Example:
CONTACT
tax_rate
Object
id
string
name
string
tax_code
string
Example:
VAT
percentage
integer
Example:
1
bundle_product
Object
id
string
Example:
31f2e99d-a5cb-21c1-2866-1a1491989893
sku
string
Example:
ICL-001
name
string
Example:
Iced Latte
classification
string
Example:
TRACEABLE_PHYSICAL_GOOD
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
POST https://sandbox.crm.com/self-service/v1/estimates/billing HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A
api_key: ab5f8b2e-092f-4848-8f46-31df1c014060
Content-Type: application/json

{
    "contact_id": "",
    "account_id": "",
    "as_of_date": 1234567,
    "upcoming_billing_cycles": 3
}

HTTP/1.1 201 Created 

Content-Type: application/json

{
    "billing_estimate": [
        {
            "billing_date": 12345678,
            "billed_period": {
                "from_date": 12345678,
                "to_date": 12345678
            },
            "account": {
                "id": "",
                "number": "",
                "name": ""
            },
            "totals": {
                "total_amount": 9.99,
                "tax_amount": 1.99,
                "net_amount": 1.99,
                "discount_amount": 1.99
            },
            "invoicing": [
                {
                    "issued_date": 123456789,
                    "due_date": 123456789,
                    "currency_code": "EUR",
                    "is_credit": true,
                    "wallet_funds_amount": 5.99,
                    "total_net_amount": 1,
                    "total_discount_amount": 1,
                    "total_discount_incl_tax": 1,
                    "total_tax_amount": 0.99,
                    "total_price": 1,
                    "total_amount": 9.99,
                    "amount_due": "",
                    "amount_to_collect": 1,
                    "taxes_breakdown": [
                        {
                            "tax_amount": 0.99,
                            "tax_rate": {
                                "id": "",
                                "name": "",
                                "tax_code": "VAT",
                                "percentage": 1
                            }
                        }
                    ],
                    "line_items": [
                        {
                            "quantity": 1,
                            "unit_price": 9.99,
                            "net_amount": 9.99,
                            "discount_amount": 1,
                            "sub_total": 9.99,
                            "pricing": 11.99,
                            "product": {
                                "id": "ba603bdc-f18f-1d4e-dd07-ad6b57c6e565",
                                "sku": "DEC1234",
                                "name": "Decoder",
                                "classification": "TRACEABLE_PHYSICAL_GOOD"
                            },
                            "discount": {
                                "discount_amount": 0.96,
                                "discount_percentage": 1.5,
                                "discount_incl_tax": 0.98
                            },
                            "applied_taxes": [
                                {
                                    "tax_amount": 0.99,
                                    "tax_exempt_reason": "CONTACT",
                                    "tax_rate": {
                                        "id": "",
                                        "name": "",
                                        "tax_code": "VAT",
                                        "percentage": 1
                                    }
                                }
                            ],
                            "bundle_product": {
                                "id": "31f2e99d-a5cb-21c1-2866-1a1491989893",
                                "sku": "ICL-001",
                                "name": "Iced Latte",
                                "classification": "TRACEABLE_PHYSICAL_GOOD"
                            }
                        }
                    ]
                }
            ]
        }
    ]
}
Invoicing
POST /estimates/invoicing

Returns an estimation of how much a customer will pay when purchasing a product. The estimation includes not just the product’s final price, but also various detailed amounts on how the estimated cost is calculated

Request headers

api_key
string required

The publishable api key for application identification

Example:
ab5f8b2e-092f-4848-8f46-31df1c014060

Request body

Object
account_id
string GUID

The account identifier

Example:
be091e01-1842-4a2a-a1ae-e7c2f5343867
line_items
Array
Object
product_id
string GUID

The product identifier

Example:
be091e01-1842-4a2a-a1ae-e7c2f5343867
bundle_product_id
string GUID

The bundle product identifier

Example:
be091e01-1842-4a2a-a1ae-e7c2f5343867
quantity
integer

The quantity of the related item line

Example:
1
price
number

The price of the related item line

Example:
9.99
discount_value
number

The discount of the related item line

Example:
1
discount_option
string

The discount option of the related item line

Example:
PERCENTAGE
tax_model
string

The tax model of the related item line

Example:
TAX_EXCLUSIVE

Responses

200 OK
Body
Object
issued_date
integer
Example:
123456789
due_date
integer
Example:
123456789
currency_code
string
Example:
EUR
is_credit
boolean
Example:
true
wallet_funds_amount
number
Example:
5.99
total_net_amount
integer
Example:
1
total_discount_amount
integer
Example:
1
total_discount_incl_tax
integer
Example:
1
total_tax_amount
number
Example:
0.99
total_amount
number
Example:
9.99
total_price
number

Sum of all product prices as these are defined in the product catalog

amount_due
string
amount_to_collect
integer
Example:
1
taxes_breakdown
Array
Object
tax_amount
number
Example:
0.99
tax_rate
Object
id
string
name
string
tax_code
string
Example:
VAT
percentage
integer
Example:
1
line_items
Array
Object
id
string
Example:
7CD9C84FA60F9FE407140E20F707726A
sku
string
name
string
tax_model
string
Example:
TAX_INCLUSIVE
rate_model
string
Example:
TIERED
quantity
integer
Example:
1
price
number
Example:
11.99
unit_price
number
Example:
9.99
net_amount
number
Example:
9.99
discount
Object
discount_amount
number
Example:
0.96
discount_percentage
number
Example:
1.5
discount_incl_tax
number
Example:
0.98
tax_amount
number
Example:
0.99
sub_total
number
Example:
9.99
classification
string
applied_taxes
Array
Object
tax_amount
number
Example:
0.99
tax_exempt_reason
string
Example:
CONTACT
tax_rate
Object
id
string
name
string
tax_code
string
Example:
VAT
percentage
integer
Example:
1
Example 1
POST https://sandbox.crm.com/self-service/v1/estimates/invoicing HTTP/1.1 

api_key: ab5f8b2e-092f-4848-8f46-31df1c014060
Content-Type: application/json

{
    "account_id": "be091e01-1842-4a2a-a1ae-e7c2f5343867",
    "line_items": [
        {
            "product_id": "be091e01-1842-4a2a-a1ae-e7c2f5343867",
            "bundle_product_id": "be091e01-1842-4a2a-a1ae-e7c2f5343867",
            "quantity": 1,
            "price": 9.99,
            "discount_value": 1,
            "discount_option": "PERCENTAGE",
            "tax_model": "TAX_EXCLUSIVE"
        }
    ]
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "issued_date": 123456789,
    "due_date": 123456789,
    "currency_code": "EUR",
    "is_credit": true,
    "wallet_funds_amount": 5.99,
    "total_net_amount": 1,
    "total_discount_amount": 1,
    "total_discount_incl_tax": 1,
    "total_tax_amount": 0.99,
    "total_amount": 9.99,
    "amount_due": "",
    "amount_to_collect": 1,
    "taxes_breakdown": [
        {
            "tax_amount": 0.99,
            "tax_rate": {
                "id": "",
                "name": "",
                "tax_code": "VAT",
                "percentage": 1
            }
        }
    ],
    "line_items": [
        {
            "id": "7CD9C84FA60F9FE407140E20F707726A",
            "sku": "",
            "name": "",
            "tax_model": "TAX_INCLUSIVE",
            "rate_model": "TIERED",
            "quantity": 1,
            "unit_price": 9.99,
            "price_incl_tax": 11.99,
            "net_amount": 9.99,
            "discount": {
                "discount_amount": 0.96,
                "discount_percentage": 1.5,
                "discount_incl_tax": 0.98
            },
            "tax_amount": 0.99,
            "sub_total": 9.99,
            "classification": "",
            "applied_taxes": [
                {
                    "tax_amount": 0.99,
                    "tax_exempt_reason": "CONTACT",
                    "tax_rate": {
                        "id": "",
                        "name": "",
                        "tax_code": "VAT",
                        "percentage": 1
                    }
                }
            ]
        }
    ]
}
Order Fulfillment
POST /estimates/order_fulfillment

Preview order fulfillment information

Notes

ORDER FLOW

Integrating an order flow the following APIs should be called The following APIs should be called in order to make an order

  1. Order Fulfillment
  2. Orders Preview
  3. Submit Order

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Request body

Object
supply_method
string

Defines the order’ supply method

Enumeration:
DELIVERY
PICK_UP
DIRECT_SALE
is_open
boolean nullable

Preview order only for open venues

Example:
true
postal_code
string nullable

Preview order based on the postal code

Example:
2415
lat_lot
string nullable

Preview order based on the geo-location (lat/long)

Example:
35.157204,33.314151
address_id
string GUID nullable

Preview order based on the customer address

Example:
28441e3e-767a-b6cc-9a59-6d7705de6428
requested_organisation_id
string GUID nullable

Preview order based on a specific organisation as requested by the customer

Example:
4456e728-019c-86e4-3e4f-bb7920e2ef75
requested_delivery_at
Object nullable

Preview order based on the date and time at which the customer requests the ordered items to be delivered/picked-uo (Applicable only for ordering ahead/scheduling an order)

time
integer required

The order ahead time

Example:
30
time_unit
string required

The order ahead time unit

Example:
MINUTES
date
integer epoch required

The order ahead date

Example:
12312323123

Responses

200 OK

The request has succeeded

Body
Array
Object
fulfilled_by
Object

Details about the organisation (business/merchant/venues) that will fulfill the order

id
string GUID

The organisation identifier

Example:
3FD1E31269B76D7A65ACCE45B2E68DFD
name
string

The organisation name

Example:
Best Burger Egkomi
phone
string

The organisation phone number

Example:
+6934222321
address
Object
address_line_1
string

The address line 1

Example:
Elia Papakyriakou 21
address_line_2
string

The address line 2

Example:
Tower Star
state_province_county
string

The address county/state/province

Example:
Egkomi
town_city
string

The address city

Example:
Nicosia
postal_code
string

The address postal code

Example:
2000
country_code
string

The country code of the address

Example:
CYP
lat
number

The latitude of the address

Example:
32.15
lon
number

The longitude of the address

Example:
35.15
google_place_id
string

The Google textual identifier that uniquely identifies an address

Example:
ChIJrTLr-GyuEmsRBfy61i59si0
parent_organisation
Object

Details about the parent organisation (business/merchant) of the fulfilled by. Not applicable if the fulfilled by organisation is of type business or merchant

id
string GUID

The organisation identifier

Example:
b1607c37-e750-2324-ac49-6591a86f54b8
name
string

The organisation name

Example:
Best Burger
creatives
Array

Creatives images for marketing includes the primary image and scaled versions to create a srcset

Object
id
string GUID

The creative identifier

Example:
a3f1f6b3-8d49-3a72-e48e-617dd6004d41
usage_type
string

Information about the creative type

Enumeration:
LOGO
BACKGROUND
MARKETING
ATTACHMENT
width
integer

The creative width

Example:
2159
height
integer

The creative height

Example:
3075
format
string

The creative format

Example:
jpg
url
string

The creative content URL

Example:
https://assets.crm.com/image/offer.jpg
public_id
string

The creative public identifier

Example:
crm-com/image
media
Array

Details about creative transformations

Object
width
integer

The transformed creative width

Example:
200
height
integer

The transformed creative height

Example:
300
url
string

The transformed creative URL

Example:
https://asset.crm.com/image/offer/c_scale,w_200/offer.jpg
payment_method_types
Array

The payment methods applicable for the fulfilled by organisation

Example:
[
    "CASH","CARD"
]
string
Enumeration:
CASH
CARD
ACCOUNT_DEBIT
WALLET
CRM_WALLET
CHEQUE
ELECTRONIC_TRANSFER
Example:
CARD
creatives
Array

Creatives images for marketing includes the primary image and scaled versions to create a srcset

Object
id
string GUID

The creative identifier

Example:
a3f1f6b3-8d49-3a72-e48e-617dd6004d41
usage_type
string

Information about the creative type

Enumeration:
LOGO
BACKGROUND
MARKETING
ATTACHMENT
width
integer

The creative width

Example:
2159
height
integer

The creative height

Example:
3075
format
string

The creative format

Example:
jpg
url
string

The creative content URL

Example:
https://assets.crm.com/image/offer.jpg
public_id
string

The creative public identifier

Example:
crm-com/image
media
Array

Details about creative transformations

Object
width
integer

The transformed creative width

Example:
200
height
integer

The transformed creative height

Example:
300
url
string

The transformed creative URL

Example:
https://asset.crm.com/image/offer/c_scale,w_200/offer.jpg
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
POST https://sandbox.crm.com/self-service/v1/estimates/order_fulfillment HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "supply_method": "DIRECT_SALE",
    "is_open": true,
    "postal_code": "2415",
    "lat_lot": "35.157204,33.314151",
    "address_id": "28441e3e-767a-b6cc-9a59-6d7705de6428",
    "requested_organisation_id": "4456e728-019c-86e4-3e4f-bb7920e2ef75",
    "requested_delivery_at": {
        "time": 30,
        "time_unit": "MINUTES",
        "date": 12312323123
    }
}

HTTP/1.1 200 OK 

Content-Type: application/json

[
    {
        "fulfilled_by": {
            "id": "3FD1E31269B76D7A65ACCE45B2E68DFD",
            "name": "Best Burger Egkomi",
            "phone": "+6934222321",
            "address": {
                "address_line_1": "Elia Papakyriakou 21",
                "address_line_2": "Tower Star",
                "state_province_county": "Egkomi",
                "town_city": "Nicosia",
                "postal_code": "2000",
                "country_code": "CYP",
                "lat": 32.15,
                "lon": 35.15,
                "google_place_id": "ChIJrTLr-GyuEmsRBfy61i59si0"
            },
            "parent_organisation": {
                "id": "b1607c37-e750-2324-ac49-6591a86f54b8",
                "name": "Best Burger",
                "creatives": [
                    {
                        "id": "CA123456789AQWSXZAQWS1236547896541",
                        "usage_type": "LOGO",
                        "width": 2159,
                        "height": 3075,
                        "format": "jpg",
                        "url": "https://assets.crm.com/image/offer.jpg",
                        "public_id": "crm-com/image",
                        "media": [
                            {
                                "width": 200,
                                "height": 300,
                                "url": "https://asset.crm.com/image/offer/c_scale,w_200/offer.jpg"
                            }
                        ]
                    }
                ]
            },
            "payment_method_types": [
                "PENDING"
            ],
            "creatives": [
                {
                    "id": "CA123456789AQWSXZAQWS1236547896541",
                    "usage_type": "MARKETING",
                    "width": 2159,
                    "height": 3075,
                    "format": "jpg",
                    "url": "https://assets.crm.com/image/offer.jpg",
                    "public_id": "crm-com/image",
                    "media": [
                        {
                            "width": 200,
                            "height": 300,
                            "url": "https://asset.crm.com/image/offer/c_scale,w_200/offer.jpg"
                        }
                    ]
                }
            ]
        }
    }
]
Order Preview
POST /estimates/orders

Preview order information before making an order including fulfillment and invoice estimations

Notes

ORDER FLOW

Integrating an order flow the following APIs should be called The following APIs should be called in order to make an order

  1. Order Fulfillment
  2. Orders Preview
  3. Submit Order

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A
api_key
string required

The publishable api key for application identification

Example:
ab5f8b2e-092f-4848-8f46-31df1c014060

Request body

Object
account_id
string GUID nullable

The account identifier that will place the order (if not specified, then order estimates and prices will be based on currency or business base/default currency)

Example:
1bd3e4d3-5981-209b-787d-352dcd5389a3
currency_code
string nullable

The currency code that order estimation will be based on (if not specified, then order estimates and prices will be based on business base/default currency)

Example:
EUR
supply_method
string

Defines the order’ supply method

Enumeration:
DELIVERY
PICK_UP
DIRECT_SALE
fulfilled_by
string required
requested_delivery_at
Object nullable

Details about the requested delivery time

time
integer
Example:
30
time_unit
string
Example:
MINUTES
date
integer
Example:
12312323123
address_id
string GUID

The contact’s existing address that order will be delivered (required for DELIVERY orders, semi-optional with currect location)

Example:
84bfd840-b520-5bde-8f0a-b36937a2fce7
current_location
Object

Details about the address

address_line_1
string

The address line 1

Example:
17 Baker Str
address_line_2
string

The address line 2

state_province_county
string

The address state/province/county

Example:
Egkomi
town_city
string

The address town/city

Example:
Nicosia
postal_code
string

The address postal code

Example:
12462
country_code
string

The address country code

Example:
GR
lat
number

The address geolocation latitude

Example:
12.345
lon
number

The address geolocation longtitude

Example:
11.452
googlePlaceId
string

The address unique Google identifier

Example:
123ewd23rwe23w
notes
string

Additional order notes

Example:
Sample Notes
use_wallet_funds
boolean

Defines whether available wallet funds should be used or not

Example:
false
wallet_funds_amount
number

The requested wallet funds amount to use

Example:
1
payment_method_type
string

Defines the desired payment method for order

Enumeration:
CASH
CARD
WALLET
CRM_WALLET
ACCOUNT_DEBIT
CHEQUE
line_items
Array
Object
id
string GUID

The unique identifier of the product to be ordered

Example:
7f45ad8a-b164-2a67-eb93-8651c0f1b101
quantity
integer
Example:
1
price
number
Example:
2.99
tax_model
string
Example:
TAX_INCLUSIVE
notes
string
price_term_id
string

Applicable and required only for termed and one-time services. If product has a single price then it is not required.

components
Array
Object
id
string GUID
Example:
6e111025-002b-48d7-a675-6d9e48070b8f
quantity
integer
Example:
1
price
number
Example:
0.5
tax_model
string
Example:
TAX_INCLUSIVE
price_terms_id
string

Applicable only when adding a service components in a flexible service bundle

Responses

200 OK

The request has succeeded

Body
Object
id
string
order_estimate
Object
ordering_allowed
boolean

Indicates whether minimum order amount is met and order can proceed with submission.

Example:
true
minimum_amount
number

Defines the minimum order amount as specified in the fulfillment policy of the organisation fulfilling the order.

Example:
5
fulfilled_by
Object
id
string
Example:
3FD1E31269B76D7A65ACCE45B2E68DFD
name
string
Example:
Bro Burgers
estimated_delivery
Object
time_to_deliver
integer
Example:
1
uot
string
Example:
minutes
delivered_at
integer
Example:
12345565
invoice_estimate
Object
issued_date
integer
Example:
123456789
due_date
integer
Example:
123456789
currency_code
string
Example:
EUR
is_credit
boolean
Example:
true
wallet_funds_amount
number
Example:
5.99
total_net_amount
integer
Example:
1
total_discount_amount
integer
Example:
1
total_discount_incl_tax
integer
Example:
1
total_tax_amount
number
Example:
0.99
total_amount
number
Example:
9.99
total_price
number

Sum of all product prices as these are defined in the product catalog

amount_due
string
amount_to_collect
integer
Example:
1
taxes_breakdown
Array
Object
tax_amount
number
Example:
0.99
tax_rate
Object
id
string
name
string
tax_code
string
Example:
VAT
percentage
integer
Example:
1
line_items
Array
Object
id
string
Example:
7CD9C84FA60F9FE407140E20F707726A
sku
string
name
string
tax_model
string
Example:
TAX_INCLUSIVE
rate_model
string
Example:
TIERED
quantity
integer
Example:
1
price
number
Example:
11.99
unit_price
number
Example:
9.99
net_amount
number
Example:
9.99
discount
Object
discount_amount
number
Example:
0.96
discount_percentage
number
Example:
1.5
discount_incl_tax
number
Example:
0.98
tax_amount
number
Example:
0.99
sub_total
number
Example:
9.99
classification
string
applied_taxes
Array
Object
tax_amount
number
Example:
0.99
tax_exempt_reason
string
Example:
CONTACT
tax_rate
Object
id
string
name
string
tax_code
string
Example:
VAT
percentage
integer
Example:
1
service_delivery_estimate
Array
Object
action_allowed
boolean
Example:
true
allowed_execution_on
integer
Example:
12345678
next_billing_date
integer
Example:
1235678
next_payment_date
integer
Example:
12345678
subscription
Object
life_cycle_state
string
Example:
ACTIVE
terms
Object
billing_period
Object
duration
integer
Example:
1
uot
string
Example:
MONTHS
billing_day
Object
day_of_month
integer
Example:
5
day_of_week
string
Example:
MONDAY
services_to_add
Array
Object
life_cycle_state
string
Example:
EFFECTIVE
product
Object
id
string
sku
string
name
string
trial_period
Object
starts_on
integer
Example:
12345678
ends_on
integer
Example:
12345678
dependencies
Array
Object
item_type
string
item_id
string
item_name
string
billing_estimate
Object
billing_date
integer
Example:
12345678
billed_period
Object
from_date
integer
Example:
12345678
to_date
integer
Example:
12345678
totals
Object
total_amount
number
Example:
9.99
tax_amount
number
Example:
1.99
net_amount
number
Example:
1.99
discount_amount
number
Example:
1.99
invoicing
Array
Object
issued_date
integer
Example:
123456789
due_date
integer
Example:
123456789
currency_code
string
Example:
EUR
is_credit
boolean
Example:
true
wallet_funds_amount
number
Example:
5.99
total_net_amount
integer
Example:
1
total_discount_amount
integer
Example:
1
total_discount_incl_tax
integer
Example:
1
total_tax_amount
number
Example:
0.99
total_amount
number
Example:
9.99
total_price
number

Sum of all product prices as these are defined in the product catalog

amount_due
string
amount_to_collect
integer
Example:
1
taxes_breakdown
Array
Object
tax_amount
number
Example:
0.99
tax_rate
Object
id
string
name
string
tax_code
string
Example:
VAT
percentage
integer
Example:
1
line_items
Array
Object
id
string
Example:
7CD9C84FA60F9FE407140E20F707726A
sku
string
name
string
tax_model
string
Example:
TAX_INCLUSIVE
rate_model
string
Example:
TIERED
quantity
integer
Example:
1
price
number
Example:
11.99
unit_price
number
Example:
9.99
net_amount
number
Example:
9.99
discount
Object
discount_amount
number
Example:
0.96
discount_percentage
number
Example:
1.5
discount_incl_tax
number
Example:
0.98
tax_amount
number
Example:
0.99
sub_total
number
Example:
9.99
classification
string
applied_taxes
Array
Object
tax_amount
number
Example:
0.99
tax_exempt_reason
string
Example:
CONTACT
tax_rate
Object
id
string
name
string
tax_code
string
Example:
VAT
percentage
integer
Example:
1
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
POST https://sandbox.crm.com/self-service/v1/estimates/orders HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "account_id": "1bd3e4d3-5981-209b-787d-352dcd5389a3",
    "supply_method": "DELIVERY",
    "fulfilled_by": "",
    "requested_delivery_at": {
        "time": 30,
        "time_unit": "MINUTES",
        "date": 12312323123
    },
    "address_id": "84bfd840-b520-5bde-8f0a-b36937a2fce7",
    "current_location": {
        "address_line_1": "17 Baker Str",
        "address_line_2": "",
        "state_province_county": "Egkomi",
        "town_city": "Nicosia",
        "postal_code": "12462",
        "country_code": "GR",
        "lat": 12.345,
        "lon": 11.452,
        "googlePlaceId": "123ewd23rwe23w"
    },
    "notes": "Sample Notes",
    "use_wallet_funds": "false",
    "payment_method_type": "CARD",
    "line_items": [
        {
            "id": "7f45ad8a-b164-2a67-eb93-8651c0f1b101",
            "quantity": 1,
            "price": 2.99,
            "tax_model": "TAX_INCLUSIVE",
            "notes": "",
            "price_term_id": "",
            "components": [
                {
                    "id": "6e111025-002b-48d7-a675-6d9e48070b8f",
                    "quantity": 1,
                    "price": 0.5,
                    "tax_model": "TAX_INCLUSIVE"
                }
            ]
        }
    ]
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "",
    "order_estimate": {
        "ordering_allowed": "true",
        "minimum_amount": 5,
        "fulfilled_by": {
            "id": "3FD1E31269B76D7A65ACCE45B2E68DFD",
            "name": "Bro Burgers"
        },
        "estimated_delivery": {
            "time_to_deliver": 1,
            "uot": "minutes",
            "delivered_at": 12345565
        }
    },
    "invoice_estimate": {
        "issued_date": 123456789,
        "due_date": 123456789,
        "currency": "EUR",
        "total_net_amount": 1,
        "total_discount_amount": 1,
        "total_tax_amount": 0.99,
        "total_amount": 9.99,
        "wallet_funds_amount": 11.99,
        "amount_due": 9.99,
        "taxes_breakdown": [
            {
                "tax_amount": 0.99,
                "tax_rate": {
                    "id": "",
                    "name": "",
                    "tax_code": "VAT",
                    "percentage": 1
                }
            }
        ],
        "line_items": [
            {
                "id": "7CD9C84FA60F9FE407140E20F707726A",
                "sku": "",
                "name": "",
                "tax_model": "TAX_INCLUSIVE",
                "rate_model": "TIERED",
                "quantity": 1,
                "unit_price": 9.99,
                "net_amount": 9.99,
                "discount_amount": 0.1,
                "tax_amount": 0.99,
                "sub_total": 9.99,
                "applied_promotions": [
                    {
                        "discount_value": 0.1,
                        "discount_type": "AMOUNT",
                        "discount_amount": 0.1,
                        "promotion": {
                            "id": "0b551184-aa37-43af-646f-a40d9da017a8",
                            "name": ""
                        }
                    }
                ],
                "applied_taxes": [
                    {
                        "tax_amount": 0.99,
                        "tax_exempt_reason": "CONTACT",
                        "tax_rate": {
                            "id": "0b551184-aa37-43af-646f-a40d9da017a8",
                            "name": "",
                            "tax_code": "VAT",
                            "percentage": 1
                        }
                    }
                ]
            }
        ]
    },
    "service_delivery_estimate": [
        {
            "action_allowed": true,
            "allowed_execution_on": 12345678,
            "next_billing_date": 1235678,
            "next_payment_date": 12345678,
            "subscription": {
                "life_cycle_state": "ACTIVE",
                "terms": {
                    "billing_period": {
                        "duration": 1,
                        "uot": "MONTHS"
                    },
                    "billing_day": {
                        "day_of_month": 5,
                        "day_of_week": "MONDAY"
                    }
                }
            },
            "services_to_add": [
                {
                    "life_cycle_state": "EFFECTIVE",
                    "product": {
                        "id": "",
                        "sku": "",
                        "name": ""
                    },
                    "trial_period": {
                        "starts_on": 12345678,
                        "ends_on": 12345678
                    },
                    "dependencies": [
                        {
                            "item_type": "",
                            "item_id": "",
                            "item_name": ""
                        }
                    ]
                }
            ],
            "billing_estimate": {
                "billing_date": 12345678,
                "billed_period": {
                    "from_date": 12345678,
                    "to_date": 12345678
                },
                "totals": {
                    "total_amount": 9.99,
                    "tax_amount": 1.99,
                    "net_amount": 1.99,
                    "discount_amount": 1.99
                },
                "invoicing": [
                    {
                        "issue_date": 123456,
                        "due_date": 123456,
                        "currency": "EUR",
                        "is_credit": true,
                        "total_net_amount": 1,
                        "total_discount_amount": 1,
                        "total_tax_amount": 0.99,
                        "total_amount": 9.99,
                        "taxes_breakdown": [
                            {
                                "tax_amount": 0.99,
                                "tax_rate": {
                                    "id": "",
                                    "name": "",
                                    "tax_code": "VAT",
                                    "percentage": 1
                                }
                            }
                        ],
                        "line_items": [
                            {
                                "id": "7CD9C84FA60F9FE407140E20F707726A",
                                "sku": "",
                                "name": "",
                                "tax_model": "TAX_INCLUSIVE",
                                "rate_model": "TIERED",
                                "quantity": 1,
                                "unit_price": 9.99,
                                "net_amount": 9.99,
                                "discount_amount": 0.1,
                                "tax_amount": 0.99,
                                "sub_total": 9.9,
                                "applied_taxes": [
                                    {
                                        "tax_amount": 0.99,
                                        "tax_exempt_reason": "CONTACT",
                                        "tax_rate": {
                                            "id": "0b551184-aa37-43af-646f-a40d9da017a8",
                                            "name": "",
                                            "tax_code": "VAT",
                                            "percentage": 1
                                        }
                                    }
                                ]
                            }
                        ]
                    }
                ]
            }
        }
    ]
}
Product Recommendation
GET /products/recommendation

Request headers

api_key
string required

The publishable api key for application identification

Example:
ab5f8b2e-092f-4848-8f46-31df1c014060

Responses

200 OK
Body
Object
content
Array
Object
upsells
string
cross_sells
string
components
string
tier_path
string
paging
Object

Information that can be used in order to display large pages

page
integer

The page number

Example:
2
size
integer

The number of records per page

Default:
10
Example:
20
total
integer

The total number of records. If “include_total” is not specified, then this total is null. If “include_total” is specified, total has a value but it is accurate up to 10K records.

Example:
1124
has_more
boolean

Shows if there are more records available to fetch

Example:
true
Service Delivery
POST /estimates/service_delivery

Returns an estimation of change(s) perfromed on a subscription service, without making the actual change. The estimation is based on the service to which the contact Is alreayd subscribed to plus any requested changes. The estiimation returns:

  • Whether the change can be performed or not
  • Where the change will be performed immediately or it should be scheduled
  • What changes on the contact’s list of services
  • How the contact’s billing is affected by presenting the contact’s next billing information.

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A
api_key
string required

The publishable api key for application identification

Example:
ab5f8b2e-092f-4848-8f46-31df1c014060

Request body

Object
action
string required

The action that the contact wants to perofrm on one or more services

Enumeration:
ADD
ACTIVATE
DEACTIVATE
CHANGE
CANCEL
REGRET
CHANGE_TERMS
Example:
CHANGE
classification_code
string

Applicable and required when changing the terms of a service

Enumeration:
OPT_IN_RENEWALS
OPT_OUT_RENEWALS
RENEW_TERMS
Example:
OPT_IN_RENEWALS
contact_id
string GUID required

The contact’s identifier. Either a contact or an organisation can be set

Example:
ab5f8b2e-092f-4848-8f46-31df1c014060
organisation_id
string

The orgnaisation that owns the subscription. Either a contact or an organisation can be set

Example:
ab5f8b2e-092f-4848-8f46-31df1c014060
account_id
string

The account of the subscriber against which the subscirpiton’s billing transactions are posted.

Example:
ab5f8b2e-092f-4848-8f46-31df1c014060
subscription_id
string

The subscription that groups the services based on their billing cycle.

Example:
ab5f8b2e-092f-4848-8f46-31df1c014060
scheduled_date
integer

The date on which the subscriber wants to make the change. This date cannot be set in the past

Example:
1663619241
subscription_term_changes
Object
billing_day
Object
day_of_month
integer nullable
Example:
1
day_of_week
string nullable
Example:
MONDAY
payment_method_id
string
funding_source
string
Enumeration:
ACCOUNT
WALLET
services_to_add
Array
Object
product_id
string required
price_terms_id
string
quantity
string
components
Array
Object
product_id
string
price_terms_id
string
services_to_remove
Array
Example:
["id1"]
Object
id
string
services_to_change
Array
Object
from_service_id
string required
to_service_product_id
string required
to_price_terms_id
string
quantity
string
components
Array
Object
product_id
string
price_terms_id
string
service_term_changes
Array
Object
service_id
string required
auto_renewal_preference
string
Example:
OPT_IN, OPT_OUT
contract_preference
string
extend_by
Object
period
string
uot
string

Responses

201 Created
Body
Object
service_delivery_estimate
Array
Object
action_allowed
boolean
Example:
true
allowed_execution_on
integer
Example:
12345678
next_billing_date
integer
Example:
1235678
next_payment_date
integer
Example:
12345678
subscription
Object
state
string
Enumeration:
ACTIVE
INACTIVE
CHURNED
terms
Object
billing_period
Object
duration
integer
Example:
1
uot
string
Example:
MONTHS
billing_day
Object
day_of_month
integer
Example:
5
day_of_week
string
Example:
MONDAY
services_to_add
Array
Object
state
string
Enumeration:
DRAFT
EFFECTIVE
NOT_EFFECTIVE
CANCELLED
REGRETTED
product
Object
id
string
sku
string
name
string
trial_period
Object
starts_on
integer
Example:
12345678
ends_on
integer
Example:
12345678
services_to_remove
Array
Object
id
string
state
string
Enumeration:
CANCELLED
REGRETTED
product
Object
id
string
sku
string
name
string
services_to_change
Array
Object
id
string
state
string
Enumeration:
EFFECTIVE
SWAPPED
product
Object
id
string
sku
string
name
string
change_to_product
Object
id
string
sku
string
name
string
billing_estimate
Object

Estimation on how the subscriber’s billing would be affected because of the requested change

billing_date
integer

When the requested change will be billed

Example:
1663619524
billed_period
Object

How the subscription’s billing cycle is affected

from_date
integer

The next billing cycle’s start dtae

Example:
1663619524
to_date
integer

The end date of the updated billing cycle

Example:
1663619559
totals
Object

Total amounts of the estimated bill

total
number

Total amount of the upcoming bill

Example:
9.99
tax
number

Total taxed

Example:
1.99
net
number

Total net

Example:
1.99
discount
number

Total discount

Example:
1.99
account_funds
number
invoicing
Array
Object
issued_date
integer
Example:
123456789
due_date
integer
Example:
123456789
currency_code
string
Example:
EUR
is_credit
boolean
Example:
true
wallet_funds_amount
number
Example:
5.99
total_net_amount
integer
Example:
1
total_discount_amount
integer
Example:
1
total_discount_incl_tax
integer
Example:
1
total_tax_amount
number
Example:
0.99
total_amount
number
Example:
9.99
total_price
number

Sum of all product prices as these are defined in the product catalog

amount_due
string
amount_to_collect
integer
Example:
1
taxes_breakdown
Array
Object
tax_amount
number
Example:
0.99
tax_rate
Object
id
string
name
string
tax_code
string
Example:
VAT
percentage
integer
Example:
1
line_items
Array
Object
id
string
Example:
7CD9C84FA60F9FE407140E20F707726A
sku
string
name
string
tax_model
string
Example:
TAX_INCLUSIVE
rate_model
string
Example:
TIERED
quantity
integer
Example:
1
price
number
Example:
11.99
unit_price
number
Example:
9.99
net_amount
number
Example:
9.99
discount
Object
discount_amount
number
Example:
0.96
discount_percentage
number
Example:
1.5
discount_incl_tax
number
Example:
0.98
tax_amount
number
Example:
0.99
sub_total
number
Example:
9.99
classification
string
applied_taxes
Array
Object
tax_amount
number
Example:
0.99
tax_exempt_reason
string
Example:
CONTACT
tax_rate
Object
id
string
name
string
tax_code
string
Example:
VAT
percentage
integer
Example:
1
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
POST https://sandbox.crm.com/self-service/v2/estimates/service_delivery HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A
api_key: ab5f8b2e-092f-4848-8f46-31df1c014060
Content-Type: application/json

{
    "action": "CHANGE",
    "classification_code": "OPT_IN_RENEWALS",
    "contact_id": "ab5f8b2e-092f-4848-8f46-31df1c014060",
    "organisation_id": "ab5f8b2e-092f-4848-8f46-31df1c014060",
    "account_id": "ab5f8b2e-092f-4848-8f46-31df1c014060",
    "subscription_id": "ab5f8b2e-092f-4848-8f46-31df1c014060",
    "scheduled_date": 1663619241, 
    "subscription_term_changes": {
        "billing_day": {
            "day_of_month": 1,
            "day_of_week": "MONDAY"
        },
        "payment_method_id": "",
        "funding_source": "WALLET"
    },
    "services_to_add": [
        {
            "product_id": "",
            "price_terms_id": "",
            "quantity": "",
            "components": [
                {
                    "product_id": "",
                    "price_terms_id": ""
                }
            ]
        }
    ],
    "services_to_remove": [
        {
            "id": ""
        }
    ],
    "services_to_change": [
        {
            "from_service_id": "",
            "to_service_product_id": "",
            "to_price_terms_id": "",
            "quantity": "",
            "components": [
                {
                    "product_id": "",
                    "price_terms_id": ""
                }
            ]
        }
    ],
    "service_term_changes": [
        {
            "service_id": "",
            "auto_renewal_preference": "OPT_IN, OPT_OUT",
            "contract_preference": "",
            "extend_by": {
                "period": "",
                "uot": ""
            }
        }
    ]
}

HTTP/1.1 201 Created 

Content-Type: application/json

{
    "service_delivery_estimate": [
        {
            "action_allowed": true,
            "allowed_execution_on": 12345678,
            "next_billing_date": 1235678,
            "next_payment_date": 12345678,
            "subscription": {
                "state": "CHURNED", 
                "terms": {
                    "billing_period": {
                        "duration": 1,
                        "uot": "MONTHS"
                    },
                    "billing_day": {
                        "day_of_month": 5,
                        "day_of_week": "MONDAY"
                    }
                }
            },
            "services_to_add": [
                {
                    "state": "DRAFT",
                    "product": {
                        "id": "",
                        "sku": "",
                        "name": ""
                    },
                    "trial_period": {
                        "starts_on": 12345678,
                        "ends_on": 12345678
                    }
                }
            ],
            "services_to_remove": [
                {
                    "id": "",
                    "state": "CANCELLED",
                    "product": {
                        "id": "",
                        "sku": "",
                        "name": ""
                    }
                }
            ],
            "services_to_change": [
                {
                    "id": "",
                    "state": "SWAPPED",
                    "product": {
                        "id": "",
                        "sku": "",
                        "name": ""
                    },
                    "change_to_product": {
                        "id": "",
                        "sku": "",
                        "name": ""
                    }
                }
            ],
            "billing_estimate": {
                "billing_date": 1663619524,
                "billed_period": {
                    "from_date": 1663619524,
                    "to_date": 1663619559
                },
                "totals": {
                    "total": 9.99,
                    "tax": 1.99,
                    "net": 1.99,
                    "discount": 1.99,
                    "account_funds": 1
                },
                "invoicing": [
                    {
                        "issued_date": 123456789,
                        "due_date": 123456789,
                        "currency_code": "EUR",
                        "is_credit": true,
                        "wallet_funds_amount": 5.99,
                        "total_net_amount": 1,
                        "total_discount_amount": 1,
                        "total_discount_incl_tax": 1,
                        "total_tax_amount": 0.99,
                        "total_amount": 9.99,
                        "total_price": 1,
                        "amount_due": "",
                        "amount_to_collect": 1,
                        "taxes_breakdown": [
                            {
                                "tax_amount": 0.99,
                                "tax_rate": {
                                    "id": "",
                                    "name": "",
                                    "tax_code": "VAT",
                                    "percentage": 1
                                }
                            }
                        ],
                        "line_items": [
                            {
                                "id": "7CD9C84FA60F9FE407140E20F707726A",
                                "sku": "",
                                "name": "",
                                "tax_model": "TAX_INCLUSIVE",
                                "rate_model": "TIERED",
                                "quantity": 1,
                                "price": 11.99,
                                "unit_price": 9.99,
                                "net_amount": 9.99,
                                "discount": {
                                    "discount_amount": 0.96,
                                    "discount_percentage": 1.5,
                                    "discount_incl_tax": 0.98
                                },
                                "tax_amount": 0.99,
                                "sub_total": 9.99,
                                "classification": "",
                                "applied_taxes": [
                                    {
                                        "tax_amount": 0.99,
                                        "tax_exempt_reason": "CONTACT",
                                        "tax_rate": {
                                            "id": "",
                                            "name": "",
                                            "tax_code": "VAT",
                                            "percentage": 1
                                        }
                                    }
                                ]
                            }
                        ]
                    }
                ]
            }
        }
    ]
}
Landing Pages

Retrieval of a web page which serves as the entry point for a website or a particular section of a website.

GET /landing_pages/{id}
Get Landing Pages
GET /landing_pages/{id}

Retrieve the requested landing page (including details and design)

Path variables

id
string GUID required

The landing page (identifier) that will be retrieved

Example:
7ef05827-11d6-f1ac-8f17-234387157322

Responses

200 OK
Body
Object
name
string

The landing page name

Example:
My loyalty pass enrolment form
public_key
string

The default (live) public key of the organisation

Example:
sdf3ref32rwerf324r134rw23rfd32r23r23r32r
description
string

The landing page description

Example:
Enrolment landing page for mobile pass cards.
type
string

The landing page type

Enumeration:
REGISTER

For contact registration

PURCHASE_PASS

For purchasing a gift pass

link
string

The link that the landing page is housed under

Example:
https://abc.com
mobile_pass
boolean

Defines whether this landing page is associated with the mobile pass card functionality

Example:
true
pass_plan_id
string

Pass plan id - in cases where ‘type’ = PURCHASE_PASS (i.e. the landing page is used for purchasing a gift pass)

Example:
5f1316d2-dfce-42f0-b7bf-c543b8df7702
form
Object
header
string

The text in the header

Example:
This is a header
title
string

The text in the title

Example:
Enrolment form
description
string

The text in the description section

Example:
Please enter detail to enrol for mobile pass cards.
footer
string

The footer text

Example:
Please sign up
button
string

The text to be displayed on the button

Example:
Submit
success
string

The success message to be displayed on the success response page

Example:
Congratulations!
fail
string

The failure message to be displayed on the failure response page

Example:
Failed.
logo_img_position
string

Defines whether the logo image will be positioned

Example:
CENTER
colors
Array

The landing page components coloring

Object
type
string

The landing page component that the color will be applied

Example:
HEADER
value
string

The color code (hex code value)

Example:
FSR4ER
opacity
Array

The landing page images opacity

Object
image
string

The image type

Example:
BACKGROUND
value
integer

The opacity percentage

Example:
1
fields
Array

Defines the landing page form fields

Object
property
string

The field property

Example:
contact.email
label
string

The field label

Example:
email
priority
string

The field priority (order)

Example:
1 , 2 , 3
creatives
Array

Creatives images for marketing includes the primary image and scaled versions to create a srcset

Object
id
string GUID

The creative identifier

Example:
a3f1f6b3-8d49-3a72-e48e-617dd6004d41
usage_type
string

Information about the creative type

Enumeration:
LOGO
BACKGROUND
MARKETING
ATTACHMENT
width
integer

The creative width

Example:
2159
height
integer

The creative height

Example:
3075
format
string

The creative format

Example:
jpg
url
string

The creative content URL

Example:
https://assets.crm.com/image/offer.jpg
public_id
string

The creative public identifier

Example:
crm-com/image
media
Array

Details about creative transformations

Object
width
integer

The transformed creative width

Example:
200
height
integer

The transformed creative height

Example:
300
url
string

The transformed creative URL

Example:
https://asset.crm.com/image/offer/c_scale,w_200/offer.jpg
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
GET https://sandbox.crm.com/self-service/v2/landing_pages/7ef05827-11d6-f1ac-8f17-234387157322 HTTP/1.1 

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "name": "My loyalty pass enrolment form",
    "public_key": "sdf3ref32rwerf324r134rw23rfd32r23r23r32r",
    "description": "Enrolment landing page for mobile pass cards.",
    "type": "REGISTER",
    "link": "https://abc.com",
    "mobile_pass": true,
    "pass_plan_id": "5f1316d2-dfce-42f0-b7bf-c543b8df7702",
    "form": {
        "header": "This is a header",
        "title": "Enrolment form",
        "description": "Please enter detail to enrol for mobile pass cards.",
        "footer": "Please sign up",
        "button": "Submit",
        "success": "Congratulations!",
        "fail": "Failed.",
        "logo_img_position": "CENTER",
        "colors": [
            {
                "type": "HEADER",
                "value": "FSR4ER"
            }
        ],
        "opacity": [
            {
                "image": "BACKGROUND",
                "value": 1
            }
        ],
        "fields": [
            {
                "property": "contact.email",
                "label": "email",
                "priority": "1 , 2 , 3"
            }
        ],
        "creatives": [
            {
                "id": "a3f1f6b3-8d49-3a72-e48e-617dd6004d41",
                "usage_type": "BACKGROUND",
                "width": 2159,
                "height": 3075,
                "format": "jpg",
                "url": "https://assets.crm.com/image/offer.jpg",
                "public_id": "crm-com/image",
                "media": [
                    {
                        "width": 200,
                        "height": 300,
                        "url": "https://asset.crm.com/image/offer/c_scale,w_200/offer.jpg"
                    }
                ]
            }
        ]
    }
}
Mobile Pass Cards

All Api’s associated to Mobile Pass Cards

GET /apple_pass/{org_id}/contacts/{contact_id}
GET /google_pass/{org_id}/contacts/{contact_id}
GET /android_wallet_pass/{org_id}/contacts/{contact_id}
Get Apple Pass
GET /apple_pass/{org_id}/contacts/{contact_id}

Retrieve a contact’s mobile pass for Apple wallet

Path variables

org_id
string GUID required

The organisation (identifier) that the wallet pass is for

Example:
909008f6-1adf-2201-c4c8-74697e5c0405
contact_id
string GUID required

The contact (identifier) that the wallet pass is for

Example:
6ffe4963-7a22-eae8-e901-707d7e180778

Responses

200 OK

The request has succeeded

Body
Object
PK pass file
unknown

Returns a PK pass file.

Get Google Pass
GET /google_pass/{org_id}/contacts/{contact_id}

Retrieve a contact’s mobile pass for Google wallet

Path variables

org_id
string GUID required

The organisation (identifier) that the wallet pass is for

Example:
952cee22-0617-b328-00ef-5ae34e69fd02
contact_id
string GUID required

The contact (identifier) that the wallet pass is for

Example:
06f36eb5-c73c-cefd-005b-ae50e26016bb

Responses

200 OK

The request has succeeded

Body
string
Example:
https://pay.google.com/gp/v/save/{jwt}
Get Android Wallet Pass
GET /android_wallet_pass/{org_id}/contacts/{contact_id}

Retrieve a contact’s mobile pass for (alternative) Android wallet

Path variables

org_id
string GUID required

The organisation (identifier) that the wallet pass is for

Example:
3aabc53a-2d31-e493-f6eb-8a9968088a94
contact_id
string GUID required

The contact (identifier) that the wallet pass is for

Example:
b7483bf0-f20e-3579-b689-8fcbef55465a

Responses

200 OK

The request has succeeded

Body
unknown
Example:
PK Passfile
Orders

Group containing Orders Web APIs

POST /orders
GET /orders/{id}
GET /contacts/{id}/orders
PUT /orders/{id}/actions
Submit Order
POST /orders

Creates a new Order for a contact based on an order’s estimation which was previously obtained by POST /estimates/orders

Notes

ORDER FLOW

Integrating an order flow the following APIs should be called The following APIs should be called in order to make an order

  1. Order Fulfillment
  2. Orders Preview
  3. Submit Order

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Request body

Object
estimation_id
string GUID required

The estimation_id as this is returned back by the estimates/order Web API

Example:
37b56acf-665c-1112-93fc-163b3639bcbe
notes
string nullable

General order notes

Example:
Lorem Ipsum
use_wallet_funds
boolean nullable

Defines whether available wallet funds can be used on the order total amount. If wallet funds do not cover the entire order amount, then payment method will be used

Default:
false
Example:
true
payments
Array required

At least one payment method must be specified. Multiple payment can be specified if the contact selects to pay using one of the allowed payment methods and additionally consume some of the available funds of the CRM Wallet.

Object
payment_method_type
string
Enumeration:
CASH
CARD
ACCOUNT_DEBIT
WALLET
CRM_WALLET
CHEQUE
ELECTRONIC_TRANSFER
Example:
CARD
payment_method_id
string GUID nullable

The payment method that was selected for this order. Applicable and required only when contact selected to pay using one of the registered contact payment methods.

Example:
37b56acf-665c-1112-93fc-163b3639bcbe
payment_token
string nullable

The token that payment will be processed

Example:
paytoken12344
amount
number

The payment amount

Example:
112.12
custom_fields
Array nullable
Object
key
string

The custom field’s unique key

Example:
custom_key
value
string

The custom field’s value

Example:
0001-345

Responses

201 Created
Body
Object
id
string

The identifier of the new Order

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
number
string

The Order’s number

Example:
O000001
fulfilled_by
Object

The organisation that will fulfill the Order

id
string GUID

The organisation’s identifer

Example:
3FD1E31269B76D7A65ACCE45B2E68DFD
name
string

The name of the organisation

Example:
Bro Burgers
phone
string

The organisation’s phone number

Example:
+6934222321
address
Object

Details about the address

address_line_1
string

The address line 1

Example:
17 Baker Str
address_line_2
string

The address line 2

state_province_county
string

The address state/province/county

Example:
Egkomi
town_city
string

The address town/city

Example:
Nicosia
postal_code
string

The address postal code

Example:
12462
country_code
string

The address country code

Example:
GR
lat
number

The address geolocation latitude

Example:
12.345
lon
number

The address geolocation longtitude

Example:
11.452
googlePlaceId
string

The address unique Google identifier

Example:
123ewd23rwe23w
estimated_delivery_time
Object

An estimation of the delivery time

time_to_deliver
integer

TIme to deliver

Example:
30
uot
string

Unit of time

Example:
MINUTES
delivery_at
integer

The actual delivery time

Example:
1668264138
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
POST https://sandbox.crm.com/self-service/v2/orders HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "estimation_id": "37b56acf-665c-1112-93fc-163b3639bcbe",
    "notes": "Lorem Ipsum",
    "use_wallet_funds": "true",
    "payments": [
        {
            "payment_method_type": "CARD",
            "payment_method_id": "37b56acf-665c-1112-93fc-163b3639bcbe",
            "payment_token": "paytoken12344",
            "amount": 112.12
        }
    ],
    "custom_fields": [
        {
            "key": "custom_key",
            "value": "0001-345"
        }
    ]
}

HTTP/1.1 201 Created 

Content-Type: application/json

{
    "id": "CAD1E31269B76D7A65ACCE45B2E68DFD",
    "number": "O000001",
    "fulfilled_by": {
        "id": "3FD1E31269B76D7A65ACCE45B2E68DFD",
        "name": "Bro Burgers",
        "phone": "+6934222321",
        "address": {
            "address_line_1": "17 Baker Str",
            "address_line_2": "",
            "state_province_county": "Egkomi",
            "town_city": "Nicosia",
            "postal_code": "12462",
            "country_code": "GR",
            "lat": 12.345,
            "lon": 11.452,
            "googlePlaceId": "123ewd23rwe23w"
        }
    },
    "estimated_delivery_time": {
        "time_to_deliver": 30,
        "uot": "MINUTES",
        "delivery_at": 1668264138
    }
}
Get Order
GET /orders/{id}

Retrieves detailed information for a specific order

Path variables

id
string GUID required

The order (identifier) that will be retrieved

Example:
6514df04-9218-d354-9d59-ed9e98882fe6

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 OK
Body
Object
id
string GUID

Order identifier

Example:
6514df04-9218-d354-9d59-ed9e98882fe6
number
string

Order number

Example:
O000001
supply_method
string

Defines the order’ supply method

Enumeration:
DELIVERY
PICK_UP
DIRECT_SALE
state
string

The order’s life cycle state

Enumeration:
NEW
IN_PROGRESS
COMPLETED
CANCELLED
ON_HOLD
stage
Object

Order’s stage

id
string

Stage identifier

Example:
6514df04-9218-d354-9d59-ed9e98882fe6
name
string

Stage name

Example:
In Progress
is_favorite
boolean

Shows the contact’s favorite Order

Example:
true
notes
string

The order general notes

Example:
General notes
net
number

Total net amount of the order

Example:
1.99
discount
Object

Total discount amount applied on this Order (includes Ad-Hoc discount as well)

amount
number

Discount amount. This amount does not include taxes.

Example:
9.99
amout_incl_tax
number

Discount amount including tax

Example:
1.99
tax
number

Total taxed amount

Example:
1.99
sub_total
number

Total cost before applying the discount, if any. Tax amoutn is included

total
number

Total cost of the Order, i.e the amount that the contact should pay

Example:
14.99
amount_due
number

Total amount that the contact still hase to pay in order to fully pay off the Order. This implies that contact might already made some payments.

Example:
13.99
currency_code
string
Min length: 3
Max length: 3
Pattern: 3-letter ISO 4217 currency code.
Example:
EUR
fulfilled_by
Object

The organisation that fulfills th eOrder

id
string GUID

The organisation’s identifer

Example:
6514df04-9218-d354-9d59-ed9e98882fe6
name
string

The name of the organisation

Example:
Good Burgers
phone
string

The organisation’s phone number

Example:
+6934222321
address
Object

Details about the address

address_line_1
string

The address line 1

Example:
17 Baker Str
address_line_2
string

The address line 2

state_province_county
string

The address state/province/county

Example:
Egkomi
town_city
string

The address town/city

Example:
Nicosia
postal_code
string

The address postal code

Example:
12462
country_code
string

The address country code

Example:
GR
lat
number

The address geolocation latitude

Example:
12.345
lon
number

The address geolocation longtitude

Example:
11.452
googlePlaceId
string

The address unique Google identifier

Example:
123ewd23rwe23w
address
Object
address_line_1
string

The address line 1

Example:
Elia Papakyriakou 21
address_line_2
string

The address line 2

Example:
Tower Star
state_province_county
string

The address county/state/province

Example:
Egkomi
town_city
string

The address city

Example:
Nicosia
postal_code
string

The address postal code

Example:
2000
country_code
string

The country code of the address

Example:
CYP
lat
number

The latitude of the address

Example:
32.15
lon
number

The longitude of the address

Example:
35.15
google_place_id
string

The Google textual identifier that uniquely identifies an address

Example:
ChIJrTLr-GyuEmsRBfy61i59si0
category
Object

Details about the category

id
string GUID

The category identifier

Example:
0e6089e0-6384-cd55-c0a3-381cc6583094
name
string

The category name

Example:
Normal
key_dates
Object

Order’s key dates

submitted_on
integer

Submitted date

Example:
1668265000
estimated_completion_date
integer

Estimated completion date

Example:
1668265000
completed_on
integer

Completion date

Example:
1668265000
cancelled_on
integer

Cancellation date

Example:
1668265000
requested_date
integer

Date on which order is requested to be delivered

Example:
1668265000
started_on
integer

Order’s progress started date

Example:
1668265000
cancellation_reason
Object

Reason for cancelling the Order

id
string

Cancellation reason identifier

Example:
6514df04-9218-d354-9d59-ed9e98882fe6
name
string

Cancellation reason name

Example:
Items out of stock
items
Array

List of Ordered items

Object
id
string

Order item identifier

quantity
integer

Ordered quantity

Example:
2
notes
string

Notes

Example:
Delay order items delivery
unit_price
number

The unit price charged for this product in the order (excluding tax)

Example:
1.99
discount
Object

Discount applied

amount
number

Applied discount without tax

Example:
1.99
amout_incl_tax
number

Discount including tax

Example:
1.49
sub_total
number

The item’s sub-total before applying the discount, if any. Tax amont is included

Example:
1.4
total
number

The order item’s sub-total

Example:
2.8
product
Object

Ordered product

id
string

Product identifier

Example:
6514df04-9218-d354-9d59-ed9e98882fe6
sku
string

Product SKU

Example:
abc-12345
name
string

Product name

Example:
Installation kit
description
string

Product descripption

classification
string
Enumeration:
TERMED_SERVICE
ONE_TME_SERVICE
EXPENSE_SERVICE
USAGE_SERVICE
TRACEABLE_PHYSICAL_GOOD
NON_TRACEABLE_PHYSCAL_GOOD
Example:
TRACEABLE_PHYSICAL_GOOD
price_terms
Object

Price terms applicable only when ordering termed or one-time services

id
string

Price identifier

billing_period
Object

Billing period

duration
integer

Duration

Example:
1
uot
string

Unit of time

Example:
MONTH
auto_renew
boolean

Service is auto-renewed or not

Example:
true
termed_period_cycles
integer

Termed period’s number of billing cycles

Example:
12
contract_period
Object

Service’s contract period

duration
integer

Duration

Example:
12
uot
string

Unit of time

Example:
MONTH
trial_period
Object

Service trial period

duration
integer

Duration

Example:
7
uot
string

Unit of time

Example:
DAY
billing_model
string

Billing model

Enumeration:
PRE_BILL
POST_BILL
components
Array

Components ordered when placing the order. Applicable for flexible bundles and products with modifiers

Object
id
string

Product identifier

Example:
6514df04-9218-d354-9d59-ed9e98882fe6
sku
string

Product SKU

Example:
0012933-100
name
string

Product name

Example:
Decoder
quantity
integer

Ordered queantity for the component

Example:
2
price
number

Component’s price

Example:
0.99
price_before_discount
number

The price of the component before applying the discount, if any. Tax amount is included

sub_total
number

Total amount for the ordered component

Example:
1.98
creatives
Array

Creatives images for marketing includes the primary image and scaled versions to create a srcset

Object
id
string GUID

The creative identifier

Example:
a3f1f6b3-8d49-3a72-e48e-617dd6004d41
usage_type
string

Information about the creative type

Enumeration:
LOGO
BACKGROUND
MARKETING
ATTACHMENT
width
integer

The creative width

Example:
2159
height
integer

The creative height

Example:
3075
format
string

The creative format

Example:
jpg
url
string

The creative content URL

Example:
https://assets.crm.com/image/offer.jpg
public_id
string

The creative public identifier

Example:
crm-com/image
media
Array

Details about creative transformations

Object
width
integer

The transformed creative width

Example:
200
height
integer

The transformed creative height

Example:
300
url
string

The transformed creative URL

Example:
https://asset.crm.com/image/offer/c_scale,w_200/offer.jpg
payments
Array

List of payment submitted for this Order.

Object
posted_on
integer

When the payment was posted

Example:
1669672054
amount
number

Payment’s amount

Example:
1.99
payment_method_details
Object
type
string
Enumeration:
CASH
CARD
ACCOUNT_DEBIT
WALLET
CRM_WALLET
CHEQUE
ELECTRONIC_TRANSFER
Example:
CARD
identity
Object

The payment method’s details that include the contact’s payment method plus important information about the payment method. Applicable only for Cards, Accunt Debits and Wallet payment method types

id
string

Unique identifier of the payment method

Example:
9837ee37-a1ab-4a27-9b4b-663c9025a205
identifier
string

A short description of the payment method. Depending on the payment method’s type different information is returned:

  • Card: the brand, followed by the last 4 digits of the card plus expiration month/year
  • Account debit: Name: Bank code followed by the first 5 and the last 9 digits of the account number/IBAN
  • Wallet: Name: Email and/or phone used on registration
Example:
Visa ****1234
custom_fields
Array
Object
key
string

The custom field’s unique key

Example:
custom_key
value
string

The custom field’s value

Example:
0001-345
queue
Object

The queue that the Order is following

id
string

Queue identifier

Example:
6514df04-9218-d354-9d59-ed9e98882fe6
name
string

Queue name

Example:
Installations
Example 1
GET https://sandbox.crm.com/self-service/v2/orders/6514df04-9218-d354-9d59-ed9e98882fe6 HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "6514df04-9218-d354-9d59-ed9e98882fe6",
    "number": "O000001",
    "supply_method": "DELIVERY",
    "state": "IN_PROGRESS",
    "stage": {
        "id": "6514df04-9218-d354-9d59-ed9e98882fe6",
        "name": "In Progress"
    },
    "is_favorite": true,
    "notes": "",
    "net": 1,
    "discount": {
        "amount": 9.99,
        "amout_incl_tax": 1
    },
    "tax": 1.99,
    "sub_total": 1,
    "total": 14.99,
    "amount_due": 13.99,
    "currency_code": "EUR",
    "fulfilled_by": {
        "id": "6514df04-9218-d354-9d59-ed9e98882fe6",
        "name": "Good Burgers",
        "phone": "+6934222321",
        "address": {
            "address_line_1": "17 Baker Str",
            "address_line_2": "",
            "state_province_county": "Egkomi",
            "town_city": "Nicosia",
            "postal_code": "12462",
            "country_code": "GR",
            "lat": 12.345,
            "lon": 11.452,
            "googlePlaceId": "123ewd23rwe23w"
        }
    },
    "address": {
        "address_line_1": "Elia Papakyriakou 21",
        "address_line_2": "Tower Star",
        "state_province_county": "Egkomi",
        "town_city": "Nicosia",
        "postal_code": "2000",
        "country_code": "CYP",
        "lat": 32.15,
        "lon": 35.15,
        "google_place_id": "ChIJrTLr-GyuEmsRBfy61i59si0"
    },
    "category": {
        "id": "0e6089e0-6384-cd55-c0a3-381cc6583094",
        "name": "Normal"
    },
    "key_dates": {
        "submitted_on": 1668265000,
        "estimated_completion_date": 1668265000,
        "completed_on": 1668265000,
        "cancelled_on": 1668265000,
        "requested_date": 1668265000,
        "started_on": 1668265000
    },
    "cancellation_reason": {
        "id": "6514df04-9218-d354-9d59-ed9e98882fe6",
        "name": "Items out of stock"
    },
    "items": [
        {
            "id": "",
            "quantity": 2,
            "notes": "Delay order items delivery",
            "unit_price": 1.99,
            "discount": {
                "amount": 1.99,
                "amout_incl_tax": 1.49
            },
            "sub_total": 1.4,
            "total": 2.8,
            "product": {
                "id": "6514df04-9218-d354-9d59-ed9e98882fe6",
                "sku": "abc-12345",
                "name": "Installation kit",
                "description": "",
                "classification": "TRACEABLE_PHYSICAL_GOOD",
                "price_terms": {
                    "id": "",
                    "billing_period": {
                        "duration": 1,
                        "uot": "MONTH"
                    },
                    "auto_renew": true,
                    "termed_period_cycles": 12,
                    "contract_period": {
                        "duration": 12,
                        "uot": "MONTH"
                    },
                    "trial_period": {
                        "duration": 7,
                        "uot": "DAY"
                    },
                    "billing_model": "POST_BILL"
                },
                "components": [
                    {
                        "id": "6514df04-9218-d354-9d59-ed9e98882fe6",
                        "sku": "0012933-100",
                        "name": "Decoder",
                        "quantity": 2,
                        "price": 0.99,
                        "price_before_discount": 1,
                        "sub_total": 1.98
                    }
                ],
                "creatives": [
                    {
                        "id": "a3f1f6b3-8d49-3a72-e48e-617dd6004d41",
                        "usage_type": "LOGO",
                        "width": 2159,
                        "height": 3075,
                        "format": "jpg",
                        "url": "https://assets.crm.com/image/offer.jpg",
                        "public_id": "crm-com/image",
                        "media": [
                            {
                                "width": 200,
                                "height": 300,
                                "url": "https://asset.crm.com/image/offer/c_scale,w_200/offer.jpg"
                            }
                        ]
                    }
                ]
            }
        }
    ],
    "payments": [
        {
            "posted_on": "",
            "amount": 1.99,
            "payment_method_details": {
                "type": "CARD",
                "identity": {
                    "id": "9837ee37-a1ab-4a27-9b4b-663c9025a205",
                    "identifier": "Visa ****1234"
                }
            }
        }
    ],
    "custom_fields": [
        {
            "key": "custom_key",
            "value": "0001-345"
        }
    ],
    "queue": {
        "id": "6514df04-9218-d354-9d59-ed9e98882fe6",
        "name": "Installations"
    }
}
List Orders
GET /contacts/{id}/orders

Retrieves a list of a contact’s Orders, regardless of their queue, stage or state.

Path variables

id
string GUID required

The contact identifier whose orders will be retrieved

Example:
067083a5-607c-959e-e62a-3ba8d359bdd6

Request parameters

sort
string optional

Defines on which attribute the results should be sorted

Allow empty value: true
Examples:
CREATED_DATEUPDATED_DATENAMEPOSTED_DATE
order
string optional

Defines how the results will be ordered

Allow empty value: true
Enumeration:
ASC
DESC
Default:
DESC
page
integer optional

The page number that should be retrieved

Default:
1
Example:
20
size
string optional

The size (total records) of each page

Default:
10
Example:
20
include_custom_fields
boolean optional

Determines whether custom fields should be retrieved or not

Example:
true
custom_fields
string optional

Filters based on custom fields (key/value set should be semicolon separated)

Example:
key;value;key;value
state
string optional
Enumeration:
NEW
IN_PROGRESS
COMPLETED
CANCELLED
ON_HOLD
supply_method
string optional
Enumeration:
DELIVERY
PICK_UP
DIRECT_SALE
stage_id
string optional

The order’s stage

Example:
6514df04-9218-d354-9d59-ed9e98882fe6

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 OK
Body
Object
id
string GUID

The order identifier

Example:
00dee79b-8a97-7d86-4ecd-5c14f75ec071
number
string

The order number

Example:
O000001
supply_method
string

Defines the order’ supply method

Enumeration:
DELIVERY
PICK_UP
DIRECT_SALE
state
string

The order’s life cycle state

Enumeration:
NEW
IN_PROGRESS
COMPLETED
CANCELLED
ON_HOLD
is_favorite
boolean

Indicates the Order that the contact marked as his/her favorite one. A single Order can be marked as a favorite.

Example:
true
total
number

The total cost of all order items. The cost equals to the total cost of the order’s invoice, taxes and discounts included

Example:
14.99
sub_total
number

Ttoal cost of the order befroe applying the discount, if any. Tax amount is included

wallet_funds_amount
number

The amount that was used from wallet funds

Example:
1.98
discount
Object

Total discount applied for the order

amount
number

Total discount amount excluding taxes. This amount equals to the sum of all discount amounts among all invoiced items. Note that this amount does not include the taxed amount.

amount_incl_tax
number

The total discount amount including taxes

amount_due
number

The amount due. This is the due amount to be paid in order to fully pay off the order.

Example:
13.01
currency_code
string

The currency in which the Order will be/was paid

Example:
EUR
submitted_date
integer epoch

Submitted date

Example:
1668265300
fulfilled_by
Object

Details about organisation

id
string GUID

The organisation identifier

Example:
087f8a94-a44c-5b0d-f932-2a50ec03c20c
name
string

The organisation name

Example:
CRM
items
Array

List of order items

Object
quantity
integer

The item quantity

Example:
1
product
Object

Details about the ordered product

id
string GUID

The product identifier

Example:
00dee79b-8a97-7d86-4ecd-5c14f75ec071
sku
string

The product sku

Example:
SKU01
name
string

The product name

Example:
Freddo Espresso
classification
string

product type classification

Example:
EXPENSES_SERVICE
price_terms
Object

The price terms of the ordered item. Applicable only when ordering termed and one-time services

billing_period
Object

Billing period

duration
integer

Duration

Example:
1
uot
string

Unit of time

Example:
MONTHS
custom_fields
Array
Object
key
string

The custom field’s unique key

Example:
custom_key
value
string

The custom field’s value

Example:
0001-345
cancelled_date
integer

Applies for cancelled orders only

Example:
1668265421
stage
Object

Order’s stage

id
string

Stage identifier

Example:
00dee79b-8a97-7d86-4ecd-5c14f75ec071
name
string

Stage name

Example:
Accepted
queue
Object

Order’s queue

id
string

Queue identifier

Example:
00dee79b-8a97-7d86-4ecd-5c14f75ec071
name
string

Queue name

Example:
Installations
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
GET https://sandbox.crm.com/self-service/v2/contacts/067083a5-607c-959e-e62a-3ba8d359bdd6/orders HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "00dee79b-8a97-7d86-4ecd -5c14f75ec071",
    "number": "O000001",
    "supply_method": "DIRECT_SALE",
    "state": "NEW",
    "is_favorite": "true",
    "total": 14.99,
    "sub_total": 1,
    "wallet_funds_amount": 1.98,
    "discount": {
        "amount": 1,
        "amount_incl_tax": 1
    },
    "amount_due": 13.01,
    "currency_code": "EUR",
    "submitted_date": 1668265300,
    "fulfilled_by": {
        "id": "087f8a94-a44c-5b0d-f932-2a50ec03c20c",
        "name": "CRM"
    },
    "items": [
        {
            "quantity": 1,
            "product": {
                "id": "00dee79b-8a97-7d86-4ecd-5c14f75ec071",
                "sku": "SKU01",
                "name": "Freddo Espresso",
                "classification": "EXPENSES_SERVICE",
                "price_terms": {
                    "billing_period": {
                        "duration": 1,
                        "uot": "MONTHS"
                    }
                }
            }
        }
    ],
    "custom_fields": [
        {
            "key": "custom_key",
            "value": "0001-345"
        }
    ],
    "cancelled_date": 1668265421,
    "stage": {
        "id": "00dee79b-8a97-7d86-4ecd-5c14f75ec071",
        "name": "Accepted"
    },
    "queue": {
        "id": "00dee79b-8a97-7d86-4ecd-5c14f75ec071",
        "name": "Installations"
    }
}
Perform Order Actions
PUT /orders/{id}/actions

Updates an existing Order

Path variables

id
string GUID required

The order (identifier) that will be updated

Example:
6514df04-9218-d354-9d59-ed9e98882fe6

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Request body

Object
action
string required

Defines the new life cycle state of the Order. Used to start the progress of an order, complete it or cancel it

Enumeration:
CANCEL

Cancel an Order

cancellation_reason_id
string GUID

The cancellation reason of the Order. Applicable only when cancelling the Order

Example:
553f91e9-a418-354e-1e69-4b6dac24558e

Responses

200 OK
Body
Object
id
string

The order identifier

Example:
6514df04-9218-d354-9d59-ed9e98882fe6
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
PUT https://sandbox.crm.com/self-service/v2/orders/6514df04-9218-d354-9d59-ed9e98882fe6/actions HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "action": "CANCEL",
    "cancellation_reason_id": "553f91e9-a418-354e-1e69-4b6dac24558e"
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "6514df04-9218-d354-9d59-ed9e98882fe6"
}
Organisations
GET /organisations/{id}/network
GET /organisations/{id}
GET /locations
POST /organisations/{id}/switch
Search Organisations
GET /organisations/{id}/network

Retrieve a list of organisations that comprise the business network

Path variables

id
string GUID required

The organisation (identifier) whose network will be retrieved

Example:
56854656-b466-463f-8e10-b6bf558b4666

Request parameters

name
string optional

Filter based on the organisation name (should behave as like)

Example:
Bravo Coffee
type
string optional

Filter based on the organisation type

Example:
MERCHANT
industries
array of string GUID optional

Filter based on organisation industries

Collection format: csv
Unique items: YES
industry_sectors
array of string GUID optional

Filter based on organisation industry sectors

Collection format: csv
Unique items: YES
business_activities
array of string GUID optional

Filter based on organisation business activities

Collection format: csv
town_cities
array of string optional

Filter based on organisation town/city that is located

Collection format: csv
Unique items: YES
tags
array of string GUID optional

Filter based on (organisation) tags

Collection format: csv
countries
array of string optional

Filter based on organisation country

Collection format: csv
Unique items: YES
contact_registry
boolean optional

Filter based on whether organisations use the service owner contact registry

Example:
true
lat
string optional

Filter based on latitude coordinate, used in conjunction with ‘lon’ & ‘distance’

Example:
35.1730837
lon
string optional

Filter based on longitude coordinate, used in conjunction with ‘lat’ & ‘distance’

Example:
33.3761312
distance
string optional

Filter organisations based on distance in KM from the lat/lon coordinates, used in conjunction with 'lat & ‘lon’

Example:
5
tap_code
string optional

Filter based on organisation TAP code

Example:
01-23-45-67-89-AB
include_order_catalogs
boolean optional

Determines whether order catelogs should be retrieved or not

Example:
true
include_wifi_sites
boolean optional

Determine whether WiFi details should be retrieved or not

Example:
true
include_custom_fields
boolean optional

Determines whether custom fields should be retrieved or not

Example:
true
custom_fields
string optional

Filters based on custom fields (key/value set should be semicolon separated)

Example:
key;value;key;value
order
string optional

Defines how the results will be ordered

Allow empty value: true
Enumeration:
ASC
DESC
Default:
DESC
sort
string optional

Defines on which attribute the results should be sorted

Enumeration:
CREATED_DATE
UPDATED_DATE
NAME
page
integer optional

The page number that should be retrieved

Default:
1
Example:
20
size
string optional

The size (total records) of each page

Default:
10
Example:
20

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 OK

The request has succeeded

Body
Object
content
Array
Object
id
string GUID

The organisation identifier

Example:
262e72a3-55df-315d-d7bc-a90ae7ea063c
name
string

The organisation name

Example:
Alfa Bakery
description
string

The organisation description

Example:
Lorem Ipsum
industry_name
string

The organisation industry

Example:
Restaurant
industry_sectors
Array

The organisation industry sectors

Object
name
string

The industry sector name

Example:
Nightlife
business_activities
Array

The organisation business activities

Object
name
string

The business activity name

Example:
Bar & Grill
tags
Array

The (organisation) tags

Object
name
string

The tag name

Example:
Restaurant
addresses
Array

Information about the specified addresses

Object
name
string

The location name

Example:
Main Store
address_line_1
string

The main address information

Example:
Elia Papakyriakou
address_line_2
string

Additional address information

Example:
Tower Stars
state_province_county
string

The address state/province.county

Example:
Egkomi
town_city
string

The address town/city

Example:
Nicosia
postal_code
string

The address postal code

Example:
2000
country_code
string

The address country

Example:
CY
care_of
string

The address care of

Example:
Lorem Ipsum
lat
string

The latitude of the location

Example:
35.157115
lon
string

The longitude of the location

Example:
33.313719
google_place_id
string

The Google textual identifier that uniquely identifies a location

Example:
ChIJrTLr-GyuEmsRBfy61i59si0
contact_info
Array

The organisation’s contact details

Unique items: YES
Example:
[
    {
        "name": "Main Office",
        "type": "PHONE",
        "value": "info@crm.com",
        "country_code": "CYP"
    }
]
Object

Information about the specified addresses

name
string

The name of the contact detail

Example:
Main Office
type
string

The type of the contact detail

Enumeration:
EMAIL
PHONE
value
string

The value of the specific contact detail

Example:
info@crm.com
country_code
string

The phone country code related to the contact detail

Example:
CYP
contact_registry
Object

Details about the contact registry (applicable only if contact registry = true)

contact_registered
boolean

Defines whether a contact has already registered or not

Example:
true
order_catalogs
Array

The organisation’s order catalogs

Object
id
string GUID

The order catalog identifier

Example:
9b6c4b9f-2982-2eb9-a13f-ec8a822da92f
display_name
string

The order catalog display name

Example:
Drinks Menu
time_availability
Array

Details about the catalog time availability

Object
day_of_week
string

The days of the week the order catalog is available

Example:
Monday
start_time
string

The start time of the order catalog

Example:
08:00
end_time
string

The end time of the order catalog

Example:
23:59
supply_method
Array

The supported supply methods of the order catalog

string
Enumeration:
DELIVERY
PICK_UP
ALL
creatives
Array

Creatives images for marketing includes the primary image and scaled versions to create a srcset

Object
id
string GUID

The creative identifier

Example:
a3f1f6b3-8d49-3a72-e48e-617dd6004d41
usage_type
string

Information about the creative type

Enumeration:
LOGO
BACKGROUND
MARKETING
ATTACHMENT
width
integer

The creative width

Example:
2159
height
integer

The creative height

Example:
3075
format
string

The creative format

Example:
jpg
url
string

The creative content URL

Example:
https://assets.crm.com/image/offer.jpg
public_id
string

The creative public identifier

Example:
crm-com/image
media
Array

Details about creative transformations

Object
width
integer

The transformed creative width

Example:
200
height
integer

The transformed creative height

Example:
300
url
string

The transformed creative URL

Example:
https://asset.crm.com/image/offer/c_scale,w_200/offer.jpg
creatives
Array

Creatives images for marketing includes the primary image and scaled versions to create a srcset

Object
id
string GUID

The creative identifier

Example:
a3f1f6b3-8d49-3a72-e48e-617dd6004d41
usage_type
string

Information about the creative type

Enumeration:
LOGO
BACKGROUND
MARKETING
ATTACHMENT
width
integer

The creative width

Example:
2159
height
integer

The creative height

Example:
3075
format
string

The creative format

Example:
jpg
url
string

The creative content URL

Example:
https://assets.crm.com/image/offer.jpg
public_id
string

The creative public identifier

Example:
crm-com/image
media
Array

Details about creative transformations

Object
width
integer

The transformed creative width

Example:
200
height
integer

The transformed creative height

Example:
300
url
string

The transformed creative URL

Example:
https://asset.crm.com/image/offer/c_scale,w_200/offer.jpg
custom_fields
Array
Object
key
string

The custom field’s unique key

Example:
custom_key
value
string

The custom field’s value

Example:
0001-345
wifi_sites
Array

A list of WiFi Sites that are related to the organisation

Object
id
string GUID

The site identifier

Example:
b1bd8cec-1b98-2636-cc91-41253fb88c82
site_id
string

The WiFi platform site id

Example:
88quh2m6
integration
Object

Details about the integration of the WiFi Site

id
string GUID

The integration identifier

Example:
bade503e-ffbc-05ba-a151-ff350cbc134d
name
string

The integration name

Example:
UniFi
paging
Object

Information that can be used in order to display large pages

page
integer

The page number

Example:
2
size
integer

The number of records per page

Default:
10
Example:
20
total
integer

The total number of records. If “include_total” is not specified, then this total is null. If “include_total” is specified, total has a value but it is accurate up to 10K records.

Example:
1124
has_more
boolean

Shows if there are more records available to fetch

Example:
true
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
GET https://sandbox.crm.com/self-service/v2/organisations/56854656-b466-463f-8e10-b6bf558b4666/network HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "content": [
        {
            "id": "262e72a3-55df-315d-d7bc-a90ae7ea063c",
            "name": "Alfa Bakery",
            "description": "Lorem Ipsum",
            "industry_name": "Restaurant",
            "industry_sectors": [
                {
                    "name": "Nightlife"
                }
            ],
            "business_activities": [
                {
                    "name": "Bar & Grill"
                }
            ],
            "tags": [
                {
                    "name": "Restaurant"
                }
            ],
            "addresses": [
                {
                    "name": "Main Store",
                    "address_line_1": "Elia Papakyriakou",
                    "address_line_2": "Tower Stars",
                    "state_province_county": "Egkomi",
                    "town_city": "Nicosia",
                    "postal_code": "2000",
                    "country_code": "CY",
                    "care_of": "Lorem Ipsum",
                    "lat": "35.157115",
                    "lon": "33.313719",
                    "google_place_id": "ChIJrTLr-GyuEmsRBfy61i59si0"
                }
            ],
            "contact_info": [
                {
                    "name": "Main Office",
                    "type": "EMAIL",
                    "value": "info@crm.com",
                    "country_code": "CYP"
                }
            ],
            "contact_registry": {
                "contact_registered": "true"
            },
            "order_catalogs": [
                {
                    "id": "9b6c4b9f-2982-2eb9-a13f-ec8a822da92f",
                    "display_name": "Drinks Menu",
                    "time_availability": [
                        {
                            "day_of_week": "Monday",
                            "start_time": "08:00",
                            "end_time": "23:59"
                        }
                    ],
                    "supply_method": [
                        "PICK_UP"
                    ],
                    "creatives": [
                        {
                            "id": "a3f1f6b3-8d49-3a72-e48e-617dd6004d41",
                            "usage_type": "MARKETING",
                            "width": 2159,
                            "height": 3075,
                            "format": "jpg",
                            "url": "https://assets.crm.com/image/offer.jpg",
                            "public_id": "crm-com/image",
                            "media": [
                                {
                                    "width": 200,
                                    "height": 300,
                                    "url": "https://asset.crm.com/image/offer/c_scale,w_200/offer.jpg"
                                }
                            ]
                        }
                    ]
                }
            ],
            "creatives": [
                {
                    "id": "a3f1f6b3-8d49-3a72-e48e-617dd6004d41",
                    "usage_type": "BACKGROUND",
                    "width": 2159,
                    "height": 3075,
                    "format": "jpg",
                    "url": "https://assets.crm.com/image/offer.jpg",
                    "public_id": "crm-com/image",
                    "media": [
                        {
                            "width": 200,
                            "height": 300,
                            "url": "https://asset.crm.com/image/offer/c_scale,w_200/offer.jpg"
                        }
                    ]
                }
            ],
            "custom_fields": [
                {
                    "key": "custom_key",
                    "value": "0001-345"
                }
            ],
            "wifi_sites": [
                {
                    "id": "b1bd8cec-1b98-2636-cc91-41253fb88c82",
                    "site_id": "88quh2m6",
                    "integration": {
                        "id": "bade503e-ffbc-05ba-a151-ff350cbc134d",
                        "name": "UniFi"
                    }
                }
            ]
        }
    ],
    "paging": {
        "page": 2,
        "size": 20,
        "total": 1124
    }
}
Get Organisation
GET /organisations/{id}

Retrieve all details for a specific organisation

Path variables

id
string GUID required

The organisation (identifier) that will be retrieved

Example:
3b2cee85-146b-3fda-3021-5d18e52e2504

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 OK

The request has succeeded

Body
Object
content
Object
id
string GUID

The organisation identifier

Example:
73267fdd-3858-001e-1275-11bb9c3b279c
name
string

The organisation name

Example:
Alfa Bakery
description
string

The organisation description

Example:
Lorem Ipsum
industry_name
string

The organisation industry

Example:
Restaurant
industry_sectors
Array

The organisation industry sectors

Object
name
string

The industry sector name

Example:
Bar
business_activities
Array

The organisation business activities

Object
name
string

The business activity name

Example:
Bar & Grill
tags
Array

The (organisation) tags

Object
name
string

The tag name

Example:
Restaurant
addresses
Array

Information about the specified addresses

Object
name
string

The location name

Example:
Main Store
address_line_1
string

The main address information

Example:
Elia Papakyriakou
address_line_2
string

Additional address information

Example:
Tower Stars
state_province_county
string

The address state/province.county

Example:
Egkomi
town_city
string

The address town/city

Example:
Nicosia
postal_code
string

The address postal code

Example:
2000
country_code
string

The address country

Example:
CY
care_of
string

The address care of

Example:
Lorem Ipsum
lat
string

The latitude of the location

Example:
35.157115
lon
string

The longitude of the location

Example:
33.313719
google_place_id
string

The Google textual identifier that uniquely identifies a location

Example:
ChIJrTLr-GyuEmsRBfy61i59si0
contact_info
Array

Details about the organisation contact details

Object

Information about the specified addresses

name
string

The name of the contact detail

Example:
Main Office
type
string

The type of the contact detail

Enumeration:
EMAIL
PHONE
value
string

The value of the specific contact detail

Example:
info@crm.com
country_code
string

The phone country code related to the contact detail

Example:
CYP
operation_details
Object

Defines the organisation operation details

opening_hours
Array

Details about the organisation’s working hours

Object
day_of_week
string
Enumeration:
MONDAY
TUESDAY
WEDNESDAY
THURSDAY
FRIDAY
SATURDAY
SUNDAY
open
string

The time that the organisation opens (HH:MM)

Example:
09:00
close
string

The time that the organisation closes (HH:MM)

Example:
15:00
operation
string

The opening hours for each organisation’s operation type

Enumeration:
DELIVERY
PICK_UP
ANY
short_term_operations
Array

Details about the organisation’s availability to offer its services

Object
operation
string
Enumeration:
DELIVERY
PICK_UP
ALL
is_closed
boolean

Defines whether the organisation is temporary closed for offering its services

Example:
false
creatives
Array

Creatives images for marketing includes the primary image and scaled versions to create a srcset

Object
id
string GUID

The creative identifier

Example:
a3f1f6b3-8d49-3a72-e48e-617dd6004d41
usage_type
string

Information about the creative type

Enumeration:
LOGO
BACKGROUND
MARKETING
ATTACHMENT
width
integer

The creative width

Example:
2159
height
integer

The creative height

Example:
3075
format
string

The creative format

Example:
jpg
url
string

The creative content URL

Example:
https://assets.crm.com/image/offer.jpg
public_id
string

The creative public identifier

Example:
crm-com/image
media
Array

Details about creative transformations

Object
width
integer

The transformed creative width

Example:
200
height
integer

The transformed creative height

Example:
300
url
string

The transformed creative URL

Example:
https://asset.crm.com/image/offer/c_scale,w_200/offer.jpg
custom_fields
Array
Object
key
string

The custom field’s unique key

Example:
custom_key
value
string

The custom field’s value

Example:
0001-345
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
GET /organisations/3b2cee85-146b-3fda-3021-5d18e52e2504 HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "content": {
        "id": "73267fdd-3858-001e-1275-11bb9c3b279c",
        "name": "Alfa Bakery",
        "description": "Lorem Ipsum",
        "industry_name": "Restaurant",
        "industry_sectors": [
            {
                "name": "Bar"
            }
        ],
        "business_activities": [
            {
                "name": "Bar & Grill"
            }
        ],
        "locations": [
            {
                "name": "Main Store",
                "address_line_1": "Elia Papakyriakou",
                "address_line_2": "Tower Stars",
                "state_province_county": "Egkomi",
                "town_city": "Nicosia",
                "postal_code": "2000",
                "country_code": "CY",
                "care_of": "Lorem Ipsum",
                "lat": "35.157115",
                "lon": "33.313719",
                "googleplaceid": "ChIJrTLr-GyuEmsRBfy61i59si0"
            }
        ],
        "creatives": [
            {
                "id": "CA123456789AQWSXZAQWS1236547896541",
                "type": "",
                "width": 2159,
                "height": 3075,
                "format": "jpg",
                "url": "https://assets.crm.com/image/offer.jpg",
                "public_id": "crm-com/image",
                "media": [
                    {
                        "width": 200,
                        "height": 300,
                        "url": "https://asset.crm.com/image/offer/c_scale,w_200/offer.jpg"
                    }
                ]
            }
        ]
    }
}
Locations
GET /locations

Get a list of organisations (merchants, venues) ordered by nearest first

Request parameters

name
string optional

Filter based on organisation name (should behave as like)

Example:
CRM
lat
string required

Filter based on latitude coordinate

Example:
38.91
lon
string required

Filter based on longitude coordinate

Example:
38.91
is_open
boolean optional

Filter based on whether an organisation is opened or not

Example:
true
supply_method
string optional

Filter based on order supply method

Enumeration:
DELIVERY
PICK_UP
DIRECT_SALE
within
number optional

Filter based on how far should the distance be at a maximum (default to 5KM)

Example:
154
industries
array of string GUID optional

Filter based on organisation industries

Collection format: csv
Unique items: YES
industry_sectors
array of string GUID optional

Filter based on organisation industriy sectors

Collection format: csv
Unique items: YES
business_activities
array of string GUID optional

Filter based on organisation business activities

Collection format: csv
Unique items: YES
tags
array of string GUID optional

Filter based on (organisation) tags

Collection format: csv
Unique items: YES
town_cities
array of string optional

Filter based on organisation town/city

Collection format: csv
Unique items: YES
include_custom_fields
boolean optional

Determines whether custom fields should be retrieved or not

Example:
true
custom_fields
string optional

Filters based on custom fields (key/value set should be semicolon separated)

Example:
key;value;key;value
include_order_catalogs
boolean optional

Determines whether order catalogs should be retrieved or not

Example:
true
include_opening_hours
boolean optional

Determines whether opening hours should be retrieved or not

Example:
true
include_creatives
boolean optional

Determines whether organisation creatives should be retrieved or not

Example:
true

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 OK
Body
Object
content
Array
Object
id
string GUID

The organisation identifier

Example:
232b8688-7275-c838-d411-af9999224545
name
string

The organisation name

Example:
CRM
description
string

The organisation description

Example:
CRM organisation for orders
address
Object

The organisation address

id
string GUID

The address identifier

Example:
c8ea18e4-2804-3e8e-9450-600263614aac
lat
number

The address latitude coordinate

Example:
12.16
lon
number

The address longitude coordinate

Example:
112.16
distance
number

The supported distance from the lat/lon coordinates

Example:
11
google_place_id
string

The Google textual identifier that uniquely identifies an address

Example:
ChIJrTLr-GyuEmsRBfy61i59si0
address_line_1
string

The address line 1

Example:
Elia Papakyriakou
address_line_2
string

The address line 2

Example:
7 Tower Stars
state_province_county
string

The address state/province/county

Example:
Egkomi
town_city
string

The address town/city

Example:
Nicosia
country_code
string

The address country (code)

Example:
CYP
postal_code
string

The address postal code

Example:
2000
contact_info
Array

The organisation contact information

Object

Information about the specified addresses

name
string

The name of the contact detail

Example:
Main Office
type
string

The type of the contact detail

Enumeration:
EMAIL
PHONE
value
string

The value of the specific contact detail

Example:
info@crm.com
country_code
string

The phone country code related to the contact detail

Example:
CYP
opening_hours
Array

The organisation opening hours for the current day

Object
supply_method
string
Enumeration:
DELIVERY
PICK_UP
ALL
open
string

The opening time (HH:MM format)

Example:
12:45
close
string

The clsoing time (HH:MM format)

Example:
19:45
order_catalogs
Array

The order catalogs applicable for the organisation

Object
id
string GUID

The order catalog identifier

Example:
10152097-dcdd-6f29-787b-7c321a1d1012
display name
string

The order catalog display name

Example:
Burgers Menu
time_availibity
Array

Details about the order catalog time availability

Object
day_of_week
string

The day of the week the Order Catalog is available

Example:
MONDAY
start_time
string

The start time the Order Catalog (HH:MM format)

Example:
09:00
end_time
string

The end time the Order Catalog (HH:MM format)

Example:
22:00
supply_methods
Array

The supported supply method of the Order Catalog

string
Enumeration:
DELIVERY
PICK_UP
ALL
creatives
Array

Creatives images for marketing includes the primary image and scaled versions to create a srcset

Object
id
string GUID

The creative identifier

Example:
a3f1f6b3-8d49-3a72-e48e-617dd6004d41
usage_type
string

Information about the creative type

Enumeration:
LOGO
BACKGROUND
MARKETING
ATTACHMENT
width
integer

The creative width

Example:
2159
height
integer

The creative height

Example:
3075
format
string

The creative format

Example:
jpg
url
string

The creative content URL

Example:
https://assets.crm.com/image/offer.jpg
public_id
string

The creative public identifier

Example:
crm-com/image
media
Array

Details about creative transformations

Object
width
integer

The transformed creative width

Example:
200
height
integer

The transformed creative height

Example:
300
url
string

The transformed creative URL

Example:
https://asset.crm.com/image/offer/c_scale,w_200/offer.jpg
creatives
Array

Creatives images for marketing includes the primary image and scaled versions to create a srcset

Object
id
string GUID

The creative identifier

Example:
a3f1f6b3-8d49-3a72-e48e-617dd6004d41
usage_type
string

Information about the creative type

Enumeration:
LOGO
BACKGROUND
MARKETING
ATTACHMENT
width
integer

The creative width

Example:
2159
height
integer

The creative height

Example:
3075
format
string

The creative format

Example:
jpg
url
string

The creative content URL

Example:
https://assets.crm.com/image/offer.jpg
public_id
string

The creative public identifier

Example:
crm-com/image
media
Array

Details about creative transformations

Object
width
integer

The transformed creative width

Example:
200
height
integer

The transformed creative height

Example:
300
url
string

The transformed creative URL

Example:
https://asset.crm.com/image/offer/c_scale,w_200/offer.jpg
custom_fields
Array
Object
key
string

The custom field’s unique key

Example:
custom_key
value
string

The custom field’s value

Example:
0001-345
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
GET https://sandbox.crm.com/self-service/v2/locations?lat=38.91&lon=38.91 HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "content": [
        {
            "id": "232b8688-7275-c838-d411-af9999224545",
            "name": "CRM",
            "description": "CRM organisation for orders",
            "address": {
                "id": "c8ea18e4-2804-3e8e-9450-600263614aac",
                "lat": 12.16,
                "lon": 112.16,
                "distance": 11,
                "google_place_id": "ChIJrTLr-GyuEmsRBfy61i59si0",
                "address_line_1": "Elia Papakyriakou",
                "address_line_2": "7 Tower Stars",
                "state_province_county": "Egkomi",
                "town_city": "Nicosia",
                "country_code": "CYP",
                "postal_code": "2000"
            },
            "contact_info": [
                {
                    "name": "Main Office",
                    "type": "EMAIL",
                    "value": "info@crm.com",
                    "country_code": "CYP"
                }
            ],
            "opening_hours": [
                {
                    "supply_method": "ALL",
                    "open": "12:45",
                    "close": "19:45"
                }
            ],
            "order_catalogs": [
                {
                    "id": "10152097-dcdd-6f29-787b-7c321a1d1012",
                    "display name": "Burgers Menu",
                    "time_availibity": [
                        {
                            "day_of_week": "MONDAY",
                            "start_time": "09:00",
                            "end_time": "22:00"
                        }
                    ],
                    "supply_methods": [
                        "DELIVERY"
                    ],
                    "creatives": [
                        {
                            "id": "a3f1f6b3-8d49-3a72-e48e-617dd6004d41",
                            "usage_type": "ATTACHMENT",
                            "width": 2159,
                            "height": 3075,
                            "format": "jpg",
                            "url": "https://assets.crm.com/image/offer.jpg",
                            "public_id": "crm-com/image",
                            "media": [
                                {
                                    "width": 200,
                                    "height": 300,
                                    "url": "https://asset.crm.com/image/offer/c_scale,w_200/offer.jpg"
                                }
                            ]
                        }
                    ]
                }
            ],
            "creatives": [
                {
                    "id": "a3f1f6b3-8d49-3a72-e48e-617dd6004d41",
                    "usage_type": "ATTACHMENT",
                    "width": 2159,
                    "height": 3075,
                    "format": "jpg",
                    "url": "https://assets.crm.com/image/offer.jpg",
                    "public_id": "crm-com/image",
                    "media": [
                        {
                            "width": 200,
                            "height": 300,
                            "url": "https://asset.crm.com/image/offer/c_scale,w_200/offer.jpg"
                        }
                    ]
                }
            ],
            "custom_fields": [
                {
                    "key": "custom_key",
                    "value": "0001-345"
                }
            ]
        }
    ]
}
Switch Organisations
POST /organisations/{id}/switch

Switch a contact’s access to another organisation that he/she is a member of

Path variables

id
string GUID required

The organisation (identifier) that contact’s access will be switched to

Example:
02ee09d0-c227-4479-a2e6-5e9958c7ea78

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 OK

The request has succeeded

Body
Object
access_token
string

The token that can be used in subsequent API calls

Example:
eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhMjc4ZDNlNS05YjhlLTQzNmUtOTIzMC03MGYzZTJkZjFjYTUiLCJleHAiOjE1Njg1NTQxMjJ9.LemqPPThkqfakkKS6CdkNvV1Lnc88CWirEpHOPnWjJPQz02zgkKSwfbvrEsl3OmR2LUhDILsOXf4x-GPFmNJCg
refresh_token
string

The token that can be used to generate a new access token (when previous is expired)

Example:
eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhMjc4ZDNlNS05YjhlLTQzNmUtOTIzMC03MGYzZTJkZjFjYTUiLCJleHAiOjE1Njg1NTQxMjJ9.LemqPPThkqfakkKS6CdkNvV1Lnc88CWirEpHOPnWjJPQz02zgkKSwfbvrEsl3OmR2LUhDILsOXf4x-GPFmNJCg
expiration_date
string epoch

The token expiration date

Example:
1572530655
contact
Object

The authorised contact details

id
string GUID

The contact’s identifier

Example:
2f2f9afe-4399-59b7-cbb8-da18c2255064
first_name
string

The contact’s first name

Example:
John
last_name
string

The contact’s last name

Example:
Doe
is_verified
boolean

Defines whether the used identity is verified

Example:
false
organisations
Array

Details about the organisations that the contact has joined

Object
id
string GUID

The organisation identifier

Example:
QWERTY12345671234567324ETFTGBY78
type
string

The organisation type

Enumeration:
SERVICE_OWNER
ORGANISATION
name
string

The organisation name

Example:
CRMdotCOM
communities
Array

Details about the contact communities that the contact is a member of

Object
id
string GUID

The contact identifier

Example:
be4113e5-0fb5-7116-7d48-6901a6f7ddad
name
string

The contact name

Example:
CRM-NIC
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
POST https://sandbox.crm.com/self-service/v2/organisations/02ee09d0-c227-4479-a2e6-5e9958c7ea78/switch HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "access_token": "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhMjc4ZDNlNS05YjhlLTQzNmUtOTIzMC03MGYzZTJkZjFjYTUiLCJleHAiOjE1Njg1NTQxMjJ9.LemqPPThkqfakkKS6CdkNvV1Lnc88CWirEpHOPnWjJPQz02zgkKSwfbvrEsl3OmR2LUhDILsOXf4x-GPFmNJCg",
    "refresh_token": "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhMjc4ZDNlNS05YjhlLTQzNmUtOTIzMC03MGYzZTJkZjFjYTUiLCJleHAiOjE1Njg1NTQxMjJ9.LemqPPThkqfakkKS6CdkNvV1Lnc88CWirEpHOPnWjJPQz02zgkKSwfbvrEsl3OmR2LUhDILsOXf4x-GPFmNJCg",
    "expiration_date": "1572530655",
    "contact": {
        "id": "2f2f9afe-4399-59b7-cbb8-da18c2255064",
        "first_name": "John",
        "last_name": "Doe",
        "is_verified": "false"
    },
    "organisations": [
        {
            "id": "QWERTY12345671234567324ETFTGBY78",
            "type": "SERVICE_OWNER",
            "name": "CRMdotCOM"
        }
    ]
}
Passes
POST /passes
GET /passes/view_promo_passes
Redeem Pass
POST /passes

Redeems a single pass by a contact

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Request body

Object
contact_id
string

Unique id of the contact who is redeeming the pass

Example:
00dc6a3d-2c90-4953-b1db-92c81d004406
wallet_id
string GUID nullable

The id of the contact’s wallet which will be credited with the pass value

Example:
228568ea-ab6f-471e-bae7-7adb7e913ff6
code
string required

The pass code to be redeemed

Example:
CRM59934377COM
pin
string nullable

The pass PIN (if applicable)

Example:
0103

Responses

200 200

OK

Body
Object
id
string GUID

The redeemed pass identifier

Example:
65132ff2-0ff2-b96f-6379-d6bbf38d07be
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
POST https://sandbox.crm.com/self-service/v2/passes HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "contact_id": "00dc6a3d-2c90-4953-b1db-92c81d004406",
    "wallet_id": "228568ea-ab6f-471e-bae7-7adb7e913ff6",
    "code": "CRM59934377COM",
    "pin": "0103"
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "65132ff2-0ff2-b96f-6379-d6bbf38d07be"
}
View Promo Pass
GET /passes/view_promo_passes

Responses

200 OK
Body

An HTML based landing page is returned and rendered

Product Catalogue

CRM.COM’s Product Cataglogue includes:

  • Products specifications
  • Product Pricing
  • Promotions that can be applied on purchasing products, subscribing to services annd during their billing.
Products

Products are the physical goods and services that a Business sells. The product definition includes basic characteristics of the products as well its pricing information. Any products defined in CRM.COM can be sold through an order or an invoice. It’s crucial that Products are configured correctly, since they appear on customer-facing apps/portals for ordering purposes.

GET /products
GET /products/{id}
GET /products/{id}/variants
Search Products
GET /products

Retrieves a list of products that can be purchased by customers through an order, filtered by their category, type etc. Modifier and Variant products are excluded since these product can only be ordered as part of another product and not individually.

Request parameters

name
string optional

Filter based on product name (search based on like, for a minimum of three characters search with CONTAINS and case insensitive)

owned_by
string optional

The organisation owning the product catalog (the subsidiary, merchant or venue from which the products will be purchased)

fulfilled_by
string optional

The organisation that wlil fulfill a customer’s ordering. Products that can be ordered by the specified organisation at the time of ordering will be returned

type_id
string GUID optional

Filter based on product type

Example:
dccb219b-1304-95de-61f8-03b4b824a428
category_id
string GUID optional

Filter based on product category

Example:
dccb219b-1304-95de-61f8-03b4b824a428
order_catalogue_id
string GUID optional

Filter based on order catalogue

Example:
dccb219b-1304-95de-61f8-03b4b824a428
order_category_id
string GUID optional

Filter based on order catalogue category

Example:
43ft5fb-1304-95de-61f8-03b4b824a428
brand_id
string GUID optional

Filter based on product brand

Example:
dccb219b-1304-95de-61f8-03b4b824a428
family_id
string GUID optional

Filter based on product family

Example:
dccb219b-1304-95de-61f8-03b4b824a428
supply_method
string optional

Filter based on product supply method

Enumeration:
DELIVERY
PICK_UP
ALL
is_modifier
boolean optional

If specified, then only products marked as modifiers are returned. A produc tis marked as modifier through its type. If not specified, then it’s gnored and filtering is not applied.

Default:
false
Example:
false
validity_date
string optional

The date on which a product is sold/added as a charge or a service should also be within its validity date. Applicable only when listing products to get the services available to be ordered, added as charges or included in a subscription either as a new addition or through a service change. Filter based on the validity date, which may fall within a given date range. The value can be a string with a date in epoch format. Each option must also include an operator. Use up to two options based on the required search (e.g. validity_date[gte]=1618395497&validity_date[lt]=1618395497).

Enumeration:
validity_date[gt]

Returns results where the validity date is greater than this value

validity_date[gte]

Returns results where the validity date is greater than or equal to this value

validity_date[lt]

Returns results where the validity date is less than this value

validity_date[lte]

Returns results where the validity date is less than or equal to this value

classification

The product’s classification

Collection format: csv
type_composition
array of Product Composition (Enum) optional

The product’s composition

Collection format: csv
order
string optional

Defines how the results will be ordered

Allow empty value: true
Enumeration:
ASC
DESC
Default:
DESC
sort
string optional

Defines on which attribute the results should be sorted

Allow empty value: true
Examples:
CREATED_DATEUPDATED_DATENAMEPOSTED_DATE
page
integer optional

The page number that should be retrieved

Default:
1
Example:
20
size
string optional

The size (total records) of each page

Default:
10
Example:
20
search_value
string optional

Search for a product using its SKU or name

include_creatives
boolean optional

If set to True, creatives will also be returned.

sales_model_id
string optional

The sales model unique identifier which will enable the user to choose one of the configured sales model types for the product

Example:
caf332bc-4e90-47b5-a05d-142b264897b9

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A
api_key
string required

The publishable api key for application identification

Example:
ab5f8b2e-092f-4848-8f46-31df1c014060

Responses

200 OK
Body
Object
content
Array
Object
id
string GUID

Product identifier

Example:
8c939607-2262-544d-99ef-4634c6e8836d
sku
string

Product SKU

Example:
MOV001
name
string

Product name

Example:
Movies
description
string

Product description

Example:
Unlimited movies
classification
string
Enumeration:
TERMED_SERVICE
ONE_TME_SERVICE
EXPENSE_SERVICE
USAGE_SERVICE
TRACEABLE_PHYSICAL_GOOD
NON_TRACEABLE_PHYSCAL_GOOD
Example:
TRACEABLE_PHYSICAL_GOOD
type_composition
string
Enumeration:
FLAT
FIXED_BUNDLE
FLEXIBLE_BUNDLE
COMPOSITE
Example:
FLAT
components
integer

Number of items in the product’s allowed composition.Available only for bundles and composite products

Example:
3
variants
integer

Number of variant products. Available only for Composite prducts

Example:
3
variant_attributes
integer

Number of variant attributes

Example:
2
number_of_prices
integer

Number of prices

Example:
2
can_be_rented
boolean

Applicable only for traceable physical goods with a rental price

Example:
true
availability
string

Denotes whether the product is available for ordering at the organisation that will fulfill the order. Available only if a fulfilled by organisation is set in the method’s filters

Enumeration:
ENABLED
DISABLED
Example:
ENABLED
type
Object

The product’s type

id
string GUID

Type identifier

Example:
8c939607-2262-544d-99ef-4634c6e8836d
name
string

Type name

Example:
TV Services
pricing
Array

Lists all prices of the product. Only prices applicable at the account owner’s Country of agreement are returned.

Object
id
string

The price’s unique identifier

Example:
8c939607-2262-544d-99ef-4634c6e8836d
price
number

The price of the product but only if the price model is Flat. For Tiered/Volume/Strairstep models, get the price from the tiering prices field.

Example:
1.99
tiers
Array

Applicable only for Tier/Volume/Stairstep pricing models. This is a list of ranges along with a price for each tier range.

Object
price
number

Tier range’s price

Example:
9.99
lower_tier
string

Lower tier of the range. First tier is always set to 1

Example:
1
pupper_tier
string

Upper tier of the range. The last range does not have an upper tier

Example:
5
currency_code
string
Min length: 3
Max length: 3
Pattern: 3-letter ISO 4217 currency code.
Example:
EUR
is_default
boolean

The default price. A single price can be the default one

Example:
true
tax_model
string
Enumeration:
TAX_INCLUSIVE
TAX_EXCLUSIVE
Example:
TAX_INCLUSIVE
price_model
string
Enumeration:
FLAT
TIERED
VOLUME
STAIRSTEP
Example:
FLAT
supply_method
string

Defines the order’ supply method

Enumeration:
DELIVERY
PICK_UP
DIRECT_SALE
price_terms
Object
terms_billing_cycles
integer

Number of billing cycles that the service’ termed period covers

Example:
12
auto_renewed
boolean

Defines whether the service is auto-renewed at the end of the termed period or it gets expired.

Example:
true
billing_model
string

Defines whether the service is billed in pre-/post-bill mode

Enumeration:
PRE_BILL
POST_BILL
Example:
PRE_BILL
contract_period
Object

The service’s contract period (if any)

duration
integer

Contract period duration

Example:
12
uot
string

Period’s unit of time

Example:
MONTHS
billing_period
Object

The service’s illing cycle

duration
integer

Billing cycle duration

Example:
1
uot
string

Billing cycle unit of time

Example:
MONTHS
trial_period
Object

Shows if the service will get a trial period

duration
integer

Trial period duration

Example:
7
uot
string

Trial period unit of time

Example:
DAYS
rental_service
Object

Applicable only for traceable physical goods given to contacts as Rentals

id
string

The rental service product indetifier. This must be a product classified as an Expense

Example:
8c939607-2262-544d-99ef-4634c6e8836d
sku
string

Rental service SKU

Example:
RENTAL
name
string

Retal servce name

Example:
Rental Fee
sales_model
Array

The sales model is the unique identifier used to classify a product’s price

Object
id
string

The sales model unique identifier

Example:
caf332bc-4e90-47b5-a05d-142b264897b9
name
string

The sales model name which has to be unique across all sales models

Example:
Retail
taxes
Array

List of taxes applicable for the product. Tax rates are filtered based on the product, the operating country of the organisation that sells the product

Object
id
string

Tax rate unique identifier

Example:
8c939607-2262-544d-99ef-4634c6e8836d
name
string

Tax rate name

Example:
Standard VAT
tax_code
string

Tax rate code

Enumeration:
VAT
TAX_EXEMPT
SALES_TAX
OTHER
Example:
VAT
percentage
number

The tax rate’s percentage

Example:
19.5
creatives
Array

Creatives images for marketing includes the primary image and scaled versions to create a srcset

Object
id
string GUID

The creative identifier

Example:
a3f1f6b3-8d49-3a72-e48e-617dd6004d41
usage_type
string

Information about the creative type

Enumeration:
LOGO
BACKGROUND
MARKETING
ATTACHMENT
width
integer

The creative width

Example:
2159
height
integer

The creative height

Example:
3075
format
string

The creative format

Example:
jpg
url
string

The creative content URL

Example:
https://assets.crm.com/image/offer.jpg
public_id
string

The creative public identifier

Example:
crm-com/image
media
Array

Details about creative transformations

Object
width
integer

The transformed creative width

Example:
200
height
integer

The transformed creative height

Example:
300
url
string

The transformed creative URL

Example:
https://asset.crm.com/image/offer/c_scale,w_200/offer.jpg
paging
Object

Information that can be used in order to display large pages

page
integer

The page number

Example:
2
size
integer

The number of records per page

Default:
10
Example:
20
total
integer

The total number of records. If “include_total” is not specified, then this total is null. If “include_total” is specified, total has a value but it is accurate up to 10K records.

Example:
1124
has_more
boolean

Shows if there are more records available to fetch

Example:
true
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
GET https://sandbox.crm.com/self-service/v2/products HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A
api_key: ab5f8b2e-092f-4848-8f46-31df1c014060

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "content": [
        {
            "id": "8c939607-2262-544d-99ef-4634c6e8836d", 
            "sku": "MOV001",
            "name": "Movies",
            "description": "Unlimited movies",
            "classification": "TRACEABLE_PHYSICAL_GOOD",
            "type_composition": "FLAT",
            "components": 3,
            "variants": 3,
            "variant_attributes": 2,
            "number_of_prices": 2,
            "can_be_rented": true,
            "availability": "ENABLED",
            "type": {
                "id": "8c939607-2262-544d-99ef-4634c6e8836d",
                "name": "TV Services"
            },
            "pricing": [
                {
                    "id": "8c939607-2262-544d-99ef-4634c6e8836d",
                    "price": 1.99,
                    "tiers": [
                        {
                            "price": 9.99,
                            "lower_tier": "1",
                            "pupper_tier": "5"
                        }
                    ],
                    "currency_code": "EUR",
                    "is_default": "true",
                    "tax_model": "TAX_INCLUSIVE",
                    "price_model": "FLAT",
                    "supply_method": "DIRECT_SALE",
                    "price_terms": {
                        "terms_billing_cycles": 12,
                        "auto_renewed": true,
                        "billing_model": "PRE_BILL",
                        "contract_period": {
                            "duration": 12,
                            "uot": "MONTHS"
                        },
                        "billing_period": {
                            "duration": 1,
                            "uot": "MONTHS"
                        },
                        "trial_period": {
                            "duration": 7,
                            "uot": "DAYS"
                        },
                        "rental_service": {
                            "id": "8c939607-2262-544d-99ef-4634c6e8836d",
                            "sku": "RENTAL",
                            "name": "Rental Fee"
                        }
                    },
                    "sales_model": [
                        {
                            "id": "caf332bc-4e90-47b5-a05d-142b264897b9",
                            "name": "Retail"
                        }
                    ]
                }
            ],
            "taxes": [
                {
                    "id": "8c939607-2262-544d-99ef-4634c6e8836d",
                    "name": "Standard VAT",
                    "tax_code": "VAT",
                    "percentage": 19.5
                }
            ],
            "creatives": [
                {
                    "id": "a3f1f6b3-8d49-3a72-e48e-617dd6004d41",
                    "usage_type": "BACKGROUND",
                    "width": 2159,
                    "height": 3075,
                    "format": "jpg",
                    "url": "https://assets.crm.com/image/offer.jpg",
                    "public_id": "crm-com/image",
                    "media": [
                        {
                            "width": 200,
                            "height": 300,
                            "url": "https://asset.crm.com/image/offer/c_scale,w_200/offer.jpg"
                        }
                    ]
                }
            ],
            "sales_model": [
                {
                    "id": "caf332bc-4e90-47b5-a05d-142b264897b9",
                    "name": "Retail"
                }
            ]
        }
    ],
    "paging": {
        "page": 2,
        "size": 20,
        "total": 1124
    }
}
Get Product
GET /products/{id}

Get detailed inormaiton of the product, its prices and taxes

Path variables

id
string GUID required

The product identifier that will be retrieved

Example:
8c939607-2262-544d-99ef-4634c6e8836d

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A
api_key
string required

The publishable api key for application identification

Example:
ab5f8b2e-092f-4848-8f46-31df1c014060

Responses

200 OK
Body
Object
id
string GUID

Product identifier

Example:
8c939607-2262-544d-99ef-4634c6e8836d
sku
string

Product SKU

Example:
ABC12345
name
string

Product name

Example:
Base TV
description
string

Product description

Example:
Basic TV & myFlix
classification
string
Enumeration:
TERMED_SERVICE
ONE_TME_SERVICE
EXPENSE_SERVICE
USAGE_SERVICE
TRACEABLE_PHYSICAL_GOOD
NON_TRACEABLE_PHYSCAL_GOOD
Example:
TRACEABLE_PHYSICAL_GOOD
type_composition
string
Enumeration:
FLAT
FIXED_BUNDLE
FLEXIBLE_BUNDLE
COMPOSITE
Example:
FLAT
number_of_prices
integer

Number of prices

Example:
3
variants
integer

Number of variant products. Applicable only for Composite prducts

Example:
3
availability
string

Indicates whether the product is available for ordering at an organisation

Enumeration:
ENABLED
DISABLED
type
Object

Product type

id
string GUID

Type identifier

Example:
8c939607-2262-544d-99ef-4634c6e8836d
name
string

Type name

Example:
TV Services
categories
Array

The product categories

Object
id
string GUID

The category identifier

Example:
8c939607-2262-544d-99ef-4634c6e8836d
name
string

The category name

Example:
PaidTV
family
Object

Product family

id
string GUID

Family identifer

Example:
8c939607-2262-544d-99ef-4634c6e8836d
name
string

Family name

Example:
Entertainment
brand
Object

Product brand

id
string GUID

Brand idetifier

Example:
8c939607-2262-544d-99ef-4634c6e8836d
name
string

Brand name

Example:
News
composition
Array

The product’s allowed composition shows which products can be included in the order. Applicable only for bundles and composite products.

Object
id
string

Component identifier

Example:
8c939607-2262-544d-99ef-4634c6e8836d
item_type
string

Component type

Enumeration:
PRODUCT
TYPE
FAMILY
CATEGORY
COMPONENT_SET
Example:
TYPE
item_id
string

Item identifier

Example:
8c939607-2262-544d-99ef-4634c6e8836d
sku
string

SKU only of component is a product

Example:
ABC12345
name
string

Name of the component item

Example:
TV Services
minimum_quantity
integer

Minimum required quantity of items to be ordered

Example:
1
maximum_quantity
integer

Maximum allowed items to be ordered

Example:
3
madnatory
boolean

When set to True, then the item is always included in the ordered product and cannot be removed

Example:
true
price_inclusive
boolean

When set to True, then the component’s price is included in the bundle/composite product’s price

Example:
true
priority
integer

How component options will be sorted on ordering

Example:
1
default_modifier
Object

Applicable only for component items that denote a set and only for Composite products. If the component set includes modifiers products, then the default modifier shows which produc twill be selected by default on ordering

id
string

Product identifier

Example:
8c939607-2262-544d-99ef-4634c6e8836d
sku
string

Product SKU

Example:
ALMMILK
name
string

Product name

Example:
Almond milk
pricing
Array

Product Prices. Only product prices available at the account owner’s Country of agreement are returned.

Object
id
string

The price’s unique identifier

price
number

The price of the product

Example:
9.99
currency_code
string
Min length: 3
Max length: 3
Pattern: 3-letter ISO 4217 currency code.
Example:
EUR
price_model
string
Enumeration:
FLAT
TIERED
VOLUME
STAIRSTEP
Example:
FLAT
tax_model
string
Enumeration:
TAX_INCLUSIVE
TAX_EXCLUSIVE
Example:
TAX_INCLUSIVE
supply_method
string

Defines the order’ supply method

Enumeration:
DELIVERY
PICK_UP
DIRECT_SALE
price_terms
Object
terms_billing_cycles
integer

Number of billing cycles that the service’ termed period covers

Example:
12
auto_renewed
boolean

Defines whether the service is auto-renewed at the end of the termed period or it gets expired.

Example:
true
billing_model
string

Defines whether the service is billed in pre-/post-bill mode

Enumeration:
PRE_BILL
POST_BILL
Example:
PRE_BILL
contract_period
Object

The service’s contract period (if any)

duration
integer

Contract period duration

Example:
12
uot
string

Period’s unit of time

Example:
MONTHS
billing_period
Object

The service’s illing cycle

duration
integer

Billing cycle duration

Example:
1
uot
string

Billing cycle unit of time

Example:
MONTHS
trial_period
Object

Shows if the service will get a trial period

duration
integer

Trial period duration

Example:
7
uot
string

Trial period unit of time

Example:
DAYS
rental_service
Object

Applicable only for traceable physical goods given to contacts as Rentals

id
string

The rental service product indetifier. This must be a product classified as an Expense

Example:
8c939607-2262-544d-99ef-4634c6e8836d
sku
string

Rental service SKU

Example:
RENTAL
name
string

Retal servce name

Example:
Rental Fee
is_default
string

The product’s default price. A single price can be the default one per product

Example:
true
sales_model
Array

The sales model unique identifier which will enable the user to choose one of the configured sales model types for the product

Object
id
string

The sales model unique identifier

Example:
caf332bc-4e90-47b5-a05d-142b264897b9
name
string

The sales model name which has to be unique across all sales models

Example:
Retail
description
string

The sales model description

Example:
Sales model available for all contact Person
tiers
Array

List of tiered prices. Applicable only for Tiered/Volume/Stairstep pricing models

Object
price
number

Tier range’s price

Example:
9.99
lower_tier
integer

Lower tier of the range. First tier is always set to 1

Example:
1
upper_tier
integer

Upper tier of the range. The last range does not have an upper tier

Example:
5
variant_attributes
Array

List of variant attributes that provide additional informaiton for the product

Object
key
string

Variant attribute key

Example:
size
label
string

Labels used for UI purposes

Example:
Size
value
string

Atribute’s value

Example:
Small
taxes
Array

List of taxes applicable for the product. Tax rates are filtered based on the product, the operating country of the organisation that sells the product

Object
id
string

Tax rate unique identifier

Example:
8c939607-2262-544d-99ef-4634c6e8836d
name
string

Tax rate name

Example:
Standard VAT
tax_code
string

Tax rate code

Enumeration:
VAT
TAX_EXEMPT
SALES_TAX
OTHER
Example:
VAT
percentage
number
Example:
19.5
creatives
Array

Creatives images for marketing includes the primary image and scaled versions to create a srcset

Object
id
string GUID

The creative identifier

Example:
a3f1f6b3-8d49-3a72-e48e-617dd6004d41
usage_type
string

Information about the creative type

Enumeration:
LOGO
BACKGROUND
MARKETING
ATTACHMENT
width
integer

The creative width

Example:
2159
height
integer

The creative height

Example:
3075
format
string

The creative format

Example:
jpg
url
string

The creative content URL

Example:
https://assets.crm.com/image/offer.jpg
public_id
string

The creative public identifier

Example:
crm-com/image
media
Array

Details about creative transformations

Object
width
integer

The transformed creative width

Example:
200
height
integer

The transformed creative height

Example:
300
url
string

The transformed creative URL

Example:
https://asset.crm.com/image/offer/c_scale,w_200/offer.jpg
sales_model
Object

The sales model is the unique identifier used to calssify a product’s prcie

id
string

The sales model unique identifier

Example:
caf332bc-4e90-47b5-a05d-142b264897b9
name
string

The sales model name which has to be unique across all sales models

Example:
Retail
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
GET https://sandbox.crm.com/self-service/v2/products/8c939607-2262-544d-99ef-4634c6e8836d HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A
api_key: ab5f8b2e-092f-4848-8f46-31df1c014060

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "8c939607-2262-544d-99ef-4634c6e8836d",
    "sku": "ABC12345",
    "name": "Base TV",
    "description": "Basic TV & myFlix",
    "classification": "TRACEABLE_PHYSICAL_GOOD",
    "type_composition": "FLAT",
    "number_of_prices": 3,
    "variants": 3,
    "availability": "ENABLED",
    "type": {
        "id": "8c939607-2262-544d-99ef-4634c6e8836d",
        "name": "TV Services"
    },
    "categories": [
        {
            "id": "8c939607-2262-544d-99ef-4634c6e8836d",
            "name": "PaidTV"
        }
    ],
    "family": {
        "id": "8c939607-2262-544d-99ef-4634c6e8836d",
        "name": "Entertainment"
    },
    "brand": {
        "id": "8c939607-2262-544d-99ef-4634c6e8836d",
        "name": "News"
    },
    "composition": [
        {
            "id": "8c939607-2262-544d-99ef-4634c6e8836d",
            "item_type": "TYPE",
            "item_id": "8c939607-2262-544d-99ef-4634c6e8836d",
            "sku": "ABC12345",
            "name": "TV Services",
            "minimum_quantity": 1,
            "maximum_quantity": 3,
            "madnatory": "true",
            "price_inclusive": "true",
            "priority": 1,
            "default_modifier": {
                "id": "8c939607-2262-544d-99ef-4634c6e8836d",
                "sku": "ALMMILK",
                "name": "Almond milk"
            }
        }
    ],
    "pricing": [
        {
            "id": "",
            "price": 9.99,
            "currency_code": "EUR",
            "price_model": "FLAT",
            "tax_model": "TAX_INCLUSIVE",
            "supply_method": "DELIVERY",
            "price_terms": {
                "terms_billing_cycles": 12,
                "auto_renewed": true,
                "billing_model": "PRE_BILL",
                "contract_period": {
                    "duration": 12,
                    "uot": "MONTHS"
                },
                "billing_period": {
                    "duration": 1,
                    "uot": "MONTHS"
                },
                "trial_period": {
                    "duration": 7,
                    "uot": "DAYS"
                },
                "rental_service": {
                    "id": "8c939607-2262-544d-99ef-4634c6e8836d",
                    "sku": "RENTAL",
                    "name": "Rental Fee"
                }
            },
            "is_default": "true",
            "sales_model": [
                {
                    "id": "caf332bc-4e90-47b5-a05d-142b264897b9",
                    "name": "Retail",
                    "description": "Sales model available for all contact Person"
                }
            ],
            "tiers": [
                {
                    "price": 9.99,
                    "lower_tier": 1,
                    "upper_tier": 5
                }
            ]
        }
    ],
    "variant_attributes": [
        {
            "key": "size",
            "label": "Size",
            "value": "Small"
        }
    ],
    "taxes": [
        {
            "id": "8c939607-2262-544d-99ef-4634c6e8836d",
            "name": "Standard VAT",
            "tax_code": "VAT",
            "percentage": 19.5
        }
    ],
    "creatives": [
        {
            "id": "a3f1f6b3-8d49-3a72-e48e-617dd6004d41",
            "usage_type": "ATTACHMENT",
            "width": 2159,
            "height": 3075,
            "format": "jpg",
            "url": "https://assets.crm.com/image/offer.jpg",
            "public_id": "crm-com/image",
            "media": [
                {
                    "width": 200,
                    "height": 300,
                    "url": "https://asset.crm.com/image/offer/c_scale,w_200/offer.jpg"
                }
            ]
        }
    ],
    "sales_model": {
        "id": "caf332bc-4e90-47b5-a05d-142b264897b9",
        "name": "Retail"
    }
}
Get Product Variants
GET /products/{id}/variants

Get the detailed information of a composite product’s variant products, their prices, composition etc. The method can only be used for products classificied as Composite, i.e. they are sold in various variations.

Path variables

id
string GUID required

The product identifier whose variants will be retrieved

Example:
2f6a70b6-84d4-2859-d230-093cb7e95c62

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A
api_key
string required

The publishable api key for application identification

Example:
ab5f8b2e-092f-4848-8f46-31df1c014060

Responses

200 OK
Body
Array
Object
id
string GUID

Product identifier

Example:
2f6a70b6-84d4-2859-d230-093cb7e95c62
sku
string

Product SKU

Example:
ABC12345
name
string

Product name

Example:
Small Latte
description
string

Product dscription

Example:
Small Latte
type_composition
string
Enumeration:
FLAT
FIXED_BUNDLE
FLEXIBLE_BUNDLE
COMPOSITE
Example:
FLAT
pricing
Array

List of prices of the variant product. A variant product by default is sold using its Composite product’s price. If the variant product’s needs to be differntiated, then it will have its own price.

Object
price
number

Price

Example:
9.99
currency_code
string
Min length: 3
Max length: 3
Pattern: 3-letter ISO 4217 currency code.
Example:
EUR
price_model
string
Enumeration:
FLAT
TIERED
VOLUME
STAIRSTEP
Example:
FLAT
tax_model
string
Enumeration:
TAX_INCLUSIVE
TAX_EXCLUSIVE
Example:
TAX_INCLUSIVE
supply_method
string

Defines the order’ supply method

Enumeration:
DELIVERY
PICK_UP
DIRECT_SALE
sales_model
Object

The sales model is the unique identifier used to calssify a product’s prcie

id
string

The sales model unique identifier

Example:
caf332bc-4e90-47b5-a05d-142b264897b9
name
string

The sales model name which has to be unique across all sales models

Example:
Retail
variant_attributes
Array

List of product attributes. The allowed attributes and their allowed values are specified at the Composite product specification. Each variant has a unique combination of these attributes and values

Object
key
string

Attribute’s key

Example:
size
value
string

Attribute value

Example:
Small
label
string

Label used for UI purposes

Example:
Size
creatives
Array

Creatives images for marketing includes the primary image and scaled versions to create a srcset

Object
id
string GUID

The creative identifier

Example:
a3f1f6b3-8d49-3a72-e48e-617dd6004d41
usage_type
string

Information about the creative type

Enumeration:
LOGO
BACKGROUND
MARKETING
ATTACHMENT
width
integer

The creative width

Example:
2159
height
integer

The creative height

Example:
3075
format
string

The creative format

Example:
jpg
url
string

The creative content URL

Example:
https://assets.crm.com/image/offer.jpg
public_id
string

The creative public identifier

Example:
crm-com/image
media
Array

Details about creative transformations

Object
width
integer

The transformed creative width

Example:
200
height
integer

The transformed creative height

Example:
300
url
string

The transformed creative URL

Example:
https://asset.crm.com/image/offer/c_scale,w_200/offer.jpg
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
GET https://sandbox.crm.com/self-service/v2/products/2f6a70b6-84d4-2859-d230-093cb7e95c62/variants HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A
api_key: ab5f8b2e-092f-4848-8f46-31df1c014060

HTTP/1.1 200 OK 

Content-Type: application/json

[
    {
        "id": "2f6a70b6-84d4-2859-d230-093cb7e95c62",
        "sku": "ABC12345",
        "name": "Small Latte",
        "description": "Small Latte",
        "type_composition": "FLAT",
        "pricing": [
            {
                "price": 9.99,
                "currency_code": "EUR",
                "price_model": "FLAT",
                "tax_model": "TAX_INCLUSIVE",
                "supply_method": "DIRECT_SALE",
                "sales_model": {
                    "id": "caf332bc-4e90-47b5-a05d-142b264897b9",
                    "name": "Retail"
                }
            }
        ],
        "variant_attributes": [
            {
                "key": "size",
                "value": "Small",
                "label": "Size"
            }
        ],
        "creatives": [
            {
                "id": "a3f1f6b3-8d49-3a72-e48e-617dd6004d41",
                "usage_type": "ATTACHMENT",
                "width": 2159,
                "height": 3075,
                "format": "jpg",
                "url": "https://assets.crm.com/image/offer.jpg",
                "public_id": "crm-com/image",
                "media": [
                    {
                        "width": 200,
                        "height": 300,
                        "url": "https://asset.crm.com/image/offer/c_scale,w_200/offer.jpg"
                    }
                ]
            }
        ]
    }
]
Promotions

Promotions provide a discount to consumers, usually when a set od conditions are met such as when, where and which products are ordered by the consumer. A promotion has offerrings that include - apart from the discount amount/percentage, the discounted products and whether the discount will be applied per product or at invoice level.

GET /promotions
GET /promotions/{id}
List Promotions
GET /promotions

Returns a list of Promotions.

Request parameters

search_value
string optional

Search for a promotion using its name

Example:
Happy Hour
organisations
array of string GUID optional

Filter based on the organisation that the promotions are created for. Use the filer so as to present the Promotion that can be applied if the contact orders items from these merchants/venues = service providers/points

Collection format: csv
Unique items: YES
sort
string optional

Defines on which attribute the results should be sorted

Allow empty value: true
Examples:
CREATED_DATEUPDATED_DATENAMEPOSTED_DATE
order
string optional

Defines how the results will be ordered

Allow empty value: true
Enumeration:
ASC
DESC
Default:
DESC
page
integer optional

The page number that should be retrieved

Default:
1
Example:
20
size
string optional

The size (total records) of each page

Default:
10
Example:
20

Responses

200 OK
Body
Object
content
Array
Object
id
string GUID

Unique identifier of the Promotion

Example:
4dc0809f-ed91-4b68-b912-5bd6064d901e
name
string

Promotion name

Example:
Sales season 20%
short_description
string

A short description for the Promotion

Example:
20% off to all services
long_description
string

A more detailed descriptino of the promotion

Example:
All termed services get 20% off on subscribing and applied for the first 6 months
state
string

State of the Promotion. Only Active Promotions are applied on purchasing products

Enumeration:
ACTIVE
INACTIVE
Example:
ACTIVE
availability
Object

Period of time during which the Promotion is available i.e. the promotion is applied only for purchases performed within this period

from_date
integer

Start date

Example:
1649231923
to_date
integer

End Date.

Example:
1649231923
creatives
Array

Creatives images for marketing includes the primary image and scaled versions to create a srcset

Object
id
string GUID

The creative identifier

Example:
a3f1f6b3-8d49-3a72-e48e-617dd6004d41
usage_type
string

Information about the creative type

Enumeration:
LOGO
BACKGROUND
MARKETING
ATTACHMENT
width
integer

The creative width

Example:
2159
height
integer

The creative height

Example:
3075
format
string

The creative format

Example:
jpg
url
string

The creative content URL

Example:
https://assets.crm.com/image/offer.jpg
public_id
string

The creative public identifier

Example:
crm-com/image
media
Array

Details about creative transformations

Object
width
integer

The transformed creative width

Example:
200
height
integer

The transformed creative height

Example:
300
url
string

The transformed creative URL

Example:
https://asset.crm.com/image/offer/c_scale,w_200/offer.jpg
pages
Object

Information that can be used in order to display large pages

page
integer

The page number

Example:
2
size
integer

The number of records per page

Default:
10
Example:
20
total
integer

The total number of records. If “include_total” is not specified, then this total is null. If “include_total” is specified, total has a value but it is accurate up to 10K records.

Example:
1124
has_more
boolean

Shows if there are more records available to fetch

Example:
true
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
GET https://sandbox.crm.com/self-service/v2/promotions HTTP/1.1 

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "content": [
        {
            "id": "4dc0809f-ed91-4b68-b912-5bd6064d901e",
            "name": "Sales season 20%",
            "short_description": "20% off to all services",
            "long_description": "All termed services get 20% off on subscribing and applied for the first 6 months",
            "state": "ACTIVE",
            "availability": {
                "from_date": 1649231923,
                "to_date": 1649231923
            },
            "creatives": [
                {
                    "id": "a3f1f6b3-8d49-3a72-e48e-617dd6004d41",
                    "usage_type": "BACKGROUND",
                    "width": 2159,
                    "height": 3075,
                    "format": "jpg",
                    "url": "https://assets.crm.com/image/offer.jpg",
                    "public_id": "crm-com/image",
                    "media": [
                        {
                            "width": 200,
                            "height": 300,
                            "url": "https://asset.crm.com/image/offer/c_scale,w_200/offer.jpg"
                        }
                    ]
                }
            ]
        }
    ],
    "pages": {
        "page": 2,
        "size": 20,
        "total": 1124
    }
}
Get Promotion
GET /promotions/{id}

Retrieve detailed information for a specific promotion

Path variables

id
string GUID required

The promotion identifier that will be retrieved

Example:
6eeec3be-be1b-3eae-ca11-779d932d97fc

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 OK
Body
Object
id
string GUID

Promotion identifier

Example:
4dc0809f-ed91-4b68-b912-5bd6064d901e
name
string

Promotion name

Example:
Sales season
state
string

Promotion state

Enumeration:
ACTIVE
INACTIVE
Example:
ACTIVE
short_description
string

Short description of the Promotion

Example:
£10 off
long_description
string

A more detailed description of the Promotion

Example:
£10 off on products whose price is more than £100
availability
Object

Determines when the Promotion is avialable and will be applied. A pPromotion is applied only when purchases are performed within this period.

from_date
integer

Contacts get the Promotion on orders performed from this date onward

Example:
1649231923
to_date
integer

Promotion applied on orders up until this date

Example:
1649231923
targets
Object

The Promotion’s target conditions i.e. the required conditions for the contact to get the discount.

segments
Array
Object
id
string

The unique identifier of the Segment

Example:
4dc0809f-ed91-4b68-b912-5bd6064d901e
name
string

Name of the Segment

Example:
VIP contacts
organisations
Array
Object
id
string

The unique identifier of the Organisation

Example:
4dc0809f-ed91-4b68-b912-5bd6064d901e
name
string

Name of the Organisation

Example:
Good Burgers
timings
Object
fixed_period
Object

Promotion is applied if the purchase is performed within the specified period off time. Either a fixed period or promotion availability must be specified

start_date
integer

Promotion applied if purchase is performed from this date (inclusive) and onwards

Example:
1648067185
end_date
integer

If specified, then purchase must be performed up until this date. Optional.

Example:
1648067185
availability
Array

Promotion is applied if the purchase is performed within the specified day(s), month(s) and/or times. Either a fixed period or promotion availability must be specified. Each availibility option should be unique

Object
day
string
Enumeration:
MONDAY
TUESDAY
WEDNESDAY
THURSDAY
FRIDAY
SATURDAY
SUNDAY
month
string
Enumeration:
JANUARY
FEBRUARY
MARCH
APRIL
MAY
JUNE
JULY
AUGUST
SEPTEMBER
OCTOBER
NOVEMBER
DECEMBER
start_time
string

Starting time

Example:
13:00
end_time
string

End time

Example:
14:00
basket
Object
rules
Object

Rules that -if specified- should be met in order for the Promotion to be applied.

payment_method_type
Array

Contact should pay using one of the specified payment method types to get the offerring

Example:
["CARD"]
string
Enumeration:
CASH
CARD
ACCOUNT_DEBIT
WALLET
CRM_WALLET
CHEQUE
ELECTRONIC_TRANSFER
Example:
CARD
supply_method
Array

Purchase is fulfiflled using one of the specified supply methods for the contact to get the offering

Example:
["DELIVERY"]
string

Defines the order’ supply method

Enumeration:
DELIVERY
PICK_UP
DIRECT_SALE
value
number

Minimum required basket total amount for the promotion to be applied. The amount is always set in the business’s base currency

Example:
9.99
quantity
integer

Miminum required quantity of basket items

Example:
5
products
Object

Products that should be included in the basket for the Promotion to be applied. Product conditions are defined as groups of conditions. In Each group there’s a product setting and the conditions that should be met. Multiple groups can be added, logically separated by AND/OR operators.

groups
Array
Object
group
string

The group’s name. Each group name must be unique

Example:
G1
operator
string

Logical operator used amount the product conditions

Example:
AND
conditions
Array

List of product conditions. Mulitple conditions can be added, each one referring to a single product. All product conditions mus tbe met to apply the promotion

Object
operator
string
Example:
OR
condition
string
product
Object

The product that should be included in the basket

item_type
string
Enumeration:
SKU
TYPE
BRAND
FAMILY
item_id
string

The identifier of the product/type/brand/family.

Example:
4dc0809f-ed91-4b68-b912-5bd6064d901e
sku
string

The product’s SKU. Applicable only when item type is set to Product

Example:
HDSTB123
name
string

The name of the product/type/brand/family

Example:
HD STB
quantity
integer

The minimum required quantity of items to be included in the basket for the promotion to be applied

Example:
1
value
number

The minimum required basket items cost. Cos tis defined in the business’s base currency

Example:
9.99
billing_cycle
Object

The billing cycle of the basket item. Applicable only for termed services. The billing cycle is the one specified in the service’s price terms selected on ordering

duration
integer

Billing cycle duration

Example:
1
uot
string

Billing cycle unit of time

Enumeration:
DAYS
MONTHS
Example:
MONTHS
contract_period
Object

The contract period of the basket item. Applicable only for termed services. The contract period is the one specified in the service’s price terms selected on ordering

duration
integer

Contract period duration

Example:
12
uot
string

Contract period unit of time

Enumeration:
MONTHS
Example:
MONTHS
offerings
Array
Object
type
string

Defines whether the offering is an actual discount amount or a discount percentage

Enumeration:
AMOUNT
PERCENTAGE
amount
number

The discount amount or percentage depending on the offering’s type

Example:
1.99
product
Object

The product on which the discount will be applied

item_type
string

Determines on which product the discount will be applied.

Enumeration:
SKU
TYPE
BRAND
FAMILY
Example:
SKU
item_id
string

The unique identifier of the product item

Example:
4dc0809f-ed91-4b68-b912-5bd6064d901e
sku
string

The product’s SKU. Applicable only for SKU item types

Example:
STB12345
name
string

The product/type/brand/family name

Example:
HD STB
duration
Object

How long the offering will be applied. Applicable only when the offering’s product is a termed service

type
string

Indicates whether the offering will be applied once, for period fo time or forever.

Enumeration:
ONCE

Discount applied only once

PERIOD

Discount applied for a limited period

FOREVER

Discount applied forever

period
Object

Applicable and required only when the offering ill be applied for a specific PERIOD

vaue
integer

The period’s duration

Example:
6
uot
string

The period’s unit of time

Enumeration:
DAYS
MONTHS
YEARS
Example:
MONTHS
creatives
Array

Creatives images for marketing includes the primary image and scaled versions to create a srcset

Object
id
string GUID

The creative identifier

Example:
a3f1f6b3-8d49-3a72-e48e-617dd6004d41
usage_type
string

Information about the creative type

Enumeration:
LOGO
BACKGROUND
MARKETING
ATTACHMENT
width
integer

The creative width

Example:
2159
height
integer

The creative height

Example:
3075
format
string

The creative format

Example:
jpg
url
string

The creative content URL

Example:
https://assets.crm.com/image/offer.jpg
public_id
string

The creative public identifier

Example:
crm-com/image
media
Array

Details about creative transformations

Object
width
integer

The transformed creative width

Example:
200
height
integer

The transformed creative height

Example:
300
url
string

The transformed creative URL

Example:
https://asset.crm.com/image/offer/c_scale,w_200/offer.jpg
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
GET https://sandbox.crm.com/self-service/v2/promotions/6eeec3be-be1b-3eae-ca11-779d932d97fc HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "4dc0809f-ed91-4b68-b912-5bd6064d901e",
    "name": "Sales season",
    "state": "ACTIVE",
    "short_description": "£10 off",
    "long_description": "£10 off on products whose price is more than £100",
    "availability": {
        "from_date": 1649231923,
        "to_date": 1649231923
    },
    "targets": {
        "segments": [
            {
                "id": "4dc0809f-ed91-4b68-b912-5bd6064d901e",
                "name": "VIP contacts"
            }
        ],
        "organisations": [
            {
                "id": "4dc0809f-ed91-4b68-b912-5bd6064d901e",
                "name": "Good Burgers"
            }
        ],
        "timings": {
            "fixed_period": {
                "start_date": 1648067185,
                "end_date": 1648067185
            },
            "availability": [
                {
                    "day": "WEDNESDAY",
                    "month": "OCTOBER",
                    "start_time": "13:00",
                    "end_time": "14:00"
                }
            ]
        }
    },
    "basket": {
        "rules": {
            "payment_method_type": [
                "CARD"
            ],
            "supply_method": [
                "DELIVERY"
            ],
            "value": 9.99,
            "quantity": 5
        },
        "products": {
            "groups": [
                {
                    "group": "G1",
                    "operator": "AND",
                    "conditions": [
                        {
                            "operator": "OR",
                            "condition": "",
                            "product": {
                                "item_type": "FAMILY",
                                "item_id": "4dc0809f-ed91-4b68-b912-5bd6064d901e",
                                "sku": "HDSTB123",
                                "name": "HD STB"
                            },
                            "quantity": 1,
                            "value": 9.99,
                            "billing_cycle": {
                                "duration": 1,
                                "uot": "MONTHS"
                            },
                            "contract_period": {
                                "duration": 12,
                                "uot": "MONTHS"
                            }
                        }
                    ]
                }
            ]
        }
    },
    "offerings": [
        {
            "type": "PERCENTAGE",
            "amount": 1.99,
            "product": {
                "item_type": "SKU",
                "item_id": "4dc0809f-ed91-4b68-b912-5bd6064d901e",
                "sku": "STB12345",
                "name": "HD STB"
            },
            "duration": {
                "type": "PERIOD",
                "period": {
                    "vaue": 6,
                    "uot": "MONTHS"
                }
            }
        }
    ],
    "creatives": [
        {
            "id": "a3f1f6b3-8d49-3a72-e48e-617dd6004d41",
            "usage_type": "MARKETING",
            "width": 2159,
            "height": 3075,
            "format": "jpg",
            "url": "https://assets.crm.com/image/offer.jpg",
            "public_id": "crm-com/image",
            "media": [
                {
                    "width": 200,
                    "height": 300,
                    "url": "https://asset.crm.com/image/offer/c_scale,w_200/offer.jpg"
                }
            ]
        }
    ]
}
Order Catalogues

An Order Catalogue is a sub-set of the Product Catalogue. An Order Catalogue is created by an Organisation to be used for ordering purposes on front-end systems like mobile apps and portals. So consumers are able to order products from various Order Catalogues depending on the day or time or organisation from which they are ordering products.

GET /order_catalogues/
GET /order_catalogues/{id}/categories
List Order Catalogues
GET /order_catalogues/

Returns a list of active order catalogues configured for the Business

Request parameters

search_value
string optional

Search for an order catalogue using its name, dispaly name or description

Example:
Food
fulfilled_by
string GUID optional

Retrieve order catalogues based on organisation that wll fulfill the order

Example:
ab5f8b2e-092f-4848-8f46-31df1c014060
supply_method
string optional

Return order catalogues available per supply method

Enumeration:
DELIVERY
PICK_UP
DIRECT_SALE
ordering_time
integer epoch optional

Retrieve order catalogue based on ordering time

Example:
1644574218
sort
string optional

Defines on which attribute the results should be sorted

Allow empty value: true
Examples:
CREATED_DATEUPDATED_DATENAMEPOSTED_DATE
order
string optional

Defines how the results will be ordered

Allow empty value: true
Enumeration:
ASC
DESC
Default:
DESC
page
integer optional

The page number that should be retrieved

Default:
1
Example:
20
size
string optional

The size (total records) of each page

Default:
10
Example:
20

Request headers

api_key
string required

The publishable api key for application identification

Example:
ab5f8b2e-092f-4848-8f46-31df1c014060
auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 OK

The request has succeeded

Body
Object
content
Array
Object
id
string GUID

The order catalogue identifier

Example:
c5d37f18-2656-739d-6340-4b1413ca9617
name
string

The order catalogue name

Example:
Monday Menu
description
string

The order catalogue description

Example:
A list of dishes available every Monday
dislpay_name
string

The order catalogue display name

Example:
Monday
creatives
Array

Creatives images for marketing includes the primary image and scaled versions to create a srcset

Object
id
string GUID

The creative identifier

Example:
a3f1f6b3-8d49-3a72-e48e-617dd6004d41
usage_type
string

Information about the creative type

Enumeration:
LOGO
BACKGROUND
MARKETING
ATTACHMENT
width
integer

The creative width

Example:
2159
height
integer

The creative height

Example:
3075
format
string

The creative format

Example:
jpg
url
string

The creative content URL

Example:
https://assets.crm.com/image/offer.jpg
public_id
string

The creative public identifier

Example:
crm-com/image
media
Array

Details about creative transformations

Object
width
integer

The transformed creative width

Example:
200
height
integer

The transformed creative height

Example:
300
url
string

The transformed creative URL

Example:
https://asset.crm.com/image/offer/c_scale,w_200/offer.jpg
paging
Object

Information that can be used in order to display large pages

page
integer

The page number

Example:
2
size
integer

The number of records per page

Default:
10
Example:
20
total
integer

The total number of records. If “include_total” is not specified, then this total is null. If “include_total” is specified, total has a value but it is accurate up to 10K records.

Example:
1124
has_more
boolean

Shows if there are more records available to fetch

Example:
true
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
GET https://sandbox.crm.com/self-service/v2/order_catalogues/ HTTP/1.1 

api_key: ab5f8b2e-092f-4848-8f46-31df1c014060

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "content": [ 
        {
            "id": "c5d37f18-2656-739d-6340-4b1413ca9617",
            "name": "Monday Menu",
            "description": "A list of dishes available every Monday",
            "dislpay_name": "Monday",
            "creatives": [
                {
                    "id": "a3f1f6b3-8d49-3a72-e48e-617dd6004d41",
                    "usage_type": "BACKGROUND",
                    "width": 2159,
                    "height": 3075,
                    "format": "jpg",
                    "url": "https://assets.crm.com/image/offer.jpg",
                    "public_id": "crm-com/image",
                    "media": [
                        {
                            "width": 200,
                            "height": 300,
                            "url": "https://asset.crm.com/image/offer/c_scale,w_200/offer.jpg"
                        }
                    ]
                }
            ]
        }
    ],
    "paging": {
        "page": 2,
        "size": 20,
        "total": 1124
    }
}
List Order Catalogue Categories
GET /order_catalogues/{id}/categories

Returns a list of order catalogue categories

Path variables

id
string required

The order catalogue identifier

Request parameters

search_value
string optional

Search for an order cataogue category using its name

parent_id
string GUID optional

Retrieve only all child nodes that have as parent this order catalogue category

Example:
9365d945-2c62-be0e-a8dc-45736fdfa5b5
return_all
boolean optional

Defines whether all order catalogue categories (parent and child) should be retrieved or not

Example:
true
sort
string optional

Defines on which attribute the results should be sorted

Allow empty value: true
Examples:
CREATED_DATEUPDATED_DATENAMEPOSTED_DATE
order
string optional

Defines how the results will be ordered

Allow empty value: true
Enumeration:
ASC
DESC
Default:
DESC
page
integer optional

The page number that should be retrieved

Default:
1
Example:
20
size
string optional

The size (total records) of each page

Default:
10
Example:
20

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A
api_key
string required

The publishable api key for application identification

Example:
ab5f8b2e-092f-4848-8f46-31df1c014060

Responses

200 OK

The request has succeeded

Body
Object
content
Array
Object
id
string GUID

The order catalogue category identifier

Example:
9365d945-2c62-be0e-a8dc-45736fdfa5b5
name
string

The order catalogue category name

Example:
Cold Drinks
description
string

The order catalogue category description

Example:
Cold Beverages and Refreshers
child_nodes
integer

The number of the order catalogue category’s child nodes

Example:
12
parent
Object

Details about the parent order catalogue category (applicable if this category is a child node)

id
string GUID

The parent order category identifier

Example:
9365d945-2c62-be0e-a8dc-45736fdfa5b5
name
string

The parent order category name

Example:
Drinks
paging
Object

Information that can be used in order to display large pages

page
integer

The page number

Example:
2
size
integer

The number of records per page

Default:
10
Example:
20
total
integer

The total number of records. If “include_total” is not specified, then this total is null. If “include_total” is specified, total has a value but it is accurate up to 10K records.

Example:
1124
has_more
boolean

Shows if there are more records available to fetch

Example:
true
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
GET https://sandbox.crm.com/self-service/v2/order_catalogues/{id}/categories HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "content": [
        {
            "id": "9365d945-2c62-be0e-a8dc-45736fdfa5b5",
            "name": "Cold Drinks",
            "description": "Cold Beverages and Refreshers",
            "child_nodes": 12,
            "parent": {
                "id": "9365d945-2c62-be0e-a8dc-45736fdfa5b5",
                "name": "Drinks"
            }
        }
    ],
    "paging": {
        "page": 2,
        "size": 20,
        "total": 1124
    }
}
Rewards

Rewards API

GET /reward_schemes
GET /reward_offers
GET /reward_offers/{id}/performance
Search Reward Schemes
GET /reward_schemes

Retrieve all active reward schemes

Request parameters

name
string optional

The reward scheme name

Example:
CRMdotCOM Reward Scheme
has_signed
boolean optional

Filter based on whether contact has signed up or not

Example:
true
sort
string optional

Defines on which attribute the results should be sorted

Allow empty value: true
Examples:
CREATED_DATEUPDATED_DATENAMEPOSTED_DATE
order
string optional

Defines how the results will be ordered

Allow empty value: true
Enumeration:
ASC
DESC
Default:
DESC
page
integer optional

The page number that should be retrieved

Default:
1
Example:
20
size
string optional

The size (total records) of each page

Default:
10
Example:
20

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 OK

The request has succeeded

Body
Object
content
Array
Object
id
string GUID

The reward scheme identifier

Example:
d740054b-8cf6-f147-33a2-844c80096b93
name
string

The reward scheme name

Example:
Loyalty Scheme
description
string

The reward scheme description

Example:
Lorem Ipsum
terms_and_conditions
string

The terms and conditions for the retrieved reward scheme

Example:
Only CRMdotCOM domain customer can sign up
sign_up_option
string

Defines how customer can sign up to the reward scheme

Enumeration:
AUTO_SIGN_UP
SELF_SIGN_UP
CLOSED_SIGN_UP
has_signed
boolean

Defines whether contact has already signed up to reward scheme

Example:
false
paging
Object

Information that can be used in order to display large pages

page
integer

The page number

Example:
2
size
integer

The number of records per page

Default:
10
Example:
20
total
integer

The total number of records. If “include_total” is not specified, then this total is null. If “include_total” is specified, total has a value but it is accurate up to 10K records.

Example:
1124
has_more
boolean

Shows if there are more records available to fetch

Example:
true
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
GET https://sandbox.crm.com/self-service/v2/reward_schemes HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "content": [
        {
            "id": "d740054b-8cf6-f147-33a2-844c80096b93",
            "name": "Loyalty Scheme",
            "description": "Lorem Ipsum",
            "terms_and_conditions": "Only CRMdotCOM domain customer can sign up",
            "sign_up_option": "SELF_SIGN_UP",
            "has_signed": "false"
        }
    ],
    "paging": {
        "page": 2,
        "size": 20,
        "total": 1124
    }
}
Search Reward Offers
GET /reward_offers

Retrieve all active reward offers that are applicable for a specific contact

Request parameters

industries
array of string GUID optional

Filter based on industries

Collection format: csv
Unique items: YES
industry_sectors
array of string GUID optional

Filter based on industry sectors

Collection format: csv
Unique items: YES
tags
array of string GUID optional

Filter based on organisation tags

Collection format: csv
Unique items: YES
towns_cities
array of string optional

Filter based on organisation location town/city

Collection format: csv
Unique items: YES
countries
array of string optional

Filter based on organisation location country (code)

Collection format: csv
Unique items: YES
organisations
array of string GUID optional

Filter based on the organisation that the offers are created for

Collection format: csv
Unique items: YES
performance_enabled
boolean optional

Filter based on whether reward offers are eligible to be used for performance purposes or not

Example:
true
sort
string optional

Defines on which attribute the results should be sorted

Allow empty value: true
Examples:
CREATED_DATEUPDATED_DATENAMEPOSTED_DATE
order
string optional

Defines how the results will be ordered

Allow empty value: true
Enumeration:
ASC
DESC
Default:
DESC
page
integer optional

The page number that should be retrieved

Default:
1
Example:
20
size
string optional

The size (total records) of each page

Default:
10
Example:
20

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 OK

The request has succeeded

Body
Object
content
Array
Object
id
string GUID

The reward offer identifier

Example:
7acb34e9-221a-32f9-008b-cb7a3d28851c
name
string

The reward offer name

Example:
10% off on any purchase
scheme
Object

Infromation about the reward scheme of this offer

id
string GUID

The reward scheme identifier

Example:
58a54215-5d8f-5b40-af91-c62e86b973a9
name
string

The reward scheme name

Example:
Loyalty Scheme
short_description
string

The reward offer short description

Example:
Short Description
long_description
string

The reward offer long description

Example:
Long Description
terms_and_conditions
string

The terms and conditions for the retrieved reward offer

Example:
Terms & Conditions
is_featured
boolean

Defines whether the reward offer is featured or not

Example:
false
performance_enabled
boolean

Defines whether the reward offer is eligible to be used for performance purposes

Example:
true
owner
Object

Information about the organisation that owns the reward offer

id
string GUID

The organisation identifier

Example:
e66d45b4-2673-0a0e-5a06-d6088a324b3f
name
string

The organisation name

Example:
Pizza Yummy
creatives
Array

Creatives images for marketing includes the primary image and scaled versions to create a srcset

Object
id
string GUID

The creative identifier

Example:
a3f1f6b3-8d49-3a72-e48e-617dd6004d41
usage_type
string

Information about the creative type

Enumeration:
LOGO
BACKGROUND
MARKETING
ATTACHMENT
width
integer

The creative width

Example:
2159
height
integer

The creative height

Example:
3075
format
string

The creative format

Example:
jpg
url
string

The creative content URL

Example:
https://assets.crm.com/image/offer.jpg
public_id
string

The creative public identifier

Example:
crm-com/image
media
Array

Details about creative transformations

Object
width
integer

The transformed creative width

Example:
200
height
integer

The transformed creative height

Example:
300
url
string

The transformed creative URL

Example:
https://asset.crm.com/image/offer/c_scale,w_200/offer.jpg
creatives
Array

Creatives images for marketing includes the primary image and scaled versions to create a srcset

Object
id
string GUID

The creative identifier

Example:
a3f1f6b3-8d49-3a72-e48e-617dd6004d41
usage_type
string

Information about the creative type

Enumeration:
LOGO
BACKGROUND
MARKETING
ATTACHMENT
width
integer

The creative width

Example:
2159
height
integer

The creative height

Example:
3075
format
string

The creative format

Example:
jpg
url
string

The creative content URL

Example:
https://assets.crm.com/image/offer.jpg
public_id
string

The creative public identifier

Example:
crm-com/image
media
Array

Details about creative transformations

Object
width
integer

The transformed creative width

Example:
200
height
integer

The transformed creative height

Example:
300
url
string

The transformed creative URL

Example:
https://asset.crm.com/image/offer/c_scale,w_200/offer.jpg
paging
Object

Information that can be used in order to display large pages

page
integer

The page number

Example:
2
size
integer

The number of records per page

Default:
10
Example:
20
total
integer

The total number of records. If “include_total” is not specified, then this total is null. If “include_total” is specified, total has a value but it is accurate up to 10K records.

Example:
1124
has_more
boolean

Shows if there are more records available to fetch

Example:
true
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
GET https://sandbox.crm.com/self-service/v2/reward_offers HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "content": [
        {
            "id": "7acb34e9-221a-32f9-008b-cb7a3d28851c",
            "name": "10% off on any purchase",
            "reward_scheme": {
                "id": "58a54215-5d8f-5b40-af91-c62e86b973a9",
                "name": "Loyalty Scheme"
            },
            "short_description": "Short Description",
            "long_description": "Long Description",
            "terms_and_conditions": "Terms & Conditions",
            "is_featured": "false",
            "performance_enabled": "true",
            "owned_by": {
                "id": "e66d45b4-2673-0a0e-5a06-d6088a324b3f",
                "name": "Pizza Yummy",
                "creatives": [
                    {
                        "id": "a3f1f6b3-8d49-3a72-e48e-617dd6004d41",
                        "usage_type": "BACKGROUND",
                        "width": 2159,
                        "height": 3075,
                        "format": "jpg",
                        "url": "https://assets.crm.com/image/offer.jpg",
                        "public_id": "crm-com/image",
                        "media": [
                            {
                                "width": 200,
                                "height": 300,
                                "url": "https://asset.crm.com/image/offer/c_scale,w_200/offer.jpg"
                            }
                        ]
                    }
                ]
            },
            "creatives": [
                {
                    "id": "a3f1f6b3-8d49-3a72-e48e-617dd6004d41",
                    "usage_type": "MARKETING",
                    "width": 2159,
                    "height": 3075,
                    "format": "jpg",
                    "url": "https://assets.crm.com/image/offer.jpg",
                    "public_id": "crm-com/image",
                    "media": [
                        {
                            "width": 200,
                            "height": 300,
                            "url": "https://asset.crm.com/image/offer/c_scale,w_200/offer.jpg"
                        }
                    ]
                }
            ]
        }
    ],
    "paging": {
        "page": 2,
        "size": 20,
        "total": 1124
    }
}
Get Reward Offer Performance
GET /reward_offers/{id}/performance

Retrieve the performance for a specific reward offer

Path variables

id
string GUID required

The reward offer (identifier) whose performance will be retrieved

Example:
a690caa5-9c4d-4eb0-b743-88076f1f5711

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 OK

The request has succeeded

Body
Object
type
string

Defines the performance type of the offer, whether it’s based on transaction amount, contact events or purchased products

Enumeration:
AMOUNT
PRODUCT
EVENT
progress
number

The progression percentage for this offer

Example:
90.11
current
number

The current performance (events, purchased products, amount) that was recorded so far

Example:
12.32
target
number

The target performance (events, purchased products, amount) that should be captured in order to be awarded from the offer

Example:
123.78
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
Example 2
Example 3
GET https://sandbox.crm.com/self-service/v2/reward_offers/a690caa5-9c4d-4eb0-b743-88076f1f5711/performance HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "type": "PRODUCT",
    "progress": 14.11,
    "current": 12.32,
    "target": 123.78
}
GET https://sandbox.crm.com/self-service/v2/reward_offers/a690caa5-9c4d-4eb0-b743-88076f1f5711/performance HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "type": "EVENT",
    "progress": null,
    "current": 12,
    "target": null
}
GET https://sandbox.crm.com/self-service/v2/reward_offers/a690caa5-9c4d-4eb0-b743-88076f1f5711/performance HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "type": "EVENT",
    "progress": 90.11,
    "current": 12,
    "target": 17
}
Service Requests

Service requests shall be created via the self service platform.

POST /contacts/{id}/service_requests
GET /contacts/{id}/service_requests
Create Service Request
POST /contacts/{id}/service_requests

Create a service request for a specific contact

Path variables

id
string GUID required

The contact (identifier) for whom a service request will be created

Example:
6b888b83-b418-752f-604d-0653cf65885d

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Request body

Object
description
string required

The service request description

Example:
I have a complaint about the potholes in Nicosia Main Road
queue_id
string GUID required

The queue identifier

Example:
6b888b83-b418-752f-604d-0653cf658811
address
Object

Address information for the service request

id
string nullable

The contact’s address id associated to the service request (either ‘id’ or ‘other’ can be specified)

Example:
61c943c8-dfeb-4c09-a25c-b054f48bf244
other
Object nullable

Details about the address

address_line_1
string

The address line 1

Example:
17 Baker Str
address_line_2
string

The address line 2

state_province_county
string

The address state/province/county

Example:
Egkomi
town_city
string

The address town/city

Example:
Nicosia
postal_code
string

The address postal code

Example:
12462
country_code
string

The address country code

Example:
GR
lat
number

The address geolocation latitude

Example:
12.345
lon
number

The address geolocation longtitude

Example:
11.452
googlePlaceId
string

The address unique Google identifier

Example:
123ewd23rwe23w
categories
Array

Default categories added to the service request based on queue definition

Object
id
string

Category id

Example:
2f4ffc37-9463-4f17-9549-dd3cbc24f7e7

Responses

201 Created
Body
Object
id
string GUID

The service request identifier that was created

Example:
8dfc2223-edca-f05d-820b-dc96ba9df2c2
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
POST https://sandbox.crm.com/self-service/v2/contacts/6b888b83-b418-752f-604d-0653cf65885d/service_requests HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "description": "I have a complaint about the potholes in Nicosia Main Road",
    "queue_id": "6b888b83-b418-752f-604d-0653cf658811",
    "address": {
        "id": "61c943c8-dfeb-4c09-a25c-b054f48bf244",
        "other": {
            "address_line_1": "17 Baker Str",
            "address_line_2": "",
            "state_province_county": "Egkomi",
            "town_city": "Nicosia",
            "postal_code": "12462",
            "country_code": "GR",
            "lat": 12.345,
            "lon": 11.452,
            "googlePlaceId": "123ewd23rwe23w"
        }
    },
    "categories": [
        {
            "id": "2f4ffc37-9463-4f17-9549-dd3cbc24f7e7"
        }
    ]
}

HTTP/1.1 201 Created 

Content-Type: application/json

{
    "id": "8dfc2223-edca-f05d-820b-dc96ba9df2c2"
}
List Service Requests
GET /contacts/{id}/service_requests

Retrieve all details relating to service requests created by or for a specific contact

Path variables

id
string GUID required

The contact id whose service requests will be retrieved

Example:
b2157d75-7959-83dc-fdfa-cacba764d4d4

Request parameters

state
string optional

Filter based on service request state

Enumeration:
NEW
IN_PROGRESS
CLOSED

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 OK
Body
Object
content
Array
Object
id
string GUID

The service request identifier

Example:
8dfc2223-edca-f05d-820b-dc96ba9df2c2
number
string

The service request number

Example:
SR1003
description
string

Description of the service request

Example:
Pot hole issues in Nicosia Main Road
comments
string

Service request system user comments, applicable only if the service request has been ‘closed’

Example:
Contact has been spoken to
category
Object

The categorisation for the service request

id
string

Category identifier

Example:
07132e7d-b4a0-4070-ad7b-7df2a8be0ebf
name
string

Category name

Example:
Complaints
created_date
integer epoch

Date service request was created

Example:
1653492769
stage
Object

The stage of the service request within the queue

id
string

Stage id

Example:
07132e7d-b4a0-4070-ad7b-7df2a8be0ebf
name
string

Stage name

Example:
Responded to customer
colour
string

Hex colour code for status

Example:
#FA89CB
state
string
Enumeration:
NEW
IN_PROGRESS
CLOSED
Example:
IN_PROGRESS
resolved
boolean

If the service request is ‘closed’, it should be noted whether it was resolved or not

Example:
true
closure_reason
Object

The closure reason of the service request, applicable only if it was closed without being resolved (i.e. ‘resolved’ = false)

id
string

Id of the configured closure reason

Example:
07132e7d-b4a0-4070-ad7b-7df2a8be0ebf
name
string

The name of reason displayed

Example:
Service request passed to Road Works Department
address
Object

Details about the address

address_line_1
string

The address line 1

Example:
17 Baker Str
address_line_2
string

The address line 2

state_province_county
string

The address state/province/county

Example:
Egkomi
town_city
string

The address town/city

Example:
Nicosia
postal_code
string

The address postal code

Example:
12462
country_code
string

The address country code

Example:
GR
lat
number

The address geolocation latitude

Example:
12.345
lon
number

The address geolocation longtitude

Example:
11.452
googlePlaceId
string

The address unique Google identifier

Example:
123ewd23rwe23w
paging
Object

Information that can be used in order to display large pages

page
integer

The page number

Example:
2
size
integer

The number of records per page

Default:
10
Example:
20
total
integer

The total number of records. If “include_total” is not specified, then this total is null. If “include_total” is specified, total has a value but it is accurate up to 10K records.

Example:
1124
has_more
boolean

Shows if there are more records available to fetch

Example:
true
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
GET https://sandbox.crm.com/self-service/v2/contacts/b2157d75-7959-83dc-fdfa-cacba764d4d4/service_requests HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "content": [
        {
            "id": "8dfc2223-edca-f05d-820b-dc96ba9df2c2",
            "number": "SR1003",
            "description": "Pot hole issues in Nicosia Main Road",
            "comments": "Contact has been spoken to",
            "category": {
                "id": "07132e7d-b4a0-4070-ad7b-7df2a8be0ebf",
                "name": "Complaints"
            },
            "created_date": 1653492769,
            "stage": {
                "id": "07132e7d-b4a0-4070-ad7b-7df2a8be0ebf",
                "name": "Responded to customer",
                "colour": "#FA89CB"
            },
            "state": "IN_PROGRESS",
            "resolved": true,
            "closure_reason": {
                "id": "07132e7d-b4a0-4070-ad7b-7df2a8be0ebf",
                "name": "Service request passed to Road Works Department"
            },
            "address": {
                "address_line_1": "17 Baker Str",
                "address_line_2": "",
                "state_province_county": "Egkomi",
                "town_city": "Nicosia",
                "postal_code": "12462",
                "country_code": "GR",
                "lat": 12.345,
                "lon": 11.452,
                "googlePlaceId": "123ewd23rwe23w"
            }
        }
    ],
    "paging": {
        "page": 2,
        "size": 20,
        "total": 1124
    }
}
Attachments

Self-service API for attaching files to service requests

POST /service_requests/{id}/attachments
DELETE /service_requests/{id}/attachments/{attachment_id}
GET /service_requests/{id}/attachments
Add Service Request Attachment
POST /service_requests/{id}/attachments

Upload an attachment for a service request

Path variables

id
string GUID required

The service request (identifier) for which a file will be attached

Example:
6b888b83-b418-752f-604d-0653cf65885d

Notes

FILE UPLOAD FLOW

Integrating file upload for Service Requests should be based on the following APIs

  1. Upload file signature
  2. Attach a file to a Service Request

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Request body

Object
file_id
string GUID required nullable

The file identifier to be attached

Example:
30526723-24a3-e4e3-1a75-b26b1b41f05c
url
string required nullable

The file (URL) to be attached

Example:
https://crm.com
description
string nullable

The file description

Example:
see more details on attached file

Responses

201 Created

The request has succeeded

Body
Object
id
string GUID

The attachment identifier

Example:
8dfc2223-edca-f05d-820b-dc96ba9df2c2
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
POST https://sandbox.crm.com/self-service/v1/service_requests/6b888b83-b418-752f-604d-0653cf65885d/attachments HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "file_id": "30526723-24a3-e4e3-1a75-b26b1b41f05c",
    "description": "Image 1"
}

HTTP/1.1 201 Created 

Content-Type: application/json

{
    "id": "8dfc2223-edca-f05d-820b-dc96ba9df2c2"
}
Delete Service Request Attachment
DELETE /service_requests/{id}/attachments/{attachment_id}

Delete an attachment file for a service request

Path variables

id
string GUID required

The service request (identifier) for which attachment file will be deleted

Example:
6b888b83-b418-752f-604d-0653cf65885d
attachment_id
string required

The attachment file (identifier) to be deleted

Example:
8dfc2223-edca-f05d-820b-dc96ba9df2c2

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

204 No Content

The request has succeeded

400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
DELETE https://sandbox.crm.com/self-service/v2/service_requests/6b888b83-b418-752f-604d-0653cf65885d/attachments/8dfc2223-edca-f05d-820b-dc96ba9df2c2 HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 204 No Content 
List Service Request Attachments
GET /service_requests/{id}/attachments

Retrieve all attachment files for a specific service request

Path variables

id
string GUID required

The service request (identifier) for which attachment files will be retrieved

Example:
6b888b83-b418-752f-604d-0653cf65885d

Request parameters

sort
string optional

Defines on which attribute the results should be sorted

Allow empty value: true
Examples:
CREATED_DATEUPDATED_DATENAMEPOSTED_DATE
order
string optional

Defines how the results will be ordered

Allow empty value: true
Enumeration:
ASC
DESC
Default:
DESC
page
integer optional

The page number that should be retrieved

Default:
1
Example:
20
size
string optional

The size (total records) of each page

Default:
10
Example:
20

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 OK

The request has succeeded

Body
Object
content
Array
Object

The attachment details

id
string GUID

The attachment identifier

Example:
af748ada-0521-0503-fc25-b67635a7d14d
description
string

The attachment description

Example:
contact's attachement
file
Object

The file details

id
string GUID

The file identifier

Example:
0317868f-28f8-9f56-d248-5a78718b38cc
mime
string

Information about the creative type

Enumeration:
csv
doc
docx
xls
xlsx
pdf
log
txt
png
jpg
jpeg
svg
name
string

The file name

Example:
image1.png
url
string

The file URL endpoint

Example:
https://crm.com
paging
Object

Information that can be used in order to display large pages

page
integer

The page number

Example:
2
size
integer

The number of records per page

Default:
10
Example:
20
total
integer

The total number of records. If “include_total” is not specified, then this total is null. If “include_total” is specified, total has a value but it is accurate up to 10K records.

Example:
1124
has_more
boolean

Shows if there are more records available to fetch

Example:
true
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
GET https://sandbox.crm.com/self-service/v2/service_requests/6b888b83-b418-752f-604d-0653cf65885d/attachments HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "content": [
        {
            "id": "af748ada-0521-0503-fc25-b67635a7d14d",
            "description": "Image 1",
            "file": {
                "id": "0317868f-28f8-9f56-d248-5a78718b38cc",
                "mime": "png",
                "name": "image1.png"
            }
        }
    ],
    "paging": {
        "page": 2,
        "size": 20,
        "total": 1124
    }
}
Subscriptions
POST /contacts/{id}/services
PUT /services/{id}
PUT /subscriptions/{id}
GET /contacts/{id}/services
GET /subscriptions/actions
GET /subscriptions/actions/{id}
PUT /subscriptions/actions/{id}
Add Service
POST /contacts/{id}/services

Subscribes the customer to new subscription services. A single service can be added per Web API call. In cases where the contact does not own a subscription in the same billing cycle as the new service’s cycle, then a new subscirption is also created with this Web API call. Otherwise, the existing subscription is amended with the new service, and this new service’s billing cycle is adjusted to the subscription’s.

Path variables

id
string required

Contact identifier

Example:
5cc0809f-ed91-4b68-b912-5bd6064d901e

Request headers

api_key
string required

The publishable api key for application identification

Example:
ab5f8b2e-092f-4848-8f46-31df1c014060

Request body

Object
product_id
string required

The new service product identifier. The product must either be a temred service or a one-time service.

Example:
4dc0809f-ed91-4b68-b912-5bd6064d901e
price_terms_id
string required

The service’s price terms

Example:
edc0809f-ed91-4b68-b912-5bd6064d901e
quantity
integer

Service quantity. If not specified, then it defaults to 1

Example:
5
scheduled_date
integer

Scheduled date on wich the service will be added. If not added immediatelly, then this date must be set in the future.

Example:
1621236954
components
Array

List of component services. Applicable only when the service to be added is a flexible bundle.

Unique items: YES
Object
product_id
string

The component service’s identifier. Only termed services can eb specified and as ong as the service meets the bundle’s allowed composition.

Example:
2dc0809f-ed91-4b68-b912-5bd6064d901e
price_terms_id
string

The component service’s price terms.

Example:
32c0809f-ed91-4b68-b912-5bd6064d901e

Responses

200 OK
Body
Object
id
string

The unique identifier of the Add service action

Example:
32c0809f-ed91-4b68-b912-5bd6064d901e
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
POST https://sandbox.crm.com/self-service/v2/contacts/5cc0809f-ed91-4b68-b912-5bd6064d901e/services HTTP/1.1 

api_key: ab5f8b2e-092f-4848-8f46-31df1c014060
Content-Type: application/json

{
    "product_id": "4dc0809f-ed91-4b68-b912-5bd6064d901e",
    "price_terms_id": "edc0809f-ed91-4b68-b912-5bd6064d901e",
    "quantity": 5,
    "scheduled_date": 1621236954,
    "components": [
        {
            "product_id": "2dc0809f-ed91-4b68-b912-5bd6064d901e",
            "price_terms_id": "32c0809f-ed91-4b68-b912-5bd6064d901e"
        }
    ]
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "32c0809f-ed91-4b68-b912-5bd6064d901e"
}
Update Service
PUT /services/{id}

Updates a single suscsription service. A service might change due to various reasons and multiple changes can be logged per Web API log:

  • Change the service’s state
  • Change the service with another service
  • Change the service’s terms
  • Change the service’s quantity
  • Change a flex service’s components

Path variables

id
string required

the subscription service identifier

Example:
32c0809f-ed91-4b68-b912-5bd6064d901e

Request headers

api_key
string required

The publishable api key for application identification

Example:
ab5f8b2e-092f-4848-8f46-31df1c014060

Request body

Object
action
string required

Determines what kind of change will be performed on the service

Enumeration:
ACTIVATE

Activates a Draft or a Not Effective service

CANCEL

Cancel a service

REGRET

Regret a service

PAUSE

Pause a service

RESUME

Resume a paused service

CHANGE

Change the service

Example:
CHANGE
category_id
string

Categorises the action.

Example:
ab5f8b2e-092f-4848-8f46-31df1c014060
scheduled_date
integer

The date on which the action is scheduled to be executed. If not specified, the action is immediatelly executed.

Example:
1
use_proposed_date
boolean

Applicable when business rules enforce an action to be performed on a future scheduled date. Set this parameter to True to indirectly use the business rules’ prposed scheduled date without explicitly defining it

Example:
true
price_terms_id
string

Applicable when changing a service’s price.

Example:
ab5f8b2e-092f-4848-8f46-31df1c014060
renewal_opt_in
boolean

If set to True, then contact opts-in to auto-renewals, otherwsie, when set to False, the contact opts out and the service will get expired at the end of the termed period.

Example:
true
number_of_days
integer

Applicable and required when pausing a service

Example:
5
change_to_service
Object

Applicable and required when changing a service into another one. The new service must be included in the same tier path as the source service.

product_id
string required

The unique identifier of the new service products

Example:
ab5f8b2e-092f-4848-8f46-31df1c014060
price_terms_id
string

Required when the new service has multiple prices.

Example:
ef5f8b2e-092f-248-8f46-31dfacb14ace
components
Object

Required when amending a service classified as a flex bundle. At least a component to be added or a component to be removed mut be specified.

added
Array

Service components to be added

Unique items: YES
Object
product_id
string required

Component service product identifier. This must be a termed service which meets the flex bundle’s composition requirements

Example:
ab5f8b2e-092f-4848-8f46-31df1c014060
price_terms_id
string

The component service’s price terms. Required i the service srvice has more tha one set of price terms. If a single price exists, then it is automatically set.

Example:
ab5f8b2e-092f-4848-8f46-31df1c014060
removed
Array

Service components to be removed

Unique items: YES
Object
id
string

The existing service cmponents identifiers (service identifier)

Example:
ab5f8b2e-092f-4848-8f46-31df1c014060

Responses

200 OK
Body
Object
id
string

The unique idetifier of the action that updates the service

Example:
ab5f8b2e-092f-4848-8f46-31df1c014060
proposed_date
integer

A proposed date on which the requested changes can be scheduled to be executed. If a date is returned, then no action is logged yet and it has to be scheduled. A proposed scheduled date is returned when business rules do not allow the action’s immediate execution.

Example:
1656962736
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
PUT https://sandbox.crm.com/self-service/v2/services/32c0809f-ed91-4b68-b912-5bd6064d901e HTTP/1.1 

api_key: ab5f8b2e-092f-4848-8f46-31df1c014060
Content-Type: application/json

{
    "action": "CHANGE",
    "category_id": "ab5f8b2e-092f-4848-8f46-31df1c014060",
    "scheduled_date": 1,
    "use_proposed_date": true,
    "price_terms_id": "ab5f8b2e-092f-4848-8f46-31df1c014060",
    "renewal_opt_in": "true",
    "number_of_days": 5,
    "change_to_service": {
        "product_id": "ab5f8b2e-092f-4848-8f46-31df1c014060",
        "price_terms_id": "ef5f8b2e-092f-248-8f46-31dfacb14ace"
    },
    "components": {
        "added": [
            {
                "product_id": "ab5f8b2e-092f-4848-8f46-31df1c014060",
                "price_terms_id": "ab5f8b2e-092f-4848-8f46-31df1c014060"
            }
        ],
        "removed": [
            {
                "id": "ab5f8b2e-092f-4848-8f46-31df1c014060"
            }
        ]
    }
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "ab5f8b2e-092f-4848-8f46-31df1c014060",
    "proposed_date": 1656962736
}
Update Subscription
PUT /subscriptions/{id}

Updates subscripion information related to the customer’s billing terms for a set of services

Path variables

id
string required

The unique identifier of a subscription

Example:
ab5f8b2e-092f-4848-8f46-31df1c014060

Request headers

api_key
string required

The publishable api key for application identification

Example:
ab5f8b2e-092f-4848-8f46-31df1c014060

Request body

Object
action
string required

How the subscription will be updated

Enumeration:
CHANGE_BILLING_DAY

Change the billing day

CHANGE_PAYMENT_METHOD

Change/Set the payment method

payment_method_id
string

Applicable and required when changing the payment method. The new payment method is also an already registered payment method of the contact

Example:
ac5401c3-b2e6-2d99-171f-276084d97536
billing_day
Object

Applicable and required when changing the billing day

day_of_week
string

Day of week for subscriptions with billing cycle shorter than a month

Example:
MONDAY
day_of_month
integer

Day of month applicable for subscriptions with billing cycle longer than a month

Example:
15

Responses

200 OK
Body
Object
id
string

The subscription action’s identifier

Example:
ac5401c3-b2e6-2d99-171f-276084d97536
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
PUT https://sandbox.crm.com/self-service/v2/subscriptions/ab5f8b2e-092f-4848-8f46-31df1c014060 HTTP/1.1 

api_key: ab5f8b2e-092f-4848-8f46-31df1c014060
Content-Type: application/json

{
    "action": "CHANGE_BILLING_DAY",
    "payment_method_id": "ac5401c3-b2e6-2d99-171f-276084d97536",
    "billing_day": {
        "day_of_week": "MONDAY",
        "day_of_month": 15
    }
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "ac5401c3-b2e6-2d99-171f-276084d97536"
}
List Contact Services
GET /contacts/{id}/services

Returns a list of services to which the contact subscribed to

Path variables

id
string required

Contact identifier

Example:
ab5f8b2e-092f-4848-8f46-31df1c014060

Request parameters

sort
string optional

Defines on which attribute the results should be sorted

Allow empty value: true
Examples:
CREATED_DATEUPDATED_DATENAMEPOSTED_DATE
order
string optional

Defines how the results will be ordered

Allow empty value: true
Enumeration:
ASC
DESC
Default:
DESC
page
integer optional

The page number that should be retrieved

Default:
1
Example:
20
size
string optional

The size (total records) of each page

Default:
10
Example:
20
classification
string optional

The product’s classification

Enumeration:
TERMED_SERVICE
ONE_TIME_SERVICE
include_subscription
boolean optional

Set it to true to also include information for the services’ subscription.

Request headers

api_key
string required

The publishable api key for application identification

Example:
ab5f8b2e-092f-4848-8f46-31df1c014060

Responses

200 OK
Body
Object
content
Array
Object
id
string

Subscription service identifier

Example:
4dc0809f-ed91-4b68-b912-5bd6064d901e
state
string

Service state

Enumeration:
EFFECTIVE
NOT_EFFECTIVE
PAUSED
Example:
EFFECTIVE
added_on
integer

Date on which the service was added to the subscripiton

Example:
1625555027
first_activated_on
integer

First activation date

Example:
1625555027
is_recurring_charge
boolean

Shows whether the service is a recurring charges (i.e. a subscription expense service) or not.

Example:
true
has_allowance
string

Shows whether the service provides usage allowance to the contact

Example:
true
scheduled_actions
string

Indicates whether scheduled actions exist for this service

Example:
true
product
Object

Service product. This product is either of Termed or One-time service classification

id
string

Product identifier

Example:
4dc0809f-ed91-4b68-b912-5bd6064d901e
sku
string

Product SKU

Example:
TV001
name
string

Product name

Example:
Films
classification
string
Enumeration:
TERMED_SERVICE
ONE_TIME_SERVICE
Example:
TERMED_SERVICE
type_composition
string

The service’s composition

Enumeration:
FLAT
FLEXIBLE_BUNDLE
FIXED_BUNDLE
Example:
FLAT
price
Object

The service’s price terms information

id
string

Price identifier

Example:
4dc0809f-ed91-4b68-b912-5bd6064d901e
price
number

Service price per billing cycle.

Example:
9.99
currency_code
string
Min length: 3
Max length: 3
Pattern: 3-letter ISO 4217 currency code.
Example:
EUR
tax_model
string
Enumeration:
TAX_INCLUSIVE
TAX_EXCLUSIVE
Example:
TAX_INCLUSIVE
billing_period
Object

The service’s billing period

duration
integer

Billing period duration

Example:
1
uot
string

Unit of time

Example:
MONTH
billing
Object

Detailed billing information for the service

billed_from
integer

Latest date from which the service was billed

Example:
1625555027
billed_to
integer

the date until which the service is billed

Example:
1625555027
terms
Object

Service terms as these were defines by the selected orice

billing_model
string

Billing model

Enumeration:
PRE_BILL
POST_BILL
Example:
PRE_BILL
auto_renew
boolean

Service auto-renewed or not

Example:
true
in_contract
boolean

Service currently in contract period or not. Set to False if service’s contract period ended or when a service was never in contract.

Example:
true
quantity
integer

Service quantity

Example:
1
contract_period
Object

Service’s contract informaiton. This information is returned even after the service exits its contract period.

duration
integer

Duration

Example:
18
uot
string

unit of time

Example:
MONTHS
start_date
integer

Contract period start date

Example:
1625555027
end_date
integer

Contract period end date

Example:
1625555027
trial_period
Object

Service’s trial period. This informaiton is returned even after the service’s trial ends.

in_trial
boolean

Show if service is currently on trial. Set to False if trial period ended.

start_date
integer

Trial start date

Example:
1625555027
end_date
integer

Trial period end date

Example:
1625555027
duration
integer

Trial period duration

Example:
7
uot
string

Trial period unit of time

Example:
DAYS
paused_period
Object

Service’s paused period. Returned only while a service is paused.

start_date
integer

Paused period start date

Example:
1625555027
end_date
integer

Paused period end date

Example:
1625555027
bundled_service
Object

The service’s bundles service. Applicable for services ordered as part of a flexible bundle.

id
string

The bundle service’s identifier

Example:
4dc0809f-ed91-4b68-b912-5bd6064d901e
product
Object

The bundle service’s product

id
string

Product identifier

Example:
4dc0809f-ed91-4b68-b912-5bd6064d901e
sku
string

Product SKU

Example:
GOLD
name
string

Product name

Example:
Gold Package
components
Array

List of component services. Applicable when the returned service is a bundle, i.e. it includes a list of component services.

Object
id
string

Component service identifier

Example:
4dc0809f-ed91-4b68-b912-5bd6064d901e
added_on
integer

Date on which the component was included in the bundle

Example:
1625555027
first_activated_on
integer

First activation date of the component service

Example:
1625555027
in_contract
boolean

Component service currently in contract or not.

Example:
true
state
string

Component’s state

Enumeration:
EFFECTIVE
NOTE_EFFECTIVE
PAUSED
product
Object

Component service product

id
string

Product identifier

Example:
4dc0809f-ed91-4b68-b912-5bd6064d901e
sku
string

Product SKU

Example:
FILMS
name
string
Example:
Films
price
Object

The component service’s price

price
number

Price

Example:
9.99
currency_code
string
Example:
EUR
subscription
Object

The service’s subscription

id
string

Subscription identifier

Example:
4dc0809f-ed91-4b68-b912-5bd6064d901e
code
string

Subscription code

Example:
60012321123
terms
Object

Subscription’s terms

funding_source
string

Subscirption is funded by the Account or the CRM Wallet

Enumeration:
ACCOUNT
WALLET
billing_day
Object

On which day the subscirption’s services are billed

day_of_month
integer

Day of month

Example:
1
day_of_week
string

Day of week for subscriptions with billing cycle sshorter than a month

Example:
WEDNESDAY
payment_method
Object

Subscription’s payment method which is also one of the contact’s payment methods

type
string

Payment method type

Enumeration:
CARD
ACCOUNT_DEBIT
WALLET
identity
Object

Payment method’s identity, i.e. details to clearly show which is the payment method

id
string

Contact payment method identifier

Example:
4dc0809f-ed91-4b68-b912-5bd6064d901e
identifier
string

Basic informaiton of the payment method

Example:
Visa *****1234 03/25
paging
Object
page
integer
Example:
2
size
integer
Example:
20
total
integer
Example:
5124
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
GET https://sandbox.crm.com/self-service/v2/contacts/ab5f8b2e-092f-4848-8f46-31df1c014060/services HTTP/1.1 

api_key: ab5f8b2e-092f-4848-8f46-31df1c014060

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "content": [
        {
            "id": "4dc0809f-ed91-4b68-b912-5bd6064d901e",
            "state": "EFFECTIVE",
            "added_on": 1625555027,
            "first_activated_on": 1625555027,
            "is_recurring_charge": true,
            "has_allowance": "true",
            "scheduled_actions": "true",
            "product": {
                "id": "4dc0809f-ed91-4b68-b912-5bd6064d901e",
                "sku": "TV001",
                "name": "Films",
                "classification": "TERMED_SERVICE",
                "type_composition": "FLAT"
            },
            "price": {
                "id": "4dc0809f-ed91-4b68-b912-5bd6064d901e",
                "price": 9.99,
                "currency_code": "EUR",
                "tax_model": "TAX_INCLUSIVE",
                "billing_period": {
                    "duration": 1,
                    "uot": "MONTH"
                }
            },
            "billing": {
                "billed_from": 1625555027,
                "billed_to": 1625555027
            },
            "terms": {
                "billing_model": "PRE_BILL",
                "auto_renew": true,
                "in_contract": true,
                "quantity": 1,
                "contract_period": {
                    "duration": 18,
                    "uot": "MONTHS",
                    "start_date": 1625555027,
                    "end_date": 1625555027
                }
            },
            "trial_period": {
                "in_trial": true,
                "start_date": 1625555027,
                "end_date": 1625555027,
                "duration": 7,
                "uot": "DAYS"
            },
            "paused_period": {
                "start_date": 1625555027,
                "end_date": 1625555027
            },
            "bundled_service": {
                "id": "4dc0809f-ed91-4b68-b912-5bd6064d901e",
                "product": {
                    "id": "4dc0809f-ed91-4b68-b912-5bd6064d901e",
                    "sku": "GOLD",
                    "name": "Gold Package"
                }
            },
            "components": [
                {
                    "id": "4dc0809f-ed91-4b68-b912-5bd6064d901e",
                    "added_on": 1625555027,
                    "first_activated_on": 1625555027,
                    "in_contract": true,
                    "state": "NOTE_EFFECTIVE",
                    "product": {
                        "id": "4dc0809f-ed91-4b68-b912-5bd6064d901e",
                        "sku": "FILMS",
                        "name": "Films"
                    },
                    "price": {
                        "price": 9.99,
                        "currency_code": "EUR"
                    }
                }
            ],
            "subscription": {
                "id": "4dc0809f-ed91-4b68-b912-5bd6064d901e",
                "code": "60012321123",
                "terms": {
                    "funding_source": "WALLET",
                    "billing_day": {
                        "day_of_month": 1,
                        "day_of_week": "WEDNESDAY"
                    },
                    "payment_method": {
                        "type": "CARD",
                        "identity": {
                            "id": "4dc0809f-ed91-4b68-b912-5bd6064d901e",
                            "identifier": "Visa *****1234 03/25"
                        }
                    }
                }
            }
        }
    ],
    "paging": {
        "page": 2,
        "size": 20,
        "total": 5124
    }
}
List Subscription Actions
GET /subscriptions/actions

Returns a list of actions related to either the contact or the subscription or for a specific service. at elast one fo the three parameters must be specified to successfully retrieve results. Multiple action can be returned, on any state

Request parameters

sort
string optional

Defines on which attribute the results should be sorted

Allow empty value: true
Examples:
CREATED_DATEUPDATED_DATENAMEPOSTED_DATE
order
string optional

Defines how the results will be ordered

Allow empty value: true
Enumeration:
ASC
DESC
Default:
DESC
page
integer optional

The page number that should be retrieved

Default:
1
Example:
20
size
string optional

The size (total records) of each page

Default:
10
Example:
20
subscription_id
string required

Returns a list of actions for a specific subscription

Allow empty value: true
Example:
4dc0809f-ed91-4b68-b912-5bd6064d901e
contact_id
string required

Returns all subscription actions for a specific contact

Allow empty value: true
Example:
4dc0809f-ed91-4b68-b912-5bd6064d901e
service_id
string required

Returns a list of actions related to a subscription service

Example:
4dc0809f-ed91-4b68-b912-5bd6064d901e
is_scheduled
boolean optional

If specified, then only Scheduled actions are returned.

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 OK
Body
Object
content
Array
Object
id
string

Subscription action identifier

Example:
4dc0809f-ed91-4b68-b912-5bd6064d901e
code
string

Subscription action code

Example:
5443456789999098
state
string

The action’s state

Enumeration:
SCHEDULED
EXECUTED
CANCELLED
REJECTED
Example:
SCHEDULED
behaviour_code
string

Action’s behaviour code

Example:
REMOVE_SERVICE
business_classification_code
string

Action’s business classification code

executed_on
integer

Date on which the action was successfully performed

Example:
1658412097
scheduled_on
integer

Date on which the action is scheduled to be performed

Example:
1658412097
cancelled_on
integer

Date on which the action was Cancelled

Example:
1658412097
rejected_on
integer

Date on which the action’s execution was rejected

Example:
1658412097
category
Object

Action’s category

id
string

Action category identifier

Example:
4dc0809f-ed91-4b68-b912-5bd6064d901e
name
string

Action category name

Example:
Regret service
paging
Object

Information that can be used in order to display large pages

page
integer

The page number

Example:
2
size
integer

The number of records per page

Default:
10
Example:
20
total
integer

The total number of records. If “include_total” is not specified, then this total is null. If “include_total” is specified, total has a value but it is accurate up to 10K records.

Example:
1124
has_more
boolean

Shows if there are more records available to fetch

Example:
true
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
GET https://sandbox.crm.com/self-service/v2/subscriptions/actions?subscription_id=4dc0809f-ed91-4b68-b912-5bd6064d901e&contact_id=4dc0809f-ed91-4b68-b912-5bd6064d901e&service_id=4dc0809f-ed91-4b68-b912-5bd6064d901e HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "content": [ 
        {
            "id": "4dc0809f-ed91-4b68-b912-5bd6064d901e",
            "code": "5443456789999098",
            "state": "SCHEDULED",
            "behaviour_code": "REMOVE_SERVICE",
            "business_classification_code": "",
            "executed_on": 1658412097,
            "scheduled_on": 1658412097,
            "cancelled_on": 1658412097,
            "rejected_on": 1658412097,
            "category": {
                "id": "4dc0809f-ed91-4b68-b912-5bd6064d901e",
                "name": "Regret service"
            }
        }
    ],
    "paging": {
        "page": 2,
        "size": 20,
        "total": 1124
    }
}
Get Subscription Action
GET /subscriptions/actions/{id}

Returns detailed information for a subscription action.

Path variables

id
string required

Subscription action identifier

Example:
4dc0809f-ed91-4b68-b912-5bd6064d901e

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 OK
Body
Object
code
string

Subscription action code

Example:
5444567099900907
state
string

Subscription action state

Enumeration:
SCHEDULED
EXECUTED
REJECTED
CANCELLED
Example:
SCHEDULED
behaviour_code
string

Action’s behaviour code

Example:
CHANGE_SERVICE
business_classification_code
string

Action’s business classification code

Example:
UPGRADE
executed_on
integer

Date on which the action was executed successfully

Example:
1658412644
scheduled_on
integer

Date on which action is scheduled to be executed

Example:
1658412644
cancelled_on
integer

Date on which the action was cancelled

Example:
1658412643
rejected_on
integer

Date on which the action was rejected

Example:
1658412643
rejection_reason
string

Additional informaiton on why the action was rejected

Example:
Service already exists on the subscription
subscription
Object

The subscription

id
string

Subscription identifier

Example:
4dc0809f-ed91-4b68-b912-5bd6064d901e
code
string

Subscription code

Example:
9900004343331234
submitted_by
Object

Who submitted the action. In the case of action submitted by a user, additional user infromaiton is returned, otherwise the contact is the one requesting for this change.

type
string

Indicates whether the action was submitted by the contact at the front-end or by a user.

Enumeration:
USER
CONTACT
Example:
USER
id
string

User identifier

Example:
a12b282f-e6ce-e618-0a72-becb3ad78033
name
string

User full name

Example:
John Smith
username
string

User’s username

Example:
johnsmith@crm.com
cancelled_by
Object

Who cancelled the action. In the case of a user cancelling the action, additional user infromation is returned.

type
string
Enumeration:
USER
CONTACT
Example:
USER
id
string

User identifier

Example:
a12b282f-e6ce-e618-0a72-becb3ad78033
name
string

User’s full name

Example:
John Smith
username
string

Username

Example:
johnsmith@crm.com
category
Object

Action’s category

id
string

Action category idnetifier

Example:
4dc0809f-ed91-4b68-b912-5bd6064d901e
name
string

Action name

Example:
High cost
services
Array

A list of sevices affected by the subscription action. With a single action one or more services are affected. An action might affect a subscription’s services in 3 different ways

Object
change_type
string

How the service was affected by the action

Enumeration:
ADDED
REMOVED
UPDATED
Example:
ADDED
quantity
integer

The service’s new quantity

Example:
2
price
Object

The service’s new price

price_terms_id
string

The service’s new price terms identifier

Example:
4dc0809f-ed91-4b68-b912-5bd6064d901e
price
number

The new price

Example:
9.99
billing_period
Object

Billing period

duration
integer

Duration of billing period

Example:
1
uot
string

Unit of time

Example:
MONTHS
product
Object

The service’s product

id
string

Product identifier

Example:
4dc0809f-ed91-4b68-b912-5bd6064d901e
sku
string

Product SKU

Example:
SVOD
name
string

Product name

Example:
Auxsat TV
devices
Array

The action’s affected Devices. With a single actions one or more devices might be affected

Object
change_type
string

How the device was affected by the action

Enumeration:
ADDED
REMOVED
UPDATED
device
Object

Device detaled information

id
string

Device identifier

Example:
4dc0809f-ed91-4b68-b912-5bd6064d901e
serial_number
string

Device serial number

Example:
001112912232
electronic_id
string

Device electronic ID

Example:
001112912232
product
Object

Device product

id
string

Product identifier

Example:
4dc0809f-ed91-4b68-b912-5bd6064d901e
sku
string

Product SKU

Example:
HDSTB
name
string

Product name

Example:
HD Set Top Box
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
GET https://sandbox.crm.com/self-service/v2/subscriptions/actions/4dc0809f-ed91-4b68-b912-5bd6064d901e HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "code": "5444567099900907",
    "state": "SCHEDULED",
    "behaviour_code": "CHANGE_SERVICE",
    "business_classification_code": "UPGRADE",
    "executed_on": 1658412644,
    "scheduled_on": 1658412644,
    "cancelled_on": 1658412643,
    "rejected_on": 1658412643,
    "rejection_reason": "Service already exists on the subscription",
    "subscription": {
        "id": "4dc0809f-ed91-4b68-b912-5bd6064d901e",
        "code": "9900004343331234"
    },
    "submitted_by": {
        "type": "USER",
        "id": "a12b282f-e6ce-e618-0a72-becb3ad78033",
        "name": "John Smith",
        "username": "johnsmith@crm.com"
    },
    "cancelled_by": {
        "type": "USER",
        "id": "a12b282f-e6ce-e618-0a72-becb3ad78033",
        "name": "John Smith",
        "username": "johnsmith@crm.com"
    },
    "category": {
        "id": "4dc0809f-ed91-4b68-b912-5bd6064d901e",
        "name": "High cost"
    },
    "services": [
        {
            "change_type": "ADDED",
            "quantity": 2,
            "price": {
                "price_terms_id": "4dc0809f-ed91-4b68-b912-5bd6064d901e",
                "price": 9.99,
                "billing_period": {
                    "duration": 1,
                    "uot": "MONTHS"
                }
            },
            "product": {
                "id": "4dc0809f-ed91-4b68-b912-5bd6064d901e",
                "sku": "SVOD",
                "name": "Auxsat TV"
            }
        }
    ],
    "devices": [
        {
            "change_type": "REMOVED",
            "device": {
                "id": "4dc0809f-ed91-4b68-b912-5bd6064d901e",
                "serial_number": "001112912232",
                "electronic_id": "001112912232",
                "product": {
                    "id": "4dc0809f-ed91-4b68-b912-5bd6064d901e",
                    "sku": "HDSTB",
                    "name": "HD Set Top Box"
                }
            }
        }
    ]
}
Update Subscription Action
PUT /subscriptions/actions/{id}

Updates information for an existing subscription action. Only scheduled actions can be amended by wither Cancelling them

Path variables

id
string required

Subscription action identifier

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A
api_key
string required

The publishable api key for application identification

Example:
ab5f8b2e-092f-4848-8f46-31df1c014060

Request body

Object
action
string required

How the action will be updated

Enumeration:
CANCEL

Cancel a schedule action

UPDATE

Update a schedule action

RESUBMIT

Resubmit a rejected action

Example:
CANCEL
category_id
string

Action category identifier

Example:
4dc0809f-ed91-4b68-b912-5bd6064d901e
scheduled_date
integer

Set a new scheduled date for the action. Applicable when updating scheduled actions or when resubmitting rejected ones

Example:
1668242869
use_proposed_date
string

Set to True when business rules dectate an allowed date on which an action can be performed. The action will be scheduled by the process by applying the business rules.

Example:
true
period_settings
Object

Applicable hwne updating a scheduled aciton that includes period information, such as Pause Service

duration_in_days
integer

The new period’s duraiton in days

Example:
5
ends_on
integer

The new period’s end date

Example:
1234567

Responses

200 OK
Body
Object
id
string

The updated action’s identifier

Example:
4dc0809f-ed91-4b68-b912-5bd6064d901e
proposed_date
integer

Returned when business rules are applied and suggest a valid date on which the action can be performed. Use this date in a sub-sequent call fo the same Web API as the action’s scheduled date.

Example:
1668251375
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
PUT https://sandbox.crm.com/self-service/v2/subscriptions/actions/{id} HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A
api_key: ab5f8b2e-092f-4848-8f46-31df1c014060
Content-Type: application/json

{
    "action": "CANCEL",
    "category_id": "4dc0809f-ed91-4b68-b912-5bd6064d901e",
    "scheduled_date": 1668242869,
    "use_proposed_date": "true",
    "period_settings": {
        "duration_in_days": 5,
        "ends_on": 1234567
    }
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "4dc0809f-ed91-4b68-b912-5bd6064d901e",
    "proposed_date": 1668251375
}
Topups

Top-ups is an easy way to add money to an Account or a Wallet. Contacts top up their accounts or wallet with funds to be used in upcoming payments.Top-ups might retrieve money from one of the contact’s payment methods.

POST /topups
Create Top-up
POST /topups

Create a new Topup for a Wallet or an Account.

Request headers

api_key
string required

The publishable api key for application identification

Example:
ab5f8b2e-092f-4848-8f46-31df1c014060

Request body

Object
amount
number required

The topup’s amount

payment_method
Object required
type
string
Enumeration:
CASH
CARD
ACCOUNT_DEBIT
WALLET
CRM_WALLET
CHEQUE
ELECTRONIC_TRANSFER
Example:
CARD
id
string

Unique identifier fo the payment method

Example:
4dc0809f-ed91-4b68-b912-5bd6064d901e
topup_date
integer

If not specified, then the current date is set

Example:
14423423
code
string

The top up’s code. If not specified, then a unique 16-digit code is assigned

Example:
1234567891234567
commerce_pool_id
string
intent_id
string nullable

The payment intent identifier that is returned by a payment gateway integrator

custom_fields
Array
Object
key
string

The custom field’s unique key

Example:
custom_key
value
string

The custom field’s value

Example:
0001-345
wallet_id
string

Responses

200 OK
Body
Object
id
string

The Top up’s unique identifier

400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
POST https://sandbox.crm.com/self-service/v2/topups/ HTTP/1.1 

api_key: ab5f8b2e-092f-4848-8f46-31df1c014060
Content-Type: application/json

{
    "amount": 1,
    "payment_method": {
        "type": "CARD",
        "id": "4dc0809f-ed91-4b68-b912-5bd6064d901e"
    },
    "topup_date": 14423423,
    "code": "1234567891234567",
    "commerce_pool_id": "",
    "intent_id": "",
    "custom_fields": [
        {
            "key": "custom_key",
            "value": "0001-345"
        }
    ]
}
Transfers

Transfers can be used to move money between accounts or even betwen an accout ad a wallet (and vise-versa).

POST /transfers
Tranfer Money
POST /transfers

Transfers an amount of money from one account or wallet to another account or wallet.A single transfer can be created per Web API call. An amount of money can be transferred to another account/wallet of the same contact who owns the origin account/wallet or transferred to another contact’s account/wallet.

Request headers

api_key
string required

The publishable api key for application identification

Example:
ab5f8b2e-092f-4848-8f46-31df1c014060

Request body

Object
code
string

Transfer’s code. If not specified, a random and unique 16-digits code is assigned to the Transfer

Example:
1234567891234567
transfer_date
integer

The transfer’s date

Example:
1620999582
amount
number

the transfer’s amount. The amount is in the oorigin entity’s currenct

Example:
9.99
origin
Object

Where the money will be transferred from. Either an account or the wallet must be specified

account_id
string

Account identifier

Example:
ab5f8b2e-092f-4848-8f46-31df1c014060
wallet_id
string

Wallet idetifier

Example:
ab5f8b2e-092f-4848-8f46-31df1c014060
destination
Object

Where the money will be transferred to. Either an account or the wallet must be specified

account_id
string

Account identifier

Example:
ab5f8b2e-092f-4848-8f46-31df1c014060
wallet_id
string

Wallet identifier

Example:
ab5f8b2e-092f-4848-8f46-31df1c014060
commerce_pool_id
string

Applicable only when transerring money to a Wallet. Group of conditions that define how the transer’s amount can be spent. Specifying these conditions will move the money to the wallet’s Commerce balance otherwise, money goes to Open balance.

Example:
ab5f8b2e-092f-4848-8f46-31df1c014060

Responses

201 Created
Body
Object
id
string

The Transfer’s unique identifier

Example:
ab5f8b2e-092f-4848-8f46-31df1c014060
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
POST https://sandbox.crm.com/self-service/v2/transfers HTTP/1.1 

api_key: ab5f8b2e-092f-4848-8f46-31df1c014060
Content-Type: application/json

{
    "code": "1234567891234567",
    "transfer_date": 1620999582,
    "amount": 9.99,
    "origin": {
        "account_id": "ab5f8b2e-092f-4848-8f46-31df1c014060",
        "wallet_id": "ab5f8b2e-092f-4848-8f46-31df1c014060"
    },
    "destination": {
        "account_id": "ab5f8b2e-092f-4848-8f46-31df1c014060",
        "wallet_id": "ab5f8b2e-092f-4848-8f46-31df1c014060"
    },
    "commerce_pool_id": "ab5f8b2e-092f-4848-8f46-31df1c014060"
}

HTTP/1.1 201 Created 

Content-Type: application/json

{
    "id": "ab5f8b2e-092f-4848-8f46-31df1c014060"
}
Wallet
POST /contacts/{id}/wallets
GET /wallets/{id}
GET /wallets/{id}/topup_settings
GET /wallets/{id}/limits
PUT /wallet/{id}
PUT /wallet/{id}/limits
GET /wallets/{id}/conditional_balances
GET /wallets/{id}/transactions
Request Wallet One Time Password
POST /wallets/otp

Request One Time Password for the contact’s wallet. OTP will be sent to the contact’s email or phone based on which one the contact used during the first registration

Request headers

api_key
string required

The publishable api key for application identification

Example:
ab5f8b2e-092f-4848-8f46-31df1c014060

Request body

Object
identity
Object required

Information on how the wallet will be identified.Either an email address or a phone number must be specified

type
string required

The wallet identity’s type

Enumeration:
PHONE
EMAIL
Example:
EMAIL
value
string required

The identity’s value

Example:
some_email@email.com
country_code
string

Country code requird when the wallet’s identity type is set to Phone.

Example:
CYP

Responses

204 No Content
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
POST https://sandbox.crm.com/self-service/v2/wallets/otp HTTP/1.1 

api_key: ab5f8b2e-092f-4848-8f46-31df1c014060
Content-Type: application/json

{
    "identity": {
        "type": "EMAIL",
        "value": "some_email@email.com",
        "country_code": "CYP"
    }
}
Set Up Wallet
POST /contacts/{id}/wallets

Set ups the Wallet for the contact by either creating a new one or linking the wallet to the contact. If the contact is aware that he/she already owns a wallet, then OTP was previously sent to the wallet’s identity(email or phone). Otherwise, contacts should specify how they want to identify their wallets so as to create a new one. A single wallet is created for a contact.

Path variables

id
string required

Contact identifier

Example:
ab5f8b2e-092f-4848-8f46-31df1c014060

Request headers

api_key
string required

The publishable api key for application identification

Example:
ab5f8b2e-092f-4848-8f46-31df1c014060

Request body

Object
otp
string required nullable

The OTP sent to the customer that will be used to identify and locate the wallet, if any exists for the contact. If provided and validated, then the existing wallet is linked to the new registered contact.

identity
Object required nullable

The wallet’s identity. Applicable if the contact does not have a wallet and a new one will be generated having the specified identity.

type
string

Determines whether the identity is the contact’s email or phone. Identity will be used for any future registrations fo the contact in another business across the network of businesses.

Enumeration:
EMAIL
PHONE
value
string

The email or phone value

Example:
someemail@email.com
country_code
string

Required when the phone is the wallet’s identity

Example:
CYP
code
string required nullable

The wallet’s code. If not specified, then it will be automatically assigned a unique and random 16-digit code.

Example:
5444406970005411

Responses

201 Created
Body
Object
id
string

The unique identifier of the linked Wallet

Example:
4aaf8b2e-092f-4848-8f46-31df1c043bcf
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
POST https://sandbox.crm.com/self-service/v2/contacts/ab5f8b2e-092f-4848-8f46-31df1c014060/wallets HTTP/1.1 

api_key: ab5f8b2e-092f-4848-8f46-31df1c014060
Content-Type: application/json

{
    "otp": "",
    "identity": {
        "type": "EMAIL",
        "value": "someemail@email.com",
        "country_code": "CYP"
    },
    "code": "5444406970005411"
}

HTTP/1.1 201 Created 

Content-Type: application/json

{
    "id": "4aaf8b2e-092f-4848-8f46-31df1c043bcf"
}
Get Wallet
GET /wallets/{id}

Retrieves detailed information for the contact’s wallet. Only the Wallet balances for the Business from which the Web API is accessed are returned (i.e. if the contact has wallet balance from other Businesses, then these balances are not returned).

Path variables

id
string required

The unique identifier of the wallet

Request headers

api_key
string required

The publishable api key for application identification

Example:
ab5f8b2e-092f-4848-8f46-31df1c014060

Responses

200 OK
Body
Object
id
string

Wallet uniue identifier

Example:
ab5f8b2e-092f-4848-8f46-31df1c014060
code
string

Wallet code which by default is a unique and random 16-digit code number.

Example:
4345975043001210
balances
Array

List of wallet balances. Each wallet has CRM and Business balances but through this Web API only the balance for the Business to which the contact signed in are returned.

Object
type
string

The wallet balance type which can either be a CRM balance or a Business balance of the organisation from which the balance is accessed.

Enumeration:
BUSINESS
Example:
BUSINESS
balance
number

Total wallet balance that includes open and commerce balances

Example:
9.99
open
number

Wallet Open Balance

Example:
1.54
commerce
number

Wallet Commerce Balance.

Example:
8.45
currency_code
string

The crrency of the amounts.

Example:
EUR
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
GET https://sandbox.crm.com/self-service/v2/wallets/{id} HTTP/1.1 

api_key: ab5f8b2e-092f-4848-8f46-31df1c014060

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "ab5f8b2e-092f-4848-8f46-31df1c014060",
    "code": "4345975043001210",
    "balances": [
        {
            "type": "BUSINESS",
            "balance": 9.99,
            "open": 1.54,
            "commerce": 8.45,
            "currency_code": "EUR"
        }
    ]
}
Get Wallet Topup Settings
GET /wallets/{id}/topup_settings

Retrieves the wallet’s Auto and Termed Top-up settings, as these are specified by the contact. If nothing is specified, then no automated or termed top-ups are perforemd since contatcs must opt-in to suh proceses by specigying this piece of information.

Path variables

id
string required

Request headers

api_key
string required

The publishable api key for application identification

Example:
ab5f8b2e-092f-4848-8f46-31df1c014060

Responses

200 OK
Body
Object
auto_topup
Object

Automatically top up the wallet with an amount once a minimum threshold is reached, using one of the contact’s payment methods.

threshold
number

The minimum wallet balance at which the auto-top up will be triggered

Example:
0.01
amount
number

The top-up’s amount

Example:
10.5
currency_code
string

The amount’s currency

Example:
EUR
payment _method
Object

One of the wallet’s payment methods that will be used in automatic top-up

type
string

Payment method type

Enumeration:
CARD
WALLET
ACCOUNT_DEBIT
Example:
CARD
id
string

The contact’s payment method identifier

Example:
4dc0809f-ed91-4b68-b912-5bd6064d901e
identifier
string

Some information of the contact payment method

Example:
****1234
termed_topup
Object

Top up the wallet on a frequent basis using one of the payment methods

amount
number

The top-up’s amount

Example:
10.5
currency_code
string

The amount’s currency

Example:
EUR
frequency
string

How often the wallet will be topped-up. Frequeency is specified using a Cronn Expression

period
string

Frequecy period

Enumeration:
DAILY
WEEKLY
MONTHLY
Example:
WEEKLY
payment_method
Object

One of the wallet’s payment methods that will be used in top-up

type
string

Payment method type

Example:
CARD
id
string

Payment method identifier

Example:
4dc0809f-ed91-4b68-b912-5bd6064d901e
identifier
string

Some basic information for the payment method

Example:
****1234
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
GET https://sandbox.crm.com/self-service/v2/wallets/{id}/topup_settings HTTP/1.1 

api_key: ab5f8b2e-092f-4848-8f46-31df1c014060

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "auto_topup": {
        "threshold": 0.01,
        "amount": 10.5,
        "currency_code": "EUR",
        "payment _method": {
            "type": "CARD",
            "id": "4dc0809f-ed91-4b68-b912-5bd6064d901e",
            "identifier": "****1234"
        }
    },
    "termed_topup": {
        "amount": 10.5,
        "currency_code": "EUR",
        "frequency": "",
        "period": "WEEKLY",
        "payment_method": {
            "type": "CARD",
            "id": "4dc0809f-ed91-4b68-b912-5bd6064d901e",
            "identifier": "****1234"
        }
    }
}
Get Wallet Limits
GET /wallets/{id}/limits

Returns a lis tof wallet limit rules as these are specified by the contact. A limit rule determines conditions of how much wallet money can be spent for variosu transactions.

Path variables

id
string required

Request headers

api_key
string required

The publishable api key for application identification

Example:
ab5f8b2e-092f-4848-8f46-31df1c014060

Responses

200 OK
Body
Object
limit_rules
Array
Array
Object
id
string

Limit rule identifier

Example:
ab5f8b2e-092f-4848-8f46-31df1c014060
name
string

The rule’s name

Example:
Monthly topups
maximum_number
integer

Maximum number of wallet journal transactions

Example:
10
maximum_amount
number

Maximum amount among all wallet journal transactions

Example:
99.99
currency_code
string

Wallet transactions’ currency code

Example:
EUR
period
string

The period during which the wallet trasnactions are performed

Enumeration:
DAILY
WEEKLY
MONTHLY
applies_for
Array

List of wallet trasnactions for which the rule is applied

Unique items: YES
Example:
["DEBIT"]
string
Enumeration:
DEBIT
CREDIT
TOP_UP
TRANSFER
Example:
DEBIT
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
GET https://sandbox.crm.com/self-service/v2/wallets/{id}/limits HTTP/1.1 

api_key: ab5f8b2e-092f-4848-8f46-31df1c014060

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "limit_rules": [ 
        [
            {
                "id": "ab5f8b2e-092f-4848-8f46-31df1c014060",
                "name": "Monthly topups",
                "maximum_number": 10,
                "maximum_amount": 99.99,
                "currency_code": "EUR",
                "period": "DAILY",
                "applies_for": [
                    "DEBIT"
                ]
            }
        ]
    ]
}
Update Wallet
PUT /wallet/{id}

Updates a single Wallet.

Path variables

id
string required

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A
api_key
string required

The publishable api key for application identification

Example:
ab5f8b2e-092f-4848-8f46-31df1c014060

Request body

Object
auto_topup
Object
threshold
number required

The minimum wallet business open balance at which the auto-top up will be triggered

Default:
0.01
Example:
0.01
amount
number required

The top-up’s amount

Example:
10.5
currency_code
string required

The amount’s currency

Example:
EUR
payment_method
Object required

One of the wallet’s payment methods that will be used in top-up

type
string

Payment method type

Enumeration:
CARD
WALLET
ACCOUNT_DEBIT
id
string

Wallet payment method identifier

Example:
acf8b8ac-a325-a644-c866-a6c9d62ff11b
termed_topup
Object
amount
number required

The top-up’s amount

Example:
10.5
currency_code
string required

The amount’s currency

Example:
EUR
frequency
string required

How often the wallet will be topped-up. Has to specified using a Cronn Expression

Example:
0 0 21 ? * MON *
period
string required

The termed top-ups’s period.

Enumeration:
DAILY
WEEKLY
MONTHLY
Example:
WEEKLY
payment_method
Object required

One of the wallet’s payment methods that will be used in top-up

type
string

Payment method type

Enumeration:
CARD
WALLET
ACCOUNT_DEBIT
id
string

Wallet payment method identifier

Example:
acf8b8ac-a325-a644-c866-a6c9d62ff11b

Responses

200 OK
Body
Object
id
string

The unique identifier of the updated waller

Example:
ab5f8b2e-092f-4848-8f46-31df1c014060
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
PUT https://sandbox.crm.com/self-service/v2/wallet/{id} HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A
api_key: ab5f8b2e-092f-4848-8f46-31df1c014060
Content-Type: application/json

{
    "auto_topup": {
        "threshold": 0.01,
        "amount": 10.5,
        "currency_code": "EUR",
        "payment_method": {
            "type": "CARD",
            "id": "acf8b8ac-a325-a644-c866-a6c9d62ff11b"
        }
    },
    "termed_topup": {
        "amount": 10.5,
        "currency_code": "EUR",
        "frequency": "0 0 21 ? * MON *",
        "period": "WEEKLY",
        "payment_method": {
            "type": "ACCOUNT_DEBIT",
            "id": "acf8b8ac-a325-a644-c866-a6c9d62ff11b"
        }
    }
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "ab5f8b2e-092f-4848-8f46-31df1c014060"
}
Update Wallet Limits
PUT /wallet/{id}/limits

Path variables

id
string required

Wallet unique identifier

Example:
ab5f8b2e-092f-4848-8f46-31df1c014060

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Request body

Object
limit_rules
Array
Array
Object
id
string required

Limit rule identifier

Example:
ab5f8b2e-092f-4848-8f46-31df1c014060
name
string required

The rule’s name that has to be unique

Example:
Monthly topups
maximum_number
integer nullable

Maximum number of wallet journal transactions

Example:
10
maximum_amount
number nullable

Maximum amount among all wallet journal transactions

Example:
99.99
currency_code
string

Wallet transactions’ currency code

Example:
EUR
period
string

The period during which the wallet trasnactions are performed

Enumeration:
DAILY
WEEKLY
MONTHLY
applies_for
Array

List of wallet trasnactions for which the rule is applied

Unique items: YES
Example:
["DEBIT"]
string
Enumeration:
DEBIT
CREDIT
TOP_UP
TRANSFER
Example:
DEBIT

Responses

200 OK
Body
Object
id
string

The unique identifier of the updated wallet

Example:
ab5f8b2e-092f-4848-8f46-31df1c014060
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
PUT https://sandbox.crm.com/self-service/v2/wallet/ab5f8b2e-092f-4848-8f46-31df1c014060/limits HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "limit_rules": [
        [
            {
                "id": "ab5f8b2e-092f-4848-8f46-31df1c014060",
                "name": "Monthly topups",
                "maximum_number": 10,
                "maximum_amount": 99.99,
                "currency_code": "EUR",
                "period": "MONTHLY",
                "applies_for": [
                    "DEBIT"
                ]
            }
        ]
    ]
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "ab5f8b2e-092f-4848-8f46-31df1c014060"
}
List Wallet Commerce Balances
GET /wallets/{id}/conditional_balances

Get the wallet commerce balances split per commerce pool

Path variables

id
string GUID required

The wallet (identifier) whose commerce balances will be retrieved

Example:
acf8b8ac-a325-a644-c866-a6c9d62ff11b

Request parameters

organisation_id
string GUID optional

The organisation that requests the wallet balance

Example:
df01f8ed-f146-a288-0545-595e8a92d28b
commerce_pool_id
string GUID optional

Filter based on commerce pool

Example:
f03b2343-f81e-344a-d82e-8ab16f3bfc4f
currency_code
string optional

Defines whether balance breakdown should be returned based on primary currency or not (if not specified, primary currency is returned)

Example:
EUR
include_expiration
boolean optional

Defines whether expiration details should be retrieved or not

Example:
true
sort
string optional

Defines on which attribute the results should be sorted

Allow empty value: true
Examples:
CREATED_DATEUPDATED_DATENAMEPOSTED_DATE
order
string optional

Defines how the results will be ordered

Allow empty value: true
Enumeration:
ASC
DESC
Default:
DESC
page
integer optional

The page number that should be retrieved

Default:
1
Example:
20
size
string optional

The size (total records) of each page

Default:
10
Example:
20

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 OK

The response succeeded

Body
Object
content
Array
Object
id
string GUID

The spend condition group identifier

Example:
4AD9C84FA60F9FE407140E20F707726A
name
string

The name of the spend condition group

Example:
Happy Hour
amount
number

The amount that is allocated to the specified spend condition

Example:
100.5
organisations
Array

The organisations where the amount can be spent at

Object
id
string GUID

The organisation identifier

Example:
4AD9C84FA60F9FE407140E20F707726A
name
string

The name of the organisation

Example:
Cafe
locations
Array

Information about the specified addresses

Object
name
string

The location name

Example:
Main Store
address_line_1
string

The main address information

Example:
Elia Papakyriakou
address_line_2
string

Additional address information

Example:
Tower Stars
state_province_county
string

The address state/province.county

Example:
Egkomi
town_city
string

The address town/city

Example:
Nicosia
postal_code
string

The address postal code

Example:
2000
country_code
string

The address country

Example:
CY
care_of
string

The address care of

Example:
Lorem Ipsum
lat
string

The latitude of the location

Example:
35.157115
lon
string

The longitude of the location

Example:
33.313719
google_place_id
string

The Google textual identifier that uniquely identifies a location

Example:
ChIJrTLr-GyuEmsRBfy61i59si0
products
Array

The products that the amount can be spent for

Object
id_type
string

The type of the ID to be provided

Enumeration:
PRODUCT
FAMILY
TYPE
BRAND
CATEGORY
id
string GUID

The ID of the product condition (based on the type provided)

Example:
4AD9C84FA60F9FE407140E20F707726A
name
string

The name of the product

Example:
Coffee
description
string

The descrtipion of the product

Example:
Brazilian Coffee
timings
Object

The time when the amount can be spent

periods
Array

Details about the period condition

Object
month
integer

Defines the month as integer (1-12)

Example:
1
day
integer

Defines the day in a week as integer (1-7). Week starts with Monday (1)

Example:
1
start_time
string

Start time within a day

Example:
19:00
end_time
string

End time within a day

Example:
21:00
expiration
Object

Defines the amounts expiring in periods. Available only if the parameter include_expiration is set to true

zero_to_thirty
number

The amount that will expire in up to 30 days

Example:
50.5
thirty_to_sixty
number

The amount that will expire from 30 to 60 days

Example:
50.5
sixty_to_ninety
number

The amount that will expire from 60 to 90 days

Example:
50.5
ninety_plus
number

The amount that will expire in more than 90 days

Example:
50.5
paging
Object

Information that can be used in order to display large pages

page
integer

The page number

Example:
2
size
integer

The number of records per page

Default:
10
Example:
20
total
integer

The total number of records. If “include_total” is not specified, then this total is null. If “include_total” is specified, total has a value but it is accurate up to 10K records.

Example:
1124
has_more
boolean

Shows if there are more records available to fetch

Example:
true
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
GET https://sandbox.crm.com/self-service/v1/wallets/acf8b8ac-a325-a644-c866-a6c9d62ff11b/conditional_balances HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "content": [
        {
            "id": "4AD9C84FA60F9FE407140E20F707726A",
            "name": "Happy Hour",
            "amount": 100.5,
            "organisations": [
                {
                    "id": "4AD9C84FA60F9FE407140E20F707726A",
                    "name": "Cafe",
                    "locations": [
                        {
                            "name": "Main Store",
                            "address_line_1": "Elia Papakyriakou",
                            "address_line_2": "Tower Stars",
                            "state_province_county": "Egkomi",
                            "town_city": "Nicosia",
                            "postal_code": "2000",
                            "country_code": "CY",
                            "care_of": "Lorem Ipsum",
                            "lat": "35.157115",
                            "lon": "33.313719",
                            "google_place_id": "ChIJrTLr-GyuEmsRBfy61i59si0"
                        }
                    ]
                }
            ],
            "products": [
                {
                    "id_type": "FAMILY",
                    "id": "4AD9C84FA60F9FE407140E20F707726A",
                    "name": "Coffee",
                    "description": "Brazilian Coffee"
                }
            ],
            "timings": {
                "periods": [
                    {
                        "month": 1,
                        "day": 1,
                        "start_time": "19:00",
                        "end_time": "21:00"
                    }
                ]
            },
            "expiration": {
                "zero_to_thirty": 50.5,
                "thirty_to_sixty": 50.5,
                "sixty_to_ninety": 50.5,
                "ninety_plus": 50.5
            }
        }
    ],
    "paging": {
        "page": 2,
        "size": 20,
        "total": 1124
    }
}
List Wallet (Journal) Transactions
GET /wallets/{id}/transactions

Get all wallet journal transactions for a specific wallet with amount information as well as reasoning on how they were originated.

Path variables

id
string GUID required

The wallet (identifier) whose wallet transactions will be retrieved

Example:
f76f96fc-22da-4f68-44d2-b9aeffa65d0f

Request parameters

type
string optional

Filters wallet transactions based on the transaction type

Enumeration:
CREDIT
DEBIT
posted_on
string optional

Filter based on the posted date, which may fall within a given date range. The value can be a string with a date in epoch format. Each option must also include an operator. Use up to two options based on the required search (e.g. performed_on[gte]=1618395497&performed_on[lt]=1618395497).

Enumeration:
posted_on[gt]

Returns results where the posted date is greater than this value

posted_on[gte]

Returns results where the posted date is greater than or equal to this value

posted_on[lt]

Returns results where the posted date is less than this value

posted_on[lte]

Returns results where the posted date is less then or equal to this value

currency_code
string optional

The wallet transaction’s currency.IF not specified, then all trasnactions are returned.

Example:
EUR
sort
string optional

Defines on which attribute the results should be sorted

Allow empty value: true
Examples:
CREATED_DATEUPDATED_DATENAMEPOSTED_DATE
order
string optional

Defines how the results will be ordered

Allow empty value: true
Enumeration:
ASC
DESC
Default:
DESC
page
integer optional

The page number that should be retrieved

Default:
1
Example:
20
size
string optional

The size (total records) of each page

Default:
10
Example:
20

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 OK

The response succeeded

Body
Object
content
Array
Object
id
string GUID

The wallet journal identifier

Example:
dd6cf22a-4292-a7f6-28bd-37501970cad4
amount
number

The wallet journal amount

Example:
9.99
currency_code
string

The wallet’s currency

Example:
EUR
type
string

The wallet journal type

Enumeration:
CREDIT
DEBIT
posted_on
integer epoch

The date that the wallet journal was posted

Example:
1620912893
reward_event
Object

Details about the reward event

type
string

The type of the event

Enumeration:
AWARD
SPEND
REDEEM
code
string

The event (unique) code

Example:
123234342342432342324r43
amount
number

The amount that was awarded, redeemed or spent

Example:
14.99
currency_code
string

The event’s amount currency

Example:
USD
redeem_method
string

Defines how customer can sign up to the reward scheme

Enumeration:
INSTANT
DEFEREED
state
string

The event state

Enumeration:
POSTED
CANCELLED
EXPIRED

Applicable only for Award Transactions

date
integer epoch

The date on which such event was posted

Example:
1614954223
expiry_date
integer

Expiry date of awarded amount

Example:
1614954223
reward_offer
Object

Details about reward offer

id
string GUID

The reward offer identifier

Example:
7ff08bc0-c7e9-c9fe-f752-71cfb3ee0dc3
name
string

The reward offer name

Example:
Birthday Offer
financial_event
Object

Details about the financial event related to the wallet journal transaction

type
string

The event type

Enumeration:
TOP_UP
TRANSFER
PASS_REDEMPTION
id
string

The event identifier

Example:
7ff08bc0-c7e9-c9fe-f752-71cfb3ee0dc3
number
string

The event number (e.g. entity number, like invoice number, credit note number, refund number)

Example:
1234
reference_number
string

The event reference number, which can be: a) Reference Number, if the transaction is of type payment, invoice, credit note, payment cancellation, refund. OR b) Code, if the transaction is a top-up or a transfer

Example:
REF12343
state
string

The event life cycle state

Enumeration:
POSTED
REJECTED
amount
number

The event amount

Example:
112.24
currency_code
string

The financial event’s currency

Example:
EUR
date
integer epoch

The date on which such event was posted

Example:
1614954223
wallet_fee
Object

Details about the wallet fee related to the wallet journal transaction

type
string

The wallet fee type

Enumeration:
CREDIT

On Credit Wallet Transactions

DEBIT

On Debit Wallet Transactions

name
string

The fee rule name

Example:
1% on all wallet transactions
order
Object

Details about the order related to the wallet journal transaction

id
string GUID

The order identifier

Example:
ecc95c03-26bc-f5d8-abe4-099c05cb6cd1
number
string

The order number

Example:
ORD001
total_cost
number

The order total cost

Example:
1.99
currency_code
string

The cost’s currency

Example:
EUR
submitted_on
integer epoch

The date on which the order was submitted

Example:
1634282740
fulfilled_by
Object

Details about organisation

id
string GUID

The organisation identifier

Example:
087f8a94-a44c-5b0d-f932-2a50ec03c20c
name
string

The organisation name

Example:
CRM
paging
Object

Information that can be used in order to display large pages

page
integer

The page number

Example:
2
size
integer

The number of records per page

Default:
10
Example:
20
total
integer

The total number of records. If “include_total” is not specified, then this total is null. If “include_total” is specified, total has a value but it is accurate up to 10K records.

Example:
1124
has_more
boolean

Shows if there are more records available to fetch

Example:
true
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
GET https://sandbox.crm.com/self-service/v2/wallets/f76f96fc-22da-4f68-44d2-b9aeffa65d0f/transactions HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "content": [
        {
            "id": "dd6cf22a-4292-a7f6-28bd-37501970cad4",
            "amount": 9.99,
            "currency_code": "EUR",
            "type": "DEBIT",
            "posted_on": 1620912893,
            "reward_event": {
                "type": "SPEND",
                "code": "123234342342432342324r43",
                "amount": 14.99,
                "currency_code": "USD",
                "redeem_method": "DEFEREED",
                "state": "EXPIRED",
                "date": 1614954223,
                "expiry_date": 1614954223,
                "reward_offer": {
                    "id": "7ff08bc0-c7e9-c9fe-f752-71cfb3ee0dc3",
                    "name": "Birthday Offer"
                }
            },
            "financial_event": {
                "type": "PASS_REDEMPTION",
                "id": "7ff08bc0-c7e9-c9fe-f752-71cfb3ee0dc3",
                "number": "1234",
                "reference_number": "REF12343",
                "state": "POSTED",
                "amount": 112.24,
                "currency_code": "EUR",
                "date": 1614954223
            },
            "wallet_fee": {
                "type": "DEBIT",
                "name": "1% on all wallet transactions"
            },
            "order": {
                "id": "ecc95c03-26bc-f5d8-abe4-099c05cb6cd1",
                "number": "ORD001",
                "total_cost": 1.99,
                "currency_code": "EUR",
                "submitted_on": 1634282740,
                "fulfilled_by": {
                    "id": "087f8a94-a44c-5b0d-f932-2a50ec03c20c",
                    "name": "CRM"
                }
            }
        }
    ],
    "paging": {
        "page": 2,
        "size": 20,
        "total": 1124
    }
}
Payment Methods
GET /wallets/{id}/payment_methods
DELETE /wallets/{id}/payment_methods/{payment_method_id}
List Wallet Payment Methods (hidden)
GET /wallets/{id}/payment_methods

Get a list of a wallet’s payment methods

Path variables

id
string required

Request parameters

sort
string optional

Defines on which attribute the results should be sorted

Allow empty value: true
Examples:
CREATED_DATEUPDATED_DATENAMEPOSTED_DATE
order
string optional

Defines how the results will be ordered

Allow empty value: true
Enumeration:
ASC
DESC
Default:
DESC
page
integer optional

The page number that should be retrieved

Default:
1
Example:
20
size
string optional

The size (total records) of each page

Default:
10
Example:
20
payment_method_type
string optional
Enumeration:
CARD
is_primary
boolean optional
is_backup
boolean optional

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 OK
Body
Object
content
Array
Object
id
string
Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
name
string
is_primary
boolean
Example:
true
is_backup
boolean
Example:
true
payment_method_type
string
Enumeration:
CARD
card
Object

The card details (applicable if the payment method is set to CARD)

name
string

The card name

Example:
Default Card
brand
string

The card brand

Example:
VISA
first6
string

The first 6 digits of the card

Example:
42424242
last4
string

The last 4 digits of the card

Example:
4242
country_of_issue
string

3 char country code

Example:
CYP
expiration_month
integer

The card expiration month

Example:
6
expiration_year
integer

The card expiration year

Example:
2021
card_holder_details
Object

Information about the card holder

card_holder_name
string

The name of the card holder

Example:
John Alias Doe
address_line_1
string

The address related to the card

Example:
Elia Papakyriakou
address_line_2
string

Additional address information related to the card

Example:
Tower Stars
address_city
string

The city related to the card

Example:
Nicosia
address_zip
string

The zip code related to the card address

Example:
2000
address_state
string

The state related to the card address

Example:
Egkomi
address_country
string

The country related to the card address

Example:
CY
gateway_token
Array
Object
gateway
string nullable

Legacy payment gateways

Enumeration:
JCC
JCC_MERCHANT
SETTLE
integration
Object nullable

Th epayment gateway integration information

id
string

Integration unique identifier

name
string

Integration name

Example:
PayPal
token
string required

The token of the payment method as this was generated by the payment gateway

paging
Object

Information that can be used in order to display large pages

page
integer

The page number

Example:
2
size
integer

The number of records per page

Default:
10
Example:
20
total
integer

The total number of records. If “include_total” is not specified, then this total is null. If “include_total” is specified, total has a value but it is accurate up to 10K records.

Example:
1124
has_more
boolean

Shows if there are more records available to fetch

Example:
true
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
GET https://sandbox.crm.com/self-service/v1/wallets/{id}/payment_methods HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "content": [
        {
            "id": "CAD1E31269B76D7A65ACCE45B2E68DFD",
            "name": "",
            "is_primary": true,
            "is_backup": true,
            "payment_method_type": "CARD",
            "card": {
                "name": "Default Card",
                "brand": "VISA",
                "first6": "42424242",
                "last4": "4242",
                "country_of_issue": "CYP",
                "expiration_month": 6,
                "expiration_year": 2021,
                "card_holder_details": {
                    "card_holder_name": "John Alias Doe",
                    "address_line_1": "Elia Papakyriakou",
                    "address_line_2": "Tower Stars",
                    "address_city": "Nicosia",
                    "address_zip": "2000",
                    "address_state": "Egkomi",
                    "address_country": "CY"
                },
                "gateway_token": [
                    {
                        "gateway": "JCC_MERCHANT",
                        "integration": {
                            "id": "",
                            "name": ""
                        },
                        "token": "123654789654"
                    }
                ]
            }
        }
    ],
    "paging": {
        "page": 2,
        "size": 20,
        "total": 1124
    }
}
Remove Wallet Payment Method (hidden)
DELETE /wallets/{id}/payment_methods/{payment_method_id}

Remove one of the wallet’s payment method

Path variables

id
string required
payment_method_id
string required

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

204 No Content
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
DELETE https://sandbox.crm.com/self-service/v1/wallets/{id}/payment_methods/{payment_method_id} HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 204 No Content 
Integrations
Provisioning Providers
GET /provisioning/service_commands
POST /provisioning/service_commands
Get Service Commands
GET /provisioning/service_commands

Retrieve a list of service commands as implemented in a provisioning provider integration

Request parameters

integration_id
string optional

The unique identifier of the provisioning provider integration.

Example:
ab5f8b2e-092f-4848-8f46-31df1c014060

Request headers

api_key
string required

The publishable api key for application identification

Example:
ab5f8b2e-092f-4848-8f46-31df1c014060

Responses

200 OK

The request has succeeded

Body
Object
content
Array
Object
name
string

The name of the command

Example:
Reset Service
label
string

The label of the command as this will be displayed in the User interface

Example:
Reset Service
code
string

The command’s code. This code will be used when calling back the integraiton to execute the service command

Example:
RESET_SERVICE
description
string

A description of the command

Example:
Resets the service
metadata_attributes
Array

Any additional information that the provisioning provider requires in order to successfully perform the command. The provisioning provider integration informs CRM about this required input

Object
key
string

Unique key for the attribute.

Example:
pin
label
string

Label as this will be displayed in th eUser interface

Example:
PIN
description
string

A description for the required field

Example:
the new pin
field
string

The field’s type (how it will be presented in the User Interface)

Example:
SELECTION
is_mandatory
boolean

Indicates whether the requested information is mandatory or not. All mandatory fields must be specified for a successful execution of the command on the provider’s side

Example:
true
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
GET https://sandbox.crm.com/self-service/v2/provisioning/service_commands HTTP/1.1 

api_key: ab5f8b2e-092f-4848-8f46-31df1c014060

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "content": [
        {
            "name": "Reset Service",
            "label": "Reset Service",
            "code": "RESET_SERVICE",
            "description": "Resets the service",
            "metadata_attributes": [
                {
                    "key": "pin",
                    "label": "PIN",
                    "description": "the new pin",
                    "field": "SELECTION",
                    "is_mandatory": true
                }
            ]
        }
    ]
}
Send Service Command
POST /provisioning/service_commands

Send a command for a service over to the provisoning adapter. The supported commands as well as detailed information on how to call them such as the required input paramters, can be retrieved from the plugin integration via the GET provisioning/service_commands Web API.

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A
api_key
string required

The publishable api key for application identification

Example:
ab5f8b2e-092f-4848-8f46-31df1c014060

Request body

Object
integration_id
string required

The unique identifier of the provisioning provider integration

Example:
4dc0809f-ed91-4b68-b912-5bd6064d901e
service_id
string required

The service for which the command will be sent

Example:
4dc0809f-ed91-4b68-b912-5bd6064d901e
code
string required

The command’s code as this was provided by the integration through Get Service Command Web API.

Example:
RESET_SERVICE
contact
Object

Contact who subscribed to the service

id
string GUID

Contact identifier

Example:
4dc0809f-ed91-4b68-b912-5bd6064d901e
code
string

Contact code

Example:
A0111012
name
string

Contact full name

Example:
John Smith
metadata_attributes
Array

A list of extra parameters (apart from the external reference) that are required to successfully send the command. Get Service Commands Web API indicates which are there paramteres and which ones are also mandatory

Object
key
string

The parameter’s key

Example:
pin
value
string

The parameter’s value

Example:
1234

Responses

201 Created

The request has succeeded

Body
Object
id
string GUID

The request identifier

Example:
7eb3ebf5-fdc1-0890-c1d2-e87f00dee456
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
POST https://sandbox.crm.com/self-service/v2/provisioning/service_commands HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A
api_key: ab5f8b2e-092f-4848-8f46-31df1c014060
Content-Type: application/json

{
    "integration_id": "4dc0809f-ed91-4b68-b912-5bd6064d901e",
    "service_id": "4dc0809f-ed91-4b68-b912-5bd6064d901e",
    "code": "RESET_SERVICE",
    "contact": {
        "id": "4dc0809f-ed91-4b68-b912-5bd6064d901e",
        "code": "A0111012",
        "name": "John Smith"
    },
    "metadata_attributes": [
        {
            "key": "pin",
            "value": "1234"
        }
    ]
}

HTTP/1.1 201 Created 
Address Lookup
GET /addresses
Address Lookup
GET /addresses

Returns a list of addresses based on the external address registry systems that CRM.COM integrates with

Request parameters

integration
string required

The address registry that lookup will be performed

Enumeration:
GOOGLE
address
string required

The address that lookup will be performed against (address and latlng are semi-optional)

Example:
Elia Papakyriakou 21, Egkomi, 2415, Nicosia, Cyprus
latlon
string required

The lat and lng coordinates that lookup will be performed against (address and latlng are semi-optional)

Example:
40.714224,-73.961452

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 OK

The request has succeeded

Body
Object
content
Array
Object
address
string

The full address as returned by the address registry

Example:
Elia Papakyriakou, Egkomi, 2415, Nicosia, Cyprus
address_line_1
string

The address information

Example:
Elia Papakyriakou 21
address_line_2
string

Additional information about the address

Example:
7 Tower Stars
state_province_county
string

The state/province/county of the address

Example:
Egkomi
town_city
string

The town/city of the address

Example:
Nicosia
postal_code
string

The postal code of the address

Example:
2415
country_code
string

The country code of the address

Example:
CY
lat
number

The latitude of the address

Example:
12.234
lon
number

The longitude of the address

Example:
23.453
google_place_id
string

The Google textual identifier that uniquely identifies a location

Example:
123d23w23fw322
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
GET /address_lookup?integrator=GOOGLE&address=Elia Papakyriakou, Egkomi, 2415, Nicosia, Cyprus HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "content": [
        {
            "address": "Elia Papakyriakou 21, Egkomi, 2415, Nicosia, Cyprus",
            "lat": 12.234,
            "lon": 23.453,
            "googlePlaceId": "123d23w23fw322"
        },
        {
            "address": "Elia Papakyriakou 22, Egkomi, 2415, Nicosia, Cyprus",
            "lat": 12.234,
            "lon": 23.453,
            "googlePlaceId": "123d23w23fw322"
        }
    ],
    "paging": {
        "page": 2,
        "size": 20,
        "total": 100
    }
}
Settings - Configuration

Lists a number of APIs that can be used for retrieving configuration settings, required by the mobile/web client

GET /applications
GET /business_activities
GET /communities/relations
GET /currencies
GET /custom_fields
GET /industries
GET /industry_sectors
GET /languages
GET /name_day_rules
GET /products/categories
GET /services_requests/queues
GET /tags
Get Application
GET /applications

Retrieve details for a specific application

Request parameters

platform_app_id
string required

The platform application identifier

Example:
f9e4b742-bfe1-09dc-f623-de71aaed61ff
version
string optional

The application version number

Example:
1.1
cloud_name
string optional

Use cloud name to retrieve Web APP settings.

Example:
crm
language_code
string optional

Filter content translations to the selected language

Example:
EN

Request headers

api_key
string required

The publishable api key for application identification

Example:
ab5f8b2e-092f-4848-8f46-31df1c014060

Responses

200 200

Successfull Completed

Body
Object
id
string GUID

The application identifier

Example:
0b9ab3de-af32-47f9-faca-ff5c94063819
name
string

The application name

Example:
Brew Coffee App
description
string

The application description

Example:
Best coffee app
type
string

The application type

Enumeration:
NATIVE
NATIVE_MERCHANT
WEB
public_key
string GUID

The public API Key to be used on subsequent API calls

Example:
71285392-8660-43e2-8fc3-ef1a61edbcd0
appearance
Object

Details about the app appearance

colors
Array

The application color style

Object
type
string

Defines the component on which the color will be applied

Enumeration:
LANDING_BACKGROUND
LANDING_CARD
LANDING_TEXT
SCREEN_CARD
SCREEN_BUTTON
SCREEN_WALLET
value
string

The color (hex) code

Example:
#eb4034
fonts
Array

The application text font style

Object
type
string

Defines the component on which the font will be applied

Example:
TEXT
font
string

The text font style that the app will use

Enumeration:
San Francisco
Roboto
Helvetica
Open Sans
Poppins
Georgia
Gilroy
dark_mode
boolean

The colour scheme of the app

Example:
true
homepage_layout
string

The homepage layout of the app

Example:
LAYOUT2
advanced_colour_mapping
string

JSON script contaning specific mapping of existing colour settings to particular elements of the app. Used in special circumstances to allow fine tuning of colour mapping without the need to rebuild the app. This is maintatined solely by CRMI and is not visible on the back-end UI.

Example:
let appearance = { main_color: '#ffffff', //landing_page.text_color, landing_page.button_text_color, main_page.card_text_color, main_page.icon_color, side_bar.text_color, side_bar.icon_color, tab_bar.background_color button_color: '#50e3c2',//landing_page.button_color, main_page.button_color, main_page.button_selected, side_bar.background_color, tab_bar.selected, card_color: '#F0F0F3', //main_page.button_unselected, main_page.card_bg_color, main_page.input_background_color background_color: '#d32166', //landing_page.background_color text_normal_color: '#212121', //main_page.text_label_color, main_page.input_label_color text_main_color: '#03041D', //main_page.button_unselected_text_color, main_page.text_color, main_page.text_title_color, main_page.card_icon_color, main_page.input_text_color border_color: 'rgba(3, 4, 29, 0.16)', //main_page.border_button_color, main_page.border_input_color, tab_bar.unselected, darkmode_color: '#212121', //background pages when dark_mode = true darkmode_text: '#ffffff', //main_page.text_color }
information
Object

Defines the app details (about, terms and conditions, privacy policy)

content
Array

The application content information

Object
type
string

The content type

Enumeration:
ABOUT

About

TERMS_CONDITIONS

Terms & Conditions

PRIVACY_POLICY

Privacy Policy

FAQS

Frequently-Asked Questions

url
string

The detail URL endpoint (URL or Content is required)

Example:
https?/crm.com
rich_content
string

The detail rich content (URL or Content is required)

Example:
Terms & Conditions
contact_us
Object

The application “contact us” details

email_address
string

The “contact us” email address

Example:
info@crm.com
phone
Object

The “contact us” phone

country_code
string

The phone country code

Example:
CYP
number
string

The phone number

Example:
99123456
website
string

The “contact us” website (URL endpoint)

Example:
https://crm.com
features
Object

Details about the features that will be supported by the app

contact
Object

Defines the supported contact features

business_network
Object

Defines the supported business network features

is_supported
boolean

Defines whether business network features should be available

Example:
true
multitenancy
Object

Defines whether multitenancy features will be available

is_supported
boolean

Defines whether multitenancy is supported

Example:
true
contact
Object

Defines the supported contact features

code_representation
string nullable

How the contact code will be depicted on the app/port, for scanning purposes

Enumeration:
BARCODE

As a barcode

QR_CODE

As a QR code

Example:
BARCODE
existing_contacts
boolean

Defines whether app will prompt contacts to link their past loyalty account with CRM

Example:
true
communities
Object

Defines whether communities (relationships between contacts) features will be available

is_supported
boolean

Defines whether communities is supported

Example:
true
profile
Array

Defines the details that a contact can provide

Object
type
string

The contact detail

Enumeration:
BIRTHDATE
GENDER
NAMEDAY
is_supported
string

Defines if such detail is supported or not

Example:
true
crm
Object

Defines the supported crm features

is_supported
boolean

Defines whether contact features should be available

Example:
true
service_requests
Object

Defines the supported service request features

is_supported
boolean

Defines whether contacts will be able to create service requests

Example:
true
supported_queues
Array

Defines whether and which service request queue, contacts will be able to select

Object
id
string GUID

The service request queue identifier

Example:
8237416b-ecca-769a-a38a-293320b0ffdf
name
string

The service request queue name

finance
Object

Defines the supported finance features

is_supported
boolean

Defines whether finance features should be available

Example:
true
wallet_top_up
boolean

Defines whether contacts will be able to top up their wallets

redeem_pass
Object

Defines the supported redeem pass features

is_supported
string

Defines whether contacts will be able to redeem a pass

Example:
false
pass_attributes
Array

Defines whether pass redemption should be supported by other attributes

Object
type
string

The type of supplementary attribute

Example:
VALUE
payment_methods
Array

Defines the allowed payment methods to be used

Object
type
string

The allowed payment method type

Example:
CASH
order
Object

Defines the supported ordering features

is_supported
boolean

Defines whether order features should be available

Example:
true
pick_up
boolean

Defines whether pick up is supported as supply method

Example:
true
delivery
boolean

Defines whether delivery is supported as supply method

Example:
true
direct_sale
boolean

Defines whether direct sale is supported as supply method

Example:
true
model
string

Defines whether contacts will be able to select from which location an order will be placed (via a list of merchants/venues) or not

Enumeration:
MARKETPLACE

Ability to select location

SINGLE_BUSINESS

Location won’t be selectable

preferred_organisation
boolean

Defines whether contact can set preferred organisation for ordering

Example:
true
order_countries
Array

Defines the countries where orders can be made

Object
country
string

The country (code)

Example:
CYP
order_catalogs
Array

Defines a list of order catalogs that should filter available products to order

Object
id
string GUID

The order catalog identifier

Example:
676055d9-fe79-6836-8a50-c2d3764e9919
name
string

The order catalog name

Example:
Network Products
use_wallet_funds
Object

Defines whether contact can pay for order using wallet funds

is_supported
boolean

Defines whether contact can pay for orders using wallet funds

Example:
true
specific_funds_amount
boolean

Defines whether contacts can specific the wallet funds amount to use on orders

Example:
true
cover_full_basket
boolean

Defines whether the wallet fund amount must cover the full basket amount

Example:
true
reward
Object

Defines the supported rewards features

is_supported
boolean

Defines whether reward features should be available

Example:
true
tiering
boolean

Defines whether reward tiering will be supported

Example:
true
preferred_organisation
boolean

Defines whether contact can select his/her preferred organisation for rewards

Example:
true
refer_friend
Object

Defines the supported refer a friend features

is_supported
boolean

Defines whether refer a friend will be supported

refer_methods
Array

Defines the communication method that should be used for refer a friend (required when refer a friend is enabled)

Example:
["SMS"]
string
Enumeration:
EMAIL
SMS
otp_spend
Object

Defines the supported OTP spend features

is_supported
boolean

Defines whether OTP spend will be supported

Example:
true
spend_attributes
Array

Defines the supplementary attributes that will be supported for OTP spends (required when OTP spend is enabled)

Object
type
string

The type of supplementary attribute

Example:
AMOUNT
self_submit_purchases
Object

Defines the supported contact self-submit purchase events features

is_supported
boolean

Defines whether contact can self-submit purchase events

Example:
true
self_submit_methods
Array

Defines how self-submit (reclaim) purchase identification will be made (required when contact self-submit purchase is enabled)

Example:
["BARCODE"]
string
Example:
BARCODE
marketing
Object

Defines the supported marketing content features

is_supported
boolean

Defines whether marketing content should be available

Example:
true
embedded_links
Array

Define links for embedded browser in front-end systems

Object
title
string

Defines the title of the link

Example:
New and upcoming events
url
string

Defines the URL of the link

Example:
https://www.guababechbar.com/news&events
creatives
Array

Creatives images for marketing includes the primary image and scaled versions to create a srcset

Object
id
string GUID

The creative identifier

Example:
a3f1f6b3-8d49-3a72-e48e-617dd6004d41
usage_type
string

Information about the creative type

Enumeration:
LOGO
BACKGROUND
MARKETING
ATTACHMENT
width
integer

The creative width

Example:
2159
height
integer

The creative height

Example:
3075
format
string

The creative format

Example:
jpg
url
string

The creative content URL

Example:
https://assets.crm.com/image/offer.jpg
public_id
string

The creative public identifier

Example:
crm-com/image
media
Array

Details about creative transformations

Object
width
integer

The transformed creative width

Example:
200
height
integer

The transformed creative height

Example:
300
url
string

The transformed creative URL

Example:
https://asset.crm.com/image/offer/c_scale,w_200/offer.jpg
mobile_pass
Object

Defines the supported mobile pass features

is_supported
boolean

Defines whether mobile pass should be available

Example:
true
merchant
Object

The supported merchant related features

reward
Object

Defines the supported reward features

is_supported
boolean

Defines whether reward features should be available

Example:
true
purchase
Object

Defines the supported purchase event features

is_supported
boolean

Defines whether merchants can submit purchase events

Example:
true
allow_spend
boolean

Defines whether the merchant app supports submission of spend requests

Example:
true
restrict_fully_covered
boolean

Defines whether the purchase will be posted successfully only if requested spend amount fully covers the purchase amount

Example:
true
authentication
Object

Details on how customers can auth by the app

email_password
boolean

Defines whether contacts can register & sign-in based on email and password

Example:
true
email_otp
string

Defines whether contacts can register & sign-in based on email and one-time password

Example:
false
sms_otp
boolean

Defines whether contacts can register & sign-in based on phone and one-time password

Example:
true
facebook
Object

Defines whether contacts can register & sign-in based on Facebook (including Facebook authentication details)

is_supported
boolean

Defines whether Facebook authentication is enabled or not

Example:
false
app_id
string

The App ID required for Facebbok authentication

Example:
dsf-w-f-esf-23f-w-eff2f
google
Object

Supported authentication based on Google

is_supported
boolean

Defines whether Google authentication is enabled or not

Example:
false
app_id
string

The App ID required for Google authentication

Example:
try-23-sww22
manage_credentials
Object

Defines whether contacts will be able to manage their authentication details

add_new
boolean

Defiens whether contact will be able to add new authentication details

Example:
true
update_existing
boolean

Defiens whether contact will be able to update existing authentication details

Example:
true
delete_existing
boolean

Defiens whether contact will be able to delete existing authentication details

Example:
false
creatives
Array

Creatives images for marketing includes the primary image and scaled versions to create a srcset

Object
id
string GUID

The creative identifier

Example:
a3f1f6b3-8d49-3a72-e48e-617dd6004d41
usage_type
string

Information about the creative type

Enumeration:
LOGO
BACKGROUND
MARKETING
ATTACHMENT
width
integer

The creative width

Example:
2159
height
integer

The creative height

Example:
3075
format
string

The creative format

Example:
jpg
url
string

The creative content URL

Example:
https://assets.crm.com/image/offer.jpg
public_id
string

The creative public identifier

Example:
crm-com/image
media
Array

Details about creative transformations

Object
width
integer

The transformed creative width

Example:
200
height
integer

The transformed creative height

Example:
300
url
string

The transformed creative URL

Example:
https://asset.crm.com/image/offer/c_scale,w_200/offer.jpg
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
GET https://sandbox.crm.com/self-service/v2/applications?platform_app_id=f9e4b742-bfe1-09dc-f623-de71aaed61ff HTTP/1.1 

api_key: ab5f8b2e-092f-4848-8f46-31df1c014060

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "0b9ab3de-af32-47f9-faca-ff5c94063819",
    "name": "Brew Coffee App",
    "description": "Best coffee app",
    "type": "NATIVE",
    "public_key": "71285392-8660-43e2-8fc3-ef1a61edbcd0",
    "appearance": {
        "colors": [
            {
                "type": "LANDING_CARD",
                "value": "#eb4034"
            }
        ],
        "fonts": [
            {
                "type": "TEXT",
                "font": "Open Sans"
            }
        ],
        "dark_mode": true,
        "homepage_layout": "LAYOUT2",
        "advanced_colour_mapping": "let appearance = { main_color: '#ffffff', //landing_page.text_color, landing_page.button_text_color, main_page.card_text_color, main_page.icon_color, side_bar.text_color, side_bar.icon_color, tab_bar.background_color button_color: '#50e3c2',//landing_page.button_color, main_page.button_color, main_page.button_selected, side_bar.background_color, tab_bar.selected, card_color: '#F0F0F3', //main_page.button_unselected, main_page.card_bg_color, main_page.input_background_color background_color: '#d32166', //landing_page.background_color text_normal_color: '#212121', //main_page.text_label_color, main_page.input_label_color text_main_color: '#03041D', //main_page.button_unselected_text_color, main_page.text_color, main_page.text_title_color, main_page.card_icon_color, main_page.input_text_color border_color: 'rgba(3, 4, 29, 0.16)', //main_page.border_button_color, main_page.border_input_color, tab_bar.unselected, darkmode_color: '#212121', //background pages when dark_mode = true darkmode_text: '#ffffff', //main_page.text_color }"
    },
    "information": {
        "content": [
            {
                "type": "FAQS",
                "url": "https?/crm.com",
                "rich_content": "Terms & Conditions"
            }
        ],
        "contact_us": {
            "email_address": "info@crm.com",
            "phone": {
                "country_code": "CYP",
                "number": "99123456"
            },
            "website": "https://crm.com"
        }
    },
    "features": {
        "contact": {
            "business_network": {
                "is_supported": true,
                "multitenancy": {
                    "is_supported": "true"
                }
            },
            "contact": {
                "code_representation": "BARCODE",
                "existing_contacts": true,
                "people": {
                    "is_supported": "true"
                },
                "profile": [
                    {
                        "type": "NAMEDAY",
                        "is_supported": "true"
                    }
                ]
            },
            "crm": {
                "is_supported": true,
                "service_requests": {
                    "is_supported": true,
                    "supported_queues": [
                        {
                            "id": "8237416b-ecca-769a-a38a-293320b0ffdf",
                            "name": ""
                        }
                    ]
                }
            },
            "finance": {
                "is_supported": true,
                "wallet_top_up": true,
                "redeem_pass": {
                    "is_supported": "false",
                    "pass_attributes": [
                        {
                            "type": "VALUE"
                        }
                    ]
                },
                "payment_methods": [
                    {
                        "type": "CASH"
                    }
                ]
            },
            "order": {
                "is_supported": true,
                "pick_up": true,
                "delivery": true,
                "direct_sale": true,
                "model": "MARKETPLACE",
                "preferred_organisation": true,
                "order_countries": [
                    {
                        "country": "CYP"
                    }
                ],
                "order_catalogs": [
                    {
                        "id": "676055d9-fe79-6836-8a50-c2d3764e9919",
                        "name": "Network Products"
                    }
                ],
                "use_wallet_funds": {
                    "is_supported": true,
                    "specific_funds_amount": true,
                    "cover_full_basket": true
                }
            },
            "reward": {
                "is_supported": true,
                "tiering": true,
                "preferred_organisation": true,
                "refer_friend": {
                    "is_supported": true,
                    "refer_methods": [
                        "SMS"
                    ]
                },
                "otp_spend": {
                    "is_supported": true,
                    "spend_attributes": [
                        {
                            "type": "AMOUNT"
                        }
                    ]
                },
                "self_submit_purchases": {
                    "is_supported": true,
                    "self_submit_methods": [
                        "BARCODE"
                    ]
                }
            },
            "marketing": {
                "is_supported": true,
                "embedded_links": [
                    {
                        "title": "New and upcoming events",
                        "url": "https://www.guababechbar.com/news&events",
                        "creatives": [
                            {
                                "id": "a3f1f6b3-8d49-3a72-e48e-617dd6004d41",
                                "usage_type": "ATTACHMENT",
                                "width": 2159,
                                "height": 3075,
                                "format": "jpg",
                                "url": "https://assets.crm.com/image/offer.jpg",
                                "public_id": "crm-com/image",
                                "media": [
                                    {
                                        "width": 200,
                                        "height": 300,
                                        "url": "https://asset.crm.com/image/offer/c_scale,w_200/offer.jpg"
                                    }
                                ]
                            }
                        ]
                    }
                ]
            },
            "mobile_pass": {
                "is_supported": "true"
            }
        },
        "merchant": {
            "reward": {
                "is_supported": true,
                "purchase": {
                    "is_supported": true,
                    "allow_spend": true,
                    "restrict_fully_covered": true
                }
            }
        }
    },
    "authentication": {
        "email_password": true,
        "email_otp": "false",
        "sms_otp": true,
        "facebook": {
            "is_supported": "false",
            "app_id": "dsf-w-f-esf-23f-w-eff2f"
        },
        "google": {
            "is_supported": "false",
            "app_id": "try-23-sww22"
        }
    },
    "creatives": [
        {
            "id": "a3f1f6b3-8d49-3a72-e48e-617dd6004d41",
            "usage_type": "MARKETING",
            "width": 2159,
            "height": 3075,
            "format": "jpg",
            "url": "https://assets.crm.com/image/offer.jpg",
            "public_id": "crm-com/image",
            "media": [
                {
                    "width": 200,
                    "height": 300,
                    "url": "https://asset.crm.com/image/offer/c_scale,w_200/offer.jpg"
                }
            ]
        }
    ]
}
List Business Activities
GET /business_activities

Returns a list of business activities

Request parameters

name
string optional

The name of the business activity

Example:
Bar & Grill
sort
string optional

Defines on which attribute the results should be sorted

Allow empty value: true
Examples:
CREATED_DATEUPDATED_DATENAMEPOSTED_DATE
order
string optional

Defines how the results will be ordered

Allow empty value: true
Enumeration:
ASC
DESC
Default:
DESC
page
integer optional

The page number that should be retrieved

Default:
1
Example:
20
size
string optional

The size (total records) of each page

Default:
10
Example:
20

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 OK

The request has succeeded

Body
Object
content
Array

Information about the retrieved business activities

Object
id
string GUID

The business activity identifier

Example:
E4AC253114B84DF2B347996DC277DDDF
name
string

The business activity name

Example:
Bar & Grill
paging
Object

Information that can be used in order to display large pages

page
integer

The page number

Example:
2
size
integer

The number of records per page

Default:
10
Example:
20
total
integer

The total number of records. If “include_total” is not specified, then this total is null. If “include_total” is specified, total has a value but it is accurate up to 10K records.

Example:
1124
has_more
boolean

Shows if there are more records available to fetch

Example:
true
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
GET /business_activities HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "content": [
        {
            "id": "E4AC253114B84DF2B347996DC277DDDF",
            "name": "Bar & Grill"
        }
    ],
    "paging": {
        "page": 2,
        "size": 20,
        "total": 100
    }
}
List Contact Community Relations
GET /communities/relations

Retrieve a list of contact community relations based on search criteria (e.g. all contact community relations)

Request parameters

name
string optional

Filter based on contact community relation name (behave as like)

Example:
Employees
sort
string optional

Defines on which attribute the results should be sorted

Allow empty value: true
Examples:
CREATED_DATEUPDATED_DATENAMEPOSTED_DATE
order
string optional

Defines how the results will be ordered

Allow empty value: true
Enumeration:
ASC
DESC
Default:
DESC
page
integer optional

The page number that should be retrieved

Default:
1
Example:
20
size
string optional

The size (total records) of each page

Default:
10
Example:
20

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 OK

The request has succeeded

Body
Object
content
Array
Object
id
string GUID

The contact community relation identifier

Example:
459f7d6e-09bb-5609-c0ad-846e369ef39e
name
string

The contact community relation name

Example:
Employees
paging
Object

Information that can be used in order to display large pages

page
integer

The page number

Example:
2
size
integer

The number of records per page

Default:
10
Example:
20
total
integer

The total number of records. If “include_total” is not specified, then this total is null. If “include_total” is specified, total has a value but it is accurate up to 10K records.

Example:
1124
has_more
boolean

Shows if there are more records available to fetch

Example:
true
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
GET https://sandbox.crm.com/self-service/v2/communities/relations HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "content": [
        {
            "id": "459f7d6e-09bb-5609-c0ad-846e369ef39e",
            "name": "Employees"
        }
    ],
    "paging": {
        "page": 2,
        "size": 20,
        "total": 1124
    }
}
List Currencies
GET /currencies

Retrieves the supported currencies

Request parameters

sort
string optional

Defines on which attribute the results should be sorted

Allow empty value: true
Examples:
CREATED_DATEUPDATED_DATENAMEPOSTED_DATE
order
string optional

Defines how the results will be ordered

Allow empty value: true
Enumeration:
ASC
DESC
Default:
DESC
page
integer optional

The page number that should be retrieved

Default:
1
Example:
20
size
string optional

The size (total records) of each page

Default:
10
Example:
20

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A
api_key
string required

The publishable api key for application identification

Example:
ab5f8b2e-092f-4848-8f46-31df1c014060

Responses

200 OK
Body
Object
content
Array
Object
code
string

The currency code

Example:
EUR
is_default
boolean

Defines whether the currency is the base (default) of the organisation

Example:
false
paging
Object

Information that can be used in order to display large pages

page
integer

The page number

Example:
2
size
integer

The number of records per page

Default:
10
Example:
20
total
integer

The total number of records. If “include_total” is not specified, then this total is null. If “include_total” is specified, total has a value but it is accurate up to 10K records.

Example:
1124
has_more
boolean

Shows if there are more records available to fetch

Example:
true
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
GET https://sandbox.crm.com/self-service/v2/currencies HTTP/1.1 

api_key: ab5f8b2e-092f-4848-8f46-31df1c014060

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "content": [
        {
            "code": "EUR",
            "is_default": "false"
        }
    ],
    "paging": {
        "page": 2,
        "size": 20,
        "total": 1124
    }
}
List Custom Fields
GET /custom_fields

Retrieve a list of custom fields based on search criteria (e.g. all contant custom fields)

Request parameters

entity
string required

The name of the entity whose custom fields will be retrieved

Enumeration:
CONTACTS
ORDERS
ORGANISATIONS
DEVICES
SERVICE_REQUESTS
PAYMENTS
REFUNDS
TOP_UPS
LEADS
visible
boolean optional

Filters custom fields based on visibility conditions

Example:
true

Request headers

authorization
string optional

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A
api_key
string optional

The publishable api key for application identification

Example:
ab5f8b2e-092f-4848-8f46-31df1c014060

Responses

200 OK

The request has succeeded

Body
Object
content
Array
Object
id
string GUID

The custom field identifier

Example:
97842945-3e9f-9a7c-50c1-ad0074ddc4e5
key
string

The custom field (unique) key

Example:
reviews
label
string

The custom field label

Example:
Reviews
tooltip
string

The custom field tooltip

Example:
Total Reviews Given
visible
boolean

Defines whether the custom field should be visible or not

Example:
true
field
string

The custom field’s UI field type

Enumeration:
SINGLE_LINE
MULTIPLE_LINES
SELECTION
CHECKBOXES
RADIO_BUTTONS
TIMESTAMP
DATE
DATE_RANGE
NUMBER
AMOUNTS
USERS
entity
string

The related entity with the custom field

Enumeration:
CONTACTS
ORDERS
ORGANISATIONS
DEVICES
SERVICE_REQUESTS
PAYMENTS
REFUNDS
TOP_UPS
LEADS
restrictions
Object

Defines the restrictions that will be applied on a custom field’s content (if applicable)

max_characters
integer

The maximum allowed number of characters that the custom field can support

Example:
1024
min_number
number

The minimum allowed number that the custom field can support

Example:
2
max_number
number

The maximum allowed number that the custom field can support

Example:
200
number_decimals
integer

The maximum allowed number of decimals that the custom field can support

Example:
2
options
Array

The available options that a user can select when the custom field is selection, checkbox or radio button based

Object
key
string

The field option key

Example:
option_1
text
string

The field option text

Example:
Silver
default
boolean

Defines whther the field option is the default one

Example:
true
order
integer

The field option order number

Example:
1
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
GET https://sandbox.crm.com/self-service/v1/custom_fields?entity=CONTACTS HTTP/1.1 

authorization: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "content": [
        {
            "key": "reviews",
            "label": "Reviews",
            "tooltip": "Total Reviews Given",
            "visible": "true",
            "field": "CHECKBOXES",
            "entity": "CONTACTS"
        }
    ]
}
List Industries
GET /industries

Returns a list of industries

Request parameters

name
string optional

The name of the industry

Example:
Education
sort
string optional

Defines on which attribute the results should be sorted

Allow empty value: true
Examples:
CREATED_DATEUPDATED_DATENAMEPOSTED_DATE
order
string optional

Defines how the results will be ordered

Allow empty value: true
Enumeration:
ASC
DESC
Default:
DESC
page
integer optional

The page number that should be retrieved

Default:
1
Example:
20
size
string optional

The size (total records) of each page

Default:
10
Example:
20

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 OK

The request has succeeded

Body
Object
content
Array

Information about the retrieved industries

Object
id
string GUID

The industry identifier

Example:
E4AC253114B84DF2B347996DC277DDDF
name
string

The industry name

Example:
Advertising
paging
Object

Information that can be used in order to display large pages

page
integer

The page number

Example:
2
size
integer

The number of records per page

Default:
10
Example:
20
total
integer

The total number of records. If “include_total” is not specified, then this total is null. If “include_total” is specified, total has a value but it is accurate up to 10K records.

Example:
1124
has_more
boolean

Shows if there are more records available to fetch

Example:
true
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
GET /industries HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "content": [
        {
            "id": "E4AC253114B84DF2B347996DC277DDDF",
            "name": "Advertising"
        }
    ],
    "paging": {
        "page": 2,
        "size": 20,
        "total": 100
    }
}
List Industry Sectors
GET /industry_sectors

Returns a list of industry sectors

Request parameters

name
string optional

The name of the industry sector

Example:
RESTAURANTS
industry_name
string optional

The name of the industry that multiple sectors belong to

Example:
EDUCATION
sort
string optional

Defines on which attribute the results should be sorted

Allow empty value: true
Examples:
CREATED_DATEUPDATED_DATENAMEPOSTED_DATE
order
string optional

Defines how the results will be ordered

Allow empty value: true
Enumeration:
ASC
DESC
Default:
DESC
page
integer optional

The page number that should be retrieved

Default:
1
Example:
20
size
string optional

The size (total records) of each page

Default:
10
Example:
20

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 OK

The request has succeeded

Body
Object
content
Array

Information about the retrieved industry sectors

Object
id
string GUID

The industry sector identifier

Example:
E4AC253114B84DF2B347996DC277DDDF
name
string

The industry sector name

Example:
Consultancy
related_industries
Array

Details about the related industries

Object
id
string GUID

The related industry identifier

Example:
E4AC253114B84DF2B347996DC277DDDF
name
string

The related industry name

Example:
Operations
paging
Object

Information that can be used in order to display large pages

page
integer

The page number

Example:
2
size
integer

The number of records per page

Default:
10
Example:
20
total
integer

The total number of records. If “include_total” is not specified, then this total is null. If “include_total” is specified, total has a value but it is accurate up to 10K records.

Example:
1124
has_more
boolean

Shows if there are more records available to fetch

Example:
true
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
GET https://sandbox.crm.com/self-service/v1/industry_sectors HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "content": [
        {
            "id": "E4AC253114B84DF2B347996DC277DDDF",
            "name": "Consultancy",
            "related_industries": [
                {
                    "id": "E4AC253114B84DF2B347996DC277DDDF",
                    "name": "Operations"
                }
            ]
        }
    ],
    "paging": {
        "page": 2,
        "size": 20,
        "total": 1124
    }
}
List Languages
GET /languages

Retrieve a list of the supported languages that can be used in communications and content translations

Notes

COMMUNICATION & CONTENT TRANSLATION LANGUAGES

Communication languages can be configured per business and are used for sending a communication content or display an entity’s content in different languages (based on contact’s preferred communication language).

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A
api_key
string required

The publishable api key for application identification

Example:
ab5f8b2e-092f-4848-8f46-31df1c014060

Responses

200 OK

The request has succeeded

Body
Object
content
Array
Object
language_code
string

The language (2-char code) that is supported

Example:
EN
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
GET https://sandbox.crm.com/self-service/v2/languages HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "content": [
        {
            "language_code": "EN"
        }
    ]
}
List Name Day Rules
GET /name_day_rules

Returns a list of name day rules

Request parameters

first_name
string optional

The first name of the contact to retrieve only applicable name days

Example:
Holly Mary

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 OK

The request has succeeded

Body
Object
name_day_rules
Array
Object
id
string GUID

The name day rule identifier

Example:
9365d945-2c62-be0e-a8dc-45736fdfa5b5
day
string

The day of the name day rule

month
string

The month of the name day rule

names
string

The names that celebrate this name day, comma separated

Example:
Marios, Maria
description
string

A description of the name day

Example:
Holly Mary
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
GET https://sandbox.crm.com/self-service/v1/name_day_rules HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "name_day_rules": [
        {
            "id": "CAD1E31269B76D7A65ACCE45B2E68DFD",
            "day": "1",
            "month": "10",
            "names": "Marios, Maria",
            "description": "Holly Mary"
        }
    ]
}
List Product Categories
GET /products/categories

Returns a list of product categories

Request parameters

parent_id
string GUID optional

Retrieve only all child nodes that have as parent this product category

Example:
9365d945-2c62-be0e-a8dc-45736fdfa5b5
return_all
boolean optional

Defines whether all product categories (parent and child) should be retrieved or not

Example:
true
available_in_order_menus
boolean optional

Filter product categories on whether to include in the order menu or not

Example:
false
organisation_id
string optional

Filter product categories on the organisation that owns the products

sort
string optional

Defines on which attribute the results should be sorted

Allow empty value: true
Examples:
CREATED_DATEUPDATED_DATENAMEPOSTED_DATE
order
string optional

Defines how the results will be ordered

Allow empty value: true
Enumeration:
ASC
DESC
Default:
DESC
page
integer optional

The page number that should be retrieved

Default:
1
Example:
20
size
string optional

The size (total records) of each page

Default:
10
Example:
20

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 OK

The request has succeeded

Body
Object
content
Array
Object
id
string GUID

The product category identifier

Example:
9365d945-2c62-be0e-a8dc-45736fdfa5b5
name
string

The product category name

Example:
Cold Drinks Delivery
display_name
string

The product category display name

Example:
Cold Drinks
description
string

The product category description

Example:
Cold Beverages and Refreshers
child_nodes
integer

The number of the product category’s child nodes

Example:
12
products
integer

The number of products in the category

Example:
2
available_in_order_menus
boolean

Defines whether the product category should be available in order menu

Example:
false
parent
Object

Details about the parent product category (applicable if this category is a child node)

id
string GUID

The parent product category identifier

Example:
9365d945-2c62-be0e-a8dc-45736fdfa5b5
name
string

The parent product category name

Example:
Drinks
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
GET https://sandbox.crm.com/self-service/v2/products/categories HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "content": [
        {
            "id": "9365d945-2c62-be0e-a8dc-45736fdfa5b5",
            "name": "Cold Drinks Delivery",
            "display_name": "Cold Drinks",
            "description": "Cold Beverages and Refreshers",
            "child_nodes": 12,
            "products": 2,
            "available_in_order_menus": "false",
            "parent": {
                "id": "9365d945-2c62-be0e-a8dc-45736fdfa5b5",
                "name": "Drinks"
            }
        }
    ]
}
List Queues
GET /services_requests/queues

Retrieves the configuration of queue settings for service requests

Request parameters

state_for_self_service
string optional

Only list the enabled queues for self service.

Enumeration:
ENABLED
DISABLED
state
string optional

State of queue. Only list enabled queues.

Example:
ENABLED

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 OK
Body
Object
content
Array
Object
queues
Object

The classification settings relating to queue type

id
string GUID

The queue identifier

Example:
c038c1a2-ffa3-37ba-4818-b3db4f2c3cc3
name
string
classification
string
owner
Object
id
string GUID
Example:
d505a1f9-af03-9c4a-b3d9-97e9e4d198a5
name
string
default_priority
Object
impact
string
Enumeration:
URGENT
HIGH
MEDIUM
LOW
urgency
string
Enumeration:
URGENT
HIGH
MEDIUM
LOW
priority
string
Enumeration:
URGENT
HIGH
MEDIUM
LOW
default_tags
Array
Object
tag_id
string GUID
Example:
93861e6b-2482-784a-5ff7-9d1c16a318e3
name
string
colour
string
default_categories
Array

The default service request categories which will be assigned to service requests

Object
id
string

Service request category id

Example:
2f4ffc37-9463-4f17-9549-dd3cbc24f7e7
name
string

Service request category name

Example:
Service requests raised through front-end devices
Example 1
GET https://sandbox.crm.com/self-service/v2/services_requests/queues HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "content": [
        {
            "queues": {
                "id": "c038c1a2-ffa3-37ba-4818-b3db4f2c3cc3",
                "name": "",
                "classification": "",
                "owner": {
                    "id": "d505a1f9-af03-9c4a-b3d9-97e9e4d198a5",
                    "name": ""
                },
                "default_priority": {
                    "impact": "LOW",
                    "urgency": "HIGH",
                    "priority": "MEDIUM"
                },
                "default_tags": [
                    {
                        "tag_id": "93861e6b-2482-784a-5ff7-9d1c16a318e3",
                        "name": "",
                        "colour": ""
                    }
                ],
                "default_categories": [
                    {
                        "id": "2f4ffc37-9463-4f17-9549-dd3cbc24f7e7",
                        "name": "Service requests raised through front-end devices"
                    }
                ]
            }
        }
    ]
}
List Tags
GET /tags

Retrieve a list of (active) tags based on search criteria (e.g. all organisation tags)

Request parameters

name
string optional

The name of the organisation tag

Example:
Bar & Grill
entity
string required

Filter based on entity

Enumeration:
ORGANISATIONS
industries
array of string optional

Defines which merchant tags belonging to industry should be retreived

Collection format: csv
industry_sectors
array of string optional

Defines which merchant tags belonging to industry sector should be retreived

Collection format: csv
sort
string optional

Defines on which attribute the results should be sorted

Allow empty value: true
Examples:
CREATED_DATEUPDATED_DATENAMEPOSTED_DATE
order
string optional

Defines how the results will be ordered

Allow empty value: true
Enumeration:
ASC
DESC
Default:
DESC
page
integer optional

The page number that should be retrieved

Default:
1
Example:
20
size
string optional

The size (total records) of each page

Default:
10
Example:
20

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 OK

The request has succeeded

Body
Object
content
Array
Object
id
string GUID

The tag identifier

Example:
3d370b10-b26c-86e8-ca6f-fa25b90a3b1e
name
string

The tag name

Example:
Restaurant
paging
Object

Information that can be used in order to display large pages

page
integer

The page number

Example:
2
size
integer

The number of records per page

Default:
10
Example:
20
total
integer

The total number of records. If “include_total” is not specified, then this total is null. If “include_total” is specified, total has a value but it is accurate up to 10K records.

Example:
1124
has_more
boolean

Shows if there are more records available to fetch

Example:
true
400 Bad Request

The input request was invalid or incorrect, often due to missing a required parameter

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

The API key or Token does not have permissions to perform the request

404 Not Found

The requested resource does not exist

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

502 Bad Gateway

The server received an invalid response from the upstream server it accessed in attempting to fulfill the request

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance

504 Gateway Timeout

The server did not receive a timely response from the upstream server

Example 1
GET https://sandbox.crm.com/self-service/v2/tags?entity=ORGANISATIONS HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "content": [
        {
            "id": "E4AC253114B84DF2B347996DC277DDDF",
            "name": "Restaurant"
        }
    ],
    "paging": {
        "page": 2,
        "size": 20,
        "total": 1124
    }
}