BackOffice Admin

https://sandbox.crm.com/backoffice/v1
Introduction

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

The CRM.COM API is designed around REST, allowing you to access and extend the software’s current functionality in a simple, programmatic way using intuitive URL endpoints, conventional HTTP requests, response codes, authentication and verbs.

Back-Office API is designed with a main focus on users and external systems that desire to access and extend the functionality found in CRM.COM.

For the Mobile/Web based Applications API please refer to the Self-Service API documentation that provides more details how to allow customer to manage their subscriptions and/or reward accounts.

Change Log

Release Date 14th Sept 2020

This is the first release of the CRM V5 platform API’s

Authentication

CRM.COM BackOffice API uses either API keys to authenticate requests or an authentication JWT token obtained from a user successful logging in

API keys can be accessed and managed in the CRM.COM Dashboard. Such API keys carry many privileges, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code and so forth

All API requests must be made over HTTPS. API requests made over plain HTTP or without authentication will fail. API keys authentication is made using -H “api_key : crm_test_;dwfwgiuhjr412edws”, while User Bearer Auth is achieved using -H “Authorization: Bearer JWT_TOKEN”

Unique Resource Identifiers

CRM.COM is built on a domain based micro-service architecture. Our primary resources such as Contact, Account, Wallet, Products, Subscriptions are all created with a unique identifier that uses a performant time based GUID. These are generated when a new resource such as a contact is created. However in some cases external integration may wish to use a unique identfier that is stored in an external system, such as a Bank CIF or Credit Card fingerprint.

Some systems allow from their create APIs to supply a unique identifier as part of the request body. CRM.COM has decided to provide an alternative approach and make an alternative unique identifier available on resources (e.g. on Contacts we provide the contact.code). If such attribute is specified during the create operation it wil be available on subsequent operations as a resource’s identifier, alongside with the GUID that is returned in the response body. Updating such resource can be achieved either using PUT /contact/GUID or PUT /contact/CODE.

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 200

The request has succeeded

400 400

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

401 401

The provided API Key or Token is invalid

403 403

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

404 404

The requested resource does not exist

500 500

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

502 502

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

503 503

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

504 504

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

Operations
Accounts
POST /contacts/{id}/accounts
GET /contacts/{id}/accounts
PUT /accounts/{id}
POST /accounts/{id}/life_cycle_state
Add Account for Contact
POST /contacts/{id}/accounts

Add a new customer account to an existing contact

Path variables

id
string GUID required

The contact identifier that will be updated

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD

Request headers

authorization
string optional

Authorization Token

Example:
eyJraWQiOiIvcHJpdmF0ZUtleS5wZW0iLCJ0eXAiOiJKV
api_key
string optional

The secret api key required for API calls to ensure that the client is trusted

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

Request body

Object
classification_id
string GUID nullable

The account’s classification ID

Example:
4AD9C84FA60F9FE407140E20F707726A
currency_code
string nullable

The account’s currency

Example:
USD
is_primary
boolean nullable

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

Example:
true
billing_address_id
string GUID nullable

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

Example:
4AD9C84FA60F9FE407140E20F707726A

Responses

200 200

OK

Body
Object
id
string GUID

The account identifier

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
400 400

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

401 401

The provided API Key or Token is invalid

403 403

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

404 404

The requested resource does not exist

500 500

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

502 502

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

503 503

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

504 504

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

Example 1
POST https://stagingapi.crm.com/backoffice/v1/contacts/CAD1E31269B76D7A65ACCE45B2E68DFD/accounts HTTP/1.1 

Content-Type: application/json

{
    "classification_id": "4AD9C84FA60F9FE407140E20F707726A",
    "currency_code": "USD",
    "is_primary": true,
    "billing_address_id": "4AD9C84FA60F9FE407140E20F707726A"
}

HTTP/1.1 200 OK 

Content-Type: application/json

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

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

Path variables

id
string GUID required

The contact identifier whose accounts will be retrieved

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD

Request parameters

is_primary
boolean optional

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

sort
string optional

Defines on which attribute the results should be sorted

Default:
CREATED_DATE
Examples:
CREATED_DATEUPDATED_DATENAME
page
integer optional

The page number that should be retrieved

Default:
1
size
integer optional

The size (total records) of each page

Default:
10
order
string optional

Defines how the results will be ordered

Default:
DESC

Request headers

authorization
string optional

Authorization Token

Example:
eyJraWQiOiIvcHJpdmF0ZUtleS5wZW0iLCJ0eXAiOiJKV
api_key
string optional

The secret api key required for API calls to ensure that the client is trusted

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

Responses

200 200

OK

Body
Object
content
Array
Object
id
string GUID

The account identifier

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
is_primary
boolean

Indicates the primary account of the contact

Example:
true
name
string

The account name

Example:
Default
number
string

The Account number

Example:
AC123456
life_cycle _state
string

The account’s life cycle state

Enumeration:
ACTIVE
SUSPENDED
TERMINATED
currency_code
string

The account’s currency

classification
Object

The account’s classification

id
string GUID

The classification identifier

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
name
string

The classification name

Example:
VIP
balance
number

The account’s calculated balance

Example:
200
credit_limit
number

The account’s credit limit

Example:
100
overdue_amount
number

The unpaid amount that is passed its due date

Example:
50
billing_address_id
string GUID

The billing address of the account which is the same as one of the contact’s addresses

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
wallet
Object

The account’s wallet information (if available)

id
string GUID

The wallet identifier

