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.

Authentication

The CRM.COM Self Service API uses a JWT token that is returned from a contact authentication call either using user / password or One Time Password request.

A pubic api key should be provided as part of the header for application identification, i.e. -H “api_key : crm_test_;dwfwgiuhjr412edws”

All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.

Example 1
curl -X POST \
  https://api.crm.com/selfservice/v3/contact/98765432/paymentmethod \
  -H 'Authorization: Bearer secret_U0tfZGtqYXNmZGJob2VJUkZKRVdGSjo=' \
  -H 'api_key: 8c54d563-b991-4b76-8a83-557c08166f95' \
  -H 'Content-Type: application/json' \ 
  -d '{
    "accounts": [{
        "account_id": "CAD1E31269B76D7A65ACCE45B2E68DFD"
        "opt_in_subscriptions": true,
        "opt_in_purchases": true,
        "use_primary": false
    }],
    "payment_method_type": "STRIPE",
    "card": {
        "gateway_tokens": [{
            "gateway": "STRIPE",
            "token": "strp_dwfgrjefegrfew"
        }]
    }
}’
Error Codes

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

  • 2xx success status codes confirm that your request worked as expected
  • 4xx error status codes indicate an error because of the information provided (e.g., a required parameter was omitted)
  • 5xx error status codes are rare and indicate an error with Stripe’s servers

Please note that some 4xx errors that could be handled programmatically (e.g. a contact already exists) contain the following informaiion

  • HTTP Code (programmatic consumption)
  • Message (human-readable)
  • Attribute (attribute that caused the error)

Below is a list of our common error codes that can be returned, along with additional information about how to resolve them

200 OK
Applied to all operations

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 and/or web-based applications.

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
Authentication

Ability to authenticate customers via a Mobile App or a Portal

POST /contacts/authenticate
POST /contacts/refresh
POST /contacts/otp
POST /contacts/validate
POST /contacts/validate-otp
POST /contacts/forgot_password
POST /contacts/change_password
POST /contacts/{id}/sign_out
Authenticate Contact
POST /contacts/authenticate

Authentication

Open

Authenticate a contact and provide a token for subsequent API access

Request headers

api_key
string required

The publc api key for application identification

Example:
731e4023-4c04-4278-8eb5-240651317e46
Content-Type
string optional
Example:
application/json

Request body

Object
username
string required

The contact’s username

Example:
johndoe@crm.com
password
string required

The contact’s password

Example:
password1234
remember_me
boolean nullable

Defines whether the contact’s credentials will not be required on the next authentication (Applicable from CRM.COM R18.2.0)

Example:
true
Examples

Responses

200 OK

The request has succeeded

Body
Object
access_token
string

The token that can be used in subsequent API calls

Example:
eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhMjc4ZDNlNS05YjhlLTQzNmUtOTIzMC03MGYzZTJkZjFjYTUiLCJleHAiOjE1Njg1NTQxMjJ9.LemqPPThkqfakkKS6CdkNvV1Lnc88CWirEpHOPnWjJPQz02zgkKSwfbvrEsl3OmR2LUhDILsOXf4x-GPFmNJCg
refresh_token
string

The token that can be used to obtain a new access token when the current one becomes invalid or expires

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

The token expiration date

Example:
1572530655
Example 1
POST /contacts/authenticate HTTP/1.1 

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

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

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "access_token": "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhMjc4ZDNlNS05YjhlLTQzNmUtOTIzMC03MGYzZTJkZjFjYTUiLCJleHAiOjE1Njg1NTQxMjJ9.LemqPPThkqfakkKS6CdkNvV1Lnc88CWirEpHOPnWjJPQz02zgkKSwfbvrEsl3OmR2LUhDILsOXf4x-GPFmNJCg",
    "refresh_token": "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhMjc4ZDNlNS05YjhlLTQzNmUtOTIzMC03MGYzZTJkZjFjYTUiLCJleHAiOjE1Njg1NTQxMjJ9.LemqPPThkqfakkKS6CdkNvV1Lnc88CWirEpHOPnWjJPQz02zgkKSwfbvrEsl3OmR2LUhDILsOXf4x-GPFmNJCg",
    "exp": "1572530655"
}
Refresh Contact
POST /contacts/refresh

Provide authentication information using a refresh token that can be used in subsequent API calls

Notes

Available from CRM.COM R18.2.0

Request headers

refresh_token
string required

The token that will be used to issue new authentication information

Example:
fdb8fdbecf1d03ce5e6125c067733c0d51de209c
api_key
string required

The publc api key for application identification

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

Responses

200 OK

The request has succeeded

Body
Object
access_token
string

The token that can be used in subsequent API calls

Example:
eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhMjc4ZDNlNS05YjhlLTQzNmUtOTIzMC03MGYzZTJkZjFjYTUiLCJleHAiOjE1Njg1NTQxMjJ9.LemqPPThkqfakkKS6CdkNvV1Lnc88CWirEpHOPnWjJPQz02zgkKSwfbvrEsl3OmR2LUhDILsOXf4x-GPFmNJCg
refresh_token
string

The token that can be used to obtain a new access token when the current one becomes invalid or expires

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

The token expiration date

Example:
1572530655
400 Bad Request

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

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

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

404 Not Found

The requested resource does not exist

500 Internal Server Error

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

502 Bad Gateway

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

503 Service Unavailable

The server is currently unable to handle the request 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/refresh HTTP/1.1 

refresh_token: fdb8fdbecf1d03ce5e6125c067733c0d51de209c
api_key: 8c54d563-b991-4b76-8a83-557c08166f95

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "access_token": "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhMjc4ZDNlNS05YjhlLTQzNmUtOTIzMC03MGYzZTJkZjFjYTUiLCJleHAiOjE1Njg1NTQxMjJ9.LemqPPThkqfakkKS6CdkNvV1Lnc88CWirEpHOPnWjJPQz02zgkKSwfbvrEsl3OmR2LUhDILsOXf4x-GPFmNJCg",
    "refresh_token": "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhMjc4ZDNlNS05YjhlLTQzNmUtOTIzMC03MGYzZTJkZjFjYTUiLCJleHAiOjE1Njg1NTQxMjJ9.LemqPPThkqfakkKS6CdkNvV1Lnc88CWirEpHOPnWjJPQz02zgkKSwfbvrEsl3OmR2LUhDILsOXf4x-GPFmNJCg",
    "exp": "1572530655"
}
Request One Time Password
POST /contacts/otp

Request a one time password for a specific contact via email or SMS. The request will send an outbound validation code that can be used to verify the contact

Request headers

api_key
string required

The publc api key for application identification

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

Request body

Object
email
string required nullable

The email where the OTP will be sent to

Example:
johndoe@crm.com
phone
string required nullable

The phone number where the OTP will be sent to

Example:
+447515650839

Responses

200 OK

The request has succeeded

Body
Object
obfuscated_value
string

The obfuscated send method value (Applicable from CRM.COM R18.2.0)

Example:
+35799***834
400 Bad Request

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

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

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

404 Not Found

The requested resource does not exist

500 Internal Server Error

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

502 Bad Gateway

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

503 Service Unavailable

The server is currently unable to handle the request 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

Request an OTP via email

POST http://staging.crm.com/self-service/v1/contacts/otp HTTP/1.1 

api_key: 731e4023-4c04-4278-8eb5-240651317e46
Content-Type: application/json

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

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "obfuscated_value": "35799***834"
}

Request an OTP via phone

POST /contacts/otp HTTP/1.1 

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

{
    "phone": "+35799000834"
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "obfuscated_value": "35799***834"
}
Validate Contact
POST /contacts/validate

Identify a specific contact using a set of contact identifiers and request a one time password for contact verification

Request headers

api_key
string required

The publc api key for application identification

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

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

The predetermined information that will be used to identify the contact

Enumeration:
BIRTHDATE
PASSPORT
CARD
PHONE
EMAIL
ID_NUMBER
REFRESH_TOKEN
value
string

The value of the credential to check

Example:
1234567

Responses

200 OK

The request has succeeded

Body
Object
obfuscated_value
string

The obfuscated send method value (Applicable from CRM.COM R18.2.0)

Example:
+35799***834
auth_otp
string GUID

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 http://staging.crm.com/self-service/v1/contacts/validate HTTP/1.1 

api_key: 731e4023-4c04-4278-8eb5-240651317e46
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"
}
Validate One Time Password
POST /contacts/validate-otp

Verifies an one time password that was requested

Notes

Part of the OTP validation the email, phone, id_number, birthdate, passport, card or auth_otp should be provided

Request headers

api_key
string required

The publc api key for application identification

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

Request body

Object
email
string required nullable

The email that was used for generating an OTP (Prior CRM.COM R18.2.0 this was semi-optional)

Example:
johndoe@crm.com
phone
string required nullable

The phone number that was used for generaiing an OTP (Prior CRM.COM R18.2.0 this was semi-optional)

Example:
+447515650839
id_number
string required nullable

The id number that was used for generating an OTP (Available from CRM.COM R18.5.0)

birthdate
string required nullable

The birthdate that was used for generating an OTP (Available from CRM.COM R18.5.0)

passport
string required nullable

The passport that was used for generating an OTP (Available from CRM.COM R18.5.0)

card
string required nullable

The card number that was used for generating an OTP (Available from CRM.COM R18.5.0)

auth_otp
string required nullable

The one time password auth id (Available from CRM.COM R18.5.0)

Example:
731e4023-4c04-4278-8eb5-240651317e46
code
string required

The OTP that should be used for verification purposes

Example:
123456789
remember_me
boolean nullable

Defines whether an OTP will not be required on the next authentication (Applicable from CRM.COM R18.2.0)

Example:
false
Examples

Responses

200 OK

The request has succeeded

Body
Object
access_token
string

The token that can be used in subsequent API calls

Example:
eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhMjc4ZDNlNS05YjhlLTQzNmUtOTIzMC03MGYzZTJkZjFjYTUiLCJleHAiOjE1Njg1NTQxMjJ9.LemqPPThkqfakkKS6CdkNvV1Lnc88CWirEpHOPnWjJPQz02zgkKSwfbvrEsl3OmR2LUhDILsOXf4x-GPFmNJCg
refresh_token
string

The token that can be used to obtain a new access token when the current one becomes invalid or expires

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

The token expiration date

Example:
1572530655
400 Bad Request

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

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

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

404 Not Found

The requested resource does not exist

500 Internal Server Error

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

502 Bad Gateway

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

503 Service Unavailable

The server is currently unable to handle the request 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 HTTP/1.1 

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

{
    "email": "johndoe@crm.com",
    "code": "123456789"
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "access_token": "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhMjc4ZDNlNS05YjhlLTQzNmUtOTIzMC03MGYzZTJkZjFjYTUiLCJleHAiOjE1Njg1NTQxMjJ9.LemqPPThkqfakkKS6CdkNvV1Lnc88CWirEpHOPnWjJPQz02zgkKSwfbvrEsl3OmR2LUhDILsOXf4x-GPFmNJCg",
    "refresh_token": "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhMjc4ZDNlNS05YjhlLTQzNmUtOTIzMC03MGYzZTJkZjFjYTUiLCJleHAiOjE1Njg1NTQxMjJ9.LemqPPThkqfakkKS6CdkNvV1Lnc88CWirEpHOPnWjJPQz02zgkKSwfbvrEsl3OmR2LUhDILsOXf4x-GPFmNJCg",
    "exp": "1572530655"
}
Forgot Password
POST /contacts/forgot_password

Requests a password reset for an existing contact

Request headers

api_key
string required

The publc api key for application identification

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

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 http://staging.crm.com/self-service/v1/contacts/forgot_password HTTP/1.1 

api_key: 731e4023-4c04-4278-8eb5-240651317e46
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 http://staging.crm.com/self-service/v1/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

Notes

Available from CRM.COM R18.5.0

Request headers

Authorization
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 http://staging.crm.com/self-service/v1/contacts/CAD1E31269B76D7A65ACCE45B2E68DFD/sign_out HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 
Contact

Contact Management

POST /contacts/register
POST /contacts/{id}/credentials
PUT /contacts/{id}
GET /contacts/{id}
POST /contacts/{id}/addresses
PUT /contacts/{id}/addresses/{address_id}
DELETE /contacts/{id}/addresses/{address_id}
POST /contacts/{id}/phones
PUT /contacts/{id}/phones/{phone_id}
DELETE /contacts/{id}/phones/{phone_id}
POST /contacts/{id}/emails
PUT /contacts/{id}/emails/{email_id}
DELETE /contacts/{id}/emails/{email_id}
POST /contacts/verify_email
POST /contacts/{id}/devices
GET /contacts/{id}/devices
DELETE /contacts/{id}/devices/{device_id}
PUT /contacts/{id}/consents
Register new Contact
POST /contacts/register

Create a new contact (person/company) into the system

Request headers

api_key
string required

The publc api key for application identification

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

Request body

Object
first_name
string required nullable

The contact first name (required if the contact represents a person)

Example:
John
middle_name
string nullable

The contact middle name (applicable if the contact represents a person)

Example:
Alias
last_name
string required nullable

The contact last name (required if the contact represents a person)

Example:
Doe
email
string required nullable

The email address of the contact

Example:
johndoe@crm.com
password
string required nullable

The initial password of the contact

Example:
password1234!
phone_country_code
string required nullable

The country that the phone number is registered

Example:
CYP
phone_number
string required nullable

The phone number of the contact

Example:
+447515650939
service_acceptance
boolean required nullable

Defines whether the contact has accepted the client service

Example:
true
email_verification
string nullable

Defines whether the email should be verified (Applicable from CRM.COM R18.2.0)

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

Register a new PERSON contact

POST /contacts/register HTTP/1.1 

Content-Type: application/json

