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
POST /approval_requests/{id}/actions
POST /approval_requests/accept
POST /approval_requests/reject
List Approval Requests
Approvals
GET /contacts/{id}/approval_requests

Retrieve all approval requests for a specific contact

Path variables

id
string GUID required

The contact (identifier) for which the related 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
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

Example:
1124
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/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
    }
}
Perform Approval Requests Actions
Approvals
POST /approval_requests/{id}/actions

Update an existing approval 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 required

Defines the action that will be applied on the approval request

Enumeration:
ACCEPT
REJECT

Responses

200 OK
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
POST https://sandbox.crm.com/self-service/v1/approval_requests/a6ecbc14-5622-0e30-b629-b1289963f7d2/actions HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "action": "REJECT"
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "a6ecbc14-5622-0e30-b629-b1289963f7d2"
}
Approve an Approval Request
Approvals
POST /approval_requests/accept

Accept a pending approval request

Request body

Object
token
string required

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

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

Responses

200 OK
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
POST https://sandbox.crm.com/self-service/v1/approval_requests/64a29ac3-48bb-7493-1e9d-45c1c3299a51/actions HTTP/1.1 

Content-Type: application/json

{
    "token": "367a4c39-d69a-a0e7-7b6f-4eccf65449a3",
    "response": "REJECT"
}

HTTP/1.1 200 OK 
Reject an Approval Request
Approvals
POST /approval_requests/reject

Reject a pending approval request

Request body

Object
token
string required

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

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

Responses

200 OK
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
POST https://sandbox.crm.com/self-service/v1/approval_requests/64a29ac3-48bb-7493-1e9d-45c1c3299a51/actions HTTP/1.1 

Content-Type: application/json

{
    "token": "367a4c39-d69a-a0e7-7b6f-4eccf65449a3",
    "response": "REJECT"
}

HTTP/1.1 200 OK 
Attachment Files & Media
Attachment Files
POST /upload/files
DELETE /files/{id}
GET /files/{id}
Upload File
Attachment Files & Media
POST /upload/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

200 OK

The response 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/v1/upload/files HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "file": "file object"
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "7279fecf-b0a6-0aab-6bcd-37881fe8c10e"
}
Delete File
Attachment Files & Media
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

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 https://sandbox.crm.com/self-service/v1/service_requests/6b888b83-b418-752f-604d-0653cf65885d/files/8dfc2223-edca-f05d-820b-dc96ba9df2c2 HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 
Get File
Attachment Files & Media
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 200

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/v1/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": "doc"
}
Authentication

Ability to authenticate customers via a Mobile App or a Portal

POST /contacts/authenticate
POST /contacts/{id}/wifi/authorization
POST /contacts/otp
POST /contacts/email_verification
POST /contacts/validate-otp
POST /contacts/refresh
POST /contacts/forgot_password
POST /contacts/change_password
POST /contacts/{id}/sign_out
GET /contacts/verify_email/{token}
Contact Authentication
POST /contacts/authenticate

Authenticate a contact and provide a token for subsequent API access

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_number
string required nullable

The contact’s phone number (applicable for PHONE providers)

Example:
22265566
country_code
string required nullable

The contact’s phone country code (applicable for PHONE providers)

Example:
CYP
application_id
string GUID nullable

The application identifier

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

Used when access token gets expired in order to refresh

exp
string epoch

The token expiration date

Example:
1572530655
contact
Object

Details about the authorised contact

id
string GUID

The cotnact’s unique identifier

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

The contact’s title

Example:
Mr
first_name
string

The contact’s first name

Example:
John
last_name
string

The contact’s last name

Example:
Doe
company_name
string

The contact’s company name

Example:
CRM
avatar
string

The contact’s avatar

Example:
avatar
is_verified
boolean

Defines whether the used identity is verified

Example:
false
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

Enumeration:
SERVICE_OWNER
ORGANISATION
name
string

The organisation name

Example:
CRMdotCOM
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

Auth using email and password

POST /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"
        }
    ]
}

Auth using MAC Address

POST https://sandbox.crm.com/self-service/v1/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"
        }
    ]
}

Auth using MW4

POST https://sandbox.crm.com/self-service/v1/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"
        }
    ]
}

Auth using phone

POST https://sandbox.crm.com/self-service/v1/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"
        }
    ]
}
Contact WiFi Authorization
POST /contacts/{id}/wifi/authorization

Authenticate a contact over to a WiFi platform

Path variables

id
string GUID required

The contact (identifier) that will be authenticated 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 authorised for

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

The site that the contact is authorised against

Example:
onwuq8y1

Responses

200 OK

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/v1/contacts/eab82829-b65e-ee5a-b0f8-33b8ad48e04e/wifi/authorization HTTP/1.1 

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

{
    "integration_id": "6b6d31e9-3603-36e1-be89-76c1e538644b",
    "mac_address": "01-23-45-67-89-AB",
    "estimation_id": "0ba7de75-8a68-c19a-3d3a-f4708723a1a4"
}

HTTP/1.1 200 OK 
Request One Time Password
POST /contacts/otp

Request a one time password for a specific contact. The request will identify the contact details and send an outbound validation number that can be used to verify the contact

Request headers

api_key
string required

The publishable api key for application identification

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

Request body

Object
send_method
string required

How to send the validation code

Enumeration:
EMAIL
SMS
credentials
Array required

Information on how the 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_details
Object

Additional gift pass information. Applicable if name = “GIFT_PASS”

email
string nullable

Email address which will receive the one-time-password, semi-optional - either email_address or phone_number must be provided

Example:
jonf.doe@gmail.com
phone
string nullable

Phone number which will receive the one-time-password, semi-optional - either email_address or phone_number must be provided

Example:
96453423
country_code
string

The phone number country code (required for phone_number)

Example:
CYP
pin
string nullable

The gift pass pin, semi-optional - either 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 send method value

Example:
+35799***834
auth_otp
string

The one time password auth id

Example:
731e4023-4c04-4278-8eb5-240651317e46
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/otp HTTP/1.1 

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

{
    "send_method": "SMS",
    "credentials": [
        {
            "name": "ID_NUMBER",
            "value": "1234567"
        }
    ]
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "obfuscated_value": "+35799***834",
    "auth_otp": "731e4023-4c04-4278-8eb5-240651317e46"
}
Request Email Verification
POST /contacts/email_verification

Request headers

api_key
string required

The publishable api key for application identification

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

Request body

Object
credentials
Array

Information on how the 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

value
string required

The value of the credential to check

Example:
sozosk@gmail.com

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

Validate One Time Password
POST /contacts/validate-otp

Verifies an one time password that was requested

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

Information on how the contact will be identified

Object
name
string required

Contact identification credentials

Enumeration:
AUTH_OTP

One Time Password Auth Id

EMAIL

The email address that was used to request the otp

PHONE

The phone number that was used to request the otp

ID_NUMBER

The contact’s id number that was used to request the otp

PASSPORT

The contact’s passport that was used to request the otp

BIRTHDATE

The contact’s birthdate that was used to request the otp

CARD

The contact’s card that was used to request the otp

LOYALTY_IDENTIFIER

The contact’s loyalty identifier that was used to request the otp

value
string required

The value of the credential to verify the contact’s authenticity

Example:
12345
code
string required

The OTP that should be used for verification purposes

Example:
123456789
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

Used when access token gets expired in order to refresh

exp
string epoch

The token expiration date

Example:
1572530655
contact
Object

Details about the authorised contact

id
string GUID

The cotnact’s unique identifier

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

The contact’s title

Example:
Mr
first_name
string

The contact’s first name

Example:
John
last_name
string

The contact’s last name

Example:
Doe
company_name
string

The contact’s company name

Example:
CRM
avatar
string

The contact’s avatar

Example:
avatar
is_verified
boolean

Defines whether the used identity is verified

Example:
false
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

Enumeration:
SERVICE_OWNER
ORGANISATION
name
string

The organisation name

Example:
CRMdotCOM
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/validate-otp HTTP/1.1 

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

{
    "credentials": [
        {
            "name": "AUTH_OTP",
            "value": "12345"
        }
    ],
    "code": "123456789"
}

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": "SUBSIDIARY",
            "name": "CRMdotCOM"
        }
    ]
}
Refresh Token
POST /contacts/refresh

Authenticate a contact and provide a token for subsequent API access

Request headers

Authorization
string required

Refresh Token supplied when authenticated

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

Used when access token gets expired in order to refresh

exp
string epoch

The token expiration date

Example:
1572530655
contact
Object

Details about the authorised contact

id
string GUID

The cotnact’s unique identifier

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

The contact’s title

Example:
Mr
first_name
string

The contact’s first name

Example:
John
last_name
string

The contact’s last name

Example:
Doe
company_name
string

The contact’s company name

Example:
CRM
avatar
string

The contact’s avatar

Example:
avatar
is_verified
boolean

Defines whether the used identity is verified

Example:
false
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

Enumeration:
SERVICE_OWNER
ORGANISATION
name
string

The organisation name

Example:
CRMdotCOM
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/refresh HTTP/1.1 

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

{
    "refresh_token": "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhMjc4ZDNlNS05YjhlLTQzNmUtOTIzMC03MGYzZTJkZjFjYTUiLCJleHAiOjE1Njg1NTQxMjJ9.LemqPPThkqfakkKS6CdkNvV1Lnc88CWirEpHOPnWjJPQz02zgkKSwfbvrEsl3OmR2LUhDILsOXf4x-GPFmNJCg"
}

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": "ORGANISATION",
            "org_relationship": "SUBSIDIARY",
            "name": "CRMdotCOM"
        }
    ]
}
Forgot Password
POST /contacts/forgot_password

Requests a password reset for an existing contact

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

Example:
johndoe@crm.com
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
POST /contacts/forgot_password HTTP/1.1 

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

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

HTTP/1.1 200 OK 
Change Forgotten Password
POST /contacts/change_password

Changes the password for a contact’s identity (EMAIL based)

Request body

Object
token
string required

The token that will verify that the client is trusted (required only if the identity is EMAIL based)

Example:
ABCTKN123456798VGP2020
password
string required

The new password

Example:
wsxcde421qadfg
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
POST /contacts/change_password HTTP/1.1 

Content-Type: application/json

{
    "token": "ABCTKN123456798VGP2020",
    "password": "wsxcde421qadfg"
}

HTTP/1.1 200 OK 
Sign Out Contact
POST /contacts/{id}/sign_out

Terminates the contact’ session and will no longer be able to access the client

Path variables

id
string GUID required

The contact (identifier) that will be signed out

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
POST /contacts/CAD1E31269B76D7A65ACCE45B2E68DFD/sign_out HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 
Verify Contact Email
GET /contacts/verify_email/{token}

Verify a contact’s email address username

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

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_email/ABCTKN123456798VGP2020 HTTP/1.1 

HTTP/1.1 200 OK 
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

Example:
1124
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

Example:
PDF
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:
INVOICE
id
string GUID required

The entity identifier

Example:
b97d4488-e9c1-a338-8420-b831147b648f

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/v1/printout HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "format": "PDF",
    "entity": {
        "type": "INVOICE",
        "id": "b97d4488-e9c1-a338-8420-b831147b648f"
    }
}

HTTP/1.1 201 Created 

Content-Type: application/json

{
    "id": "e1c67e12-6bae-53c7-f1a1-0a26aa4b27a2"
}
Contact

Contact Management

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

Create a new contact (of type person)

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 first name (required for EMAIL and PHONE providers)

Example:
John
last_name
string required nullable

The contact last name (required for EMAIL and PHONE providers)

Example:
Doe
identity
Object required

Details about the customer’s identity

provider
string

The contact’s identity provider

Enumeration:
EMAIL
FACEBOOK
GOOGLE
MW4

CRM.COM auth server

PHONE
username
string required nullable

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

Example:
johndoe@crm.com
password
string nullable

The contact’s password (applicable for EMAIL).

Example:
12345
validation_required
boolean required nullable

Defines whether the email requires verification (applicable when username and password are provided)

Example:
true
phone_number
string required nullable

The contact’s phone number (required for PHONE). OTP request is triggered.

Example:
2265577
country_code
string required nullable

The contact’s phone number country code (required for PHONE)

Example:
CYP
application_id
string required nullable

Application ID requesting register

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

The token taken from the oAUTH service provider (required for Facebook and Google)

Example:
YOJDAKEb9l1U0sUzrskM6X4emzrSeXqb
service_acceptance
boolean nullable

Defines whether the contact has accepted the client service

Default:
true
Example:
true
email_opt_out
boolean nullable

The contact setting for receiving emails

Default:
false
Example:
true
sms_opt_out
boolean nullable

The contact setting for receiving sms

Default:
false
Example:
true
consent_state
string nullable

The contact setting for consent

Enumeration:
PENDING
ACCEPTED
REJECTED
WITHDRAWN
referral_code
string nullable

The code that the contact was referred with in order to register

Example:
1234
country_agreement
string nullable

The country code that the contact agreed to register to

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 token that can be used in subsequent API calls

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

The token expiration date

Example:
1572530655
contact
Object

Details about the authorised contact

title
string

The contact’s title

Example:
Mr
first_name
string

The contact’s first name

Example:
John
last_name
string

The contact’s last name

Example:
Doe
avatar
string

The contact’s avatar

Example:
avatar
is_verified
boolean

Defines whether the used identity is 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
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
POST /contacts/register HTTP/1.1 

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

{
    "first_name": "John",
    "last_name": "Doe",
    "identity": {
        "provider": "EMAIL",
        "username": "johndoe@crm.com",
        "password": "12345",
        "validation_required": false
    },
    "service_acceptance": "true",
    "email_opt_out": "true",
    "sms_opt_out": "true"
}

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"
    }
}
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"
}

Contact registration including a pass code from a Landing page

POST https://sandbox.crm.com/self-service/v1/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": "2265577",
        "country_code": "CYP",
        "application_id": "3c33dcc6-3958-4e7d-ae0e-592948627711",
        "token": "YOJDAKEb9l1U0sUzrskM6X4emzrSeXqb"
    },
    "pass_code": "HHNSU32LNK"
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "access_token": "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhMjc4ZDNlNS05YjhlLTQzNmUtOTIzMC03MGYzZTJkZjFjYTUiLCJleHAiOjE1Njg1NTQxMjJ9.LemqPPThkqfakkKS6CdkNvV1Lnc88CWirEpHOPnWjJPQz02zgkKSwfbvrEsl3OmR2LUhDILsOXf4x-GPFmNJCg",
    "exp": "1572530655",
    "contact": {
        "first_name": "John",
        "last_name": "Doe",
     },
    "organisations": [
        {
            "external_id": "QWERTY12345671234567324ETFTGBY78",
            "org_type": "ORGANISATION",
            "org_relationship": "MERCHANT",
            "name": "CRMdotCOM"
        }
    ],
    "obfuscated_value": "+35799***834",
}
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/v1/contacts/e18ee2bc-c6f3-49e1-8e05-763386378017 HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 
Update Contact
PUT /contacts/{id}

Updates an existing contact

Path variables

id
string GUID required

The contact (identifier) that will be updated

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

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Request body

Object
company_name
string nullable

Company Name if the Contact represents a company, required attribute if the type is a Company.

Example:
Alpha Bravo
title
string nullable

The title of the contact. Applicable only if the type is PERSON

Example:
Sir
first_name
string nullable

The first name of the contact. Applicable and mandatory only if the type is PERSON

Example:
John
middle_name
string nullable

The middle name of the contact. Applicable and mandatory only if the type is PERSON

Example:
Alias
last_name
string nullable

The last name of the contact. Applicable and mandatory only if the type is PERSON

Example:
Doe
preferred_language_code
string nullable

The contact preferred language

Example:
ENG
category_id
string GUID

The contact’s category ID

Example:
4AD9C84FA60F9FE407140E20F707726A
statutory_number
string nullable

The contact statutory number

Example:
EF-12345
demographics
Object nullable

Information about the person demographics

gender
string nullable

The person gender

Enumeration:
MALE
FEMALE
passport
Object nullable

Information about the person passport

passport_number
string

The passport number

Example:
123456
issue_country_code
string

The country that issued the passport

Example:
CYP
expiration_date
integer epoch

The passport expiration date

Example:
129876567
id_details
Object nullable

Information about the person id

id_number
string

The id number

Example:
K123456
issue_country_code
string

The country that issued the id

Example:
CYP
expiration_date
integer epoch

The id expiration date

Example:
129876567
name_day
Object nullable

Information about the person nameday

month
integer required

The nameday month

Example:
10
day
integer required

The nameday day

Example:
4
date_of_birth
Object nullable

Information about the person birthdate

year
integer required

The birth year

Example:
2018
month
integer required

The birth month

Example:
10
day
string required

The birth day

Example:
16
company_profle
Object nullable

A company’s profile. Applicable only if contact_type is COMPANY

profile_year
integer epoch

The company’s profile year

Example:
129876567
annual_turnover
number

The annual turnover

Example:
1568.14
established_on
integer epoch

The date that the company was established on

Example:
129876567
number_of_employees
integer

The company’s number of employees

Example:
1
registration_number
string

The company registration number

Example:
123456
registration_country
string

The country that the company is registered to

Example:
CYP
tax_reference_number
string

The company tax reference number

Example:
123456
vat_registration_number
string

The company vat registration number

Example:
123456
industry_id
string GUID

The company’s Industry ID

Example:
4AD9C84FA60F9FE407140E20F707726A
industry_sectors
Array

The company’s Industry Sectors.

string GUID
Example:
4AD9C84FA60F9FE407140E20F707726A
email_address
string nullable

The contact’s email address

Example:
bill@gmail.com
sms_opt_out
boolean nullable

The contact setting for receiving sms

Example:
false
email_opt_out
boolean nullable

The contact setting for receiving email

Example:
false
is_tax_exempt
boolean nullable

Defiens whether the contact is tax exempt or not

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
avatar_url
string

Responses

200 OK

The request has succeeded

Body
Object
id
string GUID

The contact identifier

Example:
658AB90A6A77437091D158FD8E697B11
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/v1/contacts/CAD1E31269B76D7A65ACCE45B2E68DFD HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "company_name": "Alpha Bravo",
    "title": "Sir",
    "first_name": "John",
    "middle_name": "Alias",
    "last_name": "Doe",
    "preferred_language_code": "ENG",
    "category_id": "4AD9C84FA60F9FE407140E20F707726A",
    "statutory_number": "EF-12345",
    "demographics": {
        "gender": "MALE",
        "passport": {
            "passport_number": "123456",
            "issue_country_code": "CYP",
            "expiration_date": 129876567
        },
        "id_details": {
            "id_number": "K123456",
            "issue_country_code": "CYP",
            "expiration_date": 129876567
        },
        "name_day": {
            "month": 10,
            "day": 4
        },
        "date_of_birth": {
            "year": 2018,
            "month": 10,
            "day": "16"
        }
    },
    "company_profle": {
        "profile_year": 129876567,
        "annual_turnover": 1568.14,
        "established_on": 129876567,
        "number_of_employees": 1,
        "registration_number": "123456",
        "registration_country": "CYP",
        "tax_reference_number": "123456",
        "vat_registration_number": "123456",
        "industry_id": "4AD9C84FA60F9FE407140E20F707726A",
        "industry_sectors": [
            "4AD9C84FA60F9FE407140E20F707726A"
        ]
    },
    "email_address": "bill@gmail.com",
    "sms_opt_out": "false",
    "email_opt_out": "false",
    "is_tax_exempt": "false",
    "consent_state": "ACCEPTED"
}
PUT /contacts/{id}/consents

Updates the Consent state of the Contact

Path variables

id
string GUID required

The contact identifier that will be updated

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Request body

Object
consent_state
string required

The contact setting for consent

Enumeration:
PENDING
ACCEPTED
REJECTED
WITHDRAWN

Responses

200 OK

The request has succeeded

Body
Object
id
string GUID

The contact identifier

Example:
658AB90A6A77437091D158FD8E697B11
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/v1/contacts/CAD1E31269B76D7A65ACCE45B2E68DFD/consents HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "consent_state": "ACCEPTED"
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "658AB90A6A77437091D158FD8E697B11"
}
Get Contact
GET /contacts/{id}

Retrieve basic details for a specific contact

Path variables

id
string GUID required

The contact identifier that should be returned

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD

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:
CAD1E31269B76D7A65ACCE45B2E68DFD
code
string

The contact code

Example:
ABC-123
type
string

Tje contact type

Enumeration:
PERSON
COMPANY
title
string

The contact title

Example:
Sir
first_name
string

The contact first name

Example:
John
middle_name
string

The contact middle name

Example:
Alias
last_name
string

The contact last name

Example:
Doe
preferred_language_code
string

The contact preferred language

Example:
ENG
avatar_url
string

The contact URL of Avatar

email
string

The contact email address

Example:
jon@crm.com
referral_code
string

The contact referral code

Example:
REF123
loyalty_identifier
Array

The contact loyalty identifiers

Object
identifier
string

The contact loyalty identifier

Example:
123423435434534534543
sms_opt_out
boolean

The contact setting for receiving sms

Example:
false
email_opt_out
boolean

The contact setting for receiving email

Example:
true
consent_state
string

The contact setting for consent

Enumeration:
PENDING
ACCEPTED
REJECTED
WITHDRAWN
country_agreement
string

The country code on which the contact agreed to register to

Example:
CYP
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/v1/contacts/CAD1E31269B76D7A65ACCE45B2E68DFD HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "CAD1E31269B76D7A65ACCE45B2E68DFD",
    "code": "ABC-123",
    "type": "PERSON",
    "title": "Sir",
    "first_name": "John",
    "middle_name": "Alias",
    "last_name": "Doe",
    "preferred_language_code": "ENG",
    "avatar_url": "",
    "email": "jon@crm.com",
    "referral_code": "REF123",
    "loyalty_identifier": [
        {
            "identifier": "123423435434534534543"
        }
    ],
    "sms_opt_out": "false",
    "email_opt_out": "true",
    "consent_state": "PENDING",
    "country_agreement": "CYP",
    "custom_fields": [
        {
            "key": "custom_key",
            "value": "0001-345"
        }
    ]
}
Get Contact Demographics
GET /contacts/{id}/demographics

Retrieves the demographics of a single contact

Path variables

id
string required

The unique ID for which the demographics will be returned

Responses

200 OK
Body
Object
gender
string

The person gender

Enumeration:
MALE
FEMALE
passport
Object

Contact Password Details

number
string

The passport number

Example:
K123456
issue_country_code
string

The country that issued the passport

Example:
CYP
expiration_date
integer epoch

The expiration date of the contact passport

Example:
129876567
id_details
Object

Contact Identity Details

number
string

The number of the contact id

Example:
123456
issue_country_code
string

The country that issued that contact id

Example:
CYP
expiration_date
integer epoch

The expiration date of the contact id

Example:
129876567
name_day
Object

Contact Nameday Details

month
integer

The month of the contact nameday

Example:
10
day
integer

The day of the contact nameday

Example:
4
date_of_birth
Object

Contact Birthdate Details

year
integer

The year of the contact birthdate

Example:
1990
month
integer

The month of the contact birthdate

Example:
10
day
integer

The day of the contact birthdate

Example:
16
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/{id}/demographics HTTP/1.1 

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "gender": "FEMALE",
    "passport": {
        "number": "K123456",
        "issue_country_code": "CYP",
        "expiration_date": 129876567
    },
    "id_details": {
        "number": "123456",
        "issue_country_code": "CYP",
        "expiration_date": 129876567
    },
    "name_day": {
        "month": 10,
        "day": 4
    },
    "date_of_birth": {
        "year": 1990,
        "month": 10,
        "day": 16
    }
}
Add Contact Preferred Organisation
POST /contacts/{id}/preferences

Sets contact’s preferred organisation

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:
49144508-5520-48e7-8e64-6a1907afbb26
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 Organisation
GET /contacts/{id}/preferences

Retrieves contact’s preferred organisation

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
Object
type
string
Enumeration:
ORDERS
REWARDS
id
string GUID

The organisation identifier

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

The organisation name

Example:
Big Boy 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:
CA123456789AQWSXZAQWS1236547896541
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

Information about the 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"
                        }
                    ]
                }
            ]
        }
    ]
}
Addresses
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 contact identifier for which an address will be added

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD

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 to allow it to be easily recognised in a list