Example:
6A24D2B5E44F44B28451FE021FCAD51E
code
string
Example:
1234567898767543
balance
number
Example:
200.2
currency_code
string
Example:
EUR
life_cycle_state
string

The wallet’s life cycle state

Enumeration:
EFFECTIVE
CANCELLED
400 400

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

401 401

The provided API Key or Token is invalid

403 403

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

404 404

The requested resource does not exist

500 500

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

502 502

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

503 503

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

504 504

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

Example 1
GET https://stagingapi.crm.com/backoffice/v1/contacts/CAD1E31269B76D7A65ACCE45B2E68DFD/accounts HTTP/1.1 

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "accounts": [
        {
            "id": "CAD1E31269B76D7A65ACCE45B2E68DFD",
            "is_primary": true,
            "name": "Default",
            "number": "AC123456",
            "life_cycle _state": "ACTIVE",
            "currency_code": "",
            "classification": {
                "id": "CAD1E31269B76D7A65ACCE45B2E68DFD",
                "name": "VIP"
            },
            "balance": 200,
            "credit_limit": 100,
            "overdue_amount": 50,
            "billing_address_id": "CAD1E31269B76D7A65ACCE45B2E68DFD",
            "wallet": {
                "id": "6A24D2B5E44F44B28451FE021FCAD51E",
                "code": "1234567898767543",
                "balance": 200.2,
                "currency_code": "EUR",
                "life_cycle_state": "CANCELLED"
            }
        }
    ]
}
Update Account
PUT /accounts/{id}

Update the account of a contact

Path variables

id
string GUID required

The account identifier that will be updated

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD

Request headers

authorization
string optional

Authorization Token

Example:
eyJraWQiOiIvcHJpdmF0ZUtleS5wZW0iLCJ0eXAiOiJKV
api_key
string optional

The secret api key required for API calls to ensure that the client is trusted

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

Request body

Object
classification_id
string GUID

The account’s classification ID

Example:
4AD9C84FA60F9FE407140E20F707726A
is_primary
boolean

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

Example:
true
billing_address_id
string GUID

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

Example:
4AD9C84FA60F9FE407140E20F707726A
credit_limit
number

Sets the credit limit of the account, within the allowed range based on settings

Example:
200

Responses

200 200

OK

Body
Object
id
string GUID

The account identifier

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
400 400

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

401 401

The provided API Key or Token is invalid

403 403

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

404 404

The requested resource does not exist

500 500

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

502 502

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

503 503

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

504 504

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

Example 1
PUT https://devapi.crm.com/backoffice/v1/accounts/CAD1E31269B76D7A65ACCE45B2E68DFD HTTP/1.1 

Content-Type: application/json

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

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "CAD1E31269B76D7A65ACCE45B2E68DFD"
}
Update Account's Life Cycle State
POST /accounts/{id}/life_cycle_state

Change the life cycle state of the Account

Path variables

id
string GUID required

The account identifier that will be updated

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD

Request headers

authorization
string optional

Authorization Token

Example:
eyJraWQiOiIvcHJpdmF0ZUtleS5wZW0iLCJ0eXAiOiJKV
api_key
string optional

The secret api key required for API calls to ensure that the client is trusted

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

Request body

Object
life_cycle_state
string required

The life cycle state that the account will changed into

Enumeration:
TERMINATED
SUSPENDED
ACTIVE
transfer_to_account_id
string GUID nullable

The account to which any account/wallet balance will get transfered, in case of Termination

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD

Responses

200 200

Successful Request

Body
Object
id
string GUID

The unique identifier of the account

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
400 400

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

401 401

The provided API Key or Token is invalid

403 403

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

404 404

The requested resource does not exist

500 500

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

502 502

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

503 503

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

504 504

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

Example 1
POST /accounts/CAD1E31269B76D7A65ACCE45B2E68DFD/life_cycle_state HTTP/1.1 

Content-Type: application/json

{
    "life_cycle_state": "TERMINATED",
    "transfer_to_account_id": "CAD1E31269B76D7A65ACCE45B2E68DFD"
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "CAD1E31269B76D7A65ACCE45B2E68DFD"
}
Account Financials
GET /accounts/{id}/financials
POST /accounts/{id}/members
PUT /accounts/{id}/members/{member_id}
DELETE /accounts/{id}/members/{member_id}
GET /accounts/{id}/members
Get Account Financials
GET /accounts/{id}/financials

Get a single Account with its financial information

Path variables

id
string GUID required

The unique identification of the Account to be retrieved.

Example:
4AD9C84FA60F9FE407140E20F707726A

Request headers

authorization
string optional

Authorization Token

Example:
eyJraWQiOiIvcHJpdmF0ZUtleS5wZW0iLCJ0eXAiOiJKV
api_key
string optional

The secret api key required for API calls to ensure that the client is trusted

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

Responses

200 200

OK

Body
Object
name
string

The account’s name

Example:
John Smith AC00123456
number
string

The account’s number

Example:
AC00123456
is_primary
boolean

Defines whether the account is the primary one of the contact

Example:
true
life_cycle_state
string

The account’s life cycle state

Enumeration:
ACTIVE
SUSPENDED
TERMINATED
currency_code
string

The account’s currency (3 code currency)

Example:
EUR
balance
number

The account’s calculated balance

Example:
200
overdue_amount
number

The unpaid amount that is passed its due date

Example:
100.5
credit_limit
number

The account’s credit limit

Example:
98
accounting_period_id
string GUID