{
    "first_name": "John",
    "middle_name": "Alias",
    "last_name": "Doe",
    "email": "johndoe@crm.com",
    "password": "password1234!",
    "phone_country_code": "CYP",
    "phone_number": "+447515650939",
    "service_acceptance": "true"
}

HTTP/1.1 200 OK 
Add authorisation credentials to existing Contact
POST /contacts/{id}/credentials

Create a set of credentials for an existing customer

Path variables

id
string GUID required

The contact that should be updated

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD

Request headers

Authorization
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Request body

Object
username
string required

The contact’s username

Example:
johndoe@crm.com
password
string required

The contact’s password

Example:
password1234
Examples

Responses

200 OK

The request has succeeded

Body
Object
access_token
string

The token that can be used in subsequent API calls

Example:
eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhMjc4ZDNlNS05YjhlLTQzNmUtOTIzMC03MGYzZTJkZjFjYTUiLCJleHAiOjE1Njg1NTQxMjJ9.LemqPPThkqfakkKS6CdkNvV1Lnc88CWirEpHOPnWjJPQz02zgkKSwfbvrEsl3OmR2LUhDILsOXf4x-GPFmNJCg
refresh_token
string

The token that can be used to obtain a new access token when the current one becomes invalid or expires

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

The token expiration date

Example:
1572530655
400 Bad Request

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

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

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

404 Not Found

The requested resource does not exist

500 Internal Server Error

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

502 Bad Gateway

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

503 Service Unavailable

The server is currently unable to handle the request 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 /contact/CAD1E31269B76D7A65ACCE45B2E68DFD/register_existing HTTP/1.1 

Content-Type: application/json

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

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "access_token": "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhMjc4ZDNlNS05YjhlLTQzNmUtOTIzMC03MGYzZTJkZjFjYTUiLCJleHAiOjE1Njg1NTQxMjJ9.LemqPPThkqfakkKS6CdkNvV1Lnc88CWirEpHOPnWjJPQz02zgkKSwfbvrEsl3OmR2LUhDILsOXf4x-GPFmNJCg",
    "refresh_token": "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhMjc4ZDNlNS05YjhlLTQzNmUtOTIzMC03MGYzZTJkZjFjYTUiLCJleHAiOjE1Njg1NTQxMjJ9.LemqPPThkqfakkKS6CdkNvV1Lnc88CWirEpHOPnWjJPQz02zgkKSwfbvrEsl3OmR2LUhDILsOXf4x-GPFmNJCg",
    "exp": "1572530655"
}
Update Contact
PUT /contacts/{id}

Updates an existing contact

Path variables

id
string GUID required

The contact identifier that will be updated

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD

Request headers

Authorization
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Request body

Object
code
string nullable

The contact’s code

Example:
ABC-123
company_name
string nullable

The company name

Example:
Alpha Bravo
title
string nullable

The person title

Example:
Sir
first_name
string nullable

The person first name

Example:
John
middle_name
string nullable

The person middle name

Example:
Alias
last_name
string nullable

The person last name

Example:
Doe
preferred_language_code
string nullable

The contact preferred language

Example:
ENG
statutory_number
string nullable

The contact statutory number

Example:
EF-12345
direct_marketing
boolean nullable

The contact authorisation setting for direct marketing

Example:
false
affiliate_marketing
string nullable

The contact authorisation setting for affiliate marketing

Example:
true
category
Object

The contact’s category. Either id or code should be specified

id
string nullable

The category’s GUID

code
string nullable

The category’s code

demographics
Object nullable

Information about the person demographics

gender
string nullable

The person gender

Enumeration:
MALE
FEMALE
country_of_residence_code
string nullable

The person country of residence

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

Information about the company profile

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

The industry of the company/ Either the id or code should be specified

id
string nullable
code
string nullable
industry_sectors
Array

Information about the industry sectors

Object
id
string GUID

The industry sector identifier

Example:
CAIQ1234567891234567891234567891
code
string

the industry sector code

addresses
Array nullable

Information about the contact’s addresses

Object
id
string GUID required nullable

The address identifier

Example:
CK1234567890123456789012345678
address_type
string required nullable

The type of the address

Enumeration:
HOME
BUSINESS
POBOX
CUSTOM1
CUSTOM2
CUSTOM3
CUSTOM4
CUSTOM5
is_primary
boolean nullable

Defines whether the address is the primary one

Example:
true
address_line_1
string required

The address information

Example:
Elia Papakyriakou
address_line_2
string nullable

Additional address information

Example:
Tower Stars
state_province_county
string nullable

The address state/province/county

Example:
Egkomi
town_city
string nullable

The address town/city

Example:
Nicosia
postal_code
string nullable

The address postal code

Example:
2000
country_code
string required

The address country

Example:
CYP
care_of
string nullable

The address care of

phones
Array nullable

Information about the contact’s phones

Object
id
string GUID required nullable

The phone identifier

Example:
CK1234567890123456789012345678
phone_type
string required nullable

The type of the phone

Enumeration:
LANDLINE
MOBILE
FAX
CUSTOM1
CUSTOM2
CUSTOM3
CUSTOM4
CUSTOM5
is_primary
boolean nullable

Define whether the phone is the primary one

Example:
true
country_code
string required

The country that the phone is registered

Example:
CYP
number
string required

The phone number

Example:
238065437
emails
Array nullable

Information about the contact’s emails

Object
id
string GUID required nullable

The email identifier

Example:
CK1234567890123456789012345678
email_type
string required nullable

The type of the email

Enumeration:
PERSONAL
BUSINESS
CUSTOM1
CUSTOM2
CUSTOM3
CUSTOM4
CUSTOM5
is_primary
boolean nullable

Defines whether the email is the primary one

Example:
true
email_address
string required
Example:
johndoe@crm.com
custom_fields
Array

Information that can be used in order to display large pages

Object
key
string

The custom field’s unique key

Example:
back_office
value
string

The custom field’s value

Example:
AB00001

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

Update contact company

PUT /contacts/CAD1E31269B76D7A65ACCE45B2E68DFD HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "code": "ABC-123",
    "company_name": "Alpha Bravo",
    "preferred_language_code": "ENG",
    "statutory_number": "EF-12345",
    "category": {
        "id": "",
        "code": ""
    },
    "company_profle": {
        "profile_year": 129876567,
        "annual_turnover": 1568.14,
        "established_on": 129876567,
        "number_of_employees": 1,
        "registration_number": "123456",
        "registration_country_code": "CYP",
        "tax_reference_number": "123456",
        "vat_registration_number": "123456",
        "industry": {
            "id": "",
            "code": ""
        },
        "industry_sectors": [
            {
                "id": "CAIQ1234567891234567891234567891",
                "code": ""
            }
        ]
    },
    "addresses": [
        {
            "id": "CK1234567890123456789012345678",
            "address_type": "CUSTOM5",
            "is_primary": true,
            "address_line_1": "Elia Papakyriakou",
            "address_line_2": "Tower Stars",
            "state_province_county": "Egkomi",
            "town_city": "Nicosia",
            "postal_code": "2000",
            "country_code": "CYP",
            "care_of": ""
        }
    ],
    "phones": [
        {
            "id": "CK1234567890123456789012345678",
            "phone_type": "CUSTOM4",
            "is_primary": true,
            "country_code": "CYP",
            "number": "238065437"
        }
    ],
    "emails": [
        {
            "id": "CK1234567890123456789012345678",
            "email_type": "CUSTOM1",
            "is_primary": true,
            "email_address": "johndoe@crm.com"
        }
    ]
}

Update contact person

PUT http://staging.crm.com/self-service/v1/contacts/CAD1E31269B76D7A65ACCE45B2E68DFD HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "code": "ABC-123",
    "title": "Sir",
    "first_name": "John",
    "middle_name": "Alias",
    "last_name": "Doe",
    "preferred_language_code": "ENG",
    "statutory_number": "EF-12345",
    "direct_marketing": "false",
    "affiliate_marketing": "true",
    "category": {
        "id": "",
        "code": ""
    },
    "demographics": {
        "gender": "MALE",
        "country_of_residence_code": "CYP",
        "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"
        }
    },
    "addresses": [
        {
            "id": "CK1234567890123456789012345678",
            "address_type": "POBOX",
            "is_primary": true,
            "address_line_1": "Elia Papakyriakou",
            "address_line_2": "Tower Stars",
            "state_province_county": "Egkomi",
            "town_city": "Nicosia",
            "postal_code": "2000",
            "country_code": "CYP",
            "care_of": ""
        }
    ],
    "phones": [
        {
            "id": "CK1234567890123456789012345678",
            "phone_type": "CUSTOM3",
            "is_primary": true,
            "country_code": "CYP",
            "number": "238065437"
        }
    ],
    "emails": [
        {
            "id": "CK1234567890123456789012345678",
            "email_type": "CUSTOM5",
            "is_primary": true,
            "email_address": "johndoe@crm.com"
        }
    ],
    "custom_fields": [
        {
            "key": "back_office",
            "value": "AB00001"
        }
    ]
}
Get Contact
GET /contacts/{id}

Retrieve all details for a specific contact

Path variables

id
string GUID required

The contact identifier that should be returned

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD

Notes

To display the actual image you need to construct a URL based on the creative media url and the authorization token (e.g. https://crm.com/asset.jpg&token=4AD9C84FA60F)

Request parameters

include_rewards
string optional

If defined then information about the contact’s rewards will also be retrieved (Available from CRM.COM R18.5.0)

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

QUARTERLY

Any amount attributes will be filtered based on the current quarter of the year

YEARLY

Any amount attributes will be filtered based on the current year

OVERALL

Any amount attributes will be filtered from registration date

Default:
MONTHLY

Request headers

Authorization
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 OK

The request has succeeded

Body
Object
id
string GUID

The contact’s identifier

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
code
string

The contact’s unique code

Example:
ABC-123
contact_type
string

The contact’s type

Enumeration:
PERSON
COMPANY
company_name
string

The company name

Example:
CRMdotCOM
title
string

The person’s title

Example:
Sir
first_name
string

The person’s first name

Example:
John
middle_name
string

The person’s middle name

Example:
Alias
last_name
string

The person’s last name

Example:
Doe
preferred_language_code
string

The contact’s preferred language

Example:
ENG
statutory_number
string

The contact’s statutory number

Example:
EF-12345
direct_marketing
boolean

The contact authorisation for direct marketing

Example:
false
affiliate_marketing
boolean

The contact authorisation for affiliate marketing

Example:
true
category
Object

The contact’s category

id
string
Example:
GUID
code
string
Example:
COO1
name
string
Example:
Category A
demographics
Object

The person’s demographics information

gender
string

The gender of the contact

Enumeration:
MALE
FEMALE
country_of_residence_code
string

The country of residence

Example:
CYP
passport
Object

Information about the passport

passport_number
string

THe number of the passport

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

Information about the id

id_number
string

The id number

Example:
123456
issue_country_code
string

The country that issued the id

Example:
CYP
expiration_date
string epoch

The id expiration date

Example:
129876567
name_day
Object

Information about the nameday

month
integer

the name day month

Example:
10
day
integer

The name day

Example:
4
date_of_birth
Object

Information about the birthdate

year
integer

The birth year

Example:
2018
month
integer

The birth month

Example:
10
day
string

The birth day

Example:
16
company_profle
Object

The company’s profile information

profile_year
integer

The profile year

Example:
2019
annual_turnover
number

The annual turnover

Example:
11254.2
established_on
integer epoch

The date that the company was established on

Example:
129876567
number_of_employees
integer

The number of employees for the company

Example:
1
registration_number
string

The registration number

Example:
123456
registration_country_code
string

The country that registered the company

Example:
CYP
tax_reference_number
string

The tax reference number

Example:
123456
vat_registration_number
string

The vat registration number

Example:
123456
industry_name
string

The industry name

Example:
Retailer
industry_sectors
Array

The industry sectors

Object
name
string

The industry sector name

Example:
Shoes
addresses
Array

The contact’s addresses

Object
id
string GUID

The address identifier

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
address_type
string

The type of the address

Enumeration:
HOME
BUSINESS
POBOX
CUSTOM1
CUSTOM2
CUSTOM3
CUSTOM4
CUSTOM5
is_primary
string

Defines whether the address is the primary one

Example:
true
care_of
string

The address care of

Example:
N/A
address_line_1
string

The address line 1

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:
CYP
phones
Array

The contact’s phones

Object
id
string GUID

The phone identifier

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
phone_type
string

The type of the phone

Enumeration:
LANDLINE
MOBILE
FAX
CUSTOM1
CUSTOM2
CUSTOM3
CUSTOM4
CUSTOM5
is_primary
boolean

Defines whether the phone is the primary one

Example:
true
country_code
string

The country that the phone is registered

Example:
CYP
number
string

The phone number

Example:
238065437
emails
Array

The contact’s emails

Object
id
string GUID

The email identifier

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
email_type
string

The type of the email

Enumeration:
PERSONAL
BUSINESS
CUSTOM1
CUSTOM2
CUSTOM3
CUSTOM4
CUSTOM5
is_primary
boolean

Defines whether the email is the primary one

Example:
true
email_address
string

The email address

Example:
johndoe@crm.com
email_verification
boolean
Example:
false
rewards
Object

Rewards details about the contact’s primary account. Available when the include_rewards is enabled

total_awards
number

The total awards of the account

Example:
2345.89
total_spends
number

The total spends of the account

Example:
123.98
custom_fields
Array

Information that can be used in order to display large pages

Object
key
string

The custom field’s unique key

Example:
back_office
value
string

The custom field’s value

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

Information about the creative type

Enumeration:
ATTACHMENT
PROFILEIMAGE
MARKETING
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 http://staging.crm.com/self-service/v1/contacts/CAD1E31269B76D7A65ACCE45B2E68DFD HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "CAD1E31269B76D7A65ACCE45B2E68DFD",
    "code": "ABC-123",
    "contact_type": "PERSON",
    "title": "Sir",
    "first_name": "John",
    "middle_name": "Alias",
    "last_name": "Doe",
    "preferred_language_code": "ENG",
    "statutory_number": "EF-12345",
    "direct_marketing": "false",
    "affiliate_marketing": "true",
    "category": {
        "id": "GUID", 
        "code": "COO1",
        "name": "Category A"
    },
    "demographics": {
        "gender": "FEMALE",
        "country_of_residence_code": "CYP",
        "passport": {
            "passport_number": "K123456",
            "issue_country_code": "CYP",
            "expiration_date": 129876567
        },
        "id_details": {
            "id_number": "123456",
            "issue_country_code": "CYP",
            "expiration_date": "129876567"
        },
        "name_day": {
            "month": 10,
            "day": 4
        },
        "date_of_birth": {
            "year": 2018,
            "month": 10,
            "day": "16"
        }
    },
  
    "addresses": [
        {
            "id": "CAD1E31269B76D7A65ACCE45B2E68DFD",
            "address_type": "CUSTOM4",
            "is_primary": "true",
            "care_of": "N/A",
            "address_line_1": "Elia Papakyriakou",
            "address_line_2": "Tower Stars",
            "state_province_county": "Egkomi",
            "town_city": "Nicosia",
            "postal_code": "2000",
            "country_code": "CYP"
        }
    ],
    "phones": [
        {
            "id": "CAD1E31269B76D7A65ACCE45B2E68DFD",
            "phone_type": "CUSTOM1",
            "is_primary": true,
            "country_code": "CYP",
            "number": "238065437"
        }
    ],
    "emails": [
        {
            "id": "CAD1E31269B76D7A65ACCE45B2E68DFD",
            "email_type": "CUSTOM1",
            "is_primary": true,
            "email_address": "johndoe@crm.com",
            "email_verification": "false"
        }
    ],
    "custom_fields": [
        {
            "key": "back_office",
            "value": "AB00001"
        }
    ],
    "creatives": [
        {
            "id": "CA123456789AQWSXZAQWS1236547896541",
            "type": "PROFILEIMAGE",
            "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"
                }
            ]
        }
    ]
}
Add Contact Address
POST /contacts/{id}/addresses