address_line_1
string required

The address line 1

Example:
Elia Papakyriakou
address_line_2
string nullable

The address line 2

Example:
Tower Star
state_province_county
string nullable

The address county

Example:
Egkomi
town_city
string nullable

The address city

Example:
Nicosia
postal_code
string nullable

The address postal code

Example:
2000
country_code
string required

The address country identifier

Example:
CY
is_primary
boolean nullable

Defines whether the address is the primary one

Example:
true
lat
number nullable

The address geolocation latitude

Example:
12.212
lon
number nullable

The address geolocation longtitude

Example:
12.234
google_place_id
string nullable

The Google textual identifier that uniquely identifies an address

Example:
234242423424
care_of
string nullable

The address care of

Responses

200 OK

The request has succeeded

Body
Object
id
string GUID

The address 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/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 an existing address of a contact

Path variables

id
string GUID required

The contact identifier for which an address should be updated

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
address_id
string GUID required

The address identifier that should be updated

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Request body

Object
address_name
string nullable

A short name to allow it to be easily recognised in a list

address_line_1
string nullable

The address line 1

Example:
Elia Papakyriakou
address_line_2
string nullable

The address line 2

Example:
Tower Star
state_province_county
string nullable

The address county

Example:
Egkomi
town_city
string nullable

The address city

Example:
Nicosia
postal_code
string nullable

The address postal code

Example:
2000
country_code
string nullable

The address country identifier

Example:
CY
care_of
string nullable

The address care of

is_primary
boolean nullable

Defines whether the address is the primary one

Example:
true
lat
number nullable

The latitude of the address

Example:
12.456
lon
number nullable

The longitude of the addrsss

Example:
11.231
google_place_id
string nullable

The Google textual identifier that uniquely identifies an address

Example:
12312424324

Responses

200 OK

The request has succeeded

Body
Object
id
string GUID

The address 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/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"
}
Remove 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) from which the address will be removed

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
address_id
string GUID required

The address identifier that should be removed

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

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 the addresses of a specific contact

Path variables

id
string GUID required

The contact identifier for which his/her addresses 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 address identifier

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
address_type
string

The address type

Enumeration:
HOME
BUSINESS
address_name
string

A short name to allow it to be easily recognised in a list

Example:
My Home
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
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"
        }
    ]
}
Applications Usage
CONTACT DEVICES

A new sets of APIs (Contact Devices) are designed to cover applications usage. Please note that (Contact Application Usage) APIs are still operational and can be used for self-service integrations.

POST /contacts/{id}/applications
Add Application Usage
POST /contacts/{id}/applications

Add application usage to a contact

Path variables

id
string GUID required

The contact (identifier) where application usage will be set

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Request body

Object
application_id
string GUID required

The application identifier that usage will be set

Example:
d9acc889-098f-7811-b5fb-bb06dd87f8cd
platform
string required

The platform on which the application is downloaded and used

Enumeration:
IOS
ANDROID
BROWSER
OTHER

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
POST https://sandbox.crm.com/self-service/v1/contacts/CAD1E31269B76D7A65ACCE45B2E68DFD/applications HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "application_id": "00000000-000000000000000"
}

HTTP/1.1 200 OK 
Attachments
POST /contacts/{id}/files
DELETE /contacts/{id}/files/{file_id}
GET /contacts/{id}/files
Add Contact Attachment
POST /contacts/{id}/files

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 service request attachment identifier 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/v1/service_requests/6b888b83-b418-752f-604d-0653cf65885d/files 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}/files/{file_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
file_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/v1/contacts/6b888b83-b418-752f-604d-0653cf65885d/files/8dfc2223-edca-f05d-820b-dc96ba9df2c2 HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A

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

Retrieve all attachment files for a specific contact

Path variables

id
string GUID required

The contact (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

Details about attachment associated with an entity

id
string GUID

The attachment identifier

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

Information about the creative type

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

The attachement description

Example:
see attached file for more details
file
Object

The attachment file details

id
string GUID

The file identifier

Example:
0317868f-28f8-9f56-d248-5a78718b38cc
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

Example:
1124
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/6b888b83-b418-752f-604d-0653cf65885d/files HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "content": [
        {
            "id": "af748ada-0521-0503-fc25-b67635a7d14d",
            "mime": "png",
            "description": "Image 1",
            "file": {
                "id": "0317868f-28f8-9f56-d248-5a78718b38cc",
                "name": "image1.png"
            }
        }
    ],
    "paging": {
        "page": 2,
        "size": 20,
        "total": 1124
    }
}
Cards
Devices
CONTACT DEVICES

The (Contact Devices) APIs are updated to cover a significant number of use cases where devices can be associated with a contact. For backwards compatibility, the attribute ‘registration_type’ (including its enum values) is still operational, but on the new design is listed as ‘platform’.

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:
IOS
ANDROID
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:
37541738-3ae2-cf09-be1e-07bb027e96ba

Responses

200 OK

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/v1/contacts/cb4e9a83-9ad6-a837-238b-0238d0fa1236/devices HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "mac_address": "00-D0-56-F2-B5-12"
}

HTTP/1.1 200 OK 

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:
da25d2f1-2ec4-23ec-b6e4-0a3c78721923

Request parameters

search_value
string optional

Search for devices using their serial number or electronic ID

serial_number
string optional

Filter based on serial number

Example:
serial001
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:
IOS
ANDROID
MOBILE
BROWSER
OTHER
serial_number
string

The device 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

Example:
1124
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/da25d2f1-2ec4-23ec-b6e4-0a3c78721923/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": "MOBILE",
            "serial_number": "2049-3630",
            "electronic_id": "I243WER",
            "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"
                }
            ]
        }
    ],
    "paging": {
        "page": 2,
        "size": 20,
        "total": 1124
    }
}
Organisation Operations
POST /contacts/{id}/organisations
GET /contacts/{id}/organisations
Sign up/out Organisation
POST /contacts/{id}/organisations

Contact joins an existing organisation

Path variables

id
string GUID required

The contact (registry) (identifier) that will sign up/out to/from an organisation

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

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Request body

Object
action
string required

The action that should be applied on the organisation

Enumeration:
SIGNUP
SIGNOFF
organisation_id
string GUID required

The organisation identifier that the action will be applied

Example:
9086dd6b-2b9f-4fba-85ff-1b89143a56da
service_acceptance
boolean nullable

Defines whether the contact has accepted the client service (applicable only if action = SIGNUP)

Default:
true
Example:
true
email_opt_out
boolean nullable

The contact setting for receiving emails (applicable only if action = SIGNUP)

Default:
false
Example:
true
sms_opt_out
boolean nullable

The contact setting for receiving sms (applicable only if action = SIGNUP)

Default:
false
Example:
true
consent_state
string nullable

The contact setting for consent

Enumeration:
PENDING
ACCEPTED
REJECTED
WITHDRAWN
referral_code
string nullable

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

Example:
1234
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 organisations that the contact is signed up to

Path variables

id
string GUID required

The contact (registry) (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
Object
id
string GUID

The organisation identifier

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

The organisation name

Example:
BrewCoffee
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:
CA123456789AQWSXZAQWS1236547896541
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

Information about the 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

Wallet id

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

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

Example:
1124
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/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": "CA123456789AQWSXZAQWS1236547896541",
                    "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"
                        }
                    ]
                }
            ],
            "wallet": {
                "wallet_id": "038af54e-282c-40ad-ae5d-cc74f2c80f40",
                "balance": 9.99,
                "currency_code": "EUR"
            }
        }
    ],
    "paging": {
        "page": 2,
        "size": 20,
        "total": 1124
    }
}
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 Methods
POST /contacts/{id}/payment_methods

Add a new payment method for a contact supports Card, Account Debits and Wallet payment methods

Path variables

id
string GUID required

The contact identifier for which a payment method will be added

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD

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 that provides a small description for the payment method. In case of Wallet payment method types, use the Payment Gateway’s name

Example:
PayPal
payment_method_type
string required

The payment method that will be related with the account

Enumeration:
CARD
WALLET
ACCOUNT_DEBIT
ELECTRONIC_TRANSFER
is_primary
boolean nullable

Marks the payment method as the contact’s primary one

Example:
true
is_backup
boolean nullable

Marks the payment method as the backup

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
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
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 contact’s payment method 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 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": "CARD",
    "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": "CRM_WALLET",
                "integration_id": "",
                "token": ""
            }
        ]
    },
    "wallet": {
        "phone_details": {
            "name": "Primary phone",
            "country_code": "00357",
            "number": "91000000",
            "msisdn": "35791000000"
        },
        "email": "",
        "gateway_token": [
            {
                "gateway": "CRM_WALLET",
                "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": "BUINESS_CHECKING",
        "mandate": {
            "refernece": "",
            "sign_date": 1,
            "type": "ONEOFF"
        },
        "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": "SETTLE",
                "integration_id": "",
                "token": ""
            }
        ]
    }
}
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 paymeny method will be updated

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
payment_method_id
string GUID required

The payment method identifier that will be updated

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Request body

Object
name
string nullable
is_primary
boolean nullable

Marks the payment method as the contact’s primary one

Example:
true
is_backup
boolean nullable

Marks the payment method as the backup

Example:
false
notes
string nullable

The payment method notes

Example:
Lorem Ipsum
card
Object

Applicable only when updating a payment method of type Card

exp_month
string

Expiration month

Example:
12
exp_year
string

Expiration year

Example:
25
account_debit
Object

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
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
Examples

Responses

200 OK

The request has succeeded

Body
Object
id
string GUID

The payment method 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/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",
    "card": {
        "exp_month": "12",
        "exp_year": "25"
    },
    "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
        }
    }
}

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 from a specific contact

Path variables

id
string GUID required

The contact identifier whose payment method will be removed

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
payment_method_id
string GUID required

The payment method identifier that will be removed

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/payment_methods/CAD1E31269B76D7A65ACCE45B2E68DFD HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A

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

List of Payment methods allocated to contact.

Path variables

id
string GUID required

The contact identifier whose payment methods will be retrieved

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD

Request parameters

type
string optional

Filters the contact’s payment methods

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:
CAD1E31269B76D7A65ACCE45B2E68DFD
name
string
payment_method_type
string
Enumeration:
CARD
ACCOUNT_DEBIT
WALLET
ELECTRONIC_TRANSFER
Default:
CARD
Example:
CARD
is_primary
boolean

Indicates which payment mehod is the contact’s primary one

Example:
true
is_backup
boolean

Indicates which payment mehod is the contact’s backup one

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
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

Example:
1124
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
    }
}
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"
        }
    ]
}
Tokens
POST /contacts/{id}/tokens
GET /contacts/{id}/tokens
Request Contact Token
POST /contacts/{id}/tokens

Request a contact token

Path variables

id
string GUID required

The contact (identifier) that a token will be created

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, all amount can be spend (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 contact (identifier) 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. If not specified, all amount can be spend (applicable if intent = SPEND)

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
        }
    ]
}
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:
314de1cf-35ad-bf93-71f7-a3dbbf48f3f8

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:
1
to_month
integer required

Statement period ending month

Example:
12
from_year
integer required

Statement period starting year

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:
ed27a6c8-0ce8-9a06-a205-fe5a40951821
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/v1/contacts/314de1cf-35ad-bf93-71f7-a3dbbf48f3f8/export_statement HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

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

HTTP/1.1 201 Created 

Content-Type: application/json

{
    "id": "ed27a6c8-0ce8-9a06-a205-fe5a40951821"
}
Identities
POST /contacts/{id}/credentials
POST /contacts/{id}/identities/{identity_id}/change_username
PUT /contacts/{id}/identities/{identity_id}/change_username
POST /contacts/{id}/change_password
GET /contacts/{id}/identities
Add Contact Identity
POST /contacts/{id}/credentials

Create a set of credentials for an existing contact

Path variables

id
string GUID required

The contact (identifier) that should be updated

Example:
ff208644-385a-ea2e-f21d-2ee54a9f379b

Request headers

Authorization
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Request body

Object
identity
Object

Details about the contact’s identity

provider
string required

The contact’s identity provider

Enumeration:
EMAIL
FACEBOOK
GOOGLE
MW4

CRM.COM auth server

PHONE
username
string required nullable

The contact’s username (required for EMAIL)

Example:
johndoe@crm.com
password
string required nullable

The contact’s password (required for EMAIL)

Example:
password1234
phone_number
string required nullable

The contact’s phone number (required for PHONE)

Example:
96303540
validation_required
boolean required nullable

Defines whether the username or phone_number should be verified (required for EMAIL and PHONE)

Example:
true
country_code
string required nullable

The contact’s phone number country code (required for PHONE)

Example:
CYP
token
string required nullable

The token taken from the oAUTH service provider (required for Facebook and Google)

Example:
YOJDAKEb9l1U0sUzrskM6X4emzrSeXqb

Responses

200 OK

The request has succeeded

Body
Object
id
string GUID

The contact 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
Example 2
POST https://sandbox.crm.com/self-service/v1/contacts/CAD1E31269B76D7A65ACCE45B2E68DFD/credentials HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "identity": {
        "provider": "EMAIL",
        "username": "johndoe@crm.com",
        "password": "password1234",
        "validation_required": "true",
        "phone_number": "96303540",
        "country_code": "CYP",
        "token": "YOJDAKEb9l1U0sUzrskM6X4emzrSeXqb"
    }
}

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": "SUBSIDIARY",
            "name": "CRMdotCOM"
        }
    ]
}
POST https://sandbox.crm.com/self-service/v1/contacts/CAD1E31269B76D7A65ACCE45B2E68DFD/credentials HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "identity": {
        "provider": "PHONE",
        "phone_number": "96303540",
        "country_code": "CYP"
    }
}

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": "SUBSIDIARY",
            "name": "CRMdotCOM"
        }
    ]
}
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) for which a username change request has been made

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/v1/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) whose username will be changed

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/v1/contacts/ec23261f-cde9-0671-ec41-6db9acf4d9c5/change_username HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "username": {
        "email": "j_doe@crm.com"
    },
    "password": "123456"
}

HTTP/1.1 204 OK 
Change Password
POST /contacts/{id}/change_password

Changes the password for a contact’s identity

Path variables

id
string GUID required

The contact (identifier) whose password will be changed

Example:
0980af1d-3c24-6379-9eb9-a40e3a3f5208

Request headers

Authorization
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Request body

Object
password
string required

The new password

Example:
wsxcde421qadfg
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
POST /contacts/0980af1d-3c24-6379-9eb9-a40e3a3f5208/change_password HTTP/1.1 

Content-Type: application/json
Authorization: 4AD9C84FA60F9FE407140E20F707726A

{
    "password": "wsxcde421qadfg"
}

HTTP/1.1 200 OK 
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
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
type
string

The contact identity type

Enumeration:
EMAIL_PASSWORD
EMAIL_OTP
PHONE_OTP
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

Example:
1124
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/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",
            "email": "johndoe@crm.com",
            "type": "EMAIL_OTP"
        }
    ],
    "paging": {
        "page": 2,
        "size": 20,
        "total": 1124
    }
}
Contact Account Operations
POST /contacts/{id}/accounts
PUT /accounts/{id}
PUT /accounts/{id}/rewards
GET /contacts/{id}/accounts
GET /accounts/{id}/financials
GET /accounts/{id}/rewards
GET /accounts/{id}/journals
GET /journals/{id}
Add Account for Contact
POST /contacts/{id}/accounts

Add a new customer account to an existing contact

Path variables

id
string GUID required

The contact identifier for which a new account will be added

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Request body

Object
name
string nullable

The account name

Example:
John Doe AR001
currency_code
string nullable

The account’s currency

Default:
Auto-set by the system (based on business rules)
Example:
EUR
is_primary
boolean nullable

If set to true, then the account will be set as the primary one even if a different one exists

Example:
false
billing_address_id
string GUID nullable

The unique identification of a contact address which will be set as the billing address of the account. By default, the primary addres (if exists) will be provided

Example:
4AD9C84FA60F9FE407140E20F707726A
classification_id
string GUID nullable

The account’s classification identifier

Example:
4AD9C84FA60F9FE407140E20F707726A
Examples

Responses

200 OK

The response succeeded

Body
Object
id
string GUID

The account 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/accounts HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "currency_code": "EUR",
    "is_primary": "false",
    "billing_address_id": "4AD9C84FA60F9FE407140E20F707726A",
    "classification_id": "4AD9C84FA60F9FE407140E20F707726A"
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "CAD1E31269B76D7A65ACCE45B2E68DFD"
}
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:
CAD1E31269B76D7A65ACCE45B2E68DFD

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Request body

Object
classification_id
string GUID nullable

The account’s classification ID

Example:
4AD9C84FA60F9FE407140E20F707726A
is_primary
boolean nullable

If set to true, then the account will be set as the primary one even if a different one exists

Example:
true
billing_address_id
string GUID nullable

The unique identification of a contact address which will be set as the billing address of the account. By default, the primary addres (if exists) will be provided

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 OK

The response succeeded

Body
Object
id
string GUID

The account 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/accounts/CAD1E31269B76D7A65ACCE45B2E68DFD HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "classification_id": "4AD9C84FA60F9FE407140E20F707726A",
    "is_primary": "true",
    "billing_address_id": "4AD9C84FA60F9FE407140E20F707726A",
    "credit_limit": 200
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "CAD1E31269B76D7A65ACCE45B2E68DFD"
}
Update Account Rewards
PUT /accounts/{id}/rewards

Update the reward details for an existing contact’s account. Only primary accounts hold rewards information.

Path variables

id
string GUID required

The account (identifier) whose reward information will be updated

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD

Notes

AUTOMATIC SPEND PREFERENCES

Next Purchase Spend
On the next purchase at the selected merchant/service provider, a customer will spend automatically the maximum available wallet balance. Once the spend is made, the automatic spend preferences for the contact will be disabled.

Automatic Spend on Any Purchase
On each purchase at any merchant/service provider, a customer will spend automatically the maximum available wallet balance. Each customer has the option to select though specific merchants/service providers that auto spend will be applied.

MANAGE AUTO-SPEND MERCHANTS FLOW

Adding merchant(s) to auto spend preferences, the following APIs should be called

  1. GET /merchants for retrieving applicable merchants
  2. POST /accounts/{id}/merchants for selecting the merchant(s)

Removing merchants/service providers from auto spend preferences, the following APIs should be called

  1. GET /accounts/{id}/merchants for retrieving the merchants that auto spend is enabled
  2. DELETE /accounts/{id}/merchants/{organisation_id} for selecting the merchant(s) to be removed

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Request body

Object
account_status
string required

The account status

Enumeration:
ACTIVE
SUSPENDED
TERMINATED
automatic_spend_settings
Object nullable

Information about the automatic spend preferences

enable_automatic_spend
boolean required nullable

Defines whether automatic spends will be enabled or not

Default:
false
Example:
true
automatic_spend_preference
string required

Defines whether automatic spends will occur on the next purchase of a specific merchant or based on wallet balance and purchase amount to a group of merchants

Enumeration:
NEXT_MERCHANT_PURCHASE
ALL_MERCHANT_PURCHASE
minimum_wallet_balance
number nullable

The minimum wallet balance amount that should be available for the spend to be performed. Applicable when automatic spend preference is for all merchant purchases

Default:
1
Example:
5.21
from_purchase_amount
number nullable

The min amount (inclusive) that the purchase customer event total amount should be in order for the automatic spend to be applied. Applicable when automatic spend preference is for all merchant purchases

Default:
1
Example:
5.42
Examples

Responses

200 OK

The response succeeded

Body
Object
id
string GUID

The account 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
Example 2
PUT /accounts/CAD1E31269B76D7A65ACCE45B2E68DFD HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "account_status": "TERMINATED",
    "spend_preferences": {
        "enable_automatic_spend": "true",
        "minimum_wallet_balance": 5.21,
        "minimum_spend_amount": 5.42,
        "maximum_spend_amount": 12.24
    },
    "peferred_pament_method_id": "33434FDA22100"
}
PUT https://sandbox.crm.com/self-service/v1/accounts/CAD1E31269B76D7A65ACCE45B2E68DFD/rewards HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "automatic_spend_settings": {
        "enable_automatic_spend": "true",
        "automatic_spend_preference": "ALL_MERCHANT_PURCHASE",
        "minimum_wallet_balance": 5.21,
        "from_purchase_amount": 5.42
    }
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "CAD1E31269B76D7A65ACCE45B2E68DFD"
}
List Contact Accounts
GET /contacts/{id}/accounts

Get a list of Contact Accounts. Normally a contact will have a single account but multiple accounts can be used to service different currencies, or different spending profiles.

Path variables

id
string GUID required

The contact identifier whose accounts will be retrieved

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD

Request parameters

is_primary
string optional

If set to true, then only the primary account of the contact will get retrieved

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
accounts
Array
Object
id
string GUID

The account identifier

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
is_primary
boolean

Indicates the primary account of the contact

Example:
true
name
string

The account name

Example:
ACR123456-JohnDoe
number
string

The account name

Example:
AC123456
life_cycle _state
string

The account status

Enumeration:
ACTIVE
SUSPENDED
TERMINATED
currency_code
string

The account’s currency

Example:
EUR
balance
number

The account’s running balance

Example:
47.13
overdue_amount
number

The account’s overdue amount, i.e. invoice due date exceeded

Example:
10.59
classification
Object

Details about the related classification

id
string GUID

The classification identifier

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
name
string

The classification name

Example:
VIP
billing_address
Object
id
string GUID

The address identifier

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
address_type
string

The address type

Enumeration:
HOME
BUSINESS
address_name
string

A short name to allow it to be easily recognised in a list

Example:
My Home
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
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

Example:
1124
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/accounts HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "content": [
        {
            "accounts": [
                {
                    "id": "CAD1E31269B76D7A65ACCE45B2E68DFD",
                    "is_primary": true,
                    "name": "ACR123456-JohnDoe",
                    "number": "AC123456",
                    "life_cycle _state": "TERMINATED",
                    "currency_code": "EUR",
                    "balance": 47.13,
                    "overdue_amount": 10.59,
                    "classification": {
                        "id": "CAD1E31269B76D7A65ACCE45B2E68DFD",
                        "name": "VIP"
                    },
                    "billing_address": {
                        "id": "CAD1E31269B76D7A65ACCE45B2E68DFD",
                        "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"
                    }
                }
            ]
        }
    ],
    "paging": {
        "page": 2,
        "size": 20,
        "total": 1124
    }
}
Get Account Financials
GET /accounts/{id}/financials

Get a single Account with its financial information

Path variables

id
string GUID required

The unique identification of the Account to be retrieved.

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD

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

Defines whether the account is the primary one of the contact

Example:
true
life_cycle_state
string

The account status

Enumeration:
ACTIVE
SUSPENDED
TERMINATED
currency_code
string

The account’s currency (3 code currency)

Example:
EUR
balance
number

The account’s calculated balance

Example:
1.21
overdue_amount
number

The unpaid amount that is passed its due date

Example:
100.5
credit_limit
number

The account’s credit limit

Example:
100
accounting_period
Object

The accounting period of the latest accounting period for which the account’s openning balance was caluclated

id
string

The unique identifier of the accounting period

name
string

The name of the accounting period

opening_balance
number

The opening balance brought forwards after the latest closed accounting period

Example:
100.5
classification
Object

Details about the related classification

id
string GUID

The classification identifier

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
name
string

The classification name

Example:
VIP
billing_address
Object
id
string GUID

The address identifier

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
address_type
string

The address type

Enumeration:
HOME
BUSINESS
address_name
string

A short name to allow it to be easily recognised in a list

Example:
My Home
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
payment_terms
Object

The account’s Payment Terms

id
string

Payment terms identifier

Example:
4AD9C84FA60F9FE407140E20F707726A
name
string

Payment terms name

Example:
Net 7
wallet
Object

The Wallet related to the Account

id
string

The Wallet identifier

Example:
4AD9C84FA60F9FE407140E20F707726A
code
string

A unique 16-digit code that if not provided, it is auto-generated

Example:
6766690009889435
balance
number

Wallet total balance

Example:
9.99
open_balance
number

The commerce balance of the wallet

Example:
5.45
commerce_balance
number
Example:
4.54
life_cycle_state
string

The wallet’s life cycle state