The ID of the latest closed accounting period

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
accounting_period_name
string

The name of the account’s latest accounting period

Example:
OCTOBER2018
opening_balance
number

The opening balance brought forwards after the latest closed accounting period

Example:
100.5
classification
Object
id
string GUID

The unique identifier of the Account classification

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
name
string

The name of the Account classification

Example:
VIP
wallet
Array

The account’s wallet information (if available)

Object
id
string GUID

The wallet’s unique identifier

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
code
string

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

Example:
W00123456
balance
number

The total balance of the wallet

Example:
150.5
commerce_balance
number

The commerce balance of the wallet

Example:
98
open_balance
number

The open balance of the wallet

life_cycle_state
string

The wallet’s life cycle state

Enumeration:
EFFECTIVE
TERMINATED
minimum_balance
number

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

Example:
9
limit_rules
Array

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

Object
minimum_amount
number

The minimum amount allowed

Example:
100.5
maximum_amount
number

The maximum amount allowed

Example:
200
period
string

The period for which the limit is applied

Enumeration:
DAILY
MONTHLY
ANNUAL
transaction_type
string

The wallet transaction type for which the limit is applied

Enumeration:
CREDIT
DEBIT
TOPUP
TRANSFER
auto_topup
Object
threshold
number

Sets the threshold for the auto topup to be performed

Example:
10.5
amount
number

The amount to get topped up

Example:
10.5
payment_method
string

Indicates the method of collecting money

Enumeration:
CASH
BANK_TRANSFER
CARD
DIRECT_DEBIT
WALLET
PAYPAL
ACCOUNT
payment_method_id
string

The contact’s actual preferred payment method. Required and mandatory only for online payments (Card, Wallet, PayPal and Account). Defaults to the primary payment method, if any.

billing_address
Object
id
string GUID

The id of the billing address

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
address_line_1
string
Example:
2265 Oak Street
address_line_2
string
state_province_county
string
Example:
New York
town_city
string
Example:
Old Forge
postal_code
string
Example:
13420
country_code
string
Example:
USA
400 400

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

401 401

The provided API Key or Token is invalid

403 403

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

404 404

The requested resource does not exist

500 500

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

502 502

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

503 503

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

504 504

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

Example 1
GET https://stagingapi.crm.com/backoffice/v1/accounts/4AD9C84FA60F9FE407140E20F707726A/financials HTTP/1.1 

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "name": "John Smith AC00123456",
    "number": "AC00123456",
    "is_primary": "true",
    "life_cycle_state": "SUSPENDED",
    "currency_code": "EUR",
    "balance": 200,
    "overdue_amount": 100.5,
    "credit_limit": 98,
    "accounting_period_id": "CAD1E31269B76D7A65ACCE45B2E68DFD",
    "accounting_period_name": "OCTOBER2018",
    "opening_balance": 100.5,
    "classification": {
        "id": "CAD1E31269B76D7A65ACCE45B2E68DFD",
        "name": "VIP"
    },
    "wallet": [
        {
            "id": "CAD1E31269B76D7A65ACCE45B2E68DFD",
            "code": "W00123456",
            "balance": 150.5,
            "commerce_balance": 98,
            "open_balance": 1,
            "life_cycle_state": "EFFECTIVE",
            "minimum_balance": 9,
            "limit_rules": [
                {
                    "minimum_amount": 100.5,
                    "maximum_amount": 200,
                    "period": "ANNUAL",
                    "transaction_type": "TRANSFER"
                }
            ],
            "auto_topup": {
                "threshold": 10.5,
                "amount": 10.5,
                "payment_method": "PAYPAL",
                "payment_method_id": ""
            }
        }
    ],
    "billing_address": {
        "id": "CAD1E31269B76D7A65ACCE45B2E68DFD",
        "address_line_1": "2265 Oak Street",
        "address_line_2": "",
        "state_province_county": "New York",
        "town_city": "Old Forge",
        "postal_code": "13420",
        "country_code": "USA"
    }
}
Add Account Member
POST /accounts/{id}/members

Add new member on an account group.

Path variables

id
string GUID required

The account identifier that will add a member in its group

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD

Request headers

authorization
string optional

Authorization Token

Example:
eyJraWQiOiIvcHJpdmF0ZUtleS5wZW0iLCJ0eXAiOiJKV
api_key
string optional

The secret api key required for API calls to ensure that the client is trusted

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

Request body

Object
member_account_id
string

The account to join

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
funding_scope
string

The funding scope that the account joins the group

Enumeration:
FULLY
PARTIALLY
products
Array

The funded products of the member account

string GUID
Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
product_types
Array
string GUID
Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
product_families
Array
string GUID
Example:
CAD1E31269B76D7A65ACCE45B2E68DFD

Responses

200 200

Successful Request

Body
Object
id
string

The unique identifier of the account

400 400

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

401 401

The provided API Key or Token is invalid

403 403

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

404 404

The requested resource does not exist

500 500

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

502 502

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

503 503

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

504 504

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

Example 1
POST https://devapi.crm.com/backoffice/v1/accounts/CAD1E31269B76D7A65ACCE45B2E68DFD/members HTTP/1.1 

Content-Type: application/json

{
    "member_account_id": "CAD1E31269B76D7A65ACCE45B2E68DFD",
    "funding_scope": "PARTIALLY",
    "products": [
        "CAD1E31269B76D7A65ACCE45B2E68DFD"
    ],
    "product_types": [
        "CAD1E31269B76D7A65ACCE45B2E68DFD"
    ],
    "product_families": [
        "CAD1E31269B76D7A65ACCE45B2E68DFD"
    ]
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": ""
}
Update Account Member
PUT /accounts/{id}/members/{member_id}