Add a new address to an existing contact. A contact can have multiple addresses but only one per address type

Path variables

id
string GUID required

The contact identifier for which an address will be added

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD

Request headers

Authorization
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Request body

Object
address_type
string required

The address type

Enumeration:
HOME
BUSINESS
POBOX
CUSTOM1
CUSTOM2
CUSTOM3
CUSTOM4
CUSTOM5
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
care_of
string nullable

The address care of

is_primary
boolean nullable

Defines whether the address is the primary one

Example:
true

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

Authorization: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "address_type": "CUSTOM2",
    "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"
}
Update Contact Address
PUT /contacts/{id}/addresses/{address_id}

Add a new address to an existing contact. A contact can have multiple addresses but only one per address type

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

Authorization
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Request body

Object
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

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

Authorization
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 /contact/CAD1E31269B76D7A65ACCE45B2E68DFD/address/CAD1E31269B76D7A65ACCE45B2E68DFD HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 
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 communication method will be added

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD

Request headers

Authorization
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Request body

Object
phone_type
string required

The phone type that should be added

Enumeration:
LANDLINE
MOBILE
FAX
CUSTOM1
CUSTOM2
CUSTOM3
CUSTOM4
CUSTOM5
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

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": "CUSTOM3",
    "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

Authorization
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

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/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"
}
Delete Contact Phone
DELETE /contacts/{id}/phones/{phone_id}

Delete an existing phone of an existing contact

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

Authorization
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
PUT /contacts/CAD1E31269B76D7A65ACCE45B2E68DFD/phones/CAD1E31269B76D7A65ACCE45B2E68DFD HTTP/1.1 

HTTP/1.1 200 OK 
Add Contact Email
POST /contacts/{id}/emails

Add a new email to an existing contact. A contact can have multiple emails

Path variables

id
string GUID required

The contact (id) for which an email should be added

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD

Request headers

Authorization
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Request body

Object
email_type
string required

Defines the email type that should be added

Enumeration:
PERSONAL
BUSINESS
CUSTOM1
CUSTOM2
CUSTOM3
CUSTOM4
CUSTOM5
is_primary
boolean nullable

Defines whether the email should be the primary one

Example:
true
email_address
string required

The email address

Example:
johndoe@crm.com
email_verification
boolean nullable

Defines whether the email should be verified (Applicable from CRM.COM R18.2.0)

Example:
false

Responses

200 OK

The request has succeeded

Body
Object
id
string

The email record identifier

Default:
GUID
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 /contact/CAD1E31269B76D7A65ACCE45B2E68DFD/communications HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "email_type": "BUSINESS",
    "is_primary": "true",
    "email_address": "johndoe@crm.com"
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "CAD1E31269B76D7A65ACCE45B2E68DFD"
}
Update Contact Email
PUT /contacts/{id}/emails/{email_id}

Update an existing email of an existing contact

Path variables

id
string GUID required

The contact (id) for which an email should be updated

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
email_id
string GUID required

The email identifier that should be updated

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD

Request headers

Authorization
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Request body

Object
is_primary
boolean nullable

Defines whether the email should be the primary one

Example:
true
email_address
string required

The email address

Example:
johndoe@crm.com
email_verification
boolean nullable

Defines whether the email should be verified (Applicable from CRM.COM R18.2.0)

Example:
false

Responses

200 OK

The request has succeeded

Body
Object
id
string

The email record identifier

Default:
GUID
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/emails/CAD1E31269B76D7A65ACCE45B2E68DFD HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "is_primary": "true",
    "email_address": "johndoe@crm.com"
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "CAD1E31269B76D7A65ACCE45B2E68DFD"
}
Delete Contact Email
DELETE /contacts/{id}/emails/{email_id}

Delete an existing email of an existing contact

Path variables

id
string GUID required

The contact (id) for which an email should be deleted

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
email_id
string GUID required

The email identifier that should be deleted

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD

Request headers

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

Authorization: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 
Verify Contact Email
POST /contacts/verify_email

Verify a contact’s email address (Applicable from CRM.COM R18.2.0)

Request body

Object
token
string required

The token that will used for verifying the contact’s emaill 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
POST /contacts/verify_email HTTP/1.1 

Content-Type: application/json

{
    "token": "ABCTKN123456798VGP2020"
}

HTTP/1.1 200 OK 
Add Contact Devices
POST /contacts/{id}/devices

Adds devices on an existing contact’s primary account

Path variables

id
string GUID required

The contact (id) for which a device will be added on its primary account

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD

Request headers

Authorization
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Request body

Object
serial_number
string required

The device’s serial number or device ID

Example:
00000000-000000000000000
registration_type
string required

The device’s registration type

Enumeration:
IOS
ANDROID
registration_token
string required

The device’s registration token

Example:
4AD9C84FA60F9FE407140E20F707726A

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

Add contact deivce

POST /contacts/CAD1E31269B76D7A65ACCE45B2E68DFD/devices HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "serial_number": "00000000-000000000000000",
    "registration_type": "IOS",
    "registration_token": "4AD9C84FA60F9FE407140E20F707726A"
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "658AB90A6A77437091D158FD8E697B11"
}
List Contact Devices
GET /contacts/{id}/devices

Get a list of contact devices.

Path variables

id
string GUID required

The contact identifier for which a list of devices will be retrieved

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD

Request headers

Authorization
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 OK

The request has succeeded

Body
Object
content
Array

Information about the contact’s devies

Object
account_id
string GUID

The account identifier that the device belongs to

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
device_id
string GUID

The device identifier

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
serial_number
string

The device’s serial number which can also be the device id

Example:
00000000-000000000000000
registration_token
string

The device’s registration token

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
registration_type
string

The device’s registration type based on the device’s product and the communication settings, which can be either Android or IOS

Enumeration:
ANDROID
IOS
Example 1
GET /contacts/CAD1E31269B76D7A65ACCE45B2E68DFD/devices HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "content": [
        {
            "account_id": "CAD1E31269B76D7A65ACCE45B2E68DFD",
            "device_id": "CAD1E31269B76D7A65ACCE45B2E68DFD",
            "serial_number": "00000000-000000000000000",
            "registration_token": "CAD1E31269B76D7A65ACCE45B2E68DFD",
            "registration_type": "ANDROID"
        }
    ]
}

HTTP/1.1 200 OK 
Delete Contact Device
DELETE /contacts/{id}/devices/{device_id}

Deletes devices from an existing contact’s primary account

Path variables

id
string GUID required

The contact (id) for which a device will be deleted

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
device_id
string GUID required

The device (id) to be deleted

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD

Request headers

Authorization
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

Add contact deivce

DELETE http://staging.crm.com/self-service/v1/contacts/CAD1E31269B76D7A65ACCE45B2E68DFD/devices/CAD1E31269B76D7A65ACCE45B2E68DFD HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A

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

Authorization
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Request body

Object
consent_state
string

The consent state to be updated

Enumeration:
PENDING
ACCEPTED
REJECTED
WITHDRAWN

Responses

200 OK

The request has succeeded

Body
Object
id
string

The unique identifier of the contact

Default:
GUID
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 http://staging.crm.com/self-service/v1/contacts/CAD1E31269B76D7A65ACCE45B2E68DFD/consents HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "consent_state": "WITHDRAWN"
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "CAD1E31269B76D7A65ACCE45B2E68DFD"
}
Contact Financial Operations
PUT /accounts/{id}
GET /accounts/{id}
GET /contacts/{id}/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}/accounts
Update Account
PUT /accounts/{id}

Create a new account for an existing contact

Path variables

id
string GUID required

The account identifier that will be updated

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD

Request headers

Authorization
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Request body

Object
account_status
string required nullable

The new account status

Enumeration:
ACTIVE
SUSPENDED
TERMINATED
spend_preferences
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
minimum_wallet_balance
number nullable

The minimum wallet balance that should be available in order for an automatic awards spending to be applied.

Default:
1
Example:
5.21
minimum_spend_amount
number nullable

The minimum amount that can be spend by that specific accounts receivable during auto spend

Default:
1
Example:
5.42
maximum_spend_amount
number nullable

The maximum amount that can be spend by that specific accounts receivable during auto spend

Default:
10
Example:
12.24
preferred_payment_method_id
string

The customer’s preferred payment method that will be used for spending purposes in rewards. The payment method’s unique identifier is specified. Available from CRM.COM R18.2.0

Example:
33434FDA22100
Examples

Responses

200 OK

The response succeeded

Body
Object
id
string

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

Authorization: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "account_status": "ACTIVE",
    "spend_preferences": {
        "enable_automatic_spend": "true",
        "minimum_wallet_balance": 5.21,
        "minimum_spend_amount": 5.42,
        "maximum_spend_amount": 12.24,
        "preferred_payment_method_id": "33434FDA22100"
    }
}
Get Account
GET /accounts/{id}

Retrieve all details for a specific account

Path variables

id
string GUID required

The account identifier that should be retrieved

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD

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

The account number

Example:
ACR001
is_primary
boolean

Defines whether the account is the primary one

Example:
true
life_cycle_state
string

The account life cycle state

Enumeration:
ACTIVE
SUSPENDED
TERMINATED
balance
number

The balance of the account

Example:
450
currency_code
string

The account currency

Example:
EUR
is_tax_exempt
boolean

Indicates if the account owner is tax exempt or not

Example:
true
classification
Object

The classification of the retrieved accounts

id
string GUID

The classification identifier

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
name
string

The classification name

Example:
VIP Customer
rewards
Object

Information about the account’s rewards

preferred_payment_method_id
string

The customer’s preferred payment method that will be used for spending purposes in rewards. The payment method’s unique identifier is specified. Available from CRM.COM R18.2.0

Example:
2343433ACBD110
sign_up_on
integer epoch

The date that the accounts signed up

Example:
1572450998
enable_automatic_spend
boolean

Defines whether the accounts enables automatic spend on purchase events or not

Example:
true
minimum_wallet_balance
integer

The minimum wallet balance that should be available in order for an automatic awards spending to be applied

Example:
10
minimum_spend_amount
integer

The minimum amount that can be spend by that specific accounts during auto spend

Example:
1.24
maximum_spend_amount
integer

The maximum amount that can be spend by that specific accounts during auto spend

Example:
151.12
reward_tier
Object

Information about the reward tier

id
string GUID

The reward tier id

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
name
string

The reward tier name

Example:
Gold
marketing_information
Object

Information about the reward tier

tier_color
string HEX

The hexadecimal value of the tier’s color

Example:
FFD700
participating_schemes
Array

Information about the schemes that the account has signed up

Object
sign_up_on
integer epoch

The date that the account signed up to the scheme

Example:
1572450998
email_address
string Email

The email address that was used to sign up to a close loop reward scheme

Example:
johndoe@crm.com
reward_scheme
Object

Information about the reward scheme

id
string GUID

The reward scheme identifier

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
name
string

The reward scheme name

Example:
Loyalty Scheme
merchants
Array

Information about the merchants that are authorised by an account as part of its spend preferences

Object
id
string GUID

The merchant identifier

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
is_next_visit
boolean

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

Example:
false
business_unit
Object

Information about the business unit

id
string GUID

The business unit identifier

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
name
string