Enumeration:
EFFECTIVE
CANCELLED
minimum_balance
number

The minimum wallet balance threshold. If not provided, the global rules apply

Example:
9.99
limit_rules
Array

Defines the limit rules applied on specific wallet. If not provided, the global rules apply

Object
limit_amount
number

The maximum amount allowed

Example:
9.99
transaction_type
string

The wallet transaction type for which the limit is applied

Enumeration:
CREDIT
DEBIT
Example:
DEBIT
period
string

The period for which the limit is applied

Enumeration:
DAILY
MONTHLY
ANNUAL
Example:
MONTHLY
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/accounts/CAD1E31269B76D7A65ACCE45B2E68DFD/financials HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "name": "John Smith AC00123456",
    "number": "AC00123456",
    "is_primary": "true",
    "life_cycle_state": "ACTIVE",
    "currency_code": "EUR",
    "balance": 1.21,
    "overdue_amount": 100.5,
    "credit_limit": 100,
    "accounting_period": {
        "id": "",
        "name": ""
    },
    "opening_balance": 100.5,
    "classification": {
        "id": "CAD1E31269B76D7A65ACCE45B2E68DFD",
        "name": "VIP"
    },
    "billing_address": {
        "id": "CAD1E31269B76D7A65ACCE45B2E68DFD",
        "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"
    },
    "payment_terms": {
        "id": "4AD9C84FA60F9FE407140E20F707726A",
        "name": "Net 7"
    },
    "wallet": {
        "id": "4AD9C84FA60F9FE407140E20F707726A",
        "code": "6766690009889435",
        "balance": 9.99,
        "open_balance": 5.45,
        "commerce_balance": 4.54,
        "life_cycle_state": "CANCELLED",
        "minimum_balance": 9.99,
        "limit_rules": [
            {
                "limit_amount": 9.99,
                "transaction_type": "DEBIT",
                "period": "MONTHLY"
            }
        ]
    }
}
Get Account Rewards
GET /accounts/{id}/rewards

Retrieve the reward details for an existing contact’s account. Only primary accounts hold rewards information.

Path variables

id
string GUID required

The account (identifier) whose rewards information should be retrieved

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD

Notes

AUTOMATIC SPEND PREFERENCES

Next Purchase Spend
On the next purchase at the selected merchant/service provider, a customer will spend automatically the maximum available wallet balance. Once the spend is made, the automatic spend preferences for the contact will be disabled.

Automatic Spend on Any Purchase
On each purchase at any merchant/service provider, a customer will spend automatically the maximum available wallet balance. Each customer has the option to select though specific merchants/service providers that auto spend will be applied.

Request parameters

include_rewards
string optional

If defined then information about the total rewards

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
id
string GUID

The account identifier

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
name
string

The account name

Example:
John Smith AC00123456
number
string

The account number

Example:
ACR001
currency_code
string

The account currency

Example:
EUR
signed_up_on
integer epoch

The date when the account was signed up for the first time

Example:
1583846865
spending_blocked_status
boolean

Defines whether the account can spend or not

Example:
false
automatic_spend_settings
Object

Information about the automatic spend settings for the account

enable_automatic_spend
boolean

Defines whether automatic spend is enabled for the account

Example:
true
automatic_spend_preference
string

Defines whether automatic spends will occur on the next purchase of a specific merchant or based on wallet balance and purchase amount to a group of merchants

Enumeration:
NEXT_MERCHANT_PURCHASE
ALL_MERCHANT_PURCHASE
minimum_wallet_balance
number

The minimum wallet balance amount that should be available for the spend to be performed. Applicable when automatic spend preference is for all merchant purchases

Example:
1.87
from_purchase_amount
number

The min amount (inclusive) that the purchase customer event total amount should be in order for the automatic spend to be applied. Applicable when automatic spend preference is for all merchant purchases

Example:
23.98
reward_tier
Object

Information about the account’s reward tier

id
string GUID

The tier identifier

Example:
6883441e-194a-b92b-c6c0-2f0e869e4c65
name
string

The reward tier name

Example:
Red
color
string

The tier (marketing) color

Example:
#d4af37
achieved_date
integer epoch

The date that the current tier was reached

Example:
1615996441
period_value_units
number

Points collected during the period

Example:
2000
lifetime_value_units
number

Total Lifetime Points

Example:
12543
maintain_tier
Object

Details on how to maintain the current tier

points_needed
number

The number of points needed to maintain current tier

Example:
200
collected_by
integer epoch

The date up to which points 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

Points 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
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:
CA123456789AQWSXZAQWS1236547896541
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

Information about the 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
joined_reward_schemes
Array

Information about the reward schemes that the account has signed up to

Object
id
string GUID

The reward scheme identifier

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
name
string

The reward scheme name

Example:
CRMdotCOM Scheme
signed_up_on
integer epoch

The date when the account 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
rewards
Object

Rewards details. Available when the include_rewards is enabled

total_awards
string

The total awards of the account

Example:
123.23
total_spends
string

The total spends of the account

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/v1/accounts/CAD1E31269B76D7A65ACCE45B2E68DFD/rewards HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "CAD1E31269B76D7A65ACCE45B2E68DFD",
    "name": "John Smith AC00123456",
    "number": "ACR001",
    "currency_code": "EUR",
    "signed_up_on": 1583846865,
    "spending_blocked_status": "false",
    "automatic_spend_settings": {
        "enable_automatic_spend": "true",
        "automatic_spend_preference": "NEXT_MERCHANT_PURCHASE",
        "minimum_wallet_balance": 1.87,
        "from_purchase_amount": 23.98
    },
    "reward_tier": {
        "id": "",
        "name": "Red",
        "achieved_date": 1,
        "period_value_units": 2000,
        "lifetime_value_units": 12543,
        "maintain_tier": {
            "points_needed": 200,
            "collected_by": "15678943"
        },
        "progress": {
            "points_needed": "1400",
            "collected_by": "15678943",
            "id": "guid",
            "name": "Gold"
        }
    },
    "joined_reward_schemes": [
        {
            "id": "CAD1E31269B76D7A65ACCE45B2E68DFD",
            "name": "CRMdotCOM Scheme",
            "signed_up_on": 1583846865,
            "email_address": "johndoe@crm.com"
        }
    ],
    "preferred_payment_method": {
        "id": "CAD1E31269B76D7A65ACCE45B2E68DFD",
        "payment_method_type": "DIRECTDEBIT",
        "first6": "424242",
        "last4": "4242",
        "iban": "CY3550000000054910000003"
    },
    "rewards": {
        "total_awards": "123.23",
        "total_spends": "43.56"
    }
}
List Account Journals
GET /accounts/{id}/journals

Retrieve a list of account journals. Only journals with Posted financial state 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:
INVOICE
type
string optional

Filter by journal type

Enumeration:
DEBIT
CREDIT
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 unique identifier

Example:
7156b6b0-ab00-46c8-8411-c515c20d4e19
number
string

The number/code of the journal’s related financial transaction

Example:
INV12659
entity_id
string

The unique identifier of the entity related to the journal entry for example an invoices or a cedit note’s detifier

Example:
7156b6b0-ab00-46c8-8411-c515c20d4e19
issued_date
integer epoch

Issued date

Example:
1650436799
posted_date
integer epoch

Date posted

Example:
1651127999
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:
INVOICE
type
string

Journal action against account

Enumeration:
DEBIT
CREDIT
Example:
DEBIT
currency_code
string

Journal currency code

Example:
EUR
amount
number

Journal amount

Example:
84.99
invoice
Object

Invoice related details, applicable for invoice 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:
10.93
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

Example:
1124
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/accounts/CAD1E31269B76D7A65ACCE45B2E68DFD/journals HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "content": [
        {
            "id": "7156b6b0-ab00-46c8-8411-c515c20d4e19",
            "number": "INV12659",
            "entity_id": "7156b6b0-ab00-46c8-8411-c515c20d4e19",
            "issued_date": 1650436799,
            "posted_date": 1651127999,
            "transaction_type": "INVOICE",
            "type": "DEBIT",
            "currency_code": "EUR",
            "amount": 84.99,
            "invoice": {
                "due_date": 1651074662,
                "overdue_amount": 10.39,
                "unpaid_amount": 10.93
            }
        }
    ],
    "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:
7156b6b0-ab00-46c8-8411-c515c20d4e19

Request parameters

include_lines
boolean optional

Include financial transation lines in response?

Default:
false
Example:
true

Request headers

Authorization
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
entity_id
string

The unique identifier of the financial transaction related to the journal entry for example the invoice unique identifier.

Example:
89da9753-06ba-4b86-b686-b9748f56c2ff
issued_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

Currency code

Example:
EUR
invoice
Object

Invoice related details

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
string

Invoice unpaid amount, i.e. invoice due date not yet reached

Example:
53.79
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 product

Example:
15.99
net
number

Net unit price

Example:
14.67
discount
number

Product discount amount

Example:
0
tax
number

Product tax amount

Example:
1.32
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:
1654065507
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.46
total
number

Transaction amount

Example:
103.59
payment_method
Object

Payment method details (e.g. for a refund)

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 of the payment method. Applicable only for Cards, Accunt Debits and Wallet payment method types

id
string

The contact’s payment method unique identifier

Example:
89da9753-06ba-4b86-b686-b9748f56c2ff
identifier
string

An identifier that briefly describes the contact’s payment method (The last 4 digits for cards, the email for Paypal accounts or the wallet number

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/v1/journals/7156b6b0-ab00-46c8-8411-c515c20d4e19 HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "7156b6b0-ab00-46c8-8411-c515c20d4e19",
    "number": "INV00123",
    "entity_id": "89da9753-06ba-4b86-b686-b9748f56c2ff",
    "issued_date": 1643611106,
    "posted_date": 1646289507,
    "currency_code": "EUR",
    "invoice": {
        "due_date": 1646116707,
        "overdue_amount": 10.99,
        "unpaid_amount": "53.79"
    },
    "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.67,
            "discount": 1,
            "tax": 1.32,
            "period": {
                "from": 1646116707,
                "to": 1654065507
            }
        }
    ],
    "net": 103.59,
    "discount": 1,
    "tax": 13.46,
    "total": 103.59,
    "payment_method": {
        "type": "CARD",
        "identity": {
            "id": "89da9753-06ba-4b86-b686-b9748f56c2ff",
            "identifier": "****1234"
        }
    }
}
Contact Financial Operations
POST /payments
POST /contacts/{id}/intents
GET /contacts/{id}/client_token
PUT /payment_intents/actions
Post a Payment
POST /payments

Create a new Payment transaction for a Contact. The Payment will be issued as Posted.

Request headers

api_key
string required

The publishable api key for application identification

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

Request body

Object
code
string

The Payment’s code. If not specified, then a unique 16-digit code is assigned

Example:
1234567891234567
contact_id
string required nullable

Contact unique identifier.

Example:
ab5f8b2e-092f-4848-8f46-31df1c014060
amount
number required

The Payment’s amount.

client_secret
string

The payment intent’s client secret. This is returned by the Payment Gateway integration where the front-end requests for a payment intent.

currency_code
string

The payment’s currency. If not specified, then the currency of the contact’s primary account is used.

Example:
EUR
payment_method
Object required

Payment method to be used to collect the money

type
string required
Enumeration:
CASH
CARD
ACCOUNT_DEBIT
WALLET
CRM_WALLET
CHEQUE
ELECTRONIC_TRANSFER
Example:
CARD
id
string

Contact payment method identifier. Applicable and requied when an online paymen tmethod tyoe is selected i.e. Card, Accoount Debit or Wallet.

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

List of Invoices intended to be paid through the Payment. If not specified, then the Payment’s amount is allocated based on FIFO.

Unique items: YES
Object
id
string

Unique identfiier of an Invoice

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

An array of reference numbers of external debits to be paid. Either Invoices or External references must be specified (only one of the two)

Object
reference
string

The external reference

Example:
INV00001011
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

Responses

200 OK
Body
Object
id
string

The Payment’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/v1/payments HTTP/1.1 

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

{
    "code": "1234567891234567",
    "client_secret": "",
    "amount": 1,
    "currency_code": "EUR", 
    "contact_id": "ab5f8b2e-092f-4848-8f46-31df1c014060",
    "payment_method": {
        "type": "CARD",
        "id": "ab5f8b2e-092f-4848-8f46-31df1c014060"
    },
    "invoices_paid": [
        {
            "id": "ab5f8b2e-092f-4848-8f46-31df1c014060"
        }
    ],
    "external_payable": [
        {
            "reference": "INV00001011"
        }
    ],
    "custom_fields": [
        {
            "key": "custom_key",
            "value": "0001-345"
        }
    ]
}
Create Intent
POST /contacts/{id}/intents

Set up a new intent for a specific contact, depending on the gateway type the response will vary

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 payment gateway plugin’s identifier

Example:
2BD9C84FA60F9FE407140E20F707726A
payment_method_id
string GUID required

The contact’s payment method

Example:
3BD9C84FA60F9FE407140E20F707726A
amount
number required

The payment’s amount

Example:
9.99
currency
string required

The payment’s currency. If not speified, then it default’s to the customer’s preferred currency of the account

Example:
EUR
capture
string
Enumeration:
ON_HOLD
AUTOMATIC
Example:
ON_HOLD
statement_info
string

Details to add to Customer 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 commication with the gateway as well as it authenticates and authorises the client to communicate with the gateway.

Path variables

id
string required

Request parameters

integration_id
string required

Responses

200 OK
Body
Object
client_token
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
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 payment gateway, with optional Account / Wallet ID

Request body

Object
client_secret
string required

Unique intent identifier from Intents API

Example:
c8f2-89f4-25352e84db6a
integration_id
string GUID required

The integration’s unique identifier

Example:
daf66d67-146d-0761-4e80-af34e64200c7
action
string required
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 Reward Operations
POST /accounts/{id}/reward_schemes
GET /accounts/verify_sign_up
POST /accounts/{id}/merchants
DELETE /accounts/{id}/merchants/{organisation_id}
GET /accounts/{id}/merchants
POST /accounts/{id}/auto_spends
GET /accounts/{id}/auto_spends
Sign up/out a Reward Scheme
POST /accounts/{id}/reward_schemes

Sign up/out the account to a specific reward scheme

Path variables

id
string GUID required

The account (identifier) that will be signed up to the reward scheme

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD

Notes

SELF SIGN-UP SCHEMES
  • Signing up to a self sign-up reward scheme requires the SIGNUP action and Reward Scheme attributes.
  • Signing out from a self sign-up reward scheme requires the SIGNOUT action and Reward Scheme attributes.
EMAIL DOMAIN based CLOSED LOOP SCHEMES
  • Request to join a closed loop reward scheme based on specific email domains requires the SIGNUP action, the Reward Scheme and Email Address attributes. Any requests made for joining such reward scheme should be verified via Verify Closed Loop Sign Up Request API.
  • Signing out from a closed loop reward scheme requires the SIGNOUT action and Reward Scheme attributes.
EXTERNAL SYSTEM based CLOSED LOOP SCHEMES
  • Request to join a closed loop reward scheme based on an external system requires the SIGNUP action, the Reward Scheme and Token attributes. Any requests made for joining such reward scheme should be verified via the external system.
  • Signing out from a closed loop reward scheme requires the SIGNOUT 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:
SIGNUP

Request to sign-up to a scheme

SIGNOUT

Request to sign-off from a scheme

reward_scheme_id
string GUID required

The reward scheme that the account has signed up/out

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
email_address
string nullable

The email address of the customer 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 customer is allowed to sign up to a closed loop reward scheme

Example:
ABCTKN123456798VGP2020
Examples

Responses

200 OK

The request has succeeded

Body
Object
id
string GUID

The reward scheme 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
Example 2
Example 3

Sign up to a reward scheme of type self-sign up

POST /accounts/CAD1E31269B76D7A65ACCE45B2E68DFD/reward_schemes HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "action": "SIGNUP",
    "reward_scheme_id": "CAD1E31269B76D7A65ACCE45B2E68DFD"
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "CAD1E31269B76D7A65ACCE45B2E68DFD"
}

Sign out from a reward scheme

POST /accounts/CAD1E31269B76D7A65ACCE45B2E68DFD/reward_schemes HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "action": "SIGNOUT",
    "reward_scheme_id": "CAD1E31269B76D7A65ACCE45B2E68DFD"
}

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 /accounts/CAD1E31269B76D7A65ACCE45B2E68DFD/reward_schemes HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "action": "SIGNUP",
    "reward_scheme_id": "CAD1E31269B76D7A65ACCE45B2E68DFD",
    "email_address": "johndoe@crm.com"
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "CAD1E31269B76D7A65ACCE45B2E68DFD"
}
Verify Closed Loop Sign Up Request
GET /accounts/verify_sign_up

Verify an account’s request to join a closed loop reward scheme (of email domain specific)

Notes

Request to join a closed loop Reward Scheme based on specific email domains should be made via the “Sign up to a Reward Scheme” API, providing the Reward Scheme and Email Address attributes

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

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/accounts/verify_sign_up/SUC1234 HTTP/1.1 

HTTP/1.1 200 OK 
Add Merchants (deprecated)
POST /accounts/{id}/merchants

Add a set of new merchants for automatic spends for that account

Path variables

id
string GUID required

The account (identifier) that will add a new merchant

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD

Notes

MANAGE AUTO-SPEND MERCHANTS FLOW

Adding merchant(s) to auto spend preferences, the following APIs should be called

  1. GET /merchants for retrieving applicable merchants
  2. POST /accounts/{id}/merchants for selecting the merchant(s)

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Request body

Object
merchants
Array required

Defines a list of merchants that are authorised to perform automatic awards spending for that account

Object
organisation_id
string GUID required

The organisation identifier that should be authorised to perform automatic awards spending

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
is_next_visit
boolean nullable

Defines whether the merchant is setup for automatic spend on the next visit

Example:
false
Examples

Responses

200 OK

The request has succeeded

Body
Object
merchants
Array

A list of merchants that are authorised to perform automatic awards spending for that account

Object
id
string GUID

The organisation identifier that should be authorised to perform automatic awards spending

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 /accounts/CAD1E31269B76D7A65ACCE45B2E68DFD/merchants HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "merchants": [
        {
            "organisation_id": "CAD1E31269B76D7A65ACCE45B2E68DFD",
            "is_next_visit": "false"
        }
    ]
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "merchants": [
        {
            "id": "CAD1E31269B76D7A65ACCE45B2E68DFD"
        }
    ]
}
Remove Merchant (deprecated)
DELETE /accounts/{id}/merchants/{organisation_id}

Remove an exisintg merchant from an account’s automatic spend preferences

Path variables

id
string GUID required

The account (identifier) that will remove existing merchants

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
organisation_id
string GUID required

The organisation (identifier) that should be removed

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD

Notes

MANAGE AUTO-SPEND MERCHANTS FLOW

Removing merchants/service providers from auto spend preferences, the following APIs should be called

  1. GET /accounts/{id}/merchants for retrieving the merchants that auto spend is enabled
  2. DELETE /accounts/{id}/merchants/{organisation_id} for selecting the merchant(s) to be removed

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 /accounts/CAD1E31269B76D7A65ACCE45B2E68DFD/merchants/CAD1E31269B76D7A65ACCE45B2E68DFD HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 
Get Merchants (deprecated)
GET /accounts/{id}/merchants

Retrieve the merchant organisations that an account provisioned for automatic spend requests

Path variables

id
string GUID required

The account (identifier) whose automatic spend merchant preferences should be retrieved

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD

Notes

MANAGE AUTO-SPEND MERCHANTS FLOW

Adding merchant(s) to auto spend preferences, the following APIs should be called

  1. GET /merchants for retrieving applicable merchants
  2. POST /accounts/{id}/merchants for selecting the merchant(s)

Removing merchants/service providers from auto spend preferences, the following APIs should be called

  1. GET /accounts/{id}/merchants for retrieving the merchants that auto spend is enabled
  2. DELETE /accounts/{id}/merchants/{organisation_id} for selecting the merchant(s) to be removed

Request headers

Authorization
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 OK

The request has succeeded

Body
Object
content
Array
Object
id
string GUID

The record identifier

Example:
REC1E31269B76D7A65ACCE45B2E68DFD
is_next_visit
boolean

Defines whether the organisation is setup for automatic spend on the next visit

Example:
false
organisation
Object

Organisation details

id
string GUID

The organisation identifier

Example:
QWE1E31269B76D7A65ACCE45B2E68QAQ
name
string

The organisation name

Example:
Bravo Coffee
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 /accounts/CAD1E31269B76D7A65ACCE45B2E68DFD/merchants HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "content": [
        {
            "id": "REC1E31269B76D7A65ACCE45B2E68DFD",
            "is_next_visit": "false",
            "organisation": {
                "id": "QWE1E31269B76D7A65ACCE45B2E68QAQ",
                "name": "Bravo Coffee"
            }
        }
    ]
}
Set Automatic Spend Preferences (deprecated)
POST /accounts/{id}/auto_spends

Set the automatic spend preferences (e.g. organisations - Merchant or Service Providers) for a specific contact’s account

Path variables

id
string GUID required

The account (identifier) that automatic spend preferences will be set

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD

Notes

MANAGE AUTO-SPEND MERCHANTS FLOW

Adding merchant(s) to auto spend preferences, the following APIs should be called

  1. GET /merchants for retrieving applicable merchants
  2. POST /accounts/{id}/merchants for selecting the merchant(s)

Removing merchants/service providers from auto spend preferences, the following APIs should be called

  1. GET /accounts/{id}/merchants for retrieving the merchants that auto spend is enabled
  2. DELETE /accounts/{id}/merchants/{organisation_id} for selecting the merchant(s) to be removed

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Request body

Object
organisations
Array required

Defines a list of organisations (Merchants or Service Providers) that are authorised to perform automatic spends

Object
organisation_id
string GUID required

The organisation identifier that should be authorised to perform automatic spends

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
is_next_visit
boolean nullable

Defines whether the organisation is setup for automatic spend on the next visit

Example:
false
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
POST /accounts/CAD1E31269B76D7A65ACCE45B2E68DFD/organisations HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "organisations": [
        {
            "organisation_id": "CAD1E31269B76D7A65ACCE45B2E68DFD",
            "is_next_visit": "false"
        }
    ]
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "organisations": [
        {
            "id": "CAD1E31269B76D7A65ACCE45B2E68DFD"
        }
    ]
}
Get Automatic Spend Preferences (deprecated)
GET /accounts/{id}/auto_spends

Retrieve the automatic spend preferences for a specific contact’s account

Path variables

id
string GUID required

The account (identifier) whose automatic spend preferences should be retrieved

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD

Notes

MANAGE AUTO-SPEND MERCHANTS FLOW

Adding merchants/service providers to auto spend preferences, the following APIs should be called

  1. GET /merchants for retrieving applicable merchants/service providers
  2. POST /accounts/{id}/merchants for selecting the merchant(s)

Removing merchants/service providers from auto spend preferences, the following APIs should be called

  1. GET /accounts/{id}/merchants for retrieving the merchants/service providers that auto spend is enabled
  2. DELETE /accounts/{id}/merchants/{organisation_id} for selecting the merchants/service providers to be removed

Request headers

Authorization
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 OK

The request has succeeded

Body
Object
content
Array
Object
organisations
Array

Organisation Automatic Spend Preferences

Object
id
string GUID

The auto spend preference record identifier

Example:
REC1E31269B76D7A65ACCE45B2E68DFD
is_next_visit
boolean

Defines whether the organisation is setup for automatic spend on the next visit

Example:
true
organisation
Object

Organisation Details

id
string GUID

The organisation identifier

Example:
QWE1E31269B76D7A65ACCE45B2E68QAQ
name
string

The organisation name

Example:
Best Coffee Bew
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/accounts/CAD1E31269B76D7A65ACCE45B2E68DFD/auto_spends HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "content": [
        {
            "organisations": [
                {
                    "id": "REC1E31269B76D7A65ACCE45B2E68DFD",
                    "is_next_visit": "true",
                    "organisation": {
                        "id": "QWE1E31269B76D7A65ACCE45B2E68QAQ",
                        "name": "Best Coffee Bew"
                    }
                }
            ]
        }
    ]
}
Contact Wallet Operations
POST /wallets/{id}/actions
Actions on Wallet
POST /wallets/{id}/actions