Update a member of this account group

Path variables

id
string GUID required

The account identifier that the member belongs to

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
member_id
string GUID required

The member account identifier to be updated

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD

Request headers

authorization
string optional

Authorization Token

Example:
eyJraWQiOiIvcHJpdmF0ZUtleS5wZW0iLCJ0eXAiOiJKV
api_key
string optional

The secret api key required for API calls to ensure that the client is trusted

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

Request body

Object
funding_scope
string

The funding scope that the account joins the group

Enumeration:
FULLY
PARTIALLY
products
Array

The funded products of the member account

string GUID
Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
product_types
Array
string GUID
Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
product_families
Array
string GUID
Example:
CAD1E31269B76D7A65ACCE45B2E68DFD

Responses

200 200

Successful Request

Body
Object
id
string

The unique identifier of the account

400 400

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

401 401

The provided API Key or Token is invalid

403 403

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

404 404

The requested resource does not exist

500 500

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

502 502

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

503 503

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

504 504

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

Example 1
PUT https://devapi.crm.com/backoffice/v1/accounts/CAD1E31269B76D7A65ACCE45B2E68DFD/members/CAD1E31269B76D7A65ACCE45B2E68DFD HTTP/1.1 

Content-Type: application/json

{
    "funding_scope": "FULLY",
    "products": [
        "CAD1E31269B76D7A65ACCE45B2E68DFD"
    ],
    "product_types": [
        "CAD1E31269B76D7A65ACCE45B2E68DFD"
    ],
    "product_families": [
        "CAD1E31269B76D7A65ACCE45B2E68DFD"
    ]
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": ""
}
Remove Account Member
DELETE /accounts/{id}/members/{member_id}

Remove a member account from an account group

Path variables

id
string GUID required

The account identifier that the member belongs to

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
member_id
string GUID required

The member account identifier to be removed

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD

Request headers

authorization
string optional

Authorization Token

Example:
eyJraWQiOiIvcHJpdmF0ZUtleS5wZW0iLCJ0eXAiOiJKV
api_key
string optional

The secret api key required for API calls to ensure that the client is trusted

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

Responses

200 200

Successful Request

Body
Object
id
string GUID

The unique identifier of the account

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
400 400

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

401 401

The provided API Key or Token is invalid

403 403

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

404 404

The requested resource does not exist

500 500

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

502 502

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

503 503

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

504 504

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

Example 1
DELETE https://devapi.crm.com/backoffice/v1/accounts/CAD1E31269B76D7A65ACCE45B2E68DFD/members/CAD1E31269B76D7A65ACCE45B2E68DFD HTTP/1.1 

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "CAD1E31269B76D7A65ACCE45B2E68DFD"
}
List Account Members
GET /accounts/{id}/members

Lists the members of an account

Path variables

id
string GUID required

The account identifier for which the members will be retrieved

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD

Request headers

authorization
string optional

Authorization Token

Example:
eyJraWQiOiIvcHJpdmF0ZUtleS5wZW0iLCJ0eXAiOiJKV
api_key
string optional

The secret api key required for API calls to ensure that the client is trusted

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

Request body

Object
members
Array
Object
id
string GUID

The member account’s unique identifier

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
number
string

The member account’s number

Example:
AC123456
funding_scope
string

The funding scope that the account joins the group

Enumeration:
FULLY
PARTIALLY
products
Array
Object
id
string GUID

The unique identifier of the funded product

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
sku
string

The SKU of the funded product

Example:
ABC123
product_types
Array
Object
id
string GUID

The unique identifier of the funded product type

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
name
string

The name of the funded product type

Example:
FOOD
product_families
Array
Object
id
string GUID

The unique identifier of the funded product family

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
name
string

The name of the funded product family

Example:
COFFEE

Responses

200 200

Successful Request

Body
Object
id
string

The unique identifier of the account

400 400

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

401 401

The provided API Key or Token is invalid

403 403

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

404 404

The requested resource does not exist

500 500

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

502 502

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

503 503

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

504 504

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

Example 1
GET https://devapi.crm.com/backoffice/v1/accounts/CAD1E31269B76D7A65ACCE45B2E68DFD/members HTTP/1.1 

Content-Type: application/json

{
    "members": [
        {
            "id": "CAD1E31269B76D7A65ACCE45B2E68DFD",
            "number": "AC123456",
            "funding_scope": "PARTIALLY",
            "products": [
                {
                    "id": "CAD1E31269B76D7A65ACCE45B2E68DFD",
                    "sku": "ABC123"
                }
            ],
            "product_types": [
                {
                    "id": "CAD1E31269B76D7A65ACCE45B2E68DFD",
                    "name": "FOOD"
                }
            ],
            "product_families": [
                {
                    "id": "CAD1E31269B76D7A65ACCE45B2E68DFD",
                    "name": "COFFEE"
                }
            ]
        }
    ]
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": ""
}
Account Wallets
POST /accounts/{id}/wallets
PUT /wallets/{id}
POST /wallets/{id}/actions
GET /wallets/{id}/balances
POST /journals
Add Wallet for Account
POST /accounts/{id}/wallets

Add a new wallet for an existing account

Path variables

id
string GUID required

The account identifier that will be updated

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD

Request headers

authorization
string optional