The business unit 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 HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "CAD1E31269B76D7A65ACCE45B2E68DFD",
    "number": "ACR001",
    "is_primary": true,
    "life_cycle_state": "SUSPENDED",
    "balance": 450,
    "currency_code": "EUR",
    "is_tax_exempt": "true",
    "classification": {
        "id": "CAD1E31269B76D7A65ACCE45B2E68DFD",
        "name": "VIP Customer"
    },
    "rewards": {
        "sign_up_on": 1572450998,
        "enable_automatic_spend": "true",
        "minimum_wallet_balance": 10,
        "minimum_spend_amount": 1.24,
        "maximum_spend_amount": 151.12,
        "participating_schemes": [
            {
                "sign_up_on": 1572450998,
                "reward_scheme": {
                    "id": "CAD1E31269B76D7A65ACCE45B2E68DFD",
                    "name": "Loyalty Scheme"
                },
                "email_address": "johndoe@crm.com"
            }
        ],
        "reward_tier": {
            "id": "CAD1E31269B76D7A65ACCE45B2E68DFD",
            "name": "Gold",
            "marketing_information": {
                "tier_color": "FFD700"
            }
        },
        "merchants": [
            {
                "id": "CAD1E31269B76D7A65ACCE45B2E68DFD",
                "business_unit": {
                    "id": "CAD1E31269B76D7A65ACCE45B2E68DFD",
                    "name": "Bravo Coffee"
                },
                "is_next_visit": "false"
            }
        ]
    }
}
List Payment Methods
GET /contacts/{id}/payment_methods

Retrieve all payment methods for a specific contact

Path variables

id
string GUID required

The contact identifier for which a list of payment methods should be returned

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD

Request headers

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

The payment method that is related with the account

Enumeration:
BANK
WALLET
PAYPAL
CARD
notes
string

The payment method notes

Example:
Lorem Ipsum
bank_details
Object

Bank details information related to the payment method. Applicable only for payment methods of type DIRECT_DEBIT, GENERIC, CUSTOM_1, CUSTOM_2, CUSTOM_3, CUSTOM_4, CUSTOM_5

sort_code
string

The bank sort code

Example:
102091
account_number
string

The bank account number

Example:
001002001
bank
string

Information related to the bank

Example:
Barclays
branch
string

Information related to the bank branch

Example:
Ascot
account_holder_name
string

The owner of the account

Example:
John Doe
iban
string

The international bank account number

Example:
SE3550000000054910000003
business_identifier_code
string Alphanumeric characters

The business identifier code that identifies the bank

Min length: 8
Max length: 11
Example:
123456789
swift
string

The bank swift number

Example:
123658974454
card
Object

Information related with the card

name
string

The card’s name

Example:
Default Card
card_number
string

Obsfucated card number

Example:
424242****4242
first6
string

The card’s first six digits

Example:
42424242
last4
string

The card’s last four digits

Example:
4242
brand
string

The card brand

Enumeration:
VISA
MASTERCARD
AMERICANXPRESS
DINERSCLUB
DISCOVER
JCB
UNIONPAY
UNKNOWN
funding_type
string

The card’s funding type. Available from CRM.COM R18.2.0

Enumeration:
DEBIT
CREDIT
PREPAID
expiration_month
integer

The card’s expiration month

Example:
10
expiration_year
integer

The card’s expiration year

Example:
2020
is_default
boolean

Defines which card will be used by default

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

Example:
2000
address_state
string

The state related to the card address

Example:
Egkomi
address_country_code
string

The country related to the card address

Example:
CY
classification
Object

The card’s classification. Available from CRM.COM R18.2.0

id
string

The card’s classification unique identifier

Example:
534535ABCE232
name
string

The card’s classification name

Example:
Gold
payment_gateway_token
Object

Information about the gateway that tokenized the card

gateway
string

The payment gateway that processed the payment method details

Example:
PAYPAL
username
string

The identifier of the payment method details

Example:
johndoe@crm.com
mandate_details
Object

Information related to the provided mandate

unique_mandate_reference
string

The unique reference, which identifies a mandate that was signed by a Debtor for any given Creditor (supports up to 35 alphanumeric characters). Applicable only for payment methods of type DIRECT_DEBIT, GENERIC, CUSTOM_1, CUSTOM_2, CUSTOM_3, CUSTOM_4, CUSTOM_5

mandate_signing_date
integer epoch

The date that the mandate was signed. Applicable only for payment preferences of type DIRECT_DEBIT, GENERIC, CUSTOM_1, CUSTOM_2, CUSTOM_3, CUSTOM_4, CUSTOM_5

Example:
1572423477
mandate_termination_date
integer epoch

The date that the mandate will be terminated. No payments should be send after that date (inclusive).Applicable only for payment preferences of type DIRECT_DEBIT, GENERIC, CUSTOM_1, CUSTOM_2, CUSTOM_3, CUSTOM_4, CUSTOM_5,

Example:
1572423477
400 Bad Request

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

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

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

404 Not Found

The requested resource does not exist

500 Internal Server Error

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

502 Bad Gateway

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

503 Service Unavailable

The server is currently unable to handle the request 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/payment_methods HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "content": [
        {
            "id": "CAD1E31269B76D7A65ACCE45B2E68DFD",
            "payment_method_type": "CARD",
            "notes": "Lorem Ipsum",
            "bank_details": {
                "sort_code": "102091",
                "account_number": "001002001",
                "bank": "Barclays",
                "branch": "Ascot",
                "account_holder_name": "John Doe",
                "iban": "SE3550000000054910000003",
                "business_identifier_code": "123456789",
                "swift": "123658974454"
            },
            "card": {
                "name": "Default Card",
                "card_number": "424242****4242",
                "first6": "42424242",
                "last4": "4242",
                "brand": "VISA",
                "funding_type": "PREPAID",
                "expiration_month": 10,
                "expiration_year": 2020,
                "is_default": true,
                "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_code": "CY"
                },
                "classification": {
                    "id": "534535ABCE232",
                    "name": "Gold"
                }
            },
            "payment_gateway_token": {
                "gateway": "PAYPAL",
                "username": "johndoe@crm.com"
            },
            "mandate_details": {
                "unique_mandate_reference": "",
                "mandate_signing_date": 1572423477,
                "mandate_termination_date": 1572423477
            }
        }
    ]
}
Add Payment Method
POST /contacts/{id}/payment_methods

Contacts can have multiple accounts and each of these accounts can have different payment methods

Path variables

id
string GUID required

The contact identifier for which a payment method will be added

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD

Request headers

Authorization
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Request body

Object
payment_method_type
string required

The payment method that will be related with the account

Enumeration:
BANK
PAYPAL
CARD
notes
string nullable

The payment method notes

Example:
Lorem Ipsum
bank_details
Object required nullable

Details of the bank and bank account related to the payment method.

account_holder_name
string nullable

The account holder name of the bank

Example:
John Doe
account_number
string required nullable

The bank account number

Example:
001002001
iban
string required nullable

The international bank account number

Example:
SE3550000000054910000003
sort_code
string nullable

The bank sort code

Example:
102491
bank
string nullable

The identifier of the bank

Example:
Barclays
branch
string nullable

The identifier of the bank branch

Example:
Ascot
swift
string

The bank account swift number

Example:
12345678
card
Object required nullable

Information related with the card

name
string nullable

The card name

Example:
Default Card
card_number
string nullable

The card number

Example:
42424242****4242
first6
string nullable

The card’s first six digits

Example:
42424242
last4
string required nullable

The card’s last four digits

Example:
4242
brand
string nullable

The card’s brand

Enumeration:
VISA
MASTERCARD
AMERICANEXPRESS
DINERSCLUB
DISCOVER
JCB
UNIONPAY
UNKNOWN
fingerprint
string nullable

Uniquely identifies this particular card number

Example:
Xt5EWLLDS7FJjR1c
expiration_month
integer nullable

The card’s expiration month

Example:
10
expiration_year
integer nullable

The card’s expiration year

Example:
2020
is_default
boolean nullable

Defines which card will be used by default

Example:
true
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_code
string nullable

The country related to the card address

Example:
CY
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
card_gateway_token
Array nullable

Information regarding the card tokenization via a payment gateway

Object
gateway
string required nullable

The payment gateway that tokenized the card

Enumeration:
STRIPE
BRAINTREE
PAYEEZY
GENERIC
gateway_code
string required nullable

If using the Generic Gateway specify the implementation code given to you by CRM.COM

token
string required

The card token

Example:
123654789654
payment_gateway_token
Object required nullable

Information about the gateway token

gateway
string required

The payment gateway that processed the payment method details

Enumeration:
PAYPAL
username
string required

The identifier of the payment method details

Example:
johndoe@crm.com
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

Add a payment method related to Card

POST /contacts/CAD1E31269B76D7A65ACCE45B2E68DFD/payment_methods HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "payment_method_type": "CARD",
    "notes": "Lorem Ipsum",
    "card": {
        "name": "Default Card",
        "card_number": "42424242****4242",
        "first6": "42424242",
        "last4": "4242",
        "brand": "AMERICANEXPRESS",
        "fingerprint": "Xt5EWLLDS7FJjR1c",
        "expiration_month": 10,
        "expiration_year": 2020,
        "is_default": true,
        "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_code": "CY",
            "use_billing_address": "true"
        },
        "card_gateway_token": [
            {
                "gateway": "STRIPE",
                "gateway_code": "",
                "token": "123654789654"
            }
        ]
    }
}
Update Payment Method
PUT /contacts/{id}/payment_methods/{payment_method_id}

Contacts can have multiple accounts and each of these accounts can have different payment methods

Path variables

id
string GUID required

The contact identifier for which a payment method will be updated

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
payment_method_id
string GUID required

The payment method identifier that should be updated

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD

Request headers

Authorization
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Request body

Object
notes
string nullable

The payment method notes

Example:
Lorem Ipsum
bank_details
Object required nullable

Detals of the bank and bank account related to the payment method.

account_holder_name
string nullable

The account holder name of the bank

Example:
John Doe
account_number
string nullable

The bank account number

Example:
001002001
iban
string nullable

The international bank account number

Example:
SE3550000000054910000003
sort_code
string nullable

The bank sort code

Example:
102491
bank
string nullable

The identifier of the bank

Example:
Barclays
branch
string nullable

The identifier of the bank branch

Example:
Ascot
swift
string

The bank account swift number

Example:
12345678
card
Object required nullable

Information related with the card

name
string nullable

The card name

Example:
Default Card
card_number
string nullable

The card number with obfsucated numbers

Example:
42424242****4242
first6
string nullable

The card’s first six digits

Example:
42424242
last4
string required nullable

The card’s last four digits

Example:
4242
brand
string nullable

The card’s brand

Enumeration:
VISA
MASTERCARD
AMERICANEXPRESS
DINERSCLUB
DISCOVER
JCB
UNIONPAY
UNKNOWN
fingerprint
string nullable

Uniquely identifies this particular card number

Example:
Xt5EWLLDS7FJjR1c
expiration_month
integer nullable

The card’s expiration month

Example:
10
expiration_year
integer nullable

The card’s expiration year

Example:
2020
is_default
boolean nullable

Defines which card will be used by default

Example:
true
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_code
string nullable

The country related to the card address

Example:
CY
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
card_gateway_token
Array nullable

Information regarding the card tokenization via a payment gateway

Object
gateway
string required nullable

The payment gateway that tokenized the card

Enumeration:
STRIPE
BRAINTREE
PAYEEZY
GENERIC
gateway_code
string required nullable

If using the Generic Gateway specify the implementation code given to you by CRM.COM

token
string required

The card token

Example:
123654789654
payment_gateway_token
Object required nullable

Information about the gateway token

gateway
string required

The payment gateway that processed the payment method details

Enumeration:
PAYPAL
username
string required

The identifier of the payment method details

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

Authorization: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "notes": "Lorem Ipsum",
    "card": {
        "name": "Default Card",
        "card_number": "42424242****4242",
        "first6": "42424242",
        "last4": "4242",
        "brand": "AMERICANEXPRESS",
        "fingerprint": "Xt5EWLLDS7FJjR1c",
        "expiration_month": 10,
        "expiration_year": 2020,
        "is_default": true,
        "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_code": "CY",
            "use_billing_address": "true"
        },
        "card_gateway_token": [
            {
                "gateway": "GENERIC",
                "gateway_code": "",
                "token": "123654789654"
            }
        ]
    }
}
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 that the payment method should be removed

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
payment_method_id
string GUID required

The payment method identifier that should be removed

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD

Request headers

Authorization
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 /contact/CAD1E31269B76D7A65ACCE45B2E68DFD/payment_method/CAD1E31269B76D7A65ACCE45B2E68DFD HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 
List Contact Accounts
GET /contacts/{id}/accounts

Get a list of contact accounts for financial transactions. 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 for which a list of accounts will be retrieved

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD

Request headers

Authorization
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 OK

The request has succeeded

Body
Object
content
Array

Information about the contact’s accounts

Object
id
string GUID

The account identifier

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
name
string

The account name

Example:
ACR0001
life_cycle_state
string

The account’s life cycle state

Enumeration:
ACTIVE
SUSPENDED
TERMINATED
balance
number

The account’s balance

Example:
1501.15
currency_code
string

The account’s currency

Example:
EUR
credit_limit
integer

The account’s credit limit

Example:
100
credit_rating_code
string

The account’s credit rating code

Example:
AAA
is_primary
boolean

Defines whether the account is the primary one

Example:
true
classification
Object

The account’s classification

id
string
name
string
code
string
Example 1
GET /contacts/CAD1E31269B76D7A65ACCE45B2E68DFD/accounts HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "content": [
        {
            "id": "CAD1E31269B76D7A65ACCE45B2E68DFD",
            "name": "ACR0001",
            "life_cycle_state": "ACTIVE",
            "balance": 1501.15,
            "currency_code": "EUR",
            "credit_limit": 100,
            "credit_rating_code": "AAA",
            "is_primary": true,
            "classification": {
                "id": "",
                "name": "",
                "code": ""
            }
        }
    ]
}
Contact Reward Operations
POST /accounts/{id}/reward_schemes
POST /accounts/{id}/reward_schemes/{reward_scheme_id}/signoff
POST /accounts/{id}/merchants
DELETE /accounts/{id}/merchants/{merchant_id}/remove
GET /contacts/{id}/reward_transactions
Sign up to a Reward Scheme
POST /accounts/{id}/reward_schemes