Change the life cycle state of the Wallet

Path variables

id
string GUID required

The wallet identifier that will be updated

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Request body

Object
action
string required

Defines the life cycle state of the wallet. If selected, then all of the above will not be taken into consideration

Enumeration:
TERMINATED
EFFECTIVE

Responses

200 OK

The response succeeded

Body
Object
id
string GUID

The wallet 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 /wallets/CAD1E31269B76D7A65ACCE45B2E68DFD/actions HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "action": "CANCELLED"
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "CAD1E31269B76D7A65ACCE45B2E68DFD"
}
Customer Events
Purchases
GET /contacts/{id}/purchases
PUT /purchases/reclaim
Search Contact Purchases
GET /contacts/{id}/purchases

Get a list of contact purchase customer events. Each purchase customer event is created against an account

Path variables

id
string GUID required

The contact (identifier) for which a list of purchase customer events should be returned

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD

Request parameters

from_date
integer epoch optional

Filters customer events that were performed from that date onwards

Example:
1582852959
to_date
integer epoch optional

Filters customer events that were performed from that date backwards

Example:
1582852959
performed_on
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:
performed_on[gt]

Returns results where the performed date is greater than this value

performed_on[gte]

Returns results where the performed date is greater than or equal to this value

performed_on[lt]

Returns results where the performed date is less than this value

performed_on[lte]

Returns results where the performed date is less then or equal to this value

is_ad_hoc_return
boolean optional

Filters purchases that 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_DATEperformedOn
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 purchase customer events

Object
id
string GUID

The customer event identifier

Example:
6A24D2B5E44F44B28451FE021FCAD51E
account_id
string GUID

The account identifier that the customer event was created against

Example:
658AB90A6A77437091D158FD8E697B11
reference_number
string

The customer event reference number

Example:
0012345
life_cycle_state
string

The customer event life cycle state

Enumeration:
POSTED
CANCELLED
payment_medium_identifier
string

The unique identifier of the payment medium used in the purchase (e.g. the first 6 digits of a credit card)

Example:
424242
total_net_amount
number

The net amount of the retrieved customer event

Example:
100.9
total_tax_amount
number

The tax amount of the retrieved customer event

Example:
25.08
discount_amount
number

The discount amount of the customer event

Example:
0.5
total_amount
number

The total amount (net + tax) of the retrieved customer event, after discount

Example:
125.38
requested_spend_amount
number

The amount in real currency that was requested to be spend via the customer event

Example:
10.54
performed_on
integer epoch

The date that the customer event was performed

Example:
1572534147
classification
Object

Details about purchase customer event classification

id
string GUID

The customer event classification identifier

Example:
18670ca7-0bc4-45d7-8464-91afab817bbe
name
string

The customer event classification name

Example:
Delivery
pass
Object

Details about the pass used on the purchase

id
string GUID

The pass identifier

Example:
89136fa9-0dc9-451d-833a-d22bf9d8b947
code
string

The pass code

Example:
13456789
performed_by_organisation
Object

Information about the organisation that performed the customer event

id
string GUID

The organisation identifier

Example:
658AB90A6A77437091D158FD8E697B11
name
string

The organisation name

Example:
CRMdotCOM Nicosia
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:
CA123456789AQWSXZAQWS1236547896541
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

Information about the 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 business parent of the organisation that the purchase was performed. Available only if the performed by organisation is a venue

id
string GUID

The organisation (business/merchant) identifier

Example:
658AB90A6A77437091D158FD8E697B22
name
string

The organisation (business/merchant) name

Example:
CRMdotCOM
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:
CA123456789AQWSXZAQWS1236547896541
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

Information about the 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

amount
number

The amount that the customer was debited due to ad hoc return of goods

Example:
20.99
ad_hoc_return_date
integer epoch

The date that ad hoc retun of goods was applied

Example:
1589987160
reference_number
string

The ad hoc return reference number

Example:
ARP001
return_amount
number

The amount that was returned

Example:
1.99
rewards
Object

Infromation about the award/spend amounts for such purchase

total_award_amount
number

The amount in real currency that was awarded via the customer event

Example:
121.99
total_spend_amount
number

The amount in real currency that was spent via the customer event

Example:
12.22
total_automatic_spend_amount
number

The total amount in real currency that was spent automatically via the customer event

Example:
2.22
total_instant_discount_amount
number

The total amount in real currency that was spent instantly via the customer event

Example:
4.49
total_spend_request_amount
number

The total amount in real currency that was actually spent on request via the customer event (may differ than the requested_spend_amount)

Example:
4.51
fees
Object

Information about the fees that were applied on purchase’s award/spend transactions

total_fee_amount
number

The total fee amount (sum of all fee amounts)

Example:
2.75
wallet_credit_fee_amount
number

The wallet fee that was applied on provided awards

Example:
1.24
wallet_debit_fee_amount
number

The wallet fee that was applied on spends

Example:
1.51
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

Example:
1124
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/purchases HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "content": [
        {
            "id": "6A24D2B5E44F44B28451FE021FCAD51E",
            "account_id": "658AB90A6A77437091D158FD8E697B11",
            "reference_number": "0012345",
            "life_cycle_state": "CANCELLED",
            "payment_medium_identifier": "424242",
            "total_net_amount": 100.9,
            "total_tax_amount": 25.08,
            "discount_amount": 0.5,
            "total_amount": 125.38,
            "requested_spend_amount": 10.54,
            "performed_on": 1572534147,
            "performed_by_organisation": {
                "id": "658AB90A6A77437091D158FD8E697B11",
                "name": "CRMdotCOM Nicosia"
            },
            "parent_organisation": {
                "id": "658AB90A6A77437091D158FD8E697B22",
                "name": "CRMdotCOM"
            },
            "rewards": {
                "total_award_amount": 121.99,
                "total_spend_amount": 12.22,
                "total_automatic_spend_amount": 2.22,
                "total_instant_discount_amount": 4.49,
                "total_spend_request_amount": 4.51
            }
        }
    ],
    "paging": {
        "page": 2,
        "size": 20,
        "total": 1124
    }
}
Reclaim Purchase to Contact
PUT /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
receipt_code
string GUID required

The receipt code (receipt number) that identifies the purchase (purchase id)

Example:
sdfsdfsdf4-43-r-few-f-wf-r3443;1234
merchant_tap_code
string nullable

The merchant tap code (merchant number) that submitted the purchase

Example:
TAP001
venue_tap_code
string nullable

The venue tap code (venue number) that submitted the purchase

Example:
TAP002
total_amount
number nullable

The purchase total amount

Example:
99.99
transaction_code
string nullable

The human readable code that a contact can reclaim a purchase event

Example:
9215mp124

Responses

200 OK

The request has succeeded

Body
Object
id
string GUID

The purchase customer event identifier

Example:
f248292d-2950-2175-851a-9be073b71c5b
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/purchases/reclaim HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "receipt_code": "sdfsdfsdf4-43-r-few-f-wf-r3443;1234",
    "merchant_tap_code": "TAP001",
    "venue_tap_code": "TAP002"
}
Referrals
POST /send_referrals
POST /referrals
Refer a friend
POST /send_referrals

Send referrals to contacts, inviting them to register to the business scheme and in return to award their referred by friend

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Request body

Object
recipients
Array required

The email address or phone numbers that referrals will be sent to

Unique items: YES
string
Examples:
j_doe@crm.com0035722265566992655663579922265566

Responses

200 200

OK

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 /send_referrals HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "recipients": [
        "j_doe@crm.com",
        "0035722265566"
    ]
}

HTTP/1.1 200 OK 
Create Referral
POST /referrals

Create a referral customer event

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Request body

Object
referral_code
string required

The referral code

Example:
REF123

Responses

200 200

OK

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 /referrals HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "referral_code": "REF123"
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "fe7bcab9-59cf-4906-a100-482396f5bf3f"
}
Estimates
POST /estimates/allowance
POST /estimates/invoicing
POST /estimates/order_fulfillment
POST /estimates/orders
POST /estimates/service_delivery
POST /estimates/billing
Authorise Usage Consumption
POST /estimates/allowance

Returns an estimation on whether usage consumption is authoised or not based on purchased services allowance and how much was consumed. Web API also returns remaining allownace per service

Request parameters

include_remaining
boolean optional

Set to True if the remaining usage allowance should also be included in the response. When set to False, the Web API just informs whether usage consumption is authorised or not.

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Request body

Object
contact_id
string GUID required nullable

The contact (identifier) that will be authorised.

Example:
ba48e7d3-d00a-0d28-4f9f-02b1a5b226bc
account_id
string required nullable

The account that is authorised fro usage

Example:
2f2a7993-6bbb-bd77-cbc8-8a2a774ef4f2
product_id
string

The usage product to be authorised. IF not specified, then Web API returns usage authrsed for all services

Example:
2f2a7993-6bbb-bd77-cbc8-8a2a774ef4f2
service
Object

The service through which usage will be consumed. Only termed and one-time services allow usage consumption

id
string

Service identifier.

Example:
2f2a7993-6bbb-bd77-cbc8-8a2a774ef4f2
classification
string

Service classification.

Enumeration:
ONE_TIME_SERVICE
TERMED_SERVICE
Example:
TERMED_SERVICE
organisation_id
string GUID

The organisation at which usage will be consumed

Example:
2f2a7993-6bbb-bd77-cbc8-8a2a774ef4f2
cash_amount
number nullable

Amount of money intended to be spent for this usage

Example:
1.99
currency_code
string

Currency code

usage_amount
number nullable

Usage amount requested to be consumed

Responses

200 OK
Body
Object
estimation_id
string
Example:
4dc0809f-ed91-4b68-b912-5bd6064d901e
authorised_usage
Array

Authorised usage among all of the contact’s services. In other words, the remaining usage that the contact is still allowed to consume

Object
amount
number

Remaining usage amount among all services that allow consumption

Example:
2.68
product
Object

The usage service that is authorised for consumption

id
string

Usage service product identifier

Example:
4dc0809f-ed91-4b68-b912-5bd6064d901e
sku
string

Usage service SKU

Example:
Data
name
string

Usage service name

Example:
Data
measurement_unit
Object

The usag service’s measurement unit

id
string

Measurement unit identifier

Example:
4dc0809f-ed91-4b68-b912-5bd6064d901e
name
string

Measurement unit name

Example:
Gigabytes
display_name
string

Measurement unit display name

Example:
GB
services
Array

List of services that have remaining allowance for the specified usage service

Object
id
string

The subscription service’s uniuee identifier

Example:
4dc0809f-ed91-4b68-b912-5bd6064d901e
classification
string

Service product classification. Usage is allowed only through One-time and Termed service products

Enumeration:
ONE_TIME_SERVICE
TERMED_SERVICE
Example:
ONE_TIME_SERVICE
product
Object

The termed/one-time service product

id
string

Product identifier

Example:
4dc0809f-ed91-4b68-b912-5bd6064d901e
sku
string

Product SKU

Example:
UNL_DATA
name
string

Prodct name

Example:
Weekly Unlimited Data
services
Array
Object
authorise_consumption
boolean
Example:
true
currency_code
string
Example:
EUR
service
Object
id
string
Example:
4dc0809f-ed91-4b68-b912-5bd6064d901e
classification
string
Example:
ONE_TIME_SERVICE
product
Object
id
string
Example:
4dc0809f-ed91-4b68-b912-5bd6064d901e
sku
string
Example:
DAY5BG
name
string
Example:
Daily 5GB NOW
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
display_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",
    "account_id": "2f2a7993-6bbb-bd77-cbc8-8a2a774ef4f2",
    "product_id": "2f2a7993-6bbb-bd77-cbc8-8a2a774ef4f2",
    "service": {
        "id": "2f2a7993-6bbb-bd77-cbc8-8a2a774ef4f2",
        "classification": "TERMED_SERVICE"
    },
    "organisation_id": "2f2a7993-6bbb-bd77-cbc8-8a2a774ef4f2",
    "cash_amount": 1.99,
    "currency_code": "",
    "usage_amount": 1
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "estimation_id": "4dc0809f-ed91-4b68-b912-5bd6064d901e",
    "authorised_usage": [
        {
            "amount": 2.68,
            "product": {
                "id": "4dc0809f-ed91-4b68-b912-5bd6064d901e",
                "sku": "Data",
                "name": "Data"
            },
            "measurement_unit": {
                "id": "4dc0809f-ed91-4b68-b912-5bd6064d901e",
                "name": "Gigabytes",
                "display_name": "GB"
            },
            "services": [
                {
                    "id": "4dc0809f-ed91-4b68-b912-5bd6064d901e",
                    "classification": "ONE_TIME_SERVICE",
                    "product": {
                        "id": "4dc0809f-ed91-4b68-b912-5bd6064d901e",
                        "sku": "UNL_DATA",
                        "name": "Weekly Unlimited Data"
                    }
                }
            ]
        }
    ],
    "services": [
        {
            "authorise_consumption": true,
            "currency_code": "EUR",
            "service": {
                "id": "4dc0809f-ed91-4b68-b912-5bd6064d901e",
                "classification": "ONE_TIME_SERVICE",
                "product": {
                    "id": "4dc0809f-ed91-4b68-b912-5bd6064d901e",
                    "sku": "DAY5BG",
                    "name": "Daily 5GB NOW"
                }
            },
            "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": "",
                        "display_name": ""
                    }
                }
            ]
        }
    ]
}
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
number
amount_to_collect
number
account_credit
number

Available account funds that can be used to pay off the Invoice. Available when the account is in credit and/or the account has a credit limit. Account funds are calculated as the account’s credit limit minus the amount in credit. for example credit limit is 100 and account credit is 50, then account fund sis returned as 150

Example:
9.99
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 required

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:
CA123456789AQWSXZAQWS1236547896541
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

Information about the 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:
CA123456789AQWSXZAQWS1236547896541
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

Information about the 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

Organisation that fulfills the order

id
string
Example:
6e111025-002b-48d7-a675-6d9e48070b8f
name
string
Example:
Bro Burgers
estimated_delivery
Object
time_to_deliver
integer
Example:
1
uot
string
Example:
minutes
delivered_at
integer
Example:
12345565
invalid_products
Array

List of ordered items which were included in the order but cannot be delivered to the consumer at the time of estimation. Invalid ordered products are excluded from the orders cost estimation (invoice_estimate)

Object
unavailability_reason
string

Details on why the product is considered as invalid and cannot be included in the Order

Enumeration:
VALIDITY_PERIOD

The prodcut’s validity period has expired, i.e. the business is no longer selling this product

AVAILABILITY

The product is temporarily un-available for sale at/by the requested organisation e.g. is out of stock

ORDER_CATALOGUE

The product is not included in an valid Order Catalogue.

Example:
AVAILABILITY
product
Object

Product included in the request’s ordered items but will not be delivered

id
string

Product identifier

Example:
6e111025-002b-48d7-a675-6d9e48070b8f
sku
string

Product SKU

Example:
PIE
name
string

Product name

Example:
Cheese pie
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
number
amount_to_collect
number
account_credit
number

Available account funds that can be used to pay off the Invoice. Available when the account is in credit and/or the account has a credit limit. Account funds are calculated as the account’s credit limit minus the amount in credit. for example credit limit is 100 and account credit is 50, then account fund sis returned as 150

Example:
9.99
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
number
amount_to_collect
number
account_credit
number

Available account funds that can be used to pay off the Invoice. Available when the account is in credit and/or the account has a credit limit. Account funds are calculated as the account’s credit limit minus the amount in credit. for example credit limit is 100 and account credit is 50, then account fund sis returned as 150

Example:
9.99
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": "PICK_UP",
    "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",
    "wallet_funds_amount": 1,
    "payment_method_type": "CASH",
    "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",
                    "price_terms_id": ""
                }
            ]
        }
    ]
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "",
    "order_estimate": {
        "ordering_allowed": "true",
        "minimum_amount": 5,
        "fulfilled_by": {
            "id": "6e111025-002b-48d7-a675-6d9e48070b8f",
            "name": "Bro Burgers"
        },
        "estimated_delivery": {
            "time_to_deliver": 1,
            "uot": "minutes",
            "delivered_at": 12345565
        }
    },
    "invalid_products": [
        {
            "unavailability_reason": "AVAILABILITY",
            "product": {
                "id": "6e111025-002b-48d7-a675-6d9e48070b8f",
                "sku": "PIE",
                "name": "Cheese pie"
            }
        }
    ],
    "invoice_estimate": {
        "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": 1,
        "amount_to_collect": 1,
        "account_credit": 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,
                "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
                        }
                    }
                ]
            }
        ]
    },
    "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": [
                    {
                        "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": 1,
                        "amount_to_collect": 1,
                        "account_credit": 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,
                                "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
                                        }
                                    }
                                ]
                            }
                        ]
                    }
                ]
            }
        }
    ]
}
Service Delivery
POST /estimates/service_delivery

Returns an estimation of a change perfromed on a subscription service, without making the change. The estimation is based on existing services owned by the customer plus any requested changes.

Request body

Object
action
string required
Enumeration:
ADD
CANCEL
UPGRADE
DOWNGRADE
CHANGE_BILLING_DAY
CHANGE_PAYMENT_METHOD
CHANGE_TERMS
AMEND
classification_code
string

Applicable and required when changing the terms of a service

Enumeration:
OPT_IN_RENEWALS
OPT_OUT_RENEWALS
RENEW_TERMS
contact_id
string GUID required
account_id
string
subscription_id
string
scheduled_date
integer
Example:
12345678
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
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
quantity
integer
extend_by
Object
period
string
uot
string
component_changes
Object

Applicable and required when amending the components of a flexible bundle service

id
string

The unique identifier of the service hwose components are amended

to_be_added
Array nullable

List of components that will be included in the bundle. At least one components should be added or removed when amending a service bundle

Object
product_id
string required

The unique identifier of the component service

price_terms_id
string

The component service’s price terms

to_be_removed
Array nullable

List of components that will be removed from the bundle. At least one components should be added or removed when amending a service bundle

Object
id
string required

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
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
services_to_remove
Array
Object
id
string
life_cycle_state
string
Example:
CANCELLED
product
Object
id
string
sku
string
name
string
services_to_change
Array
Object
id
string
life_cycle_state
string
Example:
SWAPPED
product
Object
id
string
sku
string
name
string
change_to_product
Object
id
string
sku
string
name
string
dependencies
Array
Object
item_type
string
item_id
string
item_name
string
components_change
Object
service
Object

The bundle service whose components are amended

id
string
sku
string
name
string
components_added
Array
Object
id
string
sku
string
name
string
components_removed
Array
Object
id
string
sku
string
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
number
amount_to_collect
number
account_credit
number

Available account funds that can be used to pay off the Invoice. Available when the account is in credit and/or the account has a credit limit. Account funds are calculated as the account’s credit limit minus the amount in credit. for example credit limit is 100 and account credit is 50, then account fund sis returned as 150

Example:
9.99
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/service_delivery HTTP/1.1 

Content-Type: application/json

{
    "action": "UPGRADE",
    "classification_code": "OPT_IN_RENEWALS",
    "contact_id": "",
    "account_id": "",
    "subscription_id": "",
    "scheduled_date": 12345678,
    "subscription_term_changes": {
        "billing_day": {
            "day_of_month": 1,
            "day_of_week": "MONDAY"
        },
        "payment_method_id": "",
        "funding_source": "ACCOUNT"
    },
    "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": "",
            "components": [
                {
                    "product_id": "",
                    "price_terms_id": ""
                }
            ]
        }
    ],
    "service_term_changes": [
        {
            "service_id": "",
            "auto_renewal_preference": "OPT_IN, OPT_OUT",
            "contract_preference": "",
            "quantity": 1,
            "extend_by": {
                "period": "",
                "uot": ""
            }
        }
    ],
    "component_changes": {
        "id": "",
        "to_be_added": [
            {
                "product_id": "",
                "price_terms_id": ""
            }
        ],
        "to_be_removed": [
            {
                "id": ""
            }
        ]
    }
}

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": {
                "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": ""
                        }
                    ]
                }
            ],
            "services_to_remove": [
                {
                    "id": "",
                    "life_cycle_state": "CANCELLED",
                    "product": {
                        "id": "",
                        "sku": "",
                        "name": ""
                    }
                }
            ],
            "services_to_change": [
                {
                    "id": "",
                    "life_cycle_state": "SWAPPED",
                    "product": {
                        "id": "",
                        "sku": "",
                        "name": ""
                    },
                    "change_to_product": {
                        "id": "",
                        "sku": "",
                        "name": ""
                    },
                    "dependencies": [
                        {
                            "item_type": "",
                            "item_id": "",
                            "item_name": ""
                        }
                    ] 
                }
            ],
            "components_change": {
                "service": {
                    "id": "",
                    "sku": "",
                    "name": ""
                },
                "components_added": [
                    {
                        "id": "",
                        "sku": "",
                        "name": ""
                    }
                ],
                "components_removed": [
                    {
                        "id": "",
                        "sku": "",
                        "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": [
                    {
                        "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
                                        }
                                    }
                                ]
                            }
                        ]
                    }
                ]
            }
        }
    ]
}
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"
                            }
                        }
                    ]
                }
            ]
        }
    ]
}
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}

This request returns the details and design of the landing page requested.

Path variables

id
string GUID required

The GUID of the landing page being called

Example:
JHGDFJHGSF6576GHFDSHG

Responses

200 OK
Body
Object
name
string

The name associated with the landing page.

Example:
My loyalty pass enrolment form
public_key
string

The default (live) public key of the organisation

Example:
sdf3ref32rwerf324r134rw23rfd32r23r23r32r
description
string

The description of the landing page.

Example:
Enrolment landing page for mobile pass cards.
type
string

The type of landing page.

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

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
title
string

The title displayed on the landing page.

Example:
Enrolment form
footer
string

The footer text on the lanidng page.

Example:
Mobile Pass Card
header
string

The header text

Example:
Welcome!
success
string

The success message

Example:
Congradulations!
fail
string

The failure message

Example:
Request Failed!
button
string

The text to be displayed on the button

Example:
Submit!
logo_img_position
string

The position of the logo

Enumeration:
LEFT
CENTER
RIGHT
colors
Array
Object
method
string

The colours associate with the landing page.

Enumeration:
BACKGROUND
HEADER
BUTTON
TEXT
FOOTER
HEADER_TEXT
FOOTER_TEXT
BUTTON_TEXT
code
string

The colour code.

Example:
FDE56F
form
Array

Retrieves the form fields associated with this landing page.

Object
id
string GUID
Example:
JHAGDJGA6576HGGJ
property
string
Example:
contact.email
label
string
Example:
email
priority
integer
opacity
Array
Object
image
string

The image

Enumeration:
HEADER
BACKGROUND
value
integer

The value relating to the opacity percentage

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:
CA123456789AQWSXZAQWS1236547896541
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

Information about the 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/landing_pages/JHGDFJHGSF6576GHFDSHG 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",
    "title": "Enrolment form",
    "footer": "Mobile Pass Card",
    "header": "Welcome!",
    "success": "Congradulations!",
    "fail": "Request Failed!",
    "button": "Submit!",
    "logo_img_position": "RIGHT",
    "colors": [
        {
            "method": "BUTTON",
            "code": "FDE56F"
        }
    ],
    "form": [
        {
            "id": "JHAGDJGA6576HGGJ",
            "property": "contact.email",
            "label": "email",
            "priority": 1
        }
    ],
    "opacity": [
        {
            "image": "BACKGROUND",
            "value": 1
        }
    ],
    "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"
                }
            ]
        }
    ]
}
Mobile Pass Cards

All Api’s associated to Mobile Pass Cards

GET /apple_pass/{id}/contacts/{contactId}
GET /google_pass/{id}/contacts/{contactId}
GET /android_wallet_pass/{id}/contacts/{contactId}
Get Apple Pass
GET /apple_pass/{id}/contacts/{contactId}

Retrieves a mobile pass card for a Apple wallet.

Path variables

id
string required

organisation id

contactId
string required

contact id

Responses

200 OK
Body
Object
PK pass file
unknown

Returns a PK pass file.

Get Google Pass
GET /google_pass/{id}/contacts/{contactId}

Retrieves a mobile pass card for a google wallet.

Path variables

id
string required

organisation ID

contactId
string required

contact ID