Authorization Token

Example:
eyJraWQiOiIvcHJpdmF0ZUtleS5wZW0iLCJ0eXAiOiJKV
api_key
string optional

The secret api key required for API calls to ensure that the client is trusted

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

Request body

Object
minimum_balance
number

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

Example:
10
limit_rules
Array

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

Object
limit_amount
number

The maximum amount allowed

Example:
100
transaction_type
string

The wallet transaction type for which the limit is applied

Enumeration:
CREDIT
DEBIT
period
string

The period for which the limit is applied

Enumeration:
DAILY
MONTHLY
ANNUAL

Responses

200 200

OK

Body
Object
id
string GUID

The wallet identifier

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
400 400

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

401 401

The provided API Key or Token is invalid

403 403

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

404 404

The requested resource does not exist

500 500

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

502 502

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

503 503

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

504 504

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

Example 1
POST https://devapi.crm.com/backoffice/v1/accounts/CAD1E31269B76D7A65ACCE45B2E68DFD/wallets HTTP/1.1 

Content-Type: application/json

{
    "minimum_balance": 10,
    "limit_rules": [
        {
            "limit_amount": 100,
            "transaction_type": "DEBIT",
            "period": "DAILY"
        }
    ]
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "CAD1E31269B76D7A65ACCE45B2E68DFD"
}
Update Wallet
PUT /wallets/{id}

Update the wallet of an account

Path variables

id
string GUID required

The wallet identifier that will be updated

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD

Request headers

authorization
string optional

Authorization Token

Example:
eyJraWQiOiIvcHJpdmF0ZUtleS5wZW0iLCJ0eXAiOiJKV
api_key
string optional

The secret api key required for API calls to ensure that the client is trusted

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

Request body

Object
minimum_balance
number

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

Example:
10
limit_rules
Array

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

Object
minimum_amount
number

The minimum amount allowed

Example:
100
maximum_amount
number

The maximum amount allowed

Example:
200
period
string

The period for which the limit is applied

Enumeration:
DAILY
MONTHLY
ANNUAL
transaction_type
string

The wallet transaction type for which the limit is applied

Enumeration:
CREDIT
DEBIT
TOPUP
TRANSFER
auto_topup
Object
threshold
number

Sets the threshold for the auto topup to be performed

Example:
10.5
amount
number

The amount to get topped up

Example:
10.5
payment_method
string

Indicates the method of collecting money

Enumeration:
CASH
BANK_TRANSFER
CARD
DIRECT_DEBIT
WALLET
PAYPAL
ACCOUNT
payment_method_id
string

The contact’s actual preferred payment method. Required and mandatory only for online payments (Card, Wallet, PayPal and Account). Defaults to the primary payment method, if any.

Responses

200 200

OK

Body
Object
id
string GUID

The wallet identifier

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
400 400

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

401 401

The provided API Key or Token is invalid

403 403

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

404 404

The requested resource does not exist

500 500

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

502 502

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

503 503

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

504 504

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

Example 1
PUT https://stagingapi.crm.com/backoffice/v1/wallets/CAD1E31269B76D7A65ACCE45B2E68DFD HTTP/1.1 

Content-Type: application/json

{
    "minimum_balance": 10,
    "limit_rules": [
        {
            "minimum_amount": 100,
            "maximum_amount": 200,
            "period": "DAILY",
            "transaction_type": "TRANSFER"
        }
    ],
    "auto_topup": {
        "threshold": 10.5,
        "amount": 10.5,
        "payment_method": "ACCOUNT",
        "payment_method_id": ""
    }
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "CAD1E31269B76D7A65ACCE45B2E68DFD"
}
Actions on Wallet
POST /wallets/{id}/actions

Change the life cycle state of the Wallet

Path variables

id
string GUID required

The wallet identifier that will be updated

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD

Request headers

authorization
string optional

Authorization Token

Example:
eyJraWQiOiIvcHJpdmF0ZUtleS5wZW0iLCJ0eXAiOiJKV
api_key
string optional

The secret api key required for API calls to ensure that the client is trusted

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

Request body

Object
action
string

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

Enumeration:
TERMINATED
EFFECTIVE

Responses

200 200

Successful Request

Body
Object
id
string GUID

The unique identifier of the wallet

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
400 400

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

401 401

The provided API Key or Token is invalid

403 403

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

404 404

The requested resource does not exist

500 500

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

502 502

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

503 503

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

504 504

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

Example 1
POST https://stagingapi.crm.com/backoffice/v1/wallets/CAD1E31269B76D7A65ACCE45B2E68DFD/actions HTTP/1.1 

Content-Type: application/json

{
    "action": "EFFECTIVE"
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "CAD1E31269B76D7A65ACCE45B2E68DFD"
}
List Wallet Balances
GET /wallets/{id}/balances

Get the wallet’s balances split per spend condition

Path variables

id
string GUID required

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

Example:
4AD9C84FA60F9FE407140E20F707726A

Request parameters

spend_condition_id
string GUID optional

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

Example:
4AD9C84FA60F9FE407140E20F707726A
include_expiration
boolean optional

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

Example:
true
sort
string optional

Defines on which attribute the results should be sorted

Default:
CREATED_DATE
Examples:
CREATED_DATEUPDATED_DATENAME
order
string optional

Defines how the results will be ordered

Default:
DESC
page
integer optional

The page number that should be retrieved

Default:
1
size
integer optional

The size (total records) of each page

Default:
10

Request headers