Sign up the account to a specific reward scheme

Path variables

id
string GUID required

The account that will be signed up to the reward scheme

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD

Request headers

Authorization
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Request body

Object
reward_scheme_id
string GUID required

The reward scheme that the account has signed up

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
email_address
string required nullable

The email address that is associated with the unique reference code and was used while signing up to a reward scheme based on supported domains

Example:
johndoe@crm.com
reference_code
string required nullable

The unique reference code that will be used while signing up to that specific reward scheme

Example:
REF123456789
Examples

Responses

200 OK

The request has succeeded

Body
Object
reward_scheme_id
string GUID

The reward scheme 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 /accounts/CAD1E31269B76D7A65ACCE45B2E68DFD/reward_scheme HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "reward_scheme_id": "CAD1E31269B76D7A65ACCE45B2E68DFD"
}

HTTP/1.1 200 OK 
Sign off from a Reward Scheme
POST /accounts/{id}/reward_schemes/{reward_scheme_id}/signoff

Sign off the account from a specific reward scheme

Path variables

id
string GUID required

The account that will be signed off from the reward scheme

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
reward_scheme_id
string GUID required

The reward scheme identifier that the account has signed off

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD

Request headers

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

Authorization: 4AD9C84FA60F9FE407140E20F707726A

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

Request headers

Authorization
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Request body

Object
merchants
Array

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

Object
business_unit_id
string GUID required

The business unit identifier that should be authorised to perform automatic awards spending

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
is_next_visit
boolean

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

The business unit 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": [
        {
            "business_unit_id": "CAD1E31269B76D7A65ACCE45B2E68DFD",
            "is_next_visit": "false"
        }
    ]
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "merchants": [
        {
            "business_unit_id": "CAD1E31269B76D7A65ACCE45B2E68DFD"
        }
    ]
}
Remove Merchants
DELETE /accounts/{id}/merchants/{merchant_id}/remove

Remove an exisintg merchant from an account spend preferences

Path variables

id
string GUID required

The account identifier that will remove existing merchants

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
merchant_id
string GUID required

The merchant identifier that should be removed

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD

Request headers

Authorization
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/remove HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 
List Contact Reward Transactions
GET /contacts/{id}/reward_transactions

Get a list of contact reward transactions. Each reward transaction is created against an account

Path variables

id
string GUID required

The contact identifier for which a list of reward transactions should be returned

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD

Request parameters

type
string required

The reward transaction type

Allow empty value: true
Enumeration:
AWARD_TRANSACTION
SPEND_TRANSACTION
AWARD_EXPIRATION_TRANSACTION
life_cycle_state
string optional

The life cycle state of the reward transaction

Allow empty value: true
Enumeration:
POSTED
CANCELLED
sort
string optional

Defines on which attribute the results should be sorted

Allow empty value: true
Enumeration:
CREATED_DATE
UPDATED_DATE
Default:
CREATED_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

Authorization
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 OK

The request has succeeded

Body
Object
content
Array

Information about the retrieved records

Object
id
string GUID

The reward transaction identifier

Example:
6A24D2B5E44F44B28451FE021FCAD51E
type
string

The reward transaction type

Enumeration:
AWARD_TRANSACTION
SPEND_TRANSACTION
AWARD_EXPIRATION_TRANSACTION
life_cycle_state
string

The life cycle state of the reward transaction

Enumeration:
POSTED
CANCELLED
amount
number

The amount of the reward transaction in system currency

Example:
2.24
alternative_amount
number

The amount of the reward transaction in alternative currency

Example:
1.12
expiration_date
integer epoch

The reward transaction expiration date

Example:
11572530655
reward_offer
Object

The reward offer based on which the reward award transaction was created

id
string GUID

The reward offer identifier

Example:
6A24D2B5E44F44B28451FE021FCAD51E
name
string

The reward offer name

Example:
!% Cashback
code
string

The reward offer code

Example:
RO01
description
string

The reward offer description

Example:
Lorem Ipsum
marketing_information_short_description
string

The reward offer short description marketing information

Example:
Lorem Ipsum
account_id
string GUID

The account identifier that the reward transaction was created against

Example:
6A24D2B5E44F44B28451FE021FCAD51E
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/reward_transactions HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "content": [
        {
            "id": "6A24D2B5E44F44B28451FE021FCAD51E",
            "type": "AWARD_TRANSACTION",
            "life_cycle_state": "CANCELLED",
            "amount": 2.24,
            "alternative_amount": 1.12,
            "expiration_date": 11572530655,
            "reward_offer": {
                "id": "6A24D2B5E44F44B28451FE021FCAD51E",
                "name": "!% Cashback",
                "code": "RO01",
                "description": "Lorem Ipsum",
                "marketing_information_short_description": "Lorem Ipsum"
            },
            "account_id": "6A24D2B5E44F44B28451FE021FCAD51E"
        }
    ],
    "paging": {
        "page": 2,
        "size": 20,
        "total": 1124
    }
}
Contact Wallet Operations
PUT /wallets/{id}
GET /contacts/{id}/wallets
GET /wallets/{id}
GET /contacts/{id}/wallet_transactions
GET /wallet_transactions/{id}
GET /wallets/{id}/allotments/{allotment_id}
Update Wallet
PUT /wallets/{id}

Update a wallet of a contact

Path variables

id
string GUID required

The account identifier that will be updated

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD

Request headers

Authorization
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Request body

Object
wallet_limits
Object nullable

Information about the individual wallet limits

annual_limit
number nullable

Defines the annual limits of the wallet

Example:
1000
daily_limit
number nullable

Defines the daily limits of the wallet

Example:
10
wallet_transaction_types
Array

The wallet transaction types on which the limits will be applied on

Object
id
string GUID

The wallet transaction type id

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
Examples

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

Authorization: 4AD9C84FA60F9FE407140E20F707726A
Content-Type: application/json

{
    "wallet_limits": {
        "annual_limit": 1000,
        "daily_limit": 10,
        "wallet_transaction_types": [
            {
                "id": "CAD1E31269B76D7A65ACCE45B2E68DFD"
            }
        ]
    }
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "CAD1E31269B76D7A65ACCE45B2E68DFD"
}
List Contact Wallets
GET /contacts/{id}/wallets

Get a list of contact wallets. Normally a contact will have a single wallet per account, but multiple wallets (therefore multiple accounts) can be used to service different currencies

Path variables

id
string GUID required

The contact identifier for which a list of wallets should be returned

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD

Request headers

Authorization
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 OK

The request has succeeded

Body
Object
id
string GUID

The wallet identifier

Example:
6A24D2B5E44F44B28451FE021FCAD51E
account_id
string

The related account identifier

Example:
6A24D2B5E44F44B28451FE021FCAD52E
number
string

The wallet number

Example:
W000001
balance
number

The balance of the retrieved wallet in wallet currency

Example:
1234.56
alternative_balance
number

The balance of the retrieved wallet in wallet alternative currency

Example:
231.54
currency_code
string

The wallet’s currency

Example:
EUR
alternative_currency_code
string

The wallet’s alternative currency

Example:
PTS
conditional_balance
number

The conditional balance of the retrieved wallet in wallet currency

Example:
25.34
conditional_alternative_balance
number

The conditional balance of the retrieved wallet in wallet alternative currency

Example:
1.52
unconditional_balance
number

The unconditional balance of the retrieved wallet in wallet currency

Example:
4.75
unconditional_alternative_balance
number

The inconditional balance of the retrieved wallet in wallet alternative currency

Example:
4.57
amount_on_hold
number

The amount on hold of the retrieved wallet in wallet currency

Example:
5.98
alternative_amount_on_hold
number

The amount on hold of the retrieved wallet in wallet alternative currency

Example:
2.34
400 Bad Request

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

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

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

404 Not Found

The requested resource does not exist

500 Internal Server Error

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

502 Bad Gateway

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

503 Service Unavailable

The server is currently unable to handle the request 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 /contact/CAD1E31269B76D7A65ACCE45B2E68DFD/wallets HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "6A24D2B5E44F44B28451FE021FCAD51E",
    "account_id": "6A24D2B5E44F44B28451FE021FCAD52E",
    "number": "W000001",
    "balance": 1234.56,
    "alternative_balance": 231.54,
    "currency_code": "EUR",
    "alternative_currency_code": "PTS",
    "conditional_balance": 25.34,
    "conditional_alternative_balance": 1.52,
    "unconditional_balance": 4.75,
    "unconditional_alternative_balance": 4.57,
    "amount_on_hold": 5.98,
    "alternative_amount_on_hold": 2.34
}
Get Wallet
GET /wallets/{id}

Find details of a single wallet and the allotment conditions that are applicable

Path variables

id
string GUID required

The wallet identifier that should be retrieved

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD

Request headers

Authorization
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 OK

The request has succeeded

Body
Object
id
string GUID

The wallet identifier

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
number
string

The wallet number

Example:
W0001
life_cycle_state
string

The wallet life cycle state

Enumeration:
EFFECTIVE
CANCELLED
balance
number

The balance of the wallet in the default currency

Example:
2.24
alternative_balance
number

The balance of the wallet in the alternative currency

Example:
1.12
conditional_balance
number

The total conditional balance of the retrieved wallet in wallet currency

Example:
0.24
conditional_alternative_balance
number

The total conditional balance of the retrieved wallet in wallet alternative currency

Example:
0.12
unconditional_balance
number

The total unconditional balance of the retrieved wallet in wallet currency

Example:
2
unconditional_alternative_balance
number

The total unconditional balance of the retrieved wallet in wallet alternative currency

Example:
1
amount_on_hold
number

The amount in wallet currency that is not yet available for consumption due to validity restrictions

Example:
0
alternative_ amount_on_hold
number

The amount in alternative currency that is not yet available for consumption due to validity restrictions

Example:
0
currency_code
string

The default wallet currency

Example:
EUR
alternative_currency_code
string

The alternative wallet currency

Example:
PTS
account_id
string

The ID of the related account

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
allotments
Object

Information related with the amount allotted by the wallet grouped by the conditions related with the each allotted amount

id
string GUID

The unique identifier of the allotment’s group condition set

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
amount
number

The amount that was allotted in wallet currency

Example:
2
alternative_amount
number

The amount that was allotted in wallet alternative currency

Example:
1
times
Array

The time conditions related with the wallet alloted amount

Object
from
string

The start of the time period related with the allotedt amount

Example:
10
to
string

The end of the time period related with the allotedt amount

Example:
11
days
Array

The day conditions related with the wallet alloted amount

string
Example:
MONDAY, FRIDAY
products
Array

The product conditions related with the wallet alloted amount

Object
id
string

The product id

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
sku
string

The product sku

Example:
1000012
alternative_code
string

The product alternative code

Example:
FRES00001
description
string

The product description

Example:
Freddo Espresso
product_types
Array

The product type conditions related with the wallet alloted amount

Object
id
string

The product type id

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
name
string

The product type name

Example:
Iced Coffee
code
string

The product type code

Example:
IC001
product_families
Array

The product family conditions related with the wallet alloted amount

Object
id
string

The product family id

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
name
string

The product family name

Example:
Coffee
code
string

The product family code

Example:
CO001
product_categories
Array

The product category conditions related with the wallet alloted amount

Object
id
string

The product category id

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
name
string

The product category name

Example:
Origin
code
string

The product category code

Example:
O01
product_brands
Array

The product brand conditions related with the wallet alloted amount

Object
id
string

The product brand id

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
name
string

The product brand name

Example:
Variety Coffee
code
string

The product brand code

Example:
VC001
business_units
Array

The business unit conditions related with the wallet alloted amount

Object
id
string

The business unit id

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
name
string

The business unit name

Example:
New Brewery
code
string

The business unit code

Example:
NB01
parent
Object

Details about the parent business unit (returned only if the business unit has a parent business unit)

id
string GUID

The parent business unit identifier

Example:
bec6d49f-91a0-9fd9-c1c7-02d0bfa77e7e
name
string

The parent business unit name

Example:
New Brew
code
string

The parent business unit identifier

Example:
NB-123
parent_group
Object

Details about the parent group business unit (returned only if the business unit or its parent business unit has a parent group)

id
string GUID

The parent group business unit identifier

Example:
07396fee-7f3c-0329-3163-cb88c9084d92
name
string

The parent group business unit name

Example:
Brew
code
string

The parent group business unit code

Example:
B1234
400 Bad Request

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

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

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

404 Not Found

The requested resource does not exist

500 Internal Server Error

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

502 Bad Gateway

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

503 Service Unavailable

The server is currently unable to handle the request 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 http://staging.crm.com/self-service/v1/wallets/CAD1E31269B76D7A65ACCE45B2E68DFD HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "CAD1E31269B76D7A65ACCE45B2E68DFD",
    "number": "W0001",
    "life_cycle_state": "CANCELLED",
    "balance": 2.24,
    "alternative_balance": 1.12,
    "conditional_balance": 0.24,
    "conditional_alternative_balance": 0.12,
    "unconditional_balance": 2,
    "unconditional_alternative_balance": 1,
    "amount_on_hold": 1,
    "alternative_ amount_on_hold": 1,
    "currency_code": "EUR",
    "alternative_currency_code": "PTS",
    "account_id": "CAD1E31269B76D7A65ACCE45B2E68DFD",
    "allotments": {
        "id": "CAD1E31269B76D7A65ACCE45B2E68DFD",
        "amount": 2,
        "alternative_amount": 1,
        "times": [
            {
                "from": "10",
                "to": "11"
            }
        ],
        "days": [
            "MONDAY, FRIDAY"
        ],
        "products": [
            {
                "id": "CAD1E31269B76D7A65ACCE45B2E68DFD",
                "sku": "1000012",
                "alternative_code": "FRES00001",
                "description": "Freddo Espresso"
            }
        ],
        "product_types": [
            {
                "id": "CAD1E31269B76D7A65ACCE45B2E68DFD",
                "name": "Iced Coffee",
                "code": "IC001"
            }
        ],
        "product_families": [
            {
                "id": "CAD1E31269B76D7A65ACCE45B2E68DFD",
                "name": "Coffee",
                "code": "CO001"
            }
        ],
        "product_categories": [
            {
                "id": "CAD1E31269B76D7A65ACCE45B2E68DFD",
                "name": "Origin",
                "code": "O01"
            }
        ],
        "product_brands": [
            {
                "id": "CAD1E31269B76D7A65ACCE45B2E68DFD",
                "name": "Variety Coffee",
                "code": "VC001"
            }
        ],
        "business_units": [
            {
                "id": "CAD1E31269B76D7A65ACCE45B2E68DFD",
                "name": "New Brewery",
                "code": "NB01"
            }
        ]
    }
}
List Contact Wallet Transactions
GET /contacts/{id}/wallet_transactions