Responses

200 OK
Body
string
Example:
https://pay.google.com/gp/v/save/{jwt}
Get Android Wallet Pass
GET /android_wallet_pass/{id}/contacts/{contactId}

Retreives a contacts mobile pass card for a alternative android wallet.

Path variables

id
string required

organistaion Id

contactId
string required

contact ID

Responses

200 OK
Body
unknown
Example:
PK Passfile
Orders

Group containing Orders Web APIs

POST /orders
GET /orders/{id}
PUT /orders/{id}/actions
GET /contacts/{id}/orders
Submit Order
POST /orders

Creates a new Order for a contact based on an order’s estimation which was previously obtained via 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
wallet_funds_amount
number nullable

Defines a specific amount that should be used on the order total amount (applicable only if “use_wallet_funds” is true)

Example:
11.99
payments
Array required

At least one payment method must be specified.

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 when an online payment method type was selected and this is one of the contact’s payment methods.

Example:
37b56acf-665c-1112-93fc-163b3639bcbe
intent_id
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:
1668263645
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/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",
    "wallet_funds_amount": 11.99,
    "payments": [
        {
            "payment_method_type": "CARD",
            "payment_method_id": "37b56acf-665c-1112-93fc-163b3639bcbe",
            "intent_id": "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": 1668263645
    }
}
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
Example:
6514df04-9218-d354-9d59-ed9e98882fe6
number
string
Example:
O000001
supply_method
string

Defines the order’ supply method

Enumeration:
DELIVERY
PICK_UP
DIRECT_SALE
life_cycle_state
string

The order’s life cycle state

Enumeration:
NEW
IN_PROGRESS
COMPLETED
CANCELLED
ON_HOLD
is_favorite
boolean
Example:
true
notes
string

The order general notes

currency
string
Example:
EUR
discount
Object
amount
number
amout_incl_tax
number
tax_amount
number
wallet_funds_amount
number
Example:
1.98
cost_before_discount
number

Total cost before applying the discount, if any. Tax amoutn is included

total_cost
number
Example:
14.99
amount_due
number
Example:
13.01
amount_to_collect
string
fulfilled_by
Object
id
string GUID

The organisation’s identifer

Example:
5DD9C84FA60F9FE407140E20F707726A
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
submitted_on
integer
Example:
546733443345
estimated_completion_date
integer
Example:
122233443345
completed_on
integer
Example:
342342342344
cancelled_on
integer
Example:
34234342342
expiration_date
integer
Example:
1
requested_date
integer
Example:
1
started_on
integer
Example:
1
cancellation_reason
Object
id
string
name
string
Example:
Items out of stock
order_items
Array
Object
id
string
quantity
integer
Example:
2
notes
string
unit_price
number

The unit price charged for this product in the order (excluding tax)

discount
Object
amount
number
amout_incl_tax
number
total_before_tax
number

The item’s sub-total before applying the discount, if any. Tax amont is included

Example:
1.4
total_amount
number

The order item’s sub-total

Example:
2.8
product
Object
id
string
Example:
4AD9C84FA60F9FE407140E20F707726A
sku
string
Example:
abc-12345
name
string
Example:
Installation kit
description
string
classification
string
Example:
EXPENSES_SERVICE
price_terms
Object
id
string
billing_period
Object
duration
integer
Example:
1
uot
string
Example:
MONTH
auto_renew
boolean
Example:
true
termed_period_cycles
integer
Example:
12
contract_period
Object
duration
integer
Example:
12
uot
string
Example:
MONTH
trial_period
Object
duration
integer
Example:
7
uot
string
Example:
DAY
price_model
string
Example:
VARIABLE
billing_model
string
Example:
PRE_BILL
components
Array
Object
id
string
Example:
6CD9C84FA60F9FE407140E20F707726A
sku
string
Example:
0012933-100
name
string
Example:
Decoder
quantity
integer
Example:
2
price
number
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
Example:
1.98
variant_attributes
Array
Object
key
string
name
string
value
string
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:
CA123456789AQWSXZAQWS1236547896541
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

Information about the 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
Object
payment_method_type
string
Enumeration:
CASH
CHEQUE
CARD
ACCOUNT_DEBIT
WALLET
CRM_WALLET
paid_on
string
Example:
ON_COMPLETE
posted_on
string
payment_method_details
Object
id
string
last4
string
funding_type
string
brand
string
amount
number
Example:
1.99
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
account_credit
number

Amount used from account to pay off the order. Applicable when the account was in credit at the time of ordering, so this amount was used to pay off part of the order

Example:
0.99
Example 1
GET https://sandbox.crm.com/self-service/v1/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": "DIRECT_SALE",
    "life_cycle_state": "ON_HOLD",
    "is_favorite": true,
    "notes": "",
    "currency": "EUR",
    "discount": {
        "amount": 1,
        "amout_incl_tax": 1
    },
    "tax_amount": 1,
    "wallet_funds_amount": 1.98,
    "cost_before_discount": 1,
    "total_cost": 14.99,
    "amount_due": 13.01,
    "amount_to_collect": "",
    "fulfilled_by": {
        "id": "5DD9C84FA60F9FE407140E20F707726A",
        "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": 546733443345,
        "estimated_completion_date": 122233443345,
        "completed_on": 342342342344,
        "cancelled_on": 34234342342,
        "expiration_date": 1,
        "requested_date": 1,
        "started_on": 1
    },
    "cancellation_reason": {
        "id": "",
        "name": "Items out of stock"
    },
    "order_items": [
        {
            "id": "",
            "quantity": 2,
            "notes": "",
            "unit_price": 1,
            "discount": {
                "amount": 1,
                "amout_incl_tax": 1
            },
            "total_before_tax": 1.4,
            "total_amount": 2.8,
            "product": {
                "id": "4AD9C84FA60F9FE407140E20F707726A",
                "sku": "abc-12345",
                "name": "Installation kit",
                "description": "",
                "classification": "EXPENSES_SERVICE",
                "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"
                    },
                    "price_model": "VARIABLE",
                    "billing_model": "PRE_BILL"
                },
                "components": [
                    {
                        "id": "6CD9C84FA60F9FE407140E20F707726A",
                        "sku": "0012933-100",
                        "name": "Decoder",
                        "quantity": 2,
                        "price": 0.99,
                        "price_before_discount": 1,
                        "sub_total": 1.98
                    }
                ],
                "variant_attributes": [
                    {
                        "key": "",
                        "name": "",
                        "value": ""
                    }
                ],
                "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"
                            }
                        ]
                    }
                ]
            }
        }
    ],
    "payments": [
        {
            "payment_method_type": "ACCOUNT_DEBIT",
            "paid_on": "ON_COMPLETE",
            "posted_on": "",
            "payment_method_details": {
                "id": "",
                "last4": "",
                "funding_type": "",
                "brand": ""
            },
            "amount": 1.99
        }
    ],
    "custom_fields": [
        {
            "key": "custom_key",
            "value": "0001-345"
        }
    ],
    "account_credit": 0.99
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "6514df04-9218-d354-9d59-ed9e98882fe6",
    "number": "O000001",
    "supply_method": "PICK_UP",
    "life_cycle_state": "IN_PROGRESS",
    "is_favorite": true,
    "notes": "",
    "currency": "EUR",
    "discount": {
        "amount": 1,
        "amout_incl_tax": 1
    },
    "tax_amount": 1,
    "wallet_funds_amount": 1.98,
    "cost_before_discount": 1,
    "total_cost": 14.99,
    "amount_due": 13.01,
    "amount_to_collect": "",
    "fulfilled_by": {
        "id": "5DD9C84FA60F9FE407140E20F707726A",
        "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": 546733443345,
        "estimated_completion_date": 122233443345,
        "completed_on": 342342342344,
        "cancelled_on": 34234342342,
        "expiration_date": 1,
        "requested_date": 1,
        "started_on": 1
    },
    "cancellation_reason": {
        "id": "",
        "name": "Items out of stock"
    },
    "order_items": [
        {
            "id": "",
            "quantity": 2,
            "notes": "",
            "unit_price": 1,
            "discount": {
                "amount": 1,
                "amout_incl_tax": 1
            },
            "total_before_tax": 1.4,
            "total_amount": 2.8,
            "product": {
                "id": "4AD9C84FA60F9FE407140E20F707726A",
                "sku": "abc-12345",
                "name": "Installation kit",
                "description": "",
                "classification": "EXPENSES_SERVICE",
                "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"
                    },
                    "price_model": "VARIABLE",
                    "billing_model": "PRE_BILL"
                },
                "components": [
                    {
                        "id": "6CD9C84FA60F9FE407140E20F707726A",
                        "sku": "0012933-100",
                        "name": "Decoder",
                        "quantity": 2,
                        "price": 0.99,
                        "price_before_discount": 1,
                        "sub_total": 1.98
                    }
                ],
                "variant_attributes": [
                    {
                        "key": "",
                        "name": "",
                        "value": ""
                    }
                ],
                "creatives": [
                    {
                        "id": "CA123456789AQWSXZAQWS1236547896541",
                        "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"
                            }
                        ]
                    }
                ]
            }
        }
    ],
    "payments": [
        {
            "payment_method_type": "WALLET",
            "paid_on": "ON_COMPLETE",
            "posted_on": "",
            "payment_method_details": {
                "id": "",
                "last4": "",
                "funding_type": "",
                "brand": ""
            },
            "amount": 1.99
        }
    ],
    "custom_fields": [
        {
            "key": "custom_key",
            "value": "0001-345"
        }
    ],
    "account_credit": 0.99
}
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

Defines the new life cycle state of the Order. Used to start the progress of an order, complete it or cancel it

Enumeration:
PAUSE

roadmap

RESUME

roadmap

REPEAT

roadmap

CANCEL
MARK_FAVORITE

roadmap

SCHEDULE

roadmap

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/v1/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"
}
List Orders
GET /contacts/{id}/orders

Retrieves a list of a contact’s Orders

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

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 OK
Body
Object
id
string GUID

The order identifier

Example:
3DD9C84FA60F9FE407140E20F707726A
number
string

The order number

Example:
O000001
supply_method
string

Defines the order’ supply method

Enumeration:
DELIVERY
PICK_UP
DIRECT_SALE
life_cycle_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_cost
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
wallet_funds_amount
number

The amount that was used from wallet funds

Example:
1.98
discount
Object
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

cost_before_discount
number

Ttoal cost of the order befroe applying the discount, if any. Tax amount is included

amount_due
number

The amount due. This is the due amount of the order’s invoice, calculated cosidering its due date

Example:
13.01
amount_to_collect
number

The amount of money that was collected to pay off the order’s invoice. This amount equals to the order’s cost minus wallet funds (if any)

currency
string

The currency in which the Order will be/was paid

Example:
EUR
submitted_date
integer epoch
Example:
11599124760
fulfilled_by
Object

Details about the organisation

id
string GUID

The organisation identifier

Example:
380ddfaa-709a-f1f1-3283-5326ccc631ee
name
string

The organisation name

Example:
CRM Nicosia
order_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
duration
integer
uot
string
auto_renew
boolean
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/v1/contacts/067083a5-607c-959e-e62a-3ba8d359bdd6/orders HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "3DD9C84FA60F9FE407140E20F707726A",
    "number": "O000001",
    "supply_method": "DIRECT_SALE",
    "life_cycle_state": "IN_PROGRESS",
    "is_favorite": "true",
    "total_cost": 14.99,
    "wallet_funds_amount": 1.98,
    "discount": {
        "amount": 1,
        "amount_incl_tax": 1
    },
    "cost_before_discount": 1,
    "amount_due": 13.01,
    "amount_to_collect": 1,
    "currency": "EUR",
    "submitted_date": 11599124760,
    "fulfilled_by": {
        "id": "",
        "name": ""
    },
    "order_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": ""
                    },
                    "auto_renew": true
                }
            }
        }
    ],
    "custom_fields": [
        {
            "key": "custom_key",
            "value": "0001-345"
        }
    ]
}
Organisations
GET /organisations/{id}/network
GET /organisations/{id}
GET /locations
GET /merchants
POST /organisations/{id}/switch
Search Organisations
GET /organisations/{id}/network

Retrieve a list of organisations that consist 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

The organisation name (should behave as like)

Example:
Bravo Coffee
relationship
string optional

Filter based on the organisation’s relationship

Enumeration:
BUSINESS

Businesses

MERCHANT

Merchants or Service Providers

VENUE

Venues or Service Points

industries
array of string GUID optional

Industry filter for organisation

Collection format: csv
Unique items: YES
industry_sectors
array of string GUID optional

Industry sector filter for organisation

Collection format: csv
Unique items: YES
business_activities
array of string GUID optional

Business activity filter for organisation

Collection format: csv
town_cities
array of string optional

The city that a merchant is located

Collection format: csv
Unique items: YES
organisation_tags
array of string GUID optional

Tag filter for organisation

Collection format: csv
countries
array of string optional

Filter based on the organisation’s country

Collection format: csv
Unique items: YES
contact_registry
boolean optional

Filters organisations that use the service owner contact registry

Example:
true
lat
string optional

Filter based on latitude coordinate

Example:
35.1730837
lon
string optional

Filter based on longitude coordinate

Example:
33.3761312
distance
number optional

Filter organisations based on distance in KM from the lat/lon coordinates

Example:
5
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
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
tap_code
string optional

Filter based on TAP code

Example:
01-23-45-67-89-AB
include_wifi_sites
boolean optional

Defines whether WiFi Sites should be retrieved or not

Example:
true

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 merchants (business units)

Object
id
string GUID

The organisation identifier

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
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
organisation_tags
Array

The organisation tags

Object
name
string

The tag name

Example:
Restaurant
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
contact_info
Array

Information about the organisation’s contact details

Unique items: YES
Object

Information about the specified addresses

name
string

The name of the contact information

Example:
Main Office
type
string

The type of the contact information

Enumeration:
EMAIL
PHONE
value
string

The value of the specific contact information

Example:
john@crm.com
country_code
string

The country code related to the contact detail of type phone

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

Information about 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:
CA123456789AQWSXZAQWS1236547896541
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

Information about the 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:
CA123456789AQWSXZAQWS1236547896541
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

Information about the 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

Example:
1124
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/organisations/56854656-b466-463f-8e10-b6bf558b4666/network HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "content": [
        {
            "id": "CAD1E31269B76D7A65ACCE45B2E68DFD",
            "name": "Alfa Bakery",
            "description": "Lorem Ipsum",
            "industry_name": "Restaurant",
            "industry_sectors": [
                {
                    "name": "Nightlife"
                }
            ],
            "business_activities": [
                {
                    "name": "Bar & Grill"
                }
            ],
            "organisation_tags": [
                {
                    "name": "Restaurant"
                }
            ],
            "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",
                    "distance": 3,
                    "google_place_id": "ChIJrTLr-GyuEmsRBfy61i59si0"
                }
            ],
            "contact_info": [
                {
                    "name": "Main Office",
                    "type": "EMAIL",
                    "value": "john@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": [
                        "ALL"
                    ],
                    "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"
                                }
                            ]
                        }
                    ]
                }
            ],
            "creatives": [
                {
                    "id": "CA123456789AQWSXZAQWS1236547896541",
                    "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:
CAD1E31269B76D7A65ACCE45B2E68DFD

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 OK

The request has succeeded

Body
Object
content
Object

Information about the retrieved organisations

id
string GUID

The organisation identifier

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
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
organisation_tags
Array

The organisation tags

Object
name
string

The tag name

Example:
Restaurant
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
contact_info
Array

Details about the organisation information

Object

Information about the specified addresses

name
string

The name of the contact information

Example:
Main Office
type
string

The type of the contact information

Enumeration:
EMAIL
PHONE
value
string

The value of the specific contact information

Example:
john@crm.com
country_code
string

The country code related to the contact detail of type phone

Example:
CYP
operation_details
Object

Defines the operation details of the organisation

opening_hours
Array

Details about the organisation’s working hours

Object
day_of_week
string

The day of the week that the organisation is open

Example:
MONDAY
opens
string

The time that the organisation opens (HH:MM)

Example:
09:00
closes
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:
CA123456789AQWSXZAQWS1236547896541
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

Information about the 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/CAD1E31269B76D7A65ACCE45B2E68DFD HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "content": {
        "id": "CAD1E31269B76D7A65ACCE45B2E68DFD",
        "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

organisation_name
string optional

The organisation name (should behave as like)

Example:
CRM
lat
string required

Filter based on latitude coordinate

Example:
35.1730837
lon
string required

Filter based on longitude coordinate

Example:
33.3761312
is_open
boolean optional

Filter based on organisation is opened or not

Example:
true
order_type
string optional

Filter based on order type

Example:
Delivery
within
number optional

How far should the distance be at a maximum default to 5KM

Example:
154
industries
array of string GUID optional

Industry filter for organisation

Collection format: csv
Unique items: YES
industry_sectors
array of string GUID optional

Industry sector filter for organisation

Collection format: csv
Unique items: YES
business_activities
array of string GUID optional

Business activity filter for organisation

Collection format: csv
Unique items: YES
organisation_tags
array of string GUID optional

Tag filter for organisation

Collection format: csv
Unique items: YES
town_cities
array of string optional

Town/City filter for organisation

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

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

location
Object

The organisation location details

id
string GUID

The location identifier

Example:
c8ea18e4-2804-3e8e-9450-600263614aac
address_line_1
string

Location address line 1

Example:
21 Elia Papakyriakou Street
address_line_2
string

Location address line 2

Example:
7 Stars Tower
state_province_county
string

The address state/province.county

Example:
Egkomi
town_city
string

Location town/city

Example:
Nicosia
postal_code
string

Location post code

Example:
2415
country_code
string

Location country code

Example:
CY
lat
number

The location latitude coordinate

Example:
35.15445
lon
number

The location longitude coordinate

Example:
33.316777
distance
string

The supported distance from the lat/lon coordinates

Example:
12
google_place_id
string

The Google textual identifier that uniquely identifies a location

Example:
ChIJrTLr-GyuEmsRBfy61i59si0
opening_hours
Array

The organisation opening hours for the current day

Object
order_type
string
Enumeration:
DELIVERY
PICK_UP
ALL
open_time
string

The opening time (HH:MM format)

Example:
12:45
close_time
string

The clsoing time (HH:MM format)

Example:
19:45
contact_info
Array
Object

Information about the specified addresses

name
string

The name of the contact information

Example:
Main Office
type
string

The type of the contact information

Enumeration:
EMAIL
PHONE
value
string

The value of the specific contact information

Example:
john@crm.com
country_code
string

The country code related to the contact detail of type phone

Example:
CYP
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_method
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:
CA123456789AQWSXZAQWS1236547896541
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

Information about the 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:
CA123456789AQWSXZAQWS1236547896541
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

Information about the 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/v1/locations?lat=35.1730837&lon=33.3761312 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": "",
            "location": {
                "id": "c8ea18e4-2804-3e8e-9450-600263614aac",
                "address_line_1": "21 Elia Papakyriakou",
                "address_line_2": "7 Stars Tower",
                "state_province_county": "Egkomi",
                "town_city": "Nicosia",
                "postal_code": "2415",
                "country_code": "CY",
                "lat": 35.15445,
                "lon": 33.316777,
                "distance": "12",
                "google_place_id": "ChIJrTLr-GyuEmsRBfy61i59si0"
            },
            "opening_hours": [
                {
                    "order_type": "DELIVERY",
                    "open_time": "12:45",
                    "close_time": "19:45"
                }
            ],
            "contact_info": [
                {
                    "name": "Main Office",
                    "type": "PHONE",
                    "value": "john@crm.com",
                    "country_code": "CYP"
                }
            ],
            "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_method": [
                        "PICK_UP"
                    ],
                    "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"
                                }
                            ]
                        }
                    ]
                }
            ],
            "creatives": [
                {
                    "id": "CA123456789AQWSXZAQWS1236547896541",
                    "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"
                }
            ]
        }
    ]
}
Reward Merchants
GET /merchants

Search for organisations with active reward commercial terms that participate in one of the customer’s reward schemes

Request parameters

name
string optional

The organisation name (should behave as like)

Example:
CRM
organisations
array of string optional

Defines which organisations will be retrieved

Collection format: csv
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
sort
string optional

Defines on which attribute the results should be sorted

Examples:
NAMECREATED_DATEUPDATED_DATE
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
Body
Object
content
Array
Object
id
string GUID

The organisation identifier

Example:
ef4ba57e-131e-d1b8-709a-b2554baf79ef
name
string

The organisation name

Example:
CRMdotCOM
description
string

The organisation description

Example:
The best rewards company
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:
CA123456789AQWSXZAQWS1236547896541
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

Information about the 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

Switch Organisations
POST /organisations/{id}/switch

Switch contact to another organisation that belongs

Path variables

id
string GUID required

The organisation (identifier) that will be switched to

Example:
02ee09d0-c227-4479-a2e6-5e9958c7ea78

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 OK

OK

Body
Object
access_token
string

The token that can be used in subsequent API calls

Example:
eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhMjc4ZDNlNS05YjhlLTQzNmUtOTIzMC03MGYzZTJkZjFjYTUiLCJleHAiOjE1Njg1NTQxMjJ9.LemqPPThkqfakkKS6CdkNvV1Lnc88CWirEpHOPnWjJPQz02zgkKSwfbvrEsl3OmR2LUhDILsOXf4x-GPFmNJCg
refresh_token
string

Used when access token gets expired in order to refresh

exp
string epoch

The token expiration date

Example:
1572530655
contact
Object

Details about the authorised contact

id
string GUID

The cotnact’s unique identifier

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

The contact’s title

Example:
Mr
first_name
string

The contact’s first name

Example:
John
last_name
string

The contact’s last name

Example:
Doe
company_name
string

The contact’s company name

Example:
CRM
avatar
string

The contact’s avatar

Example:
avatar
is_verified
boolean

Defines whether the used identity is verified

Example:
false
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

Enumeration:
SERVICE_OWNER
ORGANISATION
name
string

The organisation name

Example:
CRMdotCOM
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/organisations/02ee09d0-c227-4479-a2e6-5e9958c7ea78/switch HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A

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": "ORGANISATION",
            "org_relationship": "MERCHANT",
            "name": "CRMdotCOM"
        }
    ]
}
Passes
POST /passes
Redeem Pass
POST /passes

Redeem a single pass

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Request body

Object
code
string required

The pass code

Example:
123456789
value
string required

The value of the pass to be redeemed

Example:
50
otp
string nullable

The OTP (if applicable)

Example:
1234
pin
string nullable

The pass PIN (if applicable)

Example:
1234
wallet_id
string GUID nullable

The contact’s unique wallet identifier for redeeming the pass

Example:
2034880822564244
contact_id
string

Unique id of contact redeeming the pass

Example:
ade6d6cc-9a78-407e-b577-6c13d469774c

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/v1/passes HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "code": "123456789",
    "value": "50",
    "otp": "1234",
    "pin": "1234",
    "wallet_id": "2034880822564244",
    "contact_id": "ade6d6cc-9a78-407e-b577-6c13d469774c"
}
Product Catalog
GET /products
GET /products/{id}
GET /products/{id}/variants
GET /products/{id}/components
GET /products/{id}/tiering
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.

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 request for product purchasing

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_catalog_id
string GUID optional

Filter based on order catalog

Example:
dccb219b-1304-95de-61f8-03b4b824a428
order_category_id
string GUID optional

Filter based on order 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
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
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
string optional

The product’s classification

Enumeration:
TERMED_SERVICE
ONE_TIME_SERVICE
EXPENSE
TRACEABLE_PHYSICAL_GOOD
NON_TRACEABLE_PHYSICAL_GOOD
Example:
TERMED_SERVICE
composition
string optional

The product’s composition

Enumeration:
FLAT
COMPOSITE
FLEXIBLE_BUNDLE
FIXED_BUNDLE
Example:
FLAT
search_value
string optional

Search for a prodcut using its SKU or name

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
Example:
8c939607-2262-544d-99ef-4634c6e8836d
sku
string
name
string
description
string
classification
string
type_composition
string
number_of_running_promotions
integer

Indicate if the product has promotions active

promotions
Array

List of Promotions