authorization
string optional

Authorization Token

Example:
eyJraWQiOiIvcHJpdmF0ZUtleS5wZW0iLCJ0eXAiOiJKV
api_key
string optional

The secret api key required for API calls to ensure that the client is trusted

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

Responses

200 200

OK

Body
Array
Object
amount
number

The amount that is allocated to the specified spend condition

Example:
100.5
id
string

The unique ID of the spend condition group

Example:
4AD9C84FA60F9FE407140E20F707726A
name
string

The name of the spend condition group

Example:
Happy Hour
organisations
Array

The organisations where the amount can be spent at

Object
id
string

The ID of the organisation

Example:
4AD9C84FA60F9FE407140E20F707726A
name
string

The name of the organisation

Example:
Cafe
locations
Array

The location of the organisation

Object
name
string
Example:
Head Office
address_line_1
string
Example:
Elia Papakyriakou 21
address_line_2
string
Example:
7 Tower Stars
state_province_county
string
Example:
Egkomi
town_city
string
Example:
Nicosia
postal_code
string
Example:
2415
country_code
string
Example:
CY
lat
string
Example:
35.157115
lon
string
Example:
33.313719
googleplaceid
string
Example:
ChIJrTLr-GyuEmsRBfy61i59si0
products
Array

The products that the amount can be spent for

Object
id_type
string

The type of the ID to be provided

Enumeration:
PRODUCT
FAMILY
TYPE
BRAND
CATEGORY
id
string GUID

The ID of the product (based on the type provided)

Example:
4AD9C84FA60F9FE407140E20F707726A
name
string

The name of the product

Example:
Coffee
description
string

The descrtipion of the product

Example:
Brazilian Coffee
timings
Array

The time when the amount can be spent

Object
month
integer

The month as a condition (1-12)

Example:
1
day
integer

The day of the week as condition (1-7), 1 is Sunday

Example:
1
start_time
string

The start time of the day in 24 Hour format

Example:
19:00
end_time
string

The end time of the day in 24 Hour format

Example:
21:00
expiration
Object

Defines the amounts expiring in periods. Available only if the parameter include_expiration is set to true

zero_to_thirty
number

The amount that will expire in up to 30 days

Example:
50.5
thirty_to_sixty
number

The amount that will expire from 30 to 60 days

Example:
50.5
sixty_to_ninety
number

The amount that will expire from 60 to 90 days

Example:
50.5
ninety_plus
number

The amount that will expire in more than 90 days

Example:
50.5
400 400

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

401 401

The provided API Key or Token is invalid

403 403

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

404 404

The requested resource does not exist

500 500

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

502 502

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

503 503

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

504 504

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

Example 1
GET https://stagingapi.crm.com/backoffice/v1/wallets/4AD9C84FA60F9FE407140E20F707726A/balances HTTP/1.1 

HTTP/1.1 200 OK 

Content-Type: application/json

[
    {
        "amount": 100.5,
        "id": "4AD9C84FA60F9FE407140E20F707726A",
        "name": "Happy Hour",
        "organisations": [
            {
                "id": "4AD9C84FA60F9FE407140E20F707726A",
                "name": "Cafe",
                "locations": [
                    {
                        "name": "Head Office",
                        "address_line_1": "Elia Papakyriakou 21",
                        "address_line_2": "7 Tower Stars",
                        "state_province_county": "Egkomi",
                        "town_city": "Nicosia",
                        "postal_code": "2415",
                        "country_code": "CY",
                        "lat": "35.157115",
                        "lon": "33.313719",
                        "googleplaceid": "ChIJrTLr-GyuEmsRBfy61i59si0"
                    }
                ]
            }
        ],
        "products": [
            {
                "id_type": "FAMILY",
                "id": "4AD9C84FA60F9FE407140E20F707726A",
                "name": "Coffee",
                "description": "Brazilian Coffee"
            }
        ],
        "timings": [
            {
                "month": 1,
                "day": 1,
                "start_time": "19:00",
                "end_time": "21:00"
            }
        ],
        "expiration": {
            "zero_to_thirty": 50.5,
            "thirty_to_sixty": 50.5,
            "sixty_to_ninety": 50.5,
            "ninety_plus": 50.5
        }
    }
]
Create Wallet Journal
POST /journals

Create a wallet debit or credit journal entry

Request headers

authorization
string optional

Authorization Token

Example:
eyJraWQiOiIvcHJpdmF0ZUtleS5wZW0iLCJ0eXAiOiJKV
api_key
string optional

The secret api key required for API calls to ensure that the client is trusted

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

Request body

Object
wallet_id
string GUID

The unique identifier for which the journal entry will be created

Example:
4AD9C84FA60F9FE407140E20F707726A
amount
number

The amount of the journal

Example:
10
type
string

The type of the journal

Enumeration:
CREDIT
DEBIT
description
string

The description of the journal

Example:
Credit adjustment by 10 EUR
spend_condition_id
string GUID

The unique identifier of the related spend condition

Example:
4AD9C84FA60F9FE407140E20F707726A
valid_from
integer epoch

The valid from date

Example:
1587988965
valid_to
integer epoch

The valid to date

Example:
1587988965
created_on
integer epoch

The date and time when the journal actually created

Example:
1588081851
allow_below_zero
boolean

Allows a wallet debit journal to take the wallet balance below zero. By default, the wallet balance cannot go below zero.

Example:
true

Responses

200 200

OK

Body
Object
id
string GUID

The wallet journal identifier

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
400 400

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