Get a list of contact wallet transactions. Each wallet transaction is created against an account

Path variables

id
string GUID required

The contact identifier for which a list of wallet transactions should be returned

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD

Request parameters

classification
string optional

The wallet transaction classification

Allow empty value: true
Enumeration:
DEBIT
CREDIT
TRANSFER
REIMBURSE
VOID
life_cycle_state
string optional

The wallet transaction life cycle state

Allow empty value: true
Enumeration:
EFFECTIVE
VOIDED
sort
string optional

Defines on which attribute the results should be sorted

Allow empty value: true
Enumeration:
CREATED_DATE
UPDATED_DATE
Default:
CREATED_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

Authorization
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 OK

The request has succeeded

Body
Object
content
Array

Information about the retrieved records

Object
id
string GUID

The wallet transaction identifier

Example:
6A24D2B5E44F44B28451FE021FCAD51E
number
string

The wallet transaction number

Example:
W12345
classification
string

The wallet transaction classification

Enumeration:
CREDIT
DEBIT
REIMBURSE
TRANSFER
VOID
life_cycle_state
string

The life cycle state of the wallet transaction

Enumeration:
EFFECTIVE
VOIDED
amount
number

The amount of the wallet transaction in system currency

Example:
2.24
alternative_amount
number

The amount of the wallet transaction in alternative currency

Example:
1.12
extra_added_amount
number

An extra added amount in wallet currency

Example:
125.34
extra_added_alternative_amount
number

An extra added amount in wallet alternative currency

Example:
24.56
transaction_date
integer epoch

The date that the wallet transaction was made

Example:
1573545935
expiration_date
integer epoch

The wallet transaction expiration date

Example:
1573545935
account_id
string GUID

The account id that the wallet transaction was created against

Example:
6A24D2B5E44F44B28451FE021FCAD51E
currency_code
string

The wallet transaction currency

Example:
GBP
alternative_currency_code
string

The wallet transaction alternative currency

Example:
PTS
transaction_source
Object

Informationb about the source that created the wallet transaction

process_name
string

The process that created the wallet transaction

Enumeration:
CREATE_AWARD_REWARD_TRXN
WALLET_BALANCE_EXPIRATION_RUN
MAINTENANCE_FEE_APPLICATION_RUN
USING_WALLET_FUNDS_FOR_PAYMENTS
CREDIT_NOTE_POSTING
TRANSFER_FROM_ACCOUNT_TO_WALLET
PREPAID_BILLING_RUN
CREATE_AWARD_EXPIRATION_TRXN
TRANSFER_FROM_WALLET_TO_ACCOUNT
TRANSFER_MONEY_BETWEEN_WALLETS
MANUALLY
PAYMENT_POSTING
CREATE_SPEND_REWARD_TRXN
TRANSACTION_FEE_APPLICATION
AD_HOC_RETURN_OF_GOODS
Example:
CREATE_AWARD_REWARD_TRXN
entity_name
string

The name of the entity that caused the creation of the wallet transaction

Example:
REWARDAWARDTRANSACTIONS
entity_value
string GUID

The value of the entity that caused the creation of the wallet transaction

Example:
10540F31CB60400EB7E9F0E2420086FD
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/wallet_transactions HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "content": [
        {
            "id": "6A24D2B5E44F44B28451FE021FCAD51E",
            "number": "W12345",
            "classification": "CREDIT",
            "life_cycle_state": "VOIDED",
            "amount": 2.24,
            "alternative_amount": 1.12,
            "extra_added_amount": 125.34,
            "extra_added_alternative_amount": 24.56,
            "transaction_date": 1573545935,
            "expiration_date": 1573545935,
            "account_id": "6A24D2B5E44F44B28451FE021FCAD51E",
            "currency_code": "GBP",
            "alternative_currency_code": "PTS",
            "transaction_source": {
                "process_name": "CREATE_AWARD_REWARD_TRXN",
                "entity_name": "REWARDAWARDTRANSACTIONS",
                "entity_value": "10540F31CB60400EB7E9F0E2420086FD"
            }
        }
    ],
    "paging": {
        "page": 2,
        "size": 20,
        "total": 1124
    }
}
Get Wallet Transaction
GET /wallet_transactions/{id}

Get a list of contact reward transactions. Each reward transaction is created against an account

Path variables

id
string GUID required

The wallet transaction identifier that should be returned

Example:
CAD12345678912345678912345678912

Request headers

Authorization
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 OK

The request has succeeded

Body
Object
content
Array

Information about the retrieved wallet transaction

Object
id
string GUID

The wallet transaction identifier

Example:
6A24D2B5E44F44B28451FE021FCAD51E
classification
string

The wallet transaction classification

Enumeration:
CREDIT
DEBIT
REIMBURSE
TRANSFER
VOID
life_cycle_state
string

The life cycle state of the wallet transaction

Enumeration:
EFFECTIVE
VOIDED
amount
number

The amount of the wallet transaction in system currency

Example:
2.24
alternative_amount
number

The amount of the wallet transaction in alternative currency

Example:
1.12
extra_added_amount
number

An extra added amount in wallet currency

Example:
124.5
extra_added_alternative_amount
number

An extra added amount in wallet alternative currency

Example:
24.65
transaction_date
integer epoch

The date that the transaction took place

Example:
1572530655
expiration_date
integer epoch

The wallet transaction expiration date

Example:
1572530655
account_id
string GUID

The account identifier that the wallet transaction was created against

Example:
6A24D2B5E44F44B28451FE021FCAD51E
currency_code
string

The wallet transaction currency

Example:
GBP
alternative_currency_code
string

The wallet transaction alternative currency

Example:
PTS
products
Array

Information about the products that are related to the wallet transaction

Object
id
string GUID

The product identifier

Example:
6A24D2B5E44F44B28451FE021FCAD51E
sku
string

The product sku

Example:
wp-fee
alternative_code
string

The product alternative code

Example:
WP123
description
string

The product description

Example:
Service Fee
transaction_source
Object

Informationb about the source that created the wallet transaction

process_name
string

The process that created the wallet transaction

Enumeration:
CREATE_AWARD_REWARD_TRXN
WALLET_BALANCE_EXPIRATION_RUN
MAINTENANCE_FEE_APPLICATION_RUN
USING_WALLET_FUNDS_FOR_PAYMENTS
CREDIT_NOTE_POSTING
TRANSFER_FROM_ACCOUNT_TO_WALLET
PREPAID_BILLING_RUN
CREATE_AWARD_EXPIRATION_TRXN
TRANSFER_FROM_WALLET_TO_ACCOUNT
TRANSFER_MONEY_BETWEEN_WALLETS
MANUALLY
PAYMENT_POSTING
CREATE_SPEND_REWARD_TRXN
TRANSACTION_FEE_APPLICATION
AD_HOC_RETURN_OF_GOODS
Example:
CREATE_AWARD_REWARD_TRXN
entity_name
string

The name of the entity that caused the creation of the wallet transaction

Example:
REWARDAWARDTRANSACTIONS
entity_value
string GUID

The value of the entity that caused the creation of the wallet transaction

Example:
10540F31CB60400EB7E9F0E2420086FD
customer_events
Array

Information about the customer events that are related to the wallet transaction

Object
id
string GUID

The customer event identifier

Example:
10540F31CB60400EB7E9F0E2420086FD
type
string

The customer event type

Enumeration:
ACHIEVEMENT
FINANCIAL_STATEMENT
PURCHASE
REFERRAL
Example:
PURCHASE
reference_number
string

The customer event reference number

Example:
PCE1234
reward_offers
Array

Information about the reward offers that are related to the wallet transaction

Object
id
string GUID

The reward offer identifier

Example:
10540F31CB60400EB7E9F0E2420086FD
name
string

The reward offer name

Example:
1% Cashback
payment_method
Object

Information about the payment method that is related to the wallet transaction

payment_method_type
string

The payment method that will be related with the account

Enumeration:
BANK
PAYPAL
CARD
Example:
CARD
account_number
string

The bank account number

Example:
001002001
iban
string

The international bank account number

Example:
SE3550000000054910000003
card_number
string

The card number with obfsucated numbers

Example:
42424242****4242
first6
string

The card’s first six digits

Example:
424242
last4
string

The card’s last four digits

Example:
4242
username
string

The identifier of the payment method details

Example:
johndoe@crm.com
401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

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

404 Not Found

The requested resource does not exist

500 Internal Server Error

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

502 Bad Gateway

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

503 Service Unavailable

The server is currently unable to handle the request 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 /wallet_transactions/CAD12345678912345678912345678912 HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "content": [
        {
            "id": "6A24D2B5E44F44B28451FE021FCAD51E",
            "classification": "TRANSFER",
            "life_cycle_state": "VOIDED",
            "amount": 2.24,
            "alternative_amount": 1.12,
            "extra_added_amount": 124.5,
            "extra_added_alternative_amount": 24.65,
            "transaction_date": 1572530655,
            "expiration_date": 1572530655,
            "account_id": "6A24D2B5E44F44B28451FE021FCAD51E",
            "currency_code": "GBP",
            "alternative_currency_code": "PTS",
            "products": [
                {
                    "id": "6A24D2B5E44F44B28451FE021FCAD51E",
                    "sku": "wp-fee",
                    "alternative_code": "WP123",
                    "description": "Service Fee"
                }
            ],
            "transaction_source": {
                "process_name": "CREATE_AWARD_REWARD_TRXN",
                "entity_name": "REWARDAWARDTRANSACTIONS",
                "entity_value": "10540F31CB60400EB7E9F0E2420086FD",
                "customer_events": [
                    {
                        "id": "10540F31CB60400EB7E9F0E2420086FD",
                        "type": "PURCHASE",
                        "reference_number": "PCE1234"
                    }
                ],
                "reward_offers": [
                    {
                        "id": "10540F31CB60400EB7E9F0E2420086FD",
                        "name": "1% Cashback"
                    }
                ],
                "payment_method": {
                    "payment_method_type": "CARD",
                    "card_number": "42424242****4242",
                    "first6": "424242",
                    "last4": "4242"
                }
            }
        }
    ]
}
Get Wallet Allotment
GET /wallets/{id}/allotments/{allotment_id}

Retrieve details of a specific allotment group condition of a specific wallet

Path variables

id
string GUID required

The wallet identifier for which the allotment will be retrieved

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
allotment_id
string GUID required

The identifier of the wallet allotment to be retrieved

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD

Request headers

Authorization
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 OK

The request has succeeded

Body
Object
amount
number

The amount that was allotted in wallet currency

Example:
2
alternative_amount
number

The amount that was allotted in wallet alternative currency

times
Array

The time conditions related with the wallet alloted amount

Object
from
string

The start of the time period related with the alloted amount

Example:
10
to
string

The end of the time period related with the allotedt amount

Example:
11
days
Array

The day conditions related with the wallet alloted amount

string
Example:
MONDAY, FRIDAY
products
Array

The product conditions related with the wallet alloted amount

Object
id
string GUID

The product ID

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
sku
string

The product sku

Example:
1000012
alternative_code
string

The product alternative code

Example:
FRES00001
description
string

The product description

Example:
Freddo Espresso
product_types
Array

The product type conditions related with the wallet alloted amount

Object
id
string GUID

The product type ID

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
name
string

The product type name

Example:
Iced Coffee
code
string

The product type code

Example:
IC001
product_families
Array

The product family conditions related with the wallet alloted amount

Object
id
string

The product family id

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
name
string

The product family name

Example:
Coffee
code
string

The product family code

Example:
CO001
product_categories
Array

The product category conditions related with the wallet alloted amount

Object
id
string GUID

The product category id

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
name
string

The product category name

Example:
Origin
code
string

The product category code

Example:
O01
product_brands
Array

The product brand conditions related with the wallet alloted amount

Object
id
string GUID

The product brand id

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
name
string

The product brand name

Example:
Variety Coffee
code
string

The product brand code

Example:
VC001
business_units
Array

The business unit conditions related with the wallet alloted amount

Object
id
string

The business unit id

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
name
string

The business unit name

Example:
New Brewery
code
string

The business unit code

Example:
NB01
expiration_breakdown
Array

A breakdown providing the expiration information of the allotment’s amount

Object
amount
number

The amount to be expired

Example:
1
alternative_amount
string

The alternative amount to be expired

Example:
2
expiration_date
string epoch

The expiration date of the specified amount

Example:
1585649285
400 Bad Request

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

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

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

404 Not Found

The requested resource does not exist

500 Internal Server Error

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

502 Bad Gateway

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

503 Service Unavailable