Object
id
string
Example:
7CD9C84FA60F9FE407140E20F707726A
name
string
Example:
Sales season
short_description
string
long_description
string
life_cycle_state
string
Example:
INACTIVE
availability
Object
from_date
integer
Example:
1
to_date
integer
Example:
1
creatives
Array
Object
id
string
Example:
CA123456789AQWSXZAQWS1236547896541
usage_type
string
Example:
MARKETING
width
integer
Example:
2159
height
integer
Example:
3075
format
string
Example:
jpg
url
string
Example:
https://assets.crm.com/image/logo.jpg
public_id
string
Example:
crm-com/image
media
Array
Object
width
integer
Example:
200
height
integer
Example:
300
url
string
Example:
https://asset.crm.com/image/offer/c_scale,w_200/logo.jpg
number_of_components
integer
number_of_variants
integer
number_of_variant_attributes
integer
number_of_prices
integer
can_be_rented
boolean

Applicable only for traceable physical goods with a rental price

availability
string
categories
Array
Object
id
string GUID
Example:
8c939607-2262-544d-99ef-4634c6e8836d
name
string
type
Object
id
string GUID
Example:
8c939607-2262-544d-99ef-4634c6e8836d
name
string
family
Object
id
string GUID
Example:
8c939607-2262-544d-99ef-4634c6e8836d
name
string
brand
Object
id
string GUID
Example:
8c939607-2262-544d-99ef-4634c6e8836d
name
string
pricing
Array
Object
id
string

The price’s unique identifier

price
number
tiers
Array

List of prices per range. Applicable only for Tiers/Volume/Stairstep pricing models

Object
price
number

The tier range price

Example:
9.99
lower_tier
integer

Range lower tier. First tier always starts from 1.

Example:
1
upper_tier
integer

Range upper tier. Last range does not have an upper tier

Example:
5
currency
string
tax_model
string
rate_model
string
supply_method
string
price_terms
Object
terms_billing_cycles
integer
Example:
12
auto_renewed
boolean
Example:
true
price_model
string
Example:
FIXED
billing_model
string
Example:
POST_BILL
contract_period
Object
duration
integer
Example:
12
uot
string
Example:
MONTHS
billing_period
Object
duration
integer
Example:
1
uot
string
Example:
MONTHS
trial_period
Object
duration
integer
Example:
7
uot
string
Example:
DAYS
rental_service
Object
id
string
sku
string
name
string
taxes
Array
Object
id
string GUID
Example:
8c939607-2262-544d-99ef-4634c6e8836d
name
string
tax_code
string
Example:
VAT
percentage
integer
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:
CA123456789AQWSXZAQWS1236547896541
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

Information about the 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

Example:
1124
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/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": "",
            "name": "",
            "description": "",
            "classification": "",
            "type_composition": "",
            "number_of_running_promotions": 1,
            "promotions": [
                {
                    "id": "7CD9C84FA60F9FE407140E20F707726A",
                    "name": "Sales season",
                    "short_description": "",
                    "long_description": "",
                    "life_cycle_state": "INACTIVE",
                    "availability": {
                        "from_date": 1,
                        "to_date": 1
                    },
                    "creatives": [
                        {
                            "id": "CA123456789AQWSXZAQWS1236547896541",
                            "usage_type": "MARKETING",
                            "width": 2159,
                            "height": 3075,
                            "format": "jpg",
                            "url": "https://assets.crm.com/image/logo.jpg",
                            "public_id": "crm-com/image",
                            "media": [
                                {
                                    "width": 200,
                                    "height": 300,
                                    "url": "https://asset.crm.com/image/offer/c_scale,w_200/logo.jpg"
                                }
                            ]
                        }
                    ]
                }
            ],
            "number_of_components": 1,
            "number_of_variants": 1,
            "number_of_variant_attributes": 1,
            "number_of_prices": 1,
            "can_be_rented": true,
            "availability": "",
            "categories": [
                {
                    "id": "8c939607-2262-544d-99ef-4634c6e8836d",
                    "name": ""
                }
            ],
            "type": {
                "id": "8c939607-2262-544d-99ef-4634c6e8836d",
                "name": ""
            },
            "family": {
                "id": "8c939607-2262-544d-99ef-4634c6e8836d",
                "name": ""
            },
            "brand": {
                "id": "8c939607-2262-544d-99ef-4634c6e8836d",
                "name": ""
            },
            "pricing": [
                {
                    "id": "",
                    "price": 1,
                    "tiers": [
                        {
                            "price": 9.99,
                            "lower_tier": 1,
                            "upper_tier": 5
                        }
                    ],
                    "currency": "",
                    "tax_model": "",
                    "rate_model": "",
                    "supply_method": "",
                    "price_terms": {
                        "terms_billing_cycles": 12,
                        "auto_renewed": true,
                        "price_model": "FIXED",
                        "billing_model": "POST_BILL",
                        "contract_period": {
                            "duration": 12,
                            "uot": "MONTHS"
                        },
                        "billing_period": {
                            "duration": 1,
                            "uot": "MONTHS"
                        },
                        "trial_period": {
                            "duration": 7,
                            "uot": "DAYS"
                        },
                        "rental_service": {
                            "id": "",
                            "sku": "",
                            "name": ""
                        }
                    },
                    "taxes": [
                        {
                            "id": "8c939607-2262-544d-99ef-4634c6e8836d",
                            "name": "",
                            "tax_code": "VAT",
                            "percentage": 1
                        }
                    ]
                }
            ],
            "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"
                        }
                    ]
                }
            ]
        }
    ],
    "paging": {
        "page": 2,
        "size": 20,
        "total": 1124
    }
}
Get Product
GET /products/{id}

Get the product, its base price, indication that there are running promotions or its components

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
Example:
7CD9C84FA60F9FE407140E20F707726A
sku
string
Example:
ABC12345
name
string
Example:
Base TV
description
string
Example:
Basic TV & myFlix
classification
string
Example:
TERMED_SERVICE
type_composition
string
Example:
FLEXIBLE_BUNDLE
number_of_running_promotions
integer
Example:
2
number_of_prices
integer
Example:
3
number_of_variant_attributes
integer
Example:
1
number_of_variants
integer
Example:
3
availability
string
Example:
DISABLED
type
Object
id
string GUID
Example:
8c939607-2262-544d-99ef-4634c6e8836d
name
string
categories
Array

The product categories

Object
id
string GUID

The category identifier

Example:
8c939607-2262-544d-99ef-4634c6e8836d
name
string

The category name

family
Object
id
string GUID
Example:
8c939607-2262-544d-99ef-4634c6e8836d
name
string
brand
Object
id
string GUID
Example:
8c939607-2262-544d-99ef-4634c6e8836d
name
string
composition
Array
Object
id
string GUID
Example:
8c939607-2262-544d-99ef-4634c6e8836d
item_type
string
Enumeration:
PRODUCT
TYPE
FAMILY
CATEGORY
item_id
string GUID
Example:
8c939607-2262-544d-99ef-4634c6e8836d
sku
string
name
string
minimum_quantity
integer
Example:
1
maximum_quantity
integer
Example:
3
mandatory
boolean
Example:
true
classification
string
Example:
MODIFIER
price_inclusive
boolean
Example:
true
default_modifer
Object

The default modifier of this composition

id
string

The identifier of the product set as default modifier

Example:
23458910-ebc2-d6c5-fb49-84bf99176171
name
string

The name of the product set as default modifier

Example:
Premium Blend
pricing
Array
Object
id
string

The price’s unique identifier

price
number
Example:
9.99
currency
string
Example:
EUR
rate_model
string
Example:
FLAT
tax_model
string
Example:
TAX_INCLUSIVE
supply_method
string
Example:
DELIVERY
price_terms
Object
terms_billing_cycles
integer
Example:
12
auto_renewed
boolean
Example:
true
price_model
string
Example:
FIXED
billing_model
string
Example:
POST_BILL
contract_period
Object
duration
integer
Example:
12
uot
string
Example:
MONTHS
billing_period
Object
duration
integer
Example:
1
uot
string
Example:
MONTHS
trial_period
Object
duration
integer
Example:
7
uot
string
Example:
DAYS
rental_service
Object
id
string
sku
string
name
string
taxes
Array
Object
id
string GUID
Example:
8c939607-2262-544d-99ef-4634c6e8836d
name
string
tax_code
string
Example:
VAT
percentage
integer
Example:
19
tiers
Array

List of prices per range. Available only for Tiered/Volume/Stairstep models.

Object
price
number
Example:
9.99
lower_tier
integer

Lower tier. First range’s tier is always set to 1

Example:
1
upper_tier
integer

Upper tier. Last range does not have an upper tier

Example:
5
upsells
Array
Object
id
string GUID
Example:
8c939607-2262-544d-99ef-4634c6e8836d
sku
string
name
string
description
string
crosssells
Array
Object
id
string GUID
Example:
8c939607-2262-544d-99ef-4634c6e8836d
sku
string
name
string
description
string
variant_attributes
Array
Object
key
string
Example:
size
label
string
Example:
Size
value
string
Example:
Small
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:
CA123456789AQWSXZAQWS1236547896541
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

Information about the 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/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": "7CD9C84FA60F9FE407140E20F707726A",
    "sku": "ABC12345",
    "name": "Base TV",
    "description": "Basic TV & myFlix",
    "classification": "TERMED_SERVICE",
    "type_composition": "FLEXIBLE_BUNDLE",
    "number_of_running_promotions": 2,
    "number_of_prices": 3,
    "number_of_variant_attributes": 1,
    "number_of_variants": 3,
    "availability": "DISABLED",
    "type": {
        "id": "8c939607-2262-544d-99ef-4634c6e8836d",
        "name": ""
    },
    "categories": [
        {
            "id": "8c939607-2262-544d-99ef-4634c6e8836d",
            "name": ""
        }
    ],
    "family": {
        "id": "8c939607-2262-544d-99ef-4634c6e8836d",
        "name": ""
    },
    "brand": {
        "id": "8c939607-2262-544d-99ef-4634c6e8836d",
        "name": ""
    },
    "composition": [
        {
            "id": "8c939607-2262-544d-99ef-4634c6e8836d",
            "item_type": "TYPE",
            "item_id": "8c939607-2262-544d-99ef-4634c6e8836d",
            "sku": "",
            "name": "",
            "minimum_quantity": 1,
            "maximum_quantity": 3,
            "mandatory": true,
            "classification": "MODIFIER",
            "price_inclusive": true,
            "default_modifer": {
                "id": "23458910-ebc2-d6c5-fb49-84bf99176171",
                "name": "Premium Blend"
            }
        }
    ],
    "pricing": [
        {
            "id": "",
            "price": 9.99,
            "currency": "EUR",
            "rate_model": "FLAT",
            "tax_model": "TAX_INCLUSIVE",
            "supply_method": "DELIVERY",
            "price_terms": {
                "terms_billing_cycles": 12,
                "auto_renewed": true,
                "price_model": "FIXED",
                "billing_model": "POST_BILL",
                "contract_period": {
                    "duration": 12,
                    "uot": "MONTHS"
                },
                "billing_period": {
                    "duration": 1,
                    "uot": "MONTHS"
                },
                "trial_period": {
                    "duration": 7,
                    "uot": "DAYS"
                },
                "rental_service": {
                    "id": "",
                    "sku": "",
                    "name": ""
                }
            },
            "taxes": [
                {
                    "id": "8c939607-2262-544d-99ef-4634c6e8836d",
                    "name": "",
                    "tax_code": "VAT",
                    "percentage": 19
                }
            ],
            "tiers": [
                {
                    "price": 9.99,
                    "lower_tier": 1,
                    "upper_tier": 5
                }
            ]
        }
    ],
    "upsells": [
        {
            "id": "8c939607-2262-544d-99ef-4634c6e8836d",
            "sku": "",
            "name": "",
            "description": ""
        }
    ],
    "crosssells": [
        {
            "id": "8c939607-2262-544d-99ef-4634c6e8836d",
            "sku": "",
            "name": "",
            "description": ""
        }
    ],
    "variant_attributes": [
        {
            "key": "size",
            "label": "Size",
            "value": "Small"
        }
    ],
    "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"
                }
            ]
        }
    ]
}
Get Product Variants
GET /products/{id}/variants

Get the detailed information of a composite product’s variant products, their prices, composition etc.

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
Example:
7CD9C84FA60F9FE407140E20F707726A
sku
string
Example:
ABC12345
name
string
Example:
Small Latte
description
string
Example:
Small Latte
type_composition
string
Example:
FLEXIBLE_BUNDLE
pricing
Array
Object
price
number
Example:
9.99
currency
string
Example:
EUR
rate_model
string
Example:
FLAT
tax_model
string
Example:
TAX_INCLUSIVE
supply_method
string
Example:
DELIVERY
taxes
Array
Object
id
string
name
string
tax_code
string
Example:
VAT
percentage
integer
Example:
19
variant_attributes
Array
Object
key
string
Example:
size
value
string
Example:
Small
label
string
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:
CA123456789AQWSXZAQWS1236547896541
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

Information about the 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/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": "7CD9C84FA60F9FE407140E20F707726A",
        "sku": "ABC12345",
        "name": "Small Latte",
        "description": "Small Latte",
        "type_composition": "FLEXIBLE_BUNDLE",
        "pricing": [
            {
                "price": 9.99,
                "currency": "EUR",
                "rate_model": "FLAT",
                "tax_model": "TAX_INCLUSIVE",
                "supply_method": "DELIVERY",
                "taxes": [
                    {
                        "id": "",
                        "name": "",
                        "tax_code": "VAT",
                        "percentage": 19
                    }
                ]
            }
        ],
        "variant_attributes": [
            {
                "key": "size",
                "value": "Small",
                "label": "Size"
            }
        ],
        "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"
                    }
                ]
            }
        ]
    }
]
Get Product Components
GET /products/{id}/components

Returns a list of products that could be added as components of a flexible bundle

Path variables

id
string GUID required

The product identifier whose components will be retrieved

Example:
2f6a70b6-84d4-2859-d230-093cb7e95c62

Request parameters

billing_period
string optional

Used when a component is added in a flexible termed service bundle in order to retrieve service components that have a price with the same billing cycle as the selected bundle

biling_period_uot
string optional

Applicable and required only when a billing period parameter is specified

Enumeration:
DAYS
WEEKS
MONTHS
YEARS
service_id
string optional

Applicable only for termed services of flexible bundle composition. If specified, then it returns the service bundle’s existing (non-cancelled) service components and merges them with any additional components that can be included in the service bundle.

search_value
string optional

Search for products using their SKU or name

include_creatives
boolean optional

Include Creatives in response

Default:
false

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
item_type
string
Enumeration:
PRODUCT
CATEGORY
TYPE
FAMILY
COMPONENT_SET
item_id
string GUID
Example:
8c939607-2262-544d-99ef-4634c6e8836d
name
string

The name of the component

Example:
Milk Options Cappuccino Massimo
dispay_name
string

The display name of the component

Example:
Milks & Alternatives
mandatory
boolean
Example:
true
classification
string
Example:
MODIFIER
price_inclusive
boolean
Example:
true
minimum_quantity
integer
Example:
1
maximum_quantity
integer
Example:
3
default_modifier
Object

The default modifier of this component

id
string

The identifier of the product set as default modifier

Example:
23458910-ebc2-d6c5-fb49-84bf99176171
name
string

The name of the product set as default modifier

Example:
Almond milk
products
Array
Object
id
string GUID
Example:
8c939607-2262-544d-99ef-4634c6e8836d
sku
string
name
string
description
string
is_included
boolean

If set to True, then this means that the product is already included as a component.

Example:
true
pricing
Array
Object
id
string
price
number
Example:
9.99
currency
string
Example:
EUR
rate_model
string
Example:
FLAT
tax_model
string
Example:
TAX_INCLUSIVE
supply_method
string
Example:
DELIVERY
taxes
Array
Object
id
string GUID
Example:
8c939607-2262-544d-99ef-4634c6e8836d
name
string
tax_code
string
Example:
VAT
percentage
integer
Example:
1
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:
CA123456789AQWSXZAQWS1236547896541
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

Information about the 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/products/2f6a70b6-84d4-2859-d230-093cb7e95c62/components HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A
api_key: ab5f8b2e-092f-4848-8f46-31df1c014060

HTTP/1.1 200 OK 

Content-Type: application/json

[
    {
        "item_type": "TYPE",
        "item_id": "8c939607-2262-544d-99ef-4634c6e8836d",
        "name": "Milk Options Cappuccino Massimo",
        "dispay_name": "Milks & Alternatives",
        "mandatory": true,
        "classification": "MODIFIER",
        "price_inclusive": true,
        "minimum_quantity": 1,
        "maximum_quantity": 3,
        "default_modifier": {
            "id": "23458910-ebc2-d6c5-fb49-84bf99176171",
            "name": "Almond milk"
        },
        "products": [
            {
                "id": "8c939607-2262-544d-99ef-4634c6e8836d",
                "sku": "",
                "name": "",
                "description": "",
                "is_included": "true",
                "pricing": [
                    {
                        "id": "",
                        "price": 9.99,
                        "currency": "EUR",
                        "rate_model": "FLAT",
                        "tax_model": "TAX_INCLUSIVE",
                        "supply_method": "DELIVERY",
                        "taxes": [
                            {
                                "id": "8c939607-2262-544d-99ef-4634c6e8836d",
                                "name": "",
                                "tax_code": "VAT",
                                "percentage": 1
                            }
                        ]
                    }
                ],
                "creatives": [
                    {
                        "id": "CA123456789AQWSXZAQWS1236547896541",
                        "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"
                            }
                        ]
                    }
                ]
            }
        ]
    }
]
Get Tier Path Products
GET /products/{id}/tiering

Returns a list of produts included within the specified product’s tier path

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
change_type
string optional
Enumeration:
UPGRADE
DOWNGRADE
billing_period_duration
string optional
billing_period_uot
string optional
currency
string optional

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
Example:
3FD9C84FA60F9FE407140E20F707726A
sku
string
Example:
abc-123456
name
string
Example:
3Play
tier_level
integer
Example:
3
change_type
string
Example:
DOWNGRADE
prices
Array
Object
id
string
price
integer
Example:
1
currency
string
tax_model
string
Example:
TAX_EXCLUSIVE
price_terms
Object
billing_period
Object
duration
integer
Example:
1
uot
string
terms_billing_cycles
integer
Example:
1
auto_renewed
boolean
Example:
true
contract_period
Object
duration
integer
Example:
1
uot
string
trial_period
Object
duration
integer
Example:
1
uot
string
price_model
string
Example:
FIXED
billing_model
string
Example:
POST_BILL
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

Example:
1124
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/products/{id}/tiering HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A
api_key: ab5f8b2e-092f-4848-8f46-31df1c014060

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "content": [
        {
            "id": "3FD9C84FA60F9FE407140E20F707726A",
            "sku": "abc-123456",
            "name": "3Play",
            "tier_level": 3,
            "change_type": "DOWNGRADE",
            "prices": [
                {
                    "id": "",
                    "price": 1,
                    "currency": "",
                    "tax_model": "TAX_EXCLUSIVE",
                    "price_terms": {
                        "billing_period": {
                            "duration": 1,
                            "uot": ""
                        },
                        "terms_billing_cycles": 1,
                        "auto_renewed": true,
                        "contract_period": {
                            "duration": 1,
                            "uot": ""
                        },
                        "trial_period": {
                            "duration": 1,
                            "uot": ""
                        },
                        "price_model": "FIXED",
                        "billing_model": "POST_BILL"
                    }
                }
            ]
        }
    ],
    "paging": {
        "page": 2,
        "size": 20,
        "total": 1124
    }
}
Promotions

Get a list of Promotions

GET /promotions
GET /promotions/{id}
List of Promotions
GET /promotions

Request parameters

search_value
string optional

Search for an promotion using its name

Example:
Happy Hour
organisations
array of string GUID optional

Filter based on the organisation that the promotions are created for

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
Example:
7CD9C84FA60F9FE407140E20F707726A
name
string
Example:
Sales season
short_description
string
long_description
string
life_cycle_state
string
Example:
INACTIVE
availability
Object
from_date
integer
Example:
1
to_date
integer
Example:
1
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:
CA123456789AQWSXZAQWS1236547896541
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

Information about the 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

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

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "content": [
        {
            "id": "7CD9C84FA60F9FE407140E20F707726A",
            "name": "Sales season",
            "short_description": "",
            "long_description": "",
            "life_cycle_state": "INACTIVE",
            "availability": {
                "from_date": 1,
                "to_date": 1
            },
            "creatives": [
                {
                    "id": "CA123456789AQWSXZAQWS1236547896541",
                    "usage_type": "MARKETING",
                    "width": 2159,
                    "height": 3075,
                    "format": "jpg",
                    "url": "https://assets.crm.com/image/logo.jpg",
                    "public_id": "crm-com/image",
                    "media": [
                        {
                            "width": 200,
                            "height": 300,
                            "url": "https://asset.crm.com/image/offer/c_scale,w_200/logo.jpg"
                        }
                    ]
                }
            ]
        }
    ],
    "pages": {
        "page": 2,
        "size": 20,
        "total": 5124
    }
}
Get Promotions
GET /promotions/{id}

Retrieve details of 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
Example:
7CD9C84FA60F9FE407140E20F707726A
name
string
Example:
Sales season
life_cycle_state
string
short_description
string
Example:
£10 off
long_description
string
availability
Object
from_date
integer
Example:
1234566
to_date
integer
Example:
1234566
targeting
Object
contact_segments
Array
Object
id
string GUID

The segment identifier

Example:
6A24D2B5E44F44B28451FE021FCAD51E
name
string

The segment name

Example:
VIP Customers
description
string

The segment description

Example:
All customers that are classified as VIP
size
integer

The segment size

Example:
112
organisations
Array
Object
id
string GUID

The organisation identifier

Example:
234234234234-23423sdfs-324234sfsf
type
string

The organisation type

Example:
MERCHANT
name
string

The organisation name

Example:
Bravo Bakery
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
timings
Object
fixed_period
Object
start_date
integer
Example:
1
end_date
integer
Example:
1
availability
Array
Object
day
integer
Example:
6
month
integer
Example:
11
start_time
string
Example:
13:00
end_time
string
Example:
14:00
basket
Array
Object
groups
Array
Object
group
string
Example:
group_1
operator
string
Example:
OR
conditions
Array
Object
condition
string
Example:
Condition_1
id
string GUID
Example:
f3e24e0b-58d0-44d9-aa08-63e7df0db282
name
string
Example:
Coffee
sku
unknown nullable
description
unknown nullable
qty
integer
Example:
10
value
unknown nullable
isoCurrencyCode
unknown nullable
operator
string
Example:
AND
id_type
string
Example:
FAMILY
offerings
Array
Object
id
string GUID
product_id
string GUID
id_type
string
Example:
SKU
term_id
string
timing
Array
Object
start
integer
Example:
1
start_uot
string
period
integer
Example:
1
period_uot
string
Example:
DAY
discount_type
string
amount
string
discount_type
string
Enumeration:
PERCENT
VALUE
amount
integer
Example:
100
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:
CA123456789AQWSXZAQWS1236547896541
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

Information about the 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
Order Catalog
GET /order_catalogs/
GET /order_catalogs/{id}/categories
List Order Catalogues
GET /order_catalogs/

Returns a list of active order catalogs configured for the Business

Request parameters

search_value
string optional

Search for an order catalog using its name, dispaly name or description

Example:
Food
fulfilled_by
string GUID optional

Retrieve order catalogs based on organisation

Example:
7CD9C84FA60F9FE407140E20F707726A
supply_method
string optional

Retrieve order catalog based on supply method

Enumeration:
DELIVERY
PICK_UP
DIRECT_SALE
ordering_time
integer epoch optional

Retreive order catalog 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

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 catalog identifier

Example:
c5d37f18-2656-739d-6340-4b1413ca9617
name
string

The order catalog name

Example:
DRINKS
description
string

The order catalog description

Example:
A list of drinks that can be ordered
dislpay_name
string

The order catalog display name

Example:
Drinks
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:
CA123456789AQWSXZAQWS1236547896541
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

Information about the 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