401 401

The provided API Key or Token is invalid

403 403

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

404 404

The requested resource does not exist

500 500

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

502 502

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

503 503

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

504 504

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

Example 1
POST https://devapi.crm.com/backoffice/v1/journals HTTP/1.1 

Content-Type: application/json

{
    "wallet_id": "4AD9C84FA60F9FE407140E20F707726A",
    "amount": 10,
    "type": "DEBIT",
    "description": "Credit adjustment by 10 EUR",
    "spend_condition_id": "4AD9C84FA60F9FE407140E20F707726A",
    "valid_from": 1587988965,
    "valid_to": 1587988965,
    "created_on": 1588081851
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "CAD1E31269B76D7A65ACCE45B2E68DFD"
}
Account Rewards
PUT /accounts/{id}/rewards
GET /accounts/{id}/rewards
POST /accounts/{id}/merchants
DELETE /accounts/{id}/merchants/{merchant_id}
POST /accounts/{id}/reward_schemes
DELETE /accounts/{id}/reward_schemes/{reward_scheme_id}
Update Account Rewards
PUT /accounts/{id}/rewards

Update the reward attributes of the primary account of a contact

Path variables

id
string GUID required

The account identifier whose reward attributes will be updated

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD

Notes

Only Primary Accounts of a Contact hold Reward information

Request headers

authorization
string optional

Authorization Token

Example:
eyJraWQiOiIvcHJpdmF0ZUtleS5wZW0iLCJ0eXAiOiJKV
api_key
string optional

The secret api key required for API calls to ensure that the client is trusted

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

Request body

Object
signed_up_on
integer epoch nullable

The date that the customer first signed up

Example:
1583846865
signed_up_organisation_id
string GUID nullable

The organisation identifier that signed up the customer (first time)

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
spending_blocked_status
boolean nullable

Defines whether the spending is blocked for the specific account

Example:
true
automatic_spend_settings
Object nullable

Information about the automatic spend settings for the account

enable_automatic_spend
boolean required

Defines whether automatic spend is enabled for the account

Example:
false
automatic_spend_preference
string nullable

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

Enumeration:
NEXT_MERCHANT_PURCHASE
ALL_MERCHANT_PURCHASE
minimum_wallet_balance
number nullable

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

from_purchase_amount
number nullable

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

Example:
1.76
preferred_payment_method_id
string GUID nullable

The customer’s preferred payment method identifier that will be used for spending purposes for back-end reduction rewards (applicable payment methods are direct debit and credit cards related)

Example:
CAD1E31269B76D7A65ACCE45B2E68DCD

Responses

200 200

OK

Body
Object
id
string GUID

The account identifier

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
400 400

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

401 401

The provided API Key or Token is invalid

403 403

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

404 404

The requested resource does not exist

500 500

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

502 502

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

503 503

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

504 504

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

Example 1
PUT https://devapi.crm.com/backoffice/v1/accounts/CAD1E31269B76D7A65ACCE45B2E68DFD/rewards HTTP/1.1 

Content-Type: application/json
authorization: 4AD9C84FA60F9FE407140E20F707726A

{
    "signed_up_on": 1583846865,
    "signed_up_organisation_id": "CAD1E31269B76D7A65ACCE45B2E68DFD",
    "spending_blocked_status": "true",
    "automatic_spend_settings": {
        "enable_automatic_spend": "false",
        "automatic_spend_preference": "ALL_MERCHANT_PURCHASE",
        "minimum_wallet_balance": 1,
        "from_purchase_amount": 1.76
    },
    "preferred_payment_method_id": "CAD1E31269B76D7A65ACCE45B2E68DCD"
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "CAD1E31269B76D7A65ACCE45B2E68DFD"
}
Get Account Rewards
GET /accounts/{id}/rewards

Retrieve the Rewards details if a single account

Path variables

id
string GUID required

The unique identification of the Account to be retrieved.

Example:
4AD9C84FA60F9FE407140E20F707726A

Notes

Only Primary Accounts of a Contact hold Reward information

Request headers

authorization
string optional

Authorization Token

Example:
eyJraWQiOiIvcHJpdmF0ZUtleS5wZW0iLCJ0eXAiOiJKV
api_key
string optional

The secret api key required for API calls to ensure that the client is trusted

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

Responses

200 200

OK

Body
Object
id
string GUID

The account identifier

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
name
string

The account’s name

Example:
John Smith AC00123456
number
string

The account’s number

Example:
AC00123456
currency_code
string

The account’s currency (3 code currency)

Example:
EUR
signed_up_on
integer epoch

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

Example:
1583846865
sign_up_organisation
Object

Information about the organisation that sign up the account for the first time

id
string GUID

The organisation identifier

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
name
string

The organisation name

Example:
CRMdotCOM
spending_blocked_status
boolean

Defines whether the account can spend or not

Example:
false
spending_blocked_date
integer epoch

The date that the spending status of the account was updated

Example:
1583846865
spending_blocked_user
Object

Information about the user that updated the spending status of the account

id
string GUID

The user identifier

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
email_address
string

The user’s email address

Example:
johndoe@crm.com
first_name
string

The user’s first name

Example:
John
last_name
string

The user’s last name

Example:
Doe
automatic_spend_settings
Object

Information about the automatic spend settings for the account

enable_automatic_spend
boolean

Defines whether automatic spend is enabled for the account

Example:
true
automatic_spend_preference
string

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