The server is currently unable to handle the request 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 http://staging.crm.com/self-service/v1/wallet/CAD1E31269B76D7A65ACCE45B2E68DFD/allotment/CAD1E31269B76D7A65ACCE45B2E68DFD HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "amount": 2,
    "alternative_amount": 1,
    "times": [
        {
            "from": "10",
            "to": "11"
        }
    ],
    "days": [
        "MONDAY, FRIDAY"
    ],
    "products": [
        {
            "id": "CAD1E31269B76D7A65ACCE45B2E68DFD",
            "sku": "1000012",
            "alternative_code": "FRES00001",
            "description": "Freddo Espresso"
        }
    ],
    "product_types": [
        {
            "id": "CAD1E31269B76D7A65ACCE45B2E68DFD",
            "name": "Iced Coffee",
            "code": "IC001"
        }
    ],
    "product_families": [
        {
            "id": "CAD1E31269B76D7A65ACCE45B2E68DFD",
            "name": "Coffee",
            "code": "CO001"
        }
    ],
    "product_categories": [
        {
            "id": "CAD1E31269B76D7A65ACCE45B2E68DFD",
            "name": "Origin",
            "code": "O01"
        }
    ],
    "product_brands": [
        {
            "id": "CAD1E31269B76D7A65ACCE45B2E68DFD",
            "name": "Variety Coffee",
            "code": "VC001"
        }
    ],
    "business_units": [
        {
            "id": "CAD1E31269B76D7A65ACCE45B2E68DFD",
            "name": "New Brewery",
            "code": "NB01"
        }
    ],
    "expiration_breakdown": [
        {
            "amount": 1,
            "alternative_amount": "2",
            "expiration_date": "1585649285"
        }
    ]
}
Contact Events
GET /contacts/{id}/purchases
List 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

sort
string optional

Defines on which attribute the results should be sorted

Allow empty value: true
Enumeration:
CREATED_DATE
UPDATED_DATE
Default:
CREATED_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

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

The customer event number

Example:
1254
reference_number
string

The customer event reference number

Example:
0012345
life_cycle_state
string

The customer event life cycle state

Enumeration:
POSTED
CANCELLED
total_amount
number

The total amount of the retrieved customer event

Example:
125.98
net_amount
number

The net amount of the retrieved customer event

Example:
100.9
tax_amount
number

The tax amount of the retrieved customer event

Example:
25.08
requested_spend_amount
number

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

Example:
10.54
requested_spend_alternative_amount
number

The alternative amount that was requested to be spend via the customer event

Example:
5.24
total_awarded_amount
number

The amount that was awarded via the customer event

Example:
1.54
total_awarded_alternative_amount
number

The alternative amount that was awarded via the customer event

Example:
0.27
total_spend_amount
number

The amount that was spent via the customer event

Example:
1.59
total_spend_alternative_amount
number

The alternative amount that was spent via the customer event

Example:
0.97
performed_on
integer epoch

The date that the customer event was actually performed

Example:
1572534147
performed_by_business_unit
Object

Information about the business unit that performed the customer event

id
string GUID

The business unit identifier

Example:
658AB90A6A77437091D158FD8E697B11
name
string

The business unit name

Example:
CRMdotCOM Nicosia
parent_business_unit
Object

Information about the business parent of the unit that the purchase was performed. Available only if the performed by business unit (outlet) has a parent (merchant)

id
string GUID

The business unit identifier

Example:
658AB90A6A77437091D158FD8E697B11
name
string

The business unit name

Example:
CRMdotCOM
account_id
string GUID

The account identifier that the customer event was created against

Example:
658AB90A6A77437091D158FD8E697B11
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 /contact/CAD1E31269B76D7A65ACCE45B2E68DFD/customer_events/purchase HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "content": [
        {
            "id": "6A24D2B5E44F44B28451FE021FCAD51E",
            "number": "1254",
            "reference_number": "0012345",
            "life_cycle_state": "POSTED",
            "total_amount": 125.98,
            "net_amount": 100.9,
            "tax_amount": 25.08,
            "requested_spend_amount": 10.54,
            "requested_spend_alternative_amount": 5.24,
            "total_awarded_amount": 1.54,
            "total_awarded_alternative_amount": 0.27,
            "total_spend_amount": 1.59,
            "total_spend_alternative_amount": 0.97,
            "performed_on": 1572534147,
            "performed_by_business_unit": {
                "id": "658AB90A6A77437091D158FD8E697B11",
                "name": "CRMdotCOM Nicosia"
            },
            "account_id": "658AB90A6A77437091D158FD8E697B11"
        }
    ]
}
Rewards

Rewards API

GET /reward_schemes
GET /reward_offers
GET /reward_offers/{id}
GET /merchants/{id}
List Reward Schemes
GET /reward_schemes

Retrieve all reward schemes from a specific organisation

Request headers

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

The reward scheme name

Example:
LS
description
string

The reward scheme description

Example:
Lorem Ipsum
marketing_information
Object

Marketing information about the reward scheme

short_description
string

The scheme short description

Example:
Lorem Ipsum
long_description
string

The scheme long description

Example:
Lorem Ipsum
terms_and_conditions
string

The terms and conditions for the retrieved reward scheme

Example:
Lorem Ipsum
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
type
string

Information about the creative type

Enumeration:
ATTACHMENT
PROFILEIMAGE
MARKETING
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
life_cycle_state
string

The life cycle state of the retrieved reward scheme

Enumeration:
EFFECTIVE
NOT_EFFECTIVE
400 Bad Request

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

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

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

404 Not Found

The requested resource does not exist

500 Internal Server Error

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

502 Bad Gateway

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

503 Service Unavailable

The server is currently unable to handle the request 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 /reward_schemes HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "content": [
        {
            "id": "CAD1E31269B76D7A65ACCE45B2E68DFD",
            "name": "Loyalty Scheme",
            "code": "LS",
            "description": "Lorem Ipsum",
            "marketing_information": {
                "short_description": "Lorem Ipsum",
                "long_description": "Lorem Ipsum",
                "terms_and_conditions": "Lorem Ipsum",
                "creatives": [
                    {
                        "id": "CA123456789AQWSXZAQWS1236547896541",
                        "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"
                            }
                        ]
                    }
                ]
            },
            "life_cycle_state": "NOT_EFFECTIVE"
        }
    ]
}
List Reward Offers
GET /reward_offers

Retrieve all effective reward offers that are applicable for a specific customer

Request parameters

category
array of string optional

Information about the reward offer categories that should be used as a filter (Prior CRM.COM R18.2.0, this attribute was a single value based instead of an array)

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

Information about the industries that should be used as a filter (Prior CRM.COM R18.2.0, this attribute was a single value based instead of an array)

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

Information about the industry sectors that should be used as a filter (Prior CRM.COM R18.2.0, this attribute was a single value based instead of an array)

Collection format: csv
town_city
array of string optional

Information about the merchant/outlet location that should be used as a filter (should behave as like and case insensitive) (case insensitive is available from CRM.COM R18.6.0, prior CRM.COM R18.2.0, this attribute was a single value based instead of an array)

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

Filter based on the organisation that owns such reward offers

Collection format: csv
sort
string optional

Defines on which attribute the results should be sorted

Allow empty value: true
Enumeration:
CREATED_DATE
UPDATED_DATE
Default:
CREATED_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

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

The reward offer description

Example:
Lorem Ipsum
category
Object

Information about the reward offer category

id
string GUID

The category identifier

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
name
string

The category name

Example:
Seasonal
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
marketing_information
Object

Markeing information related to the reward offer

short_description
string

The reward offer short description

Example:
Lorem Ipsum
long_description
string

The reward offer long description

Example:
Lorem Ipsum
terms_and_conditions
string

The terms and conditions for the retrieved reward offer

Example:
Lorem Ipsum
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
type
string

Information about the creative type

Enumeration:
ATTACHMENT
PROFILEIMAGE
MARKETING
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
owned_by_business_unit
Object

Information about the business unit that owns the reward offer

id
string GUID

The business unit identifier

Example:
CAD1E31269B76D7A65ACCE45B2E68987
name
string

The business name name

Example:
Pizza Yummy
display_order
integer

Defines the order that will be used for displaying the reward offers

Example:
1
is_featured
boolean

Defines whether the reward offer is featured or not

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

Authorization: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "content": [
        {
            "id": "6A24D2B5E44F44B28451FE021FCAD51E",
            "name": "10% off on any purchase",
            "description": "Lorem Ipsum",
            "category": {
                "id": "CAD1E31269B76D7A65ACCE45B2E68DFD",
                "name": "Seasonal"
            },
            "reward_scheme": {
                "id": "CAD1E31269B76D7A65ACCE45B2E68DFD",
                "name": "Loyalty Scheme"
            },
            "marketing_information": {
                "short_description": "Lorem Ipsum",
                "long_description": "Lorem Ipsum",
                "terms_and_conditions": "Lorem Ipsum",
                "creatives": [
                    {
                        "id": "CA123456789AQWSXZAQWS1236547896541",
                        "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"
                            }
                        ]
                    }
                ]
            },
            "owned_by_business_unit": {
                "id": "CAD1E31269B76D7A65ACCE45B2E68987",
                "name": "Pizza Yummy"
            },
            "display_order": 1
        }
    ],
    "paging": {
        "page": 2,
        "size": 20,
        "total": 1124
    }
}
Get Reward Offer
GET /reward_offers/{id}

Retrieve all effective reward offers that are applicable for a specific customer

Path variables

id
string GUID required

The reward offer (identifier) that will be retrieved

Example:
b12295b7-57ed-a51e-3390-73666e959124

Request headers

Authorization
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 OK

The request has succeeded

Body
Object
id
string GUID

The reward offer identifier

Example:
0aa0203f-c049-3300-a7cb-3cfb8b6c2789
name
string

The reward offer name

Example:
10% off on any purchase
description
string

The reward offer description

Example:
Lorem Ipsum
short_description
string

The reward offer short description

Example:
Lorem Ipsum
long_description
string

The reward offer long description

Example:
Lorem Ipsum
terms_and_conditions
string

The terms and conditions for the retrieved reward offer

Example:
Lorem Ipsum
category
Object

Information about the reward offer category

id
string GUID

The category identifier

Example:
cb93ed4f-fc73-c51f-42c7-652a1a543dc6
name
string

The category name

Example:
Seasonal
reward_scheme
Object

Infromation about the reward scheme of this offer

id
string GUID

The reward scheme identifier

Example:
88e2b65b-680b-746d-03b0-34b92155f11c
name
string

The reward scheme name

Example:
Loyalty Scheme
owned_by_business_unit
Object

Information about the business unit that owns the reward offer

id
string GUID

The business unit identiifer

Example:
e4412e30-a2a8-2ef8-2d4c-72828c55ff75
name
string

The business unit name

Example:
Pizza Yummy
award
Object
type
string

The award type

Enumeration:
FIXED
PERCENTAGE
QTY
amount
number

The award amount/percentage value, when amount type is based on FIXED or PERCENTAGE on all products (for Universal Offer Percentage based, this attribute will be the default percentage)

Example:
10.99
products
Array

Details about specific product award conditions

Object
id
string GUID

The product condition identifier (can be the identifier of a product, brand or family)

Example:
d7656d5d-4336-6a93-59ab-998d83ce5f52
id_type
string

The product condition type

Enumeration:
PRODUCT
PRODUCT_FAMILY

Increase Revenue, Product Based

name
string

The product condition name (can be the name of a product)

Example:
SKU00001
alternative_code
string

The product condition alternative code

Example:
S01
description
string

The product condition description (can be the description of a product)

Example:
Coffee Latte
amount
number

The award amount/percentage value (applicable only if award should be different for this product)

Example:
1.82
quantity
integer

The purchased quantity that award will be based on

Example:
1
business_units
Array

Details about specific business unit conditions (applicable for Universal Offer)

Object
id
string

The business unit identifier

Example:
3177b256-cf1b-c5e2-9572-b9f7c062b4e8
name
string

The business unit name

Example:
SKU00001
amount
number

The award amount/percentage value (applicable only if award should be different for this business unit)

Example:
2.99
industries
Array

Details about specific industry conditions (applicable for Universal Offer)

Object
id
string

The industry identifier

Example:
8a4b52b3-3e4e-4bdf-8ca7-9a5b614ce045
name
string

The industry name

Example:
Restaurants
amount
number

The award amount/percentage value (applicable only if award should be different for this industry)

Example:
0.99
time
Object

Details about award that will be provided based on percentage of awarded amount within X UOT

duration
string

The time duration that will be considered during award

uot
string

The unit of time that will be considered during award

Enumeration:
DAYS
WEEKS
MONTHS
YEARS
validity
Object

Award Validity (from)

validity_type
string

The validity type

Enumeration:
PERIOD

Award will be available from a specific period

SPECIFIC_DATE

Award will be available from a specific DATE

AWARD_DAY

Award will be available from THE DAY OF AWARDING

valid_date
integer epoch

The date from which the award will be valid (applicable when type is set to specific date)

Example:
1622808033
period
integer

The period from which the award will be valid (applicable when type is set to period)

Example:
2
period_unit
string

The unit of time from which the award will be valid (applicable when type is set to period)

Enumeration:
DAYS
expiration
Object

Award Expiration

expiration_type
string

The expiration type

Enumeration:
NEVER

Award will never expire

SPECIFIC_DATE

Award will expire on specific date

END_OF_MONTH

Award will expire at the end of the month that was provided

END_OF_YEAR

Award will expire at the end of the year that was provided

END_OF_X_YEAR

Award will expired at the end of X years that was provided

PERIOD

Award will expired at the end of a specific period

expiry_date
string epoch

The date that the award will expire (applicable when type is specific date)

Example:
1622808309
period
integer

The period up to which the award will be expired (applicable when type is set to period or end of X years)

Example:
3
period_unit
string

The unit of time up to which the award will be expired (applicable when type is set to period)

Enumeration:
DAYS
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
type
string

Information about the creative type