Example:
1124
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/order_catalogs/?fulfilled_by=7CD9C84FA60F9FE407140E20F707726A HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A
api_key: ab5f8b2e-092f-4848-8f46-31df1c014060

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "content": [
        {
            "id": "c5d37f18-2656-739d-6340-4b1413ca9617",
            "name": "DRINKS",
            "description": "A list of drinks that can be ordered",
            "dislpay_name": "Drinks",
            "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"
                        }
                    ]
                }
            ]
        }
    ],
    "paging": {
        "page": 2,
        "size": 20,
        "total": 1124
    }
}
List Order Catalogue Categories
GET /order_catalogs/{id}/categories

Returns a list of product categories

Path variables

id
string required

The order catalog identifier

Request parameters

search_value
string optional

Search for an order category using its name

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 order 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 category identifier

Example:
9365d945-2c62-be0e-a8dc-45736fdfa5b5
name
string

The order category name

Example:
Cold Drinks
description
string

The order category description

Example:
Cold Beverages and Refreshers
child_nodes
integer

The number of the order category’s child nodes

Example:
12
parent
Object

Details about the parent order 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
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/order_catalogs/{id}/order_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"
            }
        }
    ]
}
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
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 reward schemes that are available

Object
id
string GUID

The reward scheme identifier

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
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
CLOSE_LOOP_SIGN_UP
is_joined
boolean

Defines whether contact has already joined the 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

Example:
1124
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/reward_schemes HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "content": [
        {
            "id": "CAD1E31269B76D7A65ACCE45B2E68DFD",
            "name": "Loyalty Scheme",
            "description": "Lorem Ipsum",
            "terms_and_conditions": "Only CRMdotCOM domain customer can sign up",
            "sign_up_option": "SELF_SIGN_UP",
            "is_joined": "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 customer

Request parameters

industry
array of string GUID optional

Information about the industries that should be used as a filter

Collection format: csv
Unique items: YES
industry_sector
array of string GUID optional

Information about the industry sectors that should be used as a filter

Collection format: csv
Unique items: YES
organisation_tag
array of string GUID optional

Information about the organisation tag that should be used as a filter

Collection format: csv
Unique items: YES
town_city
array of string optional

Information about the organisation location town/city that should be used as a filter

Collection format: csv
Unique items: YES
country
array of string optional

Information about the organisation location country (code) that should be used as a filter

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 reward offers whether are eligible to be used for performance purposes

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

Information about the retrieved reward offers

Object
id
string GUID

The reward offer identifier

Example:
6A24D2B5E44F44B28451FE021FCAD51E
name
string

The reward offer name

Example:
10% off on any purchase
reward_scheme
Object

Infromation about the reward scheme of this offer

id
string GUID

The reward scheme identifier

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
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
owned_by
Object

Information about the organisation that owns the reward offer

id
string GUID

The organisation identifier

Example:
CAD1E31269B76D7A65ACCE45B2E68987
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:
CA123456789AQWSXZAQWS1236547896541
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

Information about the 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
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
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:
CA123456789AQWSXZAQWS1236547896541
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

Information about the 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

Example:
1124
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/reward_offers HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "content": [
        {
            "id": "6A24D2B5E44F44B28451FE021FCAD51E",
            "name": "10% off on any purchase",
            "reward_scheme": {
                "id": "CAD1E31269B76D7A65ACCE45B2E68DFD",
                "name": "Loyalty Scheme"
            },
            "short_description": "Short Description",
            "long_description": "Long Description",
            "terms_and_conditions": "Terms & Conditions",
            "owned_by": {
                "id": "CAD1E31269B76D7A65ACCE45B2E68987",
                "name": "Pizza Yummy",
                "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"
                            }
                        ]
                    }
                ]
            },
            "is_featured": "false",
            "performance_enabled": "true",
            "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"
                        }
                    ]
                }
            ]
        }
    ],
    "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, whether it’s based on transaction amount or purchased products

Enumeration:
AMOUNT
PRODUCT
EVENT
percentage_progress
number

The progression percentage for this offer

Example:
90.11
current_purchases
integer

The number of purchases that were done so far and not awarded (applicable if the performance type is PRODUCT based)

Example:
2
target_purchases
integer

The total amount of purchases that should be done in order for the offer to be awarded (applicable if the performance type is PRODUCT based)

Example:
121
current_amount
number

The amount of money that was purchased so far if the offer (applicable if the performance type is AMOUNT based)

Example:
0.99
target_amount
number

The total amount of money that should be purchased in order for the offer to be awarded (applicable if the performance type is AMOUNT based)

Example:
123.78
current_events
integer

The number of events that were done so far and not awarded (applicable if the performance type is EVENT based)

Example:
1
target_events
integer

The total number of events that should be done in order for the offer to provide the award (applicable if the performance type is EVENT based)

Example:
2
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/reward_offers/a690caa5-9c4d-4eb0-b743-88076f1f5711/performance HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "type": "AMOUNT",
    "percentage_progress": 90.11,
    "current_amount": 0.99,
    "target_amount": 123.78
}
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

The service request description

Example:
I have a query about the potholes in Nicosia Main Road
queue_id
string GUID

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/v1/contacts/6b888b83-b418-752f-604d-0653cf65885d/service_requests/ HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "description": "I have a query 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 the contact

Path variables

id
string GUID required

The contact id relating to the contact wishing to view the service request

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

Request parameters

state
string optional

Filter based on service request state

Enumeration:
ACTIVE

Any status that is not closed

CLOSED

Closed status

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 sR number.

Example:
SR1003
description
string

Decsription of service request

Example:
Pot hole issues in Nicosia Main Road
response
string

If closed - the response can be displayed.

Example:
Contact has been spoken to.
classification
string

The classification which relates to the queue type.

created_date
integer epoch
status
Object

The status of the service request

id
string

status id

Example:
JHSKJDHKFHJS87987
name
string

name of status

Example:
Responded to customer
colour
string

Colour code for status

Example:
FA767HH
priority
string
Enumeration:
URGENT
HIGH
MEDIUM
LOW
resolved
boolean

If the service request is closed it should be noted whether it was resolved or not.

closure_reason
Object

shall be displayed if resolved = FALSE

id
string

id of the configured closure reason

Example:
UGYUGUHIH768787
name
string

the name of reason displayed.

Example:
Passed over to external 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

Example:
1124
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/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",
            "response": "Contact has been spoken to.",
            "classification": "",
            "created_date": 1,
            "status": {
                "id": "JHSKJDHKFHJS87987",
                "name": "Responded to customer",
                "colour": "FA767HH"
            },
            "priority": "LOW",
            "resolved": true,
            "closure_reason": {
                "id": "UGYUGUHIH768787",
                "name": "Passed over to external 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}/files
DELETE /service_requests/{id}/files/{file_id}
GET /service_requests/{id}/files
Add Service Request Attachment
POST /service_requests/{id}/files

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 service request attachment identifier 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/v1/service_requests/6b888b83-b418-752f-604d-0653cf65885d/files 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}/files/{file_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
file_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/v1/service_requests/6b888b83-b418-752f-604d-0653cf65885d/files/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}/files

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

Details about attachment associated with an entity

id
string GUID

The attachment identifier

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

Information about the creative type

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

The attachement description

Example:
see attached file for more details
file
Object

The attachment file details

id
string GUID

The file identifier

Example:
0317868f-28f8-9f56-d248-5a78718b38cc
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

Example:
1124
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/service_requests/6b888b83-b418-752f-604d-0653cf65885d/files HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "content": [
        {
            "id": "af748ada-0521-0503-fc25-b67635a7d14d",
            "mime": "png",
            "description": "Image 1",
            "file": {
                "id": "0317868f-28f8-9f56-d248-5a78718b38cc",
                "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 /services/{id}/devices
Add Service
POST /contacts/{id}/services

Subscribes the customer to new subscription services. Multiple services can be added per Web API call

Path variables

id
string required

Request headers

api_key
string required

The publishable api key for application identification

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

Request body

Object
services
Array required
Min items: 1
Unique items: YES
Object
product_id
string required

The unique identifer of the service product to which the customer subscribes

price_terms_id
string

The unique identifer of the service’s price terms. Required if service has multiple prices

quantity
integer
components
Array
Object
product_id
string
price_terms_id
string
scheduled_date
integer
Example:
1
used_proposed_date
boolean

Responses

200 OK
Body
Object
id
string

The unique identifier of the Add service action

proposed_scheduled_date
integer

A proposed scheduled date

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/contacts/{id}/services HTTP/1.1 

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

{
    "services": [
        {
            "product_id": "",
            "price_terms_id": "",
            "quantity": 1,
            "components": [
                {
                    "product_id": "",
                    "price_terms_id": ""
                }
            ] 
        }
    ],
    "scheduled_date": 1,
    "used_proposed_date": true
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "",
    "proposed_scheduled_date": 1
}
Update Service
PUT /services/{id}

Updates a single susbcription service. A service can be updated either in term of changing its state (e.g. Cancel, Activate) or it could update the service into another service or change its price terms. Each Web API call can either change the service’s state using one of the actions available or change the existing service’s terms.

Path variables

id
string required

The identifier fo the service to be updated

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
DEACTIVATE
CHANGE
CANCEL
REGRET
PAUSE
RESUME
Example:
CHANGE
category_id
string

Cateogrise the action using one of the avaialble categories.

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

The date on which the change will be performed.

Example:
1659594769
use_proposed_date
boolean

When business rules define when the update is allowed to be performed, the Web API’s response will return a proposed date. If this field is set to true, then the Web API call instructs the process to use its proposed date

Example:
true
number_of_days
integer

Applicable and required when pausing a service

Example:
1
price_terms_id
string

The new price of the service. Applicable when changing the service only. A service’s price can be changed to any other price of a different set of price terms that might also include a different billing cycle

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

Applicable and required when upgrading or downgrading a service. The request should include the new service to which the existing one will be changed too as well as the new service’s set of price terms.

product_id
string required

The unique identifier of the new service product

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

Required when the new service has multiple prices.

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

Applicable when the service’s product is a flexible bundle. The request should include the new components to be added to the existing service and/or the existing components that have to be removed. Amending a flexible bundle’s components, also results in classifying the change as an upgrade or a downgrade depending on the service’s recurring pricing.

added
Array

Services that will be included in the bundle

Object
product_id
string

The component’s product identifier

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

The component product’s price terms identifier

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

The existing service components to be removed from the flexible bundle

Object
id
string

The component service’s identifier.

Responses

200 OK
Body
Object
id
string

The unique identifier of the action that updates the service. The identifier is returned only if the change is successfully submitted either to be immediatelly performed or submitted as a scheduled change. When business rules indicate a scheduled date (e.g. at the end of billing cycle), then no identifier is returned. In such cases, a proposed scheduled date is returned and used to infom subscribers about the service change allowed date.

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

Returned in cases where business rules dictate a scheduled date (so no identifier is returned). This proposed date can be used to call the Web API again with the proposed date. Another Web API call should be triggered again, using use_proposed_date set as True so as to enforce scheduling of the service change.

Example:
1659595061
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/services/{id} 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": 1659594769,
    "use_proposed_date": true,
    "number_of_days": 1,
    "price_terms_id": "ab5f8b2e-092f-4848-8f46-31df1c014060",
    "change_to_service": {
        "product_id": "ab5f8b2e-092f-4848-8f46-31df1c014060",
        "price_terms_id": "ab5f8b2e-092f-4848-8f46-31df1c014060"
    },
    "components": {
        "added": [
            {
                "product_id": "ab5f8b2e-092f-4848-8f46-31df1c014060",
                "price_terms_id": "ab5f8b2e-092f-4848-8f46-31df1c014060"
            }
        ],
        "removed": [
            {
                "id": ""
            }
        ]
    }
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "ab5f8b2e-092f-4848-8f46-31df1c014060",
    "proposed_scheduled_date": 1659595061
}
Update Subscription
PUT /subscriptions/{id}

Updates subscription information related to the customer’s billing terms for a set of services

Path variables

id
string required

The unique identifier of a subscription

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
Enumeration:
CHANGE_BILLING_DAY
CHANGE_PAYMENT_METHOD
category_id
string
Example:
ac5401c3-b2e6-2d99-171f-276084d97536
scheduled_date
integer
Example:
1
use_proposed_date
boolean
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
Example:
MONDAY
day_of_month
integer
Example:
15

Responses

200 OK
Body
Object
id
string
Example:
ac5401c3-b2e6-2d99-171f-276084d97536
proposed_scheduled_date
integer
Example:
1
Example 1
PUT https://sandbox.crm.com/self-service/v1/subscriptions/{id} HTTP/1.1 

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

{
    "action": "CHANGE_PAYENT_METHOD",
    "category_id": "ac5401c3-b2e6-2d99-171f-276084d97536",
    "scheduled_date": 1,
    "use_proposed_date": true,
    "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",
    "proposed_scheduled_date": 1
}
List Contact Services
GET /contacts/{id}/services

Returns a list of services to which the contact subscribed to

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
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
classification
string
Enumeration:
TERMED_SERVICE
ONE_TIME_SERVICE
EXPENSE
terms
Object
agreement_date
integer
Example:
12345678
billing_period
Object
duration
integer
Example:
1
uot
string
Example:
MONTHS
billing_day
Object
day_of_month
integer
Example:
1
day_of_week
string
Example:
MONDAY
payment_method
Object
id
string
type
string
Example:
CARD
last4
string
Example:
1234
brand
string
Example:
VISA
funding_type
string
Example:
PREPAID
subscription
Object
id
string
code
string
account
Object
id
string
number
string
name
string
service
Object
id
string
life_cycle_state
string
Example:
EFFECTIVE
added_on
integer
Example:
1234567
removed_on
integer
Example:
1234567
first_activated_on
integer
Example:
1234567
is_recurring_charge
boolean
Example:
true
product
Object
id
string
sku
string
name
string
classification
string
Example:
TERMED_SERVICE
type_composition
string
Example:
FLEXIBLE_BUNDLE
price
Object
id
string
price
number
Example:
9.99
currency
string
Example:
EUR
price_type
string
Example:
FIXED
billing_period
Object
duration
integer
uot
string
tax_model
string
Enumeration:
TAX_INCLUSIVE
TAX_EXCLUSIVE
rating
Object
state
string
Example:
PENDING
rated_from
integer
Example:
12345678
rated_to
integer
Example:
12345678
terms
Object
billing_model
string
Example:
PRE_BILL
auto_renew
boolean
Example:
true
in_contract
boolean
Example:
true
contract_period
Object
duration
integer
Example:
18
uot
string
Example:
MONTHS
start_date
integer
Example:
12345678
end_date
integer
Example:
12345678
termed_period
Object
billing_cycles
integer
Example:
1
start_date
integer
Example:
1
end_date
integer
Example:
1
trial_period
Object
trial_state
string
Example:
IN_TRIAL
start_date
integer
Example:
12345678
end_date
integer
Example:
12345677
duration
integer
Example:
7
uot
string
Example:
DAYS
paused_period
Object
start_date
integer
Example:
12345678
end_date
integer
Example:
12345678
components
Array
Object
id
string
added_on
integer
first_activated_on
integer
in_contract
boolean
life_cycle_state
string
product
Object
id
string
sku
string
name
string
price
Object
price
number
currency
string
trial_period
Object
trial_state
string
Enumeration:
IN_TRIAL
start_date
integer
end_date
integer
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

Example:
1124
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}/services HTTP/1.1 

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

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "content": [ 
        {
            "classification": "EXPENSE",
            "terms": {
                "agreement_date": 12345678,
                "billing_period": {
                    "duration": 1,
                    "uot": "MONTHS"
                },
                "billing_day": {
                    "day_of_month": 1,
                    "day_of_week": "MONDAY"
                },
                "payment_method": {
                    "id": "",
                    "type": "CARD",
                    "last4": "1234",
                    "brand": "VISA",
                    "funding_type": "PREPAID"
                }
            },
            "subscription": {
                "id": "",
                "code": ""
            },
            "account": {
                "id": "",
                "number": "",
                "name": ""
            },
            "service": {
                "id": "",
                "life_cycle_state": "EFFECTIVE",
                "added_on": 1234567,
                "removed_on": 1234567,
                "first_activated_on": 1234567,
                "is_recurring_charge": true,
                "product": {
                    "id": "",
                    "sku": "",
                    "name": "",
                    "classification": "TERMED_SERVICE",
                    "type_composition": "FLEXIBLE_BUNDLE"
                },
                "price": {
                    "id": "",
                    "price": 9.99,
                    "currency": "EUR",
                    "price_type": "FIXED",
                    "billing_period": {
                        "duration": 1,
                        "uot": ""
                    },
                    "tax_model": "TAX_EXCLUSIVE"
                },
                "rating": {
                    "state": "PENDING",
                    "rated_from": 12345678,
                    "rated_to": 12345678
                },
                "terms": {
                    "billing_model": "PRE_BILL",
                    "auto_renew": true,
                    "in_contract": true,
                    "contract_period": {
                        "duration": 18,
                        "uot": "MONTHS",
                        "start_date": 12345678,
                        "end_date": 12345678
                    },
                    "termed_period": {
                        "billing_cycles": 1,
                        "start_date": 1,
                        "end_date": 1
                    }
                },
                "trial_period": {
                    "trial_state": "IN_TRIAL",
                    "start_date": 12345678,
                    "end_date": 12345677,
                    "duration": 7,
                    "uot": "DAYS"
                },
                "paused_period": {
                    "start_date": 12345678,
                    "end_date": 12345678
                },
                "components": [
                    {
                        "id": "",
                        "added_on": 1,
                        "first_activated_on": 1,
                        "in_contract": "",
                        "life_cycle_state": "",
                        "product": {
                            "id": "",
                            "sku": "",
                            "name": ""
                        },
                        "price": {
                            "price": 1,
                            "currency": ""
                        },
                        "trial_period": {
                            "trial_state": "IN_TRIAL",
                            "start_date": 1,
                            "end_date": 1
                        }
                    }
                ]
            }
        }
    ],
    "pages": {
        "page": 2,
        "size": 20,
        "total": 1124
    }
}
Get Service Devices
GET /services/{id}/devices

Returns a list of Devices to which a service is already enabled on and devices onwed by the contact that are eligible to deliver the specified service

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
state
string optional

If not specified, then return all devices regardless of service being enabled on them or not

Enumeration:
ENABLED
DISABLED

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
state
string

Determined whether the service is already enabled on the device or not

Enumeration:
ENABLED

Service enabled on the device

DISABLED

Service not enabled on the device

Example:
ENABLED
device
Object

Detailed information of the device

id
string

Unique dentifier of the device

Example:
4dc0809f-ed91-4b68-b912-5bd6064d901e
serial_number
string

Device’s serial number

Example:
STB0001023222
electronic_id
string

The device’s electronic ID

Example:
123-456-789
product
Object

The traceable physical good related to the Device

id
string

Product unique identifer

Example:
2dc0809f-ed91-4b68-b912-5bd6064d901e
sku
string

Product SKU

Example:
STB001
name
string

Product name

Example:
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/v1/services/{id}/devices HTTP/1.1 

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

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "content": [
        {
            "state": "ENABLED",
            "device": {
                "id": "4dc0809f-ed91-4b68-b912-5bd6064d901e",
                "serial_number": "STB0001023222",
                "electronic_id": "123-456-789",
                "product": {
                    "id": "2dc0809f-ed91-4b68-b912-5bd6064d901e",
                    "sku": "STB001",
                    "name": "Set-Top-Box"
                }
            }
        }
    ]
}
Topups
POST /topups
Topup Wallet
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
topup_date
integer

If not specified, then the current date is set

Example:
14423423
amount
number required

The topup’s amount

currency_code
string

The top up’s currency. If not specified, then the wallet’s primary currency is used (if topping up the wallet). When topping up the account, then it’s the accounts currency by default.

Example:
EUR
code
string

The top up’s code. If not specified, then a unique 16-digit code is assigned

Example:
1234567891234567
payment_method_type
string required

The top up’s payment method

Enumeration:
CARD
Default:
CARD
payment_method_id
string nullable

One of the wallet’s payment methods that will be used to top up the wallet

spend_condition_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

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/v1/wallets/id/topup HTTP/1.1 

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

{
    "topup_date": 14423423,
    "amount": 1,
    "currency_code": "EUR",
    "code": "1234567891234567",
    "payment_method_type": "CARD",
    "payment_method_id": "",
    "spend_condition_id": "",
    "intent_id": "",
    "custom_fields": [
        {
            "key": "custom_key",
            "value": "0001-345"
        }
    ]
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": ""
}
Transfers
POST /transfers
Transfer
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

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
code
string

A unique code to idetify the Transfer. If not specified, then a unique and random 16-digit code will be created.

Example:
1234567891234567
transfer_date
integer

The date on which the transfer is performed It defaults to current date if not specified

Example:
1620999582
amount
number required

The amount of money to be transfered. The amount of money is in the origin account’s currency

Example:
9.99
origin
Object required

From which account or wallet money will be transferred. Either an account or a wallet must be specified

account_id
string nullable
Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
wallet_id
string nullable
Example:
A65ACCE45B2E68DFDCAD1E31269B76D7
destination
Object required

To which account or wallet money will be transferred. Either an account or a wallet must be specified.

account_id
string nullable
Example:
CE45B2E68DFDCAD1E31269B76D7A65AC
wallet_id
string nullable
Example:
B76D7A65ACCCAD1E31269E45B2E68DFD
spend_condition_id
string

Spend conditions identifier if the transferred amount goes into a wallet’ comerce money

Example:
B76D7A65ACCCAD1E31269E45B2E68DFD

Responses

201 Created
Body
Object
id
string

The unique identifier of the Transfer

Example:
B76D7A65ACCCAD1E31269E45B2E68DFD
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/transfers HTTP/1.1 

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

{
    "code": "1234567891234567",
    "transfer_date": 1620999582,
    "amount": 9.99,
    "origin": {
        "account_id": "CAD1E31269B76D7A65ACCE45B2E68DFD",
        "wallet_id": "A65ACCE45B2E68DFDCAD1E31269B76D7"
    },
    "destination": {
        "account_id": "CE45B2E68DFDCAD1E31269B76D7A65AC",
        "wallet_id": "B76D7A65ACCCAD1E31269E45B2E68DFD"
    },
    "spend_condition_id": "B76D7A65ACCCAD1E31269E45B2E68DFD"
}

HTTP/1.1 201 Created 

Content-Type: application/json

{
    "id": "B76D7A65ACCCAD1E31269E45B2E68DFD"
}
Wallet
PUT /wallets/{id}
GET /wallets/{id}/conditional_balances
GET /wallets/{id}/transactions
Update Wallet
PUT /wallets/{id}

Updates Wallet’s Top-up settings

Path variables

id
string required

The Wallet’s identifier

Example:
4AD9C84FA60F9FE407140E20F707726A

Request headers

auth_token
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Request body

Object
auto_topup
Object
threshold
number
Example:
0.01
amount
number
Example:
10.5
payment_method
Object
type
string
Enumeration:
CARD
id
string

The wallet payment method identifier

termed_topup
Object
amount
number
Example:
10.5
frequency
Object
period
string
Example:
MONTHS
value
integer
Example:
1
topup_day
Object
day_of_month
integer
Example:
1
day_of_week
string
Example:
MONDAY
payment_method
Object
type
string
Enumeration:
CARD
id
string

The wallet payment method identifier

Responses

200 OK
Body
Object
id
string

The unique identifier of the updated waller

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/wallets/{id} HTTP/1.1 

auth_token: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "auto_topup": {
        "threshold": 0.01,
        "amount": 10.5,
        "payment_method": {
            "type": "CARD",
            "id": ""
        }
    },
    "termed_topup": {
        "amount": 10.5,
        "frequency": {
            "period": "MONTHS",
            "value": 1
        },
        "topup_day": {
            "day_of_month": 1,
            "day_of_week": "MONDAY"
        },
        "payment_method": {
            "type": "CARD",
            "id": ""
        }
    }
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": ""
}
List Wallet Conditional Balances
GET /wallets/{id}/conditional_balances

Get the wallet’s balances split per spend condition

Path variables

id
string GUID required

The unique identification of the wallet whose balance spend conditions will be retrieved.

Example:
acf8b8ac-a325-a644-c866-a6c9d62ff11b

Request parameters

organisation_id
string required

The organisation that requests the wallet balance

spend_condition_id
string GUID optional

The id of a specific spend condition (optional). If not provided then all spend conditions are retrieved