Enumeration:
NEXT_MERCHANT_PURCHASE
ALL_MERCHANT_PURCHASE
minimum_wallet_balance
number

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

Example:
0.52
from_purchase_amount
number

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

Example:
1.78
merchants
Array

Information about the merchants that automatic spending is allowed

Object
id
string GUID

The merchant record identifier

Example:
REC1E31269B76D7A65ACCE45B2E68DFD
is_next_visit
boolean

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

Example:
false
organisation
Object

Information about organisation

id
string GUID

The organisation identifier

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
name
string

The organisation name

Example:
Bravo Coffee
reward_tier
Object

Information about the account’s reward tier

id
string GUID

The reward tier identifier

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
name
string

The reward tier name

Example:
Gold
color
string

The designated hexadecimal code of the tier’s color

Example:
#d4af37
period_value_units
number

The account’s value units that accumulated during the last rolling period

Example:
222
lifetime_value_units
number

The account’s value units that accumulated overall

Example:
333
next_tier_progression
number

The progression percentage until the next reward tier is reached

Example:
45.98
tier_progression
Array

Details about The progression percentage for each reward tier

Object
percentage
number

The progression percentage until the reward tier

Example:
45.98
tier
Object

Details about the reward tier

id
string GUID

The reward tier identifier

Example:
41ed2390-4058-81a2-d41b-18acaea22c84
name
string

The reward tier name

Example:
Gold
value_units
integer

The tier (threshold) value units (inclusive)

Example:
2500
remaining_value_units
integer

The remaining value units to reach this tier

Example:
123
joined_reward_schemes
Array

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

Object
id
string GUID

The reward scheme identifier

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
name
string

The reward scheme name

Example:
CRMdotCOM Scheme
signed_up_on
integer epoch

The date when the account was signed up on the specific reward scheme

Example:
1583846865
email_address
string

The email address that was used during sign up (applicable if the reward scheme is a close loop scheme based on email domains)

Example:
johndoe@crm.com
sign_up_option
string

Defines how customers can sign up to the reward scheme

Enumeration:
AUTO_SIGN_UP
SELF_SIGN_UP
CLOSE_LOOP_SIGN_UP
preferred_payment_method
Object

The customer’s preferred payment method identifier that will be used for spending purposes for back-end reduction rewards (applicable payment methods are direct debit and credit cards related)

id
string GUID

The preferred payment method identifier

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
payment_method_type
string

The customer’s preferred payment method identifier that will be used for spending purposes

Enumeration:
CARD
DIRECT_DEBIT
first6
string

The first six digits of the card (applicable only if the payment method type is card based)

Example:
424242
last4
string

The last four digits of the card (applicable only if the payment method type is card based)

Example:
4242
iban
string

The bank’s iban (applicable only if the payment method type is direct debit based)

Example:
CY3550000000054910000003
400 400

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

401 401

The provided API Key or Token is invalid

403 403

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

404 404

The requested resource does not exist

500 500

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

502 502

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

503 503

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

504 504

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

Example 1
GET https://devapi.crm.com/backoffice/v1/accounts/4AD9C84FA60F9FE407140E20F707726A/rewards HTTP/1.1 

authorization: 4AD9C84FA60F9FE407140E20F707726A

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "name": "John Smith AC00123456",
    "number": "AC00123456",
    "currency_code": "EUR",
    "signed_up_on": 1583846865,
    "sign_up_organisation": {
        "id": "CAD1E31269B76D7A65ACCE45B2E68DFD",
        "name": "CRMdotCOM"
    },
    "spending_blocked_status": "false",
    "spending_blocked_date": 1583846865,
    "spending_blocked_user": {
        "id": "CAD1E31269B76D7A65ACCE45B2E68DFD",
        "email_address": "johndoe@crm.com",
        "first_name": "John",
        "last_name": "Doe"
    },
    "automatic_spend_settings": {
        "automatic_spend_preference": "NEXT_MERCHANT_PURCHASE",
        "minimum_wallet_balance": 0.52,
        "from_purchase_amount": 1.78,
        "allowed_merchants": [
            {
                "id": "CAD1E31269B76D7A65ACCE45B2E68DFD",
                "name": "CRMdotCOM"
            }
        ]
    },
    "reward_tier": {
        "id": "CAD1E31269B76D7A65ACCE45B2E68DFD",
        "name": "Gold",
        "color": "#d4af37",
        "period_value_units": 222,
        "lifetime_value_units": 333,
        "next_tier_progression": 45.98
    },
    "joined_reward_schemes": [
        {
            "id": "CAD1E31269B76D7A65ACCE45B2E68DFD",
            "name": "CRMdotCOM Scheme"
            "signed_up_on": 1583846865,
            "email_address": "johndoe@crm.com",
            "sign_up_option": "CLOSE_LOOP_SIGN_UP"
        }
    ]
}
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 whose reward attributes will be updated

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD

Request headers

authorization
string optional

Authorization Token

Example:
eyJraWQiOiIvcHJpdmF0ZUtleS5wZW0iLCJ0eXAiOiJKV
api_key
string optional

The secret api key required for API calls to ensure that the client is trusted

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

Request body

Object
merchants
Array required

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

Unique items: YES
Object
organisation_id
string GUID required

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

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
is_next_visit
boolean nullable

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

Example:
false

Responses

200 200

OK

Body
Object
merchants
Array

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

Object
id
string GUID

The organisation identifier

Example:
CAD1E31269B76D7A65ACCE45B2E68DFD
400 400

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

401 401 <