Enumeration:
ATTACHMENT
PROFILEIMAGE
MARKETING
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 http://sandbox.crm.com/self-service/v1/reward_offers/b12295b7-57ed-a51e-3390-73666e959124 HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "0aa0203f-c049-3300-a7cb-3cfb8b6c2789",
    "name": "10% off on any purchase",
    "description": "Lorem Ipsum",
    "short_description": "Lorem Ipsum",
    "long_description": "Lorem Ipsum",
    "terms_and_conditions": "Lorem Ipsum",
    "category": {
        "id": "cb93ed4f-fc73-c51f-42c7-652a1a543dc6",
        "name": "Seasonal"
    },
    "reward_scheme": {
        "id": "88e2b65b-680b-746d-03b0-34b92155f11c",
        "name": "Loyalty Scheme"
    },
    "owned_by_business_unit": {
        "id": "e4412e30-a2a8-2ef8-2d4c-72828c55ff75",
        "name": "Pizza Yummy"
    },
    "award": {
        "type": "PERCENTAGE",
        "amount": null,
        "business_units": null,
        "industries": null,
        "products": [{
            "id": "d7656d5d-4336-6a93-59ab-998d83ce5f52",
            "id_type": "PRODUCT",
            "name": "SKU00001",
            "alternative_code": "AC1",
            "description": "Coffee Latte",
            "amount": 1.99,
            "quantity": null
        },
        {
            "id": "d7656d5d-4336-6a93-59ab-998d83ce5f52",
            "id_type": "PRODUCT",
            "name": "SKU00001",
            "alternative_code": "AC2",
            "description": "Coffee Latte",
            "amount": 2.99,
            "quantity": null
        }]
    },
    "validity": {
        "validity_type": "SPECIFIC_DATE",
        "valid_date": 1622808033,
        "period": null,
        "period_unit": null
    },
    "expiration": {
        "expiration_type": "SPECIFIC_DATE",
        "expiry_date": "1622808309",
        "period": 3,
        "period_unit": "DAYS"
    },
    "creatives": [
        {
            "id": "CA123456789AQWSXZAQWS1236547896541",
            "type": "PROFILEIMAGE",
            "width": 2159,
            "height": 3075,
            "format": "jpg",
            "url": "https://assets.crm.com/image/offer.jpg",
            "public_id": "crm-com/image",
            "media": [
                {
                    "width": 200,
                    "height": 300,
                    "url": "https://asset.crm.com/image/offer/c_scale,w_200/offer.jpg"
                }
            ]
        }
    ]
}
List Merchants for Scheme
GET /merchants

Retrieve a list of merchants that participate in one of the customer’s reward schemes

Request parameters

name
string optional

The merchant name (should behave as like and case insensitive) (case insensitive is available from CRM.COM R18.6.0)

Example:
Bravo Coffee
industry
array of string optional

Industry filter for merchant (Available from CRM.COM R18.2.0)

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

Industry sector filter for merchant (Prior CRM.COM R18.2.0, this attribute was a single value based instead of an array)

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

Town/City filter for merchant (should behave as like and case insensitive) (case insensitive is available from CRM.COM R18.6.0, prior CRM.COM R18.2.0, this attribute was a single value based instead of an array)

Collection format: csv
Unique items: YES
group_by_parent
boolean optional

Defines whether merchants should be grouped by their parent

Example:
true
sort
string optional

Defines on which attribute the results should be sorted

Enumeration:
CREATED_DATE
UPDATED_DATE
NAME
Default:
CREATED_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

Authorization
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 business unit identifier

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
name
string

The name of the business unit

Example:
Alfa Bakery
description
string

The description of the retrieved business unit

Example:
Lorem Ipsum
universal_offer
Object

Information about the merchant’s award based on the universal offer (Applicable from CRM.COM R18.2.0)

id
string GUID

The reward offer identifier

Example:
10540F31CB60400EB7E9F0E2420086FD
currency_code
string

The currency code that the award will be provided in

Example:
EUR
award_amount
number

The amount that the universal offer will provide

Example:
1.21
award_percentage
number

The percentage that the universal offer will provide for that merchant

Example:
14.52
industry_name
string

The business unit industry

Example:
Restaurant
industry_sectors
Array

The business unit industry sectors

Object
name
string

The industry sector name

Example:
Bar
address
Array

Information about the merchant’s addresses

Object
address_type
string

The type of the address

Enumeration:
HOME
BUSINESS
POBOX
CUSTOM1
CUSTOM2
CUSTOM3
CUSTOM4
CUSTOM5
is_primary
boolean

Defines whether the address is the primary one

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

Information about the creative type

Enumeration:
ATTACHMENT
PROFILEIMAGE
MARKETING
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 /merchants HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "content": [
        {
            "id": "CAD1E31269B76D7A65ACCE45B2E68DFD",
            "name": "Alfa Bakery",
            "description": "Lorem Ipsum",
            "universal_offer": {
                "id": "10540F31CB60400EB7E9F0E2420086FD",
                "currency_code": "EUR",
                "award_percentage": 14.52
            },
            "industry_name": "Restaurant",
            "industry_sectors": [
                {
                    "name": "Bar"
                }
            ],
            "address": [
                {
                    "address_type": "CUSTOM4",
                    "is_primary": true,
                    "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"
                }
            ],
            "creatives": [
                {
                    "id": "CA123456789AQWSXZAQWS1236547896541",
                    "type": "PROFILEIMAGE",
                    "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 Merchant
GET /merchants/{id}

Retrieve all details for a specific merchant

Path variables

id
string GUID required

The merchant identifier

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD

Notes

To display the actual image you need to construct a URL based on the creative media url and the authorization token (e.g. https://crm.com/asset.jpg&token=4AD9C84FA60F)

Request parameters

include_venues
boolean optional

Defines if child business units should be returned or not

Example:
true

Request headers

Authorization
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 OK

The request has succeeded

Body
Object
content
Object

Information about the retrieved merchants (business units)

id
string GUID

The business unit identifier

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
name
string

The name of the business unit

Example:
Alfa Bakery
description
string

The description of the retrieved business unit

Example:
Lorem Ipsum
industry_name
string

The business unit industry

Example:
Restaurant
industry_sectors
Array

The business unit industry sectors

Object
name
string

The industry sector name

Example:
Bar
addresses
Array

Information about the specified addresses

Object
id
string GUID

The address identifier

address_type
string

The type of the address

Enumeration:
HOME
BUSINESS
POBOX
CUSTOM1
CUSTOM2
CUSTOM3
CUSTOM4
CUSTOM5
is_primary
boolean

Defines whether the address is the primary one

Example:
true
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
child_business_units
Array

Information about the merchant’s outlets

Object
id
string GUID

The business unit identifier

Example:
CAD1E31269B76D7A65ACCE45B2E68D78
name
string

The child business unit name

Example:
Alpha Bakery Egkomis
description
string

The description of the retrieved child business unit

Example:
Lorem Ipsum
addresses
Array

Information about the specified addresses

Object
id
string GUID

The address identifier

address_type
string

The type of the address

Enumeration:
HOME
BUSINESS
POBOX
CUSTOM1
CUSTOM2
CUSTOM3
CUSTOM4
CUSTOM5
is_primary
boolean

Defines whether the address is the primary one

Example:
true
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
phones
Array

The contact’s phones

Object
id
string GUID

The phone identifier

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
phone_type
string

The type of the phone

Enumeration:
LANDLINE
MOBILE
FAX
CUSTOM1
CUSTOM2
CUSTOM3
CUSTOM4
CUSTOM5
is_primary
boolean

Defines whether the phone is the primary one

Example:
true
country_code
string

The country that the phone is registered

Example:
CYP
number
string

The phone number

Example:
238065437
parent_business_unit
Object

Information about the business parent of this business unit. Available only if the business unit has a parent business unit

id
string GUID

The business unit identifier

Example:
CAD1E31269B76D7A65ACCE45B2E68D78
name
string

The business unit name

Example:
Alpha Bakery
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
type
string

Information about the creative type

Enumeration:
ATTACHMENT
PROFILEIMAGE
MARKETING
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 http://staging.crm.com/self-service/v1/merchants/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"
            }
        ],
        "addresses": [
            {
                "id": "",
                "address_type": "POBOX",
                "is_primary": true,
                "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"
            }
        ],
        "child_business_units": [
            {
                "id": "CAD1E31269B76D7A65ACCE45B2E68D78",
                "name": "Alfa Bakery Egkomis",
                "description": "Lorem Ipsum",
                "addresses": [
                    {
                        "id": "",
                        "address_type": "CUSTOM3",
                        "is_primary": true,
                        "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"
                    }
                ],
                "phones": [
                    {
                        "id": "CAD1E31269B76D7A65ACCE45B2E68DFD",
                        "phone_type": "CUSTOM4",
                        "is_primary": true,
                        "country_code": "CYP",
                        "number": "238065437"
                    }
                ]
            }
        ],
        "creatives": [
            {
                "id": "CA123456789AQWSXZAQWS1236547896541",
                "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"
                    }
                ]
            }
        ]
    }
}
Communications
GET /contacts/{id}/communications
GET /communications/{id}
PUT /communications/{id}/mark_viewed
PUT /communications/{id}/mark_archived
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
Enumeration:
CREATED_DATE
UPDATED_DATE
Default:
CREATED_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
type
string optional

The type of the communications to be retrieved

Enumeration:
EMAIL
SMS
DEVICE
IN_APP
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

Authorization
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 OK

The request has succeeded

Body
Object
content
Array

Information about the retrieved communication records

Object
id
string

The ID of the retrieved communication

Example:
6A24D2B5E44F44B28451FE021FCAD51E
number
string

The communication number

Example:
124
subject
string

The communication subject

Example:
Lorem Ipsum
subtitle
string

The communication subtitle (applicable if communication is IN APP)

Example:
Lorem Ipsum
content
string

The communication content

Example:
Lorem Ipsum
viewed
boolean

Defines whether the communication was viewed or not

Example:
true
viewed_on
integer epoch

Defines the date that the communication was viewed

Example:
1573763120
created_on
integer epoch

Defines the date that the communication was created

Example:
1573763120
category
Object

The communication category

id
string
code
string
name
string
paging
Object

Information that can be used in order to display large pages

page
integer

The page number

Example:
2
size
integer

The number of records per page

Default:
10
Example:
20
total
integer

The total number of records

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

Authorization: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "content": [
        {
            "id": "6A24D2B5E44F44B28451FE021FCAD51E",
            "number": "124",
            "subject": "Lorem Ipsum",
            "content": "Lorem Ipsum",
            "viewed": "true",
            "viewed_on": 1573763120,
            "created_on": 1573763120,
            "category": {
                "id": "",
                "code": "",
                "name": ""
            }
        }
    ],
    "paging": {
        "page": 2,
        "size": 20,
        "total": 1124
    }
}
Get Communication
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

Authorization
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 OK

The request has succeeded

Body
Object
id
string GUID

The communication identifier

Example:
6A24D2B5E44F44B28451FE021FCAD51E
number
string

The communication number

Example:
125
subject
string

The communication subject

Example:
Lorem Ipsum
subtitle
string

The communication subtitle (applicable if communication is IN APP)

Example:
Lorem Ipsum
content
string

The communication content

Example:
Lorem Ipsum
viewed
boolean

Defines whether the communication was viewed or not

Example:
true
viewed_on
integer epoch

The date that the communciation was viewed

Example:
1572530655
category
Object

The communication category

id
string GUID

The communication category identifer

Example:
6A24D2B5E44F44B28451FE021FCAD51E
name
string

The communication category name

Example:
Marketing
code
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 /communications/CAD1E31269B76D7A65ACCE45B2E68DFD HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "6A24D2B5E44F44B28451FE021FCAD51E",
    "number": "125",
    "subject": "Lorem Ipsum",
    "content": "Lorem Ipsum",
    "viewed": "true",
    "viewed_on": 1572530655,
    "category": {
        "id": "6A24D2B5E44F44B28451FE021FCAD51E",
        "name": "Marketing"
    }
}
Mark Communication as Viewed
PUT /communications/{id}/mark_viewed

Mark an existing communication as viewed

Path variables

id
string GUID required

The communication identifier that should be makred as viewed

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD

Request headers

Authorization
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 OK

The request has succeeded

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

Authorization: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "CAD1E31269B76D7A65ACCE45B2E68DFD"
}
Mark Communication as Archived
PUT /communications/{id}/mark_archived

Mark an existing communication as archived. Available from R18.2.0 onwards

Path variables

id
string GUID required

The communication identifier that should be makred as archived

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD

Request headers

Authorization
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 OK

The request has succeeded

Body
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 /communications/CAD1E31269B76D7A65ACCE45B2E68DFD/mark_archived HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "CAD1E31269B76D7A65ACCE45B2E68DFD"
}
Configuration

Lists a number of APIs that can be used for retrieving configuration settings, required by the mobile/web client

GET /categories
List Categories
GET /categories

Returns a list of categories based on the provided type

Request parameters

entity
string required

Defines which entity categories to retrieve

Enumeration:
REWARDOFFER
CONTACT
BUSINESSUNIT

Request headers

Authorization
string required

Authorization Token

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 OK

The request has succeeded

Body
Object
content
Array

Information about the retrieved categories

Object
id
string GUID

The category identifier

Example:
E4AC253114B84DF2B347996DC277DDDF
name
string

The category name

Example:
Seasonal
description
string

The category description

Example:
Lorem Ipsum
400 Bad Request

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

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

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

404 Not Found

The requested resource does not exist

500 Internal Server Error

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

502 Bad Gateway

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

503 Service Unavailable

The server is currently unable to handle the request 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 /categories?entity=REWARDOFFER HTTP/1.1 

Authorization: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "content": [
        {
            "id": "E4AC253114B84DF2B347996DC277DDDF",
            "name": "Seasonal",
            "description": "Lorem Ipsum"
        }
    ]
}