Example:
4AD9C84FA60F9FE407140E20F707726A
include_expiration
boolean optional

If set to true, then the expiration information will also be retrieved

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
currency_code
string optional

If not specified, the wallet balance breakdown of the primary currency is returned

Example:
EUR

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

Example:
1124
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
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 related to the wallet journal transaction

type
string

The type of the event

Enumeration:
AWARD
SPEND
code
string

The event (unique) code

Example:
123234342342432342324r43
amount
number

The amount that was awarded or spent

Example:
14.99
currency_code
string

The reward event’s currency

Example:
USD
spend_method
string

Define how awards can be/were spent (for SPEND transactions only)

Enumeration:
INSTANT

Instant Discount

AUTOMATIC_SPEND

Automatic Spend Requests

ON_REQUEST

Spend on Customer Request

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:
1669218231
reward_offer
Object

Details of reward offer that triggered the award/spend (spend is related to an offer when it’s an instant discount)

id
string

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
life_cycle_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

Defines the reason for which the fee was applied on wallet

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
submitted_on
integer

The date on which the order was submitted

Example:
1634282740
fulfilled_by
Object

The organisation that fulfilled the order

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

Example:
1124
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/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": "CREDIT",
            "posted_on": 1620912893,
            "reward_event": {
                "type": "SPEND",
                "code": "123234342342432342324r43",
                "amount": 14.99,
                "currency_code": "USD",
                "spend_method": "ON_REQUEST",
                "state": "CANCELLED",
                "date": 1614954223,
                "expiry_date": 1669218231,
                "reward_offer": {
                    "id": "7ff08bc0-c7e9-c9fe-f752-71cfb3ee0dc3",
                    "name": "Birthday Offer"
                }
            },
            "financial_event": {
                "type": "TOP_UP",
                "id": "7ff08bc0-c7e9-c9fe-f752-71cfb3ee0dc3",
                "number": "1234",
                "reference_number": "REF12343",
                "life_cycle_state": "REJECTED",
                "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": "",
                "submitted_on": 1634282740,
                "fulfilled_by": {
                    "id": "087f8a94-a44c-5b0d-f932-2a50ec03c20c",
                    "name": "CRM"
                }
            }
        }
    ],
    "paging": {
        "page": 2,
        "size": 20,
        "total": 1124
    }
}
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
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
Example 1
GET https://sandbox.crm.com/self-service/v1/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

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:
ab5f8b2e-092f-4848-8f46-31df1c014060
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

Contact identifier

Example:
4dc0809f-ed91-4b68-b912-5bd6064d901e
code
string

Contact code

Example:
A0111012
name
string

Contatc 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
Example 1
POST https://sandbox.crm.com/self-service/v1/provisioning/service_commands HTTP/1.1 

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

{
    "integration_id": "ab5f8b2e-092f-4848-8f46-31df1c014060",
    "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
latlng
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

Information about the retrieved address lookups

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 /currencies
GET /custom_fields
GET /industries
GET /industry_sectors
GET /name_day_rules
GET /organisation_tags
GET /product_categories
GET /queues
GET /languages
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

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
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

background_color
string

The background color that the app will use as the main color (hex code). Note: will temporarily co-exist with landing_page_colours & screen_colours for backward compatibility purposes

Example:
#eb4034
card_color
string

The color that te app will use on card-like components (hex code). Note: will temporarily co-exist with landing_page_colours & screen_colours for backward compatibility purposes

Example:
#eb4034
button_color
string

The color that the app will use on all buttons, link text, selected tabs (hex code). Note: will temporarily co-exist with landing_page_colours & screen_colours for backward compatibility purposes

Default:
#d14b50
Example:
#eb4034
landing_page_colours
Object

Colours applied to the landing page

background
string

The landing page background colour (hex code), this can be replaced by an image defined in creatives.usage_type = LANDING_PAGE_BACKGROUND_IMAGE

Example:
#eb4034
button
string

Landing page button colour (hex code)

Example:
#36e3d7
text
string

Landing page text colour (hex code)

Example:
#e3cf36
screen_colours
Object

Colours applied to other screens

button
string

Screen button colour is applied to clickable buttons, selected tabs and text button options (hex code)

Example:
#36e3d7
wallet
string

Colour of the wallet card (hex code). If reward tiering is configured then this colour is overridden with the reward tier colour

Example:
#eb4034
card
string

Colour used on card like components across all screens (hex code)

Example:
#eb4034
advanced_colour_mapping
string

JSON script containing 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 }
dark_mode
boolean

The colour scheme of the app

Default:
false
text_font
string

The text font style that the app will use

Enumeration:
San Francisco
Roboto
Helvetica
Open Sans
Poppins
Georgia
Gilroy
homepage_layout
string

homepage_layout

Enumeration:
LAYOUT1
LAYOUT2
LAYOUT3
LAYOUT4
LAYOUT5
about_details
Object

Defines the app details (about, terms and conditions, privacy policy)

about
Object

Details about us (URL or contact should be specified)

url
string

The about URL

Example:
https?/crm.com
content
string

The about rich content

Example:
About Us
terms_conditions
Object

Details about the terms and conditions (URL or contact should be specified)

url
string

The terms and conditions URL

Example:
https?/crm.com
content
string

The terms and conditions rich content

Example:
Terms & Conditions
privacy_policy
Object

Details about the privacy policy (URL or contact should be specified)

url
string

The privacy policy URL

Example:
https?/crm.com
content
string

The privacy policy rich content

Example:
Privacy Policy
faqs
Object

Details about the FAQs (URL or contact should be specified)

url
string

The FAQs URL

Example:
https?/crm.com
content
string

The FAQs rich content

Example:
FAQs
contact_us
Object

Details about contact us

email_address
string

The contact us email address

Example:
info@crm.com
phone_country_code
string

The contact us phone number country code

Example:
CYP
phone_number
string

The contact us phone number

Example:
22265566
website
string

The contact us website

Example:
https?/crm.com
features
Object

Details about the features that will be supported by the app

billing
boolean

Defines whether billing feature is supported

Example:
true
rewards
boolean

Defines whether rewards feature is supported

Example:
true
ordering
boolean

Defines whether ordering feature is supported

Example:
true
subscriptions
boolean

Defines whether subscriptions feature is supported

Example:
true
finance
boolean

Defines whether finance feature is supported

Example:
false
crm
boolean

Defines whether crm feature is supported

Example:
false
marketing_content
boolean

Defines whether marketing content feature is supported

Example:
false
business_network
boolean

Defines whether business network feature is supported

Example:
false
mobile_passes
boolean

Defines whether mobile passes are configured (applicable only for app_type=WEB (Portal))

business_network_details
Object

Defines the supported business network items (only if business network feature is supported)

multitenancy
boolean

Defines whether multitenancy will be supported

Example:
true
ordering_model
string

Defines the consumer ordering model

Enumeration:
MARKETPLACE
SINGLE_BUSINESS
contact
Object

Supported contact features for app & portal

is_supported
boolean

Are contact features supported?

Example:
true
code_representation
string nullable

How the contact code will be depicted on the app/portal, for scanning purposes

Enumeration:
BARCODE

As a barcode

QR_CODE

As a QR code

finance_details
Object

Defines the supported finance items (only if finance feature is supported)

wallet_top_up
boolean

Defines whether contacts will be able to top up their wallets

Example:
false
redeem_pass
boolean

Defines whether contacts will be able to redeem a pass

Example:
true
redeem_pass_attributes
Array

Defines whether redeem pass should be supported by other attributes

string
Enumeration:
CODE
VALUE
PIN
ordering_details
Object

Defines the supported ordering items (only if ordering feature is supported)

ordering_pickup
boolean

Defines whether pick up is supported as supply method

Example:
true
ordering_delivery
boolean

Defines whether delivery is supported as supply method

Example:
true
ordering_direct_sale
boolean

new object features.ordering_details.ordering_direct_sale

preferred_organisation_orders
boolean

Defines whether contact can set preferred organisation for ordering

Example:
true
ordering_countries
Array

Defines the countries where orders will be applicable

Object
country
string

The country (code)

Example:
CYP
allow_wallet_funds_payment
boolean

Defines whether contact can pay for order using wallet funds

Example:
true
allow_specific_funds_amount
boolean

Defines whether contacts can specific the wallet funds amount to use on orders

Example:
true
allow_full_basket_wallet_fund
boolean

Defines whether the wallet fund amount must cover the full basket amount

Example:
false
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:
fc76f42c-6fcd-6f25-d0a3-2de49163cdf6
name
string

the order catalog name

Example:
WiFi Products
rewards_details
Object

Defines the supported rewards items (only if rewards feature is supported)

automatic_spends
boolean

Defines whether automatic spend preferences will be supported

Example:
true
automatic_spend_options
Object

Details about the automatic spend settings that a contact can set up

any_purchase
boolean

Defines whether automatic spends can be set for any purchase

Example:
true
any_purchase_collect_on
string

Defines whether contact can set preferred merchants on which automatic spends wil be applied (applicable only if any_purchase = true)

Enumeration:
ANY_MERCHANT

Contact auto spends will be applied on all merchant purchases

PREFERRED_MERCHANT

Contact will have the ability to select the merchants that auto spends will be applied

next_purchase_merchant
boolean

Defines whether automatic spends can be set for next purchase at merchant X

Example:
true
return_cashback
boolean

Defines whether the ability to select payment method for cashback returns will be supported

Example:
true
customer_selfservice_purchases
boolean

Defines whether customer self service purchase identification and OTP request to spend will be supported

Example:
true
reward_tiering
boolean

Defines whether reward tiering will be supported

Example:
false
preferred_organisation_rewards
boolean

Defines whether contact can set preferred organisation for rewards

Example:
true
refer_friend
boolean

Defines whether refer a friend will be supported

Example:
true
refer_friend_communication_method
string

Defines the communication method that should be used for refer a friend

Enumeration:
EMAIL
SMS
otp_spend
boolean

Defines whether OTP send will be supported

Example:
true
otp_spend_attributes
Array

Defines the supplementary attributes that will be supported for OTP spends

string
Enumeration:
AMOUNT
reclaim_purchase_methods
Array

Defines how reclaim purchase identification will be made

string
Enumeration:
BARCODE
TRX_CODE
crm_details
Object

Defines the supported crm items

Example:
false
service_request
boolean

Defines whether contacts will be able to submit service requests

Example:
false
marketing_content_details
Object

Defines marketing content to display in front-end systems

embedded_links
Array

Define links for embedded browser in front-end systems

Object
title
string

Defines the title of the link

Example:
News & upcoming event
url
string

Defines the url of the link

Example:
https://www.guababeachbar.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:
CA123456789AQWSXZAQWS1236547896541
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

Information about the 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
merchant_app
Object

Defines the supported Merchant App items

allow_spend
boolean

Defines whether the merchant app supports submission of Spend requests

Example:
true
restrict_fully_covered
boolean

Defines whether the purchase (front-end reduction) will be posted successfully only if requested spend amount fully covers the purchase amount

Example:
true
auth_support
Object

Details on how customers can auth by the app

email_password
boolean

Supported authentication based on email and password

Example:
true
email_verification
boolean

Email Verification required (if auth method = email & password)

Example:
false
email_otp
string

Supported authentication based on one time password

Example:
false
sms_otp
boolean

Supported authentication based on one time password

Example:
true
facebook
boolean

Supported authentication based on Facebook

Example:
true
fb_app_id
string

Facebook App ID required for FB authentication

Example:
sfsdf-23-we-wer-3ew-dw
google
boolean

Supported authentication based on Google

Example:
true
google_app_id
string

Google App ID required for Google authentication

Example:
sfsdf-23-we-wer-3ew-dw
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:
false
delete_existing
boolean

Defiens whether contact will be able to delete existing authentication details

Example:
false
contact
Object

Details on supported contact attributes

profile_details
Array

Lists all supported contact attributes

Object
type
string

The contact attribute

Enumeration:
BIRTHDATE
NAMEDAY
GENDER
is_supported
boolean

Defines if the profile attribute is supported or not

Example:
true
agreement_countries
Array

Lists all supported countries of agreement that contact can register to

Object
country
string

The country code

Example:
CYP
is_default
boolean

Defines if the country is the default one or not

Example:
true
allowed_payment_methods
Array

The allowed payment methods for the business

Object
payment_method_type
string

The allowed payment methods configured for the Business

Enumeration:
CASH
CARD
label
string

The label of the payment method for display purposes

Example:
Cash
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:
CA123456789AQWSXZAQWS1236547896541
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

Information about the 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
background_creative
Object

The image/video/animation that will be displayed in the app landing page

id
string GUID

The creative identifier

Example:
CA123456789AQWSXZAQWS1236547896541
usage_type
string

Information about the creative type

Enumeration:
BACKGROUND
width
integer

The creative width

Example:
2159
height
integer

The creative height

Example:
2159
format
string

The creative format

Example:
jpg, lottie, mp4
url
string

The creative content URL

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

The creative public identifier

Example:
crm-com/image
media
Array

Information about the creative transformations

Object
width
integer

The transformed creative width

height
integer

The transformed creative height

url
string

The transformed creative URL

Example:
https://asset.crm.com/image/offer/c_scale,w_200/background.jpg
partner_creatives
Array

Partner creatives for an partners assigned to the Business (by the Service Owner)

Object
id
string

The creative identifier

Example:
WSXZAQWS1236547896541A123456789AQC
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/partner.jpg
public_id
string

The creative public identifier

Example:
crm-com/image
media
Array

Information about the creative transformations

Object
width
integer

The transformed creative width

Example:
200
height
string

The transformed creative height

Example:
300
url
string

The transformed creative URL

Example:
https://asset.crm.com/image/offer/c_scale,w_200/partner.jpg
integrations
Array

Details about the supported integrations

Object
type
string

The integration type

Enumeration:
PAYMENT_GATEWAYS
TOKENIZATION_SERVICES

Defined on the Service Owner level (inheritly utilized by Business as well)

id
string GUID

The integration identifier

Example:
9f8d5fb5-81cc-140c-bdf4-834171abfa5d
name
string

The integration name

Example:
JCC
parameters
Array

A list of parameters that are required by the integration

Object
key
string

The parameter key name

Example:
type
value
string

The parameter value

Example:
pan_number
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/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",
    "app_type": "WEB",
    "public_key": "71285392-8660-43e2-8fc3-ef1a61edbcd0",
    "appearance": {
        "background_color": "#eb4034",
        "card_color": "#eb4034",
        "button_color": "#eb4034",
        "landing_page_colours": {
            "background": "#eb4034",
            "button": "#36e3d7",
            "text": "#e3cf36"
        },
        "screen_colours": {
            "button": "#36e3d7",
            "wallet": "#eb4034",
            "card": "#eb4034"
        },
        "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     }",
        "dark_mode": "false",
        "text_font": "San Francisco",
        "homepage_layout": "LAYOUT3"
    },
    "about_details": {
        "about": {
            "url": "https?/crm.com",
            "content": "About Us"
        },
        "terms_conditions": {
            "url": "https?/crm.com",
            "content": "Terms & Conditions"
        },
        "privacy_policy": {
            "url": "https?/crm.com",
            "content": "Privacy Policy"
        },
        "faqs": {
            "url": "https?/crm.com",
            "content": "FAQs"
        },
        "contact_us": {
            "email_address": "info@crm.com",
            "phone_country_code": "CYP",
            "phone_number": "22265566",
            "website": "https?/crm.com"
        }
    },
    "features": {
        "billing": true,
        "rewards": true,
        "ordering": true,
        "subscriptions": "true",
        "finance": "false",
        "crm": "false",
        "marketing_content": "false",
        "business_network": "false",
        "mobile_passes": true,
        "business_network_details": {
            "multitenancy": true,
            "ordering_model": "SINGLE_BUSINESS"
        },
        "contact": {
            "is_supported": true,
            "code_representation": "BARCODE"
        },
        "finance_details": {
            "wallet_top_up": "false",
            "redeem_pass": "true",
            "redeem_pass_attributes": [
                "PIN"
            ]
        },
        "ordering_details": {
            "ordering_pickup": true,
            "ordering_delivery": true,
            "ordering_direct_sale": true,
            "preferred_organisation_orders": "true",
            "ordering_countries": [
                {
                    "country": "CYP"
                }
            ],
            "allow_wallet_funds_payment": "true",
            "allow_specific_funds_amount": "true",
            "allow_full_basket_wallet_fund": "false",
            "order_catalogs": [
                {
                    "id": "fc76f42c-6fcd-6f25-d0a3-2de49163cdf6",
                    "name": "WiFi Products"
                }
            ]
        },
        "rewards_details": {
            "automatic_spends": true,
            "automatic_spend_options": {
                "any_purchase": "true",
                "any_purchase_collect_on": "ANY_MERCHANT",
                "next_purchase_merchant": "true"
            },
            "return_cashback": true,
            "customer_selfservice_purchases": true,
            "reward_tiering": "false",
            "preferred_organisation_rewards": "true",
            "refer_friend": "true",
            "refer_friend_communication_method": "SMS",
            "otp_spend": "true",
            "otp_spend_attributes": [
                "AMOUNT"
            ],
            "reclaim_purchase_methods": [
                "BARCODE"
            ]
        },
        "crm_details": {
            "service_request": "false"
        },
        "marketing_content_details": {
            "embedded_links": [
                {
                    "title": "News & upcoming event",
                    "url": "https://www.guababeachbar.com/news&events",
                    "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"
                                }
                            ]
                        }
                    ]
                }
            ]
        },
        "merchant_app": {
            "allow_spend": true,
            "restrict_fully_covered": "true"
        }
    },
    "auth_support": {
        "email_password": true,
        "email_verification": "false",
        "email_otp": "false",
        "sms_otp": true,
        "facebook": true,
        "fb_app_id": "sfsdf-23-we-wer-3ew-dw",
        "google": true,
        "google_app_id": "sfsdf-23-we-wer-3ew-dw"
    },
    "contact": {
        "profile_details": [
            {
                "type": "GENDER",
                "is_supported": true
            }
        ],
        "agreement_countries": [
            {
                "country": "CYP",
                "is_default": "true"
            }
        ]
    },
    "allowed_payment_methods": [
        {
            "payment_method_type": "CASH",
            "label": "Cash"
        }
    ],
    "creatives": [
        {
            "id": "CA123456789AQWSXZAQWS1236547896541",
            "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"
                }
            ]
        }
    ],
    "background_creative": {
        "id": "CA123456789AQWSXZAQWS1236547896541",
        "usage_type": "BACKGROUND",
        "width": 2159,
        "height": 2159,
        "format": "jpg, lottie, mp4",
        "url": "https://assets.crm.com/image/background.jpg",
        "public_id": "crm-com/image",
        "media": [
            {
                "width": 1,
                "height": 1,
                "url": "https://asset.crm.com/image/offer/c_scale,w_200/background.jpg"
            }
        ]
    },
    "partner_creatives": [
        {
            "id": "WSXZAQWS1236547896541A123456789AQC",
            "width": 2159,
            "height": 3075,
            "format": "jpg",
            "url": "https://assets.crm.com/image/partner.jpg",
            "public_id": "crm-com/image",
            "media": [
                {
                    "width": 200,
                    "height": "300",
                    "url": "https://asset.crm.com/image/offer/c_scale,w_200/partner.jpg"
                }
            ]
        }
    ],
    "integrations": [
        {
            "type": "PAYMENT_GATEWAYS",
            "id": "9f8d5fb5-81cc-140c-bdf4-834171abfa5d",
            "name": "JCC",
            "parameters": [
                {
                    "key": "type",
                    "value": "pan_number"
                }
            ]
        }
    ]
}
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

Example:
1124
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 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

The request has succeeded

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

Example:
1124
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/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

Returns a list of “enabled” custom fields configured in the system

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
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
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

Example:
1124
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

Example:
1124
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 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 Organisation Tags
GET /organisation_tags

Returns a list of organisation tags

Request parameters

name
string optional

The name of the organisation tag

Example:
Bar & Grill
industry
array of string optional

Defines which merchant tags belonging to industry should be retrieved

Collection format: csv
industry_sector
array of string optional

Defines which merchant tags belonging to industry sector should be retrieved

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

Information about the retrieved organisation tags

Object
id
string GUID

The organisation tag identifier

Example:
E4AC253114B84DF2B347996DC277DDDF
name
string

The organisation 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

Example:
1124
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 /organisation_tags HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "content": [
        {
            "id": "E4AC253114B84DF2B347996DC277DDDF",
            "name": "Restaurant"
        }
    ],
    "paging": {
        "page": 2,
        "size": 20,
        "total": 100
    }
}
List Product Categories
GET /product_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
product_count
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/v1/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,
            "product_count": 2,
            "available_in_order_menus": "false",
            "parent": {
                "id": "9365d945-2c62-be0e-a8dc-45736fdfa5b5",
                "name": "Drinks"
            }
        }
    ]
}
List Queues
GET /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 of this queue

Object
id
string

Service request category id

Example:
2f4ffc37-9463-4f17-9549-dd3cbc24f7e7
name
string

Service request category name

Example:
Self-service SR
Example 1
GET https://sandbox.crm.com/self-service/v1/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": "HIGH",
                    "urgency": "URGENT",
                    "priority": "HIGH"
                },
                "default_tags": [
                    {
                        "tag_id": "93861e6b-2482-784a-5ff7-9d1c16a318e3",
                        "name": "",
                        "colour": ""
                    }
                ],
                "default_categories": [
                    {
                        "id": "2f4ffc37-9463-4f17-9549-dd3cbc24f7e7",
                        "name": "Self-service SR"
                    }
                ]
            }
        }
    ]
}

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": "HIGH",
                    "urgency": "LOW",
                    "priority": "URGENT"
                },
                "default_tags": [
                    {
                        "tag_id": "93861e6b-2482-784a-5ff7-9d1c16a318e3",
                        "name": "",
                        "colour": ""
                    }
                ],
                "default_categories": [
                    {
                        "id": "2f4ffc37-9463-4f17-9549-dd3cbc24f7e7",
                        "name": "Self-service SR"
                    }
                ]
            }
        }
    ]
}
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
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

Example:
1124
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/languages HTTP/1.1 

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

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "content": [
        {
            "language_code": "EN"
        }
    ],
    "paging": {
        "page": 2,
        "size": 20,
        "total": 1124
    }
}
Recommendations
GET /products/recommendation
Product Recommendation
GET /products/recommendation

Provides recommendation on products that the business wants to promote to its consumers through an application:

  • Business promotes its best selling products (in term of quantities of items sold to consumers)
  • Business recommends products to include in purchases and this will result in applying either a Reward Offer or a Promotion to the consumer.
  • Business informs the consumer a list of products on which they can spend their awarded amounts based on their Busines spocket’s commerce balance and its product conditions.

Request parameters

contact_id
string required

The contact (identifier) for which product recommendation is performed.

size
integer optional

The number of products to be returned in each recommended category. If not specified, then it defaults to 5, and the maximum allowed size is 50.

Max: 50
Default:
5

Responses

200 OK
Body
Object
category
Object
type
string
Example:
REWARD_OFFER
id
string
Example:
string
name
string
Example:
string
description
string
validity_ends
integer
Example:
123456789
product
Object
id
string
Example:
string
sku
string
Example:
string
name
string
Example:
string
description
string
Example:
string
pricing
Object
id
string
Example:
string
price
number
Example:
5.99
currency_code
string
Example:
EUR
price_terms
Object
billing_cycle
Object
duration
integer
Example:
1
uot
string
Example:
MONTH
tiers
Object
upper_tier
integer
Example:
5
number_of_tiers
integer
Example:
3
Example 1
GET https://sandbox.crm.com/self-service/v1/products/recommendation?contact_id= HTTP/1.1 

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "category": {
        "type": "REWARD_OFFER",
        "id": "string",
        "name": "string",
        "description": "",
        "validity_ends": 123456789
    },
    "product": {
        "id": "string",
        "sku": "string",
        "name": "string",
        "description": "string",
        "pricing": {
            "id": "string",
            "price": 5.99,
            "currency_code": "EUR",
            "price_terms": {
                "billing_cycle": {
                    "duration": 1,
                    "uot": "MONTH"
                }
            },
            "tiers": {
                "upper_tier": 5,
                "number_of_tiers": 3
            }
        }
    }
}