Plugin Integrators

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

Welcome to the CRM.COM Application Programming Interface (API) documentation for Provisioning Provider Integrations.

Change Log

Release Date April 21, 2021

This is the first release of the CRM V5 Provisioning Provider APIs

API Documentation
API Reference

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

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

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

Authentication

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

All API requests made by CRM.COM (Provisioning) Provider API should authenticate using an API (Secret) Key, which can be accessed and managed from the CRM.COM Dashboard.

SECURITY NOTICE

All API requests must be made over HTTPS. Any request made over plain HTTP or without authentication will fail. In addition, 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 or client-side code.

API KEY AUTHORIZATION HEADER EXAMPLE

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

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

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

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

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

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

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

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

4XX ERROR RESPONSE EXAMPLE

An example of a customer not found error is as follows

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

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

200 OK

The request has succeeded

400 Bad Request

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

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

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

404 Not Found

The requested resource does not exist

500 Internal Server Error

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

502 Bad Gateway

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

503 Service Unavailable

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

504 Gateway Timeout

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

Operations
Provisioning Providers
POST /provisioning/entitlements
POST /provisioning/message
GET /provisioning/ird_commands
POST /provisioning/ird_commands
Manage Entitlements
POST /provisioning/entitlements

Send to the provisioning provider intergator whenever there’s a change in the set of subscirption services (e.g. whenever an authorisation or a de-authorisation signal must be sent) or in the set of devices which provision the services. Each Web API call must include basic subscirpiton information and then at least one of the following:

  • service(s) to authorise on devices (if any)
  • service(s) to de-authorise on devices (if any)
  • device(s) to initialise
  • device(s) to terminate

For OTT platforms, device information is not required.

Request headers

api_key
string required

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

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

Request body

Object
subscription
Object required

The subscription that groups together the services

id
string GUID required

The subscription identifier

Example:
b0b7b887-6fc5-957a-8e86-8abe689ed3bc
code
string required

The subscription code. By default, the subscription’s code is a 16-digit code

Example:
4433940593221123
first_activation
integer epoch required

The date on which the subscription was first activated

Example:
1618998627
authorise_services
Array nullable

Details about the services that will be (authorised) provisioned. Multiple services can be authorised on multiple devices per Web API call. When a service is to be authorised on multiple devices in a signle call, then one entry per service-device pair will have to be sent.

Object
external_reference
string required

The provider’s reference for the service that will be (authorised) provisioned

Example:
101
start_date
integer epoch

The date that the service was initially authorised

Example:
1622009627
end_date
integer epoch nullable

The last date that the service will be authorised (applicable for one-time services)

Example:
1622009628
last_authorisation_date
integer epoch nullable

roadmap

Example:
1622009627
device
Object required

Details about the device on which the service will be authorised

external_reference
string

The device’s external reference, for example its serial number

Example:
STB2231233401
deauthorise_services
Array nullable

Details about the services that will be deauthorised. Multiple services can be de-authorised on multiple devices per Web API call. When a service is to be de-authorised on multiple devices in a signle call, then one entry per service-device pair will have to be sent.

Object
external_reference
string required

The provider;'s reference for the service that will be deauthorised

Example:
102
device
Object required

Details about the devices on which such service will be deauthorised

external_reference
string

The device’s external reference, for example its serial number

Example:
STB2231233203
initialised_devices
Array nullable

A list of devices that require initialisation on the provider side before authorising services to them. Multiple devices can be initialised per Web API call.

Object
external_reference
string

The device’s external reference, for example its serial number

Example:
STB2231233100
terminated_devices
Array nullable

A list of devices that have to be terminated after all services have been de-authorised. Multiple devices can be terminated per Web API call.

Object
external_reference
string

The device’s external reference, for example its serial number

Example:
STB2231233303

Responses

200 200

The request has succeeded

Body
Object
state
string
Enumeration:
PENDING

Request sent to the integrator but no response received back (confirming whether the integrator received it, processed it etc)

POSTED

Provisioning integrator successfully processed the request sent by CRM.COM

REJECTED

Provisioning request sent by CRM.COM was rejected by the integrator

UNDER_PROCESSING

Provisioning integrator received the request by CRM.COM and it’s being processed.

Example:
PENDING
reference_number
string

A reference number related to the provisioning request. Return by the provisioning integrator to uniquely identify the request.

Example:
423045544544-122
error_code
string

Error code return by the provisioning integrator

Example:
500
error_description
string

Error description return by the provisioning integrator

Example:
HTTP transport error: java.net.UnknownHostException
requests
Array

A list of provioning requests that might be sent per CRM.COM event

Object
request
string

The request sent by the provisioning provider integrator to CAS/OTT

response
string

The response received by the CAS/OTT

400 Bad Request

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

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

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

404 Not Found

The requested resource does not exist

500 Internal Server Error

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

502 Bad Gateway

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

503 Service Unavailable

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

504 Gateway Timeout

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

Example 1
POST https://sandbox.crm.com/backoffice/v1/provisioning/entitlements HTTP/1.1 

api_key: 4dc0809f-ed91-4b68-b912-5bd6064d901e
Content-Type: application/json

{
    "subscription": {
        "id": "b0b7b887-6fc5-957a-8e86-8abe689ed3bc",
        "code": "4433940593221123",
        "first_activation": 1618998627
    },
    "authorise_services": [
        {
            "external_reference": "101",
            "start_date": 1622009627,
            "end_date": 1622009628,
            "last_authorisation_date": 1622009627,
            "device": {
                "external_reference": "STB2231233401"
            }
        }
    ],
    "deauthorise_services": [
        {
            "external_reference": "102",
            "device": {
                "external_reference": "STB2231233203"
            }
        }
    ],
    "initialised_devices": [
        {
            "external_reference": "STB2231233100"
        }
    ],
    "terminated_devices": [
        {
            "external_reference": "STB2231233303"
        }
    ]
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "state": "PENDING",
    "reference_number": "423045544544-122",
    "error_code": "500",
    "error_description": "HTTP transport error: java.net.UnknownHostException",
    "requests": [
        {
            "request": "",
            "response": ""
        }
    ]
}
Send Message
POST /provisioning/message

Send to the Provisioning Provide Integrator whenever a communication should be sent to the customer’s device. A communication could either be a message stored on the device (e.g. a Set-Top-Box) or an on-screen-display message

Request headers

api_key
string required

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

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

Request body

Object
devices
Array required

The devices on which the message will be sent

Min items: 1
Unique items: YES
Object
external_reference
string required

The serial number for the device on which the message will be sent to

Example:
SN091234344450
message
string required

The message (from the communication plan) that will be sent

Example:
Free Trial Period Expires Soon. Join our awesome scheme!
type
string required

Defines on which communication channel the message will be sent

Enumeration:
OSD

Message will be shown On Screen Display (OSD)

MAIL

Message will be send via email

Responses

200 200

The request has succeeded

400 Bad Request

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

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

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

404 Not Found

The requested resource does not exist

500 Internal Server Error

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

502 Bad Gateway

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

503 Service Unavailable

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

504 Gateway Timeout

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

Example 1
POST https://sandbox.crm.com/backoffice/v1/provisioning/message HTTP/1.1 

api_key: 4dc0809f-ed91-4b68-b912-5bd6064d901e
Content-Type: application/json

{
    "devices": [
        {
            "external_reference": "SN091234344450"
        }
    ],
    "message": "Free Trial Period Expires Soon. Join our awesome scheme!",
    "type": "OSD"
}
Get IRD Commands
GET /provisioning/ird_commands

Retrieve a list of Integrated Receiver/Decoder (IRD) commands (of a device) as implemetned in the provisoning adapter

Request headers

api_key
string required

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

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

Responses

200 OK
Body
Object
content
Array
Object
name
string

The command name

Example:
Reset PIN
code
string

The command code

Example:
RESET_PIN
description
string

The command description

Example:
Resets the PIN to a given value
metadata_attributes
Array

Details about the metadata attributes that are required for the specific command

Object
key
string

The metadata attribute key

Example:
pin
label
string

The metadata attribute label

Example:
PIN
description
string

The metadata attribute description

Example:
the new pin
type
string

The metadata attribute (supported) field type

Enumeration:
SINGLE_LINE
MULTIPLE_LINES
SELECTION
CHECKBOXES
TIMESTAMP
DATE
DATE_RANGE
NUMBER
AMOUNT
is_mandatory
boolean

Defines whether the metadata attribute is mandatory or not

Example:
true
Example 1
GET https://sandbox.crm.com/backoffice/v1/provisioning/ird_commands HTTP/1.1 

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

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "content": [
        {
            "name": "Reset PIN",
            "code": "RESET_PIN",
            "description": "Resets the PIN to a given value",
            "metadata_attributes": [
                {
                    "key": "pin",
                    "label": "PIN",
                    "description": "the new pin",
                    "type": "DATE",
                    "is_mandatory": true
                }
            ]
        }
    ]
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "content": [
        {
            "name": "Reset PIN",
            "code": "RESET_PIN",
            "description": "Resets the PIN to a given value",
            "metadata_attributes": [
                {
                    "key": "pin",
                    "label": "PIN",
                    "description": "the new pin",
                    "type": "MULTIPLE_LINES",
                    "is_mandatory": true
                }
            ]
        }
    ]
}
Send IRD Command
POST /provisioning/ird_commands

Send an Integrated Receiver/Decoder (IRD) command for a device over to the provisioning adapter

Request headers

api_key
string required

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

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

Request body

Object
external_reference
string required

The device (serial number) on which the command will be performed

Example:
DEV-01
code
string required

The command that should be performed

Enumeration:
RESET_PIN
RESET_DEVICE
ENFORCE_DOWNLOAD
device_location
string nullable

The device’s location. Required only when sending a command related to the device’s physical locatin/region.

Example:
master room
metadata_attributes
Array nullable

Details about the metadata attributes that are required for the specific command

Object
key
string required

The metadata attribute key

Example:
pin
value
string required

The metadata attribute value

Example:
1234

Responses

200 200

The request has succeeded

Body
Object
state
string
Enumeration:
PENDING

Request sent to the integrator but no response received back (confirming whether the integrator received it, processed it etc)

POSTED

Provisioning integrator successfully processed the request sent by CRM.COM

REJECTED

Provisioning request sent by CRM.COM was rejected by the integrator

UNDER_PROCESSING

Provisioning integrator received the request by CRM.COM and it’s being processed.

Example:
PENDING
reference_number
string

A reference number related to the provisioning request. Return by the provisioning integrator to uniquely identify the request.

Example:
423045544544-122
error_code
string

Error code return by the provisioning integrator

Example:
500
error_description
string

Error description return by the provisioning integrator

Example:
HTTP transport error: java.net.UnknownHostException
requests
Array

A list of provioning requests that might be sent per CRM.COM event

Object
request
string

The request sent by the provisioning provider integrator to CAS/OTT

response
string

The response received by the CAS/OTT

400 Bad Request

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

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

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

404 Not Found

The requested resource does not exist

500 Internal Server Error

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

502 Bad Gateway

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

503 Service Unavailable

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

504 Gateway Timeout

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

Example 1
POST https://sandbox.crm.com/backoffice/v1/provisioning/ird_commands HTTP/1.1 

api_key: 4dc0809f-ed91-4b68-b912-5bd6064d901e
Content-Type: application/json

{
    "external_reference": "DEV-01",
    "code": "RESET_PIN",
    "device_location": "master room",
    "metadata_attributes": [
        {
            "key": "pin",
            "value": "1234"
        }
    ]
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "state": "PENDING",
    "reference_number": "423045544544-122",
    "error_code": "500",
    "error_description": "HTTP transport error: java.net.UnknownHostException",
    "requests": [
        {
            "request": "",
            "response": ""
        }
    ]
}
Payment Gateway Providers

The ability for Payment Gateway Providers to be configured / used by external gateways. In particualr creating payment methods that can be used by client based initiated flows or server based flows for recurring billing actions.

POST /payment_gateways/payment_methods
POST /payment_gateways/intents
PUT /payment_gateways/intents
POST /payment_gateways/refunds
POST /payment_gateways/payouts
Add Payment Method
POST /payment_gateways/payment_methods

Add a payment method that has details collected by a front end SDK, HPP or other Data Capture such as Bank direct Debit

Request headers

api_key
string optional

Secret API Key

Request body

Object
type
string
Enumeration:
CARD
WALLET
ACCOUNT_DEBIT
Example:
CARD
contact
Object required

Contact Details that may be needed to represent a contact in the payment gateway

id
string

Unique identifier of contact from CRM.COM can be used as the payment gateway’s contact ID if supported or a link relationship

name
string

Used for identification of a contact

Example:
John Smith
email
string

Email of contact

Example:
john.smith@gmail.com
phone
string

Phone of contact

Example:
+4475612345
address
Object

An address that might also indicate the billing address of the contact

address_line_1
string
address_line_2
string
state_province_county
string
town_city
string
country
string
postal_code
string
card
Object

Card Details. Applicable only for Card payment method type

id
string

Unique id of the card that is either a token or unique id provided by an SDK or HPP flow.

account_debit
Object

Bank Details. Applicable only for Direct Debit payment method type. Roadmap

account_name
string

Bank account name

account_number
string

Bank account number

iban
string
bank
string

Bank account’s sort code

bank_code
string

Responses

201 Created
Body
Object
token
string

A unique identifier of the payment method at the plugin side (called id, token, fingerprint). This unique identifier kept at CRM.COM side as a reference between the payment methods between the two sides (CRM.COM and Payment Gateway)

400 Bad Request

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

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

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

404 Not Found

The requested resource does not exist

500 Internal Server Error

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

502 Bad Gateway

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

503 Service Unavailable

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

504 Gateway Timeout

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

Example 1
POST https://sandbox.crm.com/backoffice/v1/payment_gateways/payment_methods HTTP/1.1 

Content-Type: application/json

{
    "type": "CARD",
    "contact": {
        "id": "",
        "name": "John Smith",
        "email": "john.smith@gmail.com",
        "phone": "+4475612345",
        "address": {
            "address_line_1": "",
            "address_line_2": "",
            "state_province_county": "",
            "town_city": "",
            "country": "",
            "postal_code": ""
        }
    },
    "card": {
        "id": ""
    },
    "account_debit": {
        "account_name": "",
        "account_number": "",
        "iban": "",
        "bank": "",
        "bank_code": ""
    }
}

HTTP/1.1 201 Created 

Content-Type: application/json

{
    "id": ""
}
Create Payment Intent
POST /payment_gateways/intents

Create a payment intent that can be used online or offline.

Request body

Object
id
string

The unique identifier of the payment intent at CRM.COM

Example:
215bbff9-a423-2fef-1943-330e52d75abc
contact
Object

Unique identifier of the contact

id
string GUID
Example:
915bbff9-a420-2fef-1943-330e52d75ddc
name
string
code
string
payment_method
Object required

The contact’s payment method identifier

id
string GUID
Example:
d6ee0df7-0ab7-a3cc-4700-9955f6f613d8
type
string
Enumeration:
CARD
ACCOUNT_DEBIT
WALLET
fingerprint
string
account_debit
Object nullable

Additional details about the account debit method

account_name
string required

The account name (i.e. bank account name)

Example:
John Doe
iban
string required

The account IBAN

Example:
CY17002001280000001200527600
swift
string required

The account Business Identifier Code (BIC) - SWIFT code

Example:
BCYPCY2N
mandate
Object required

Details about mandate

reference
string required

The mandate reference

Example:
d9fd84de378f191067da
sign_date
integer epoch required

The mandate sign up date

Example:
1633951353
amount
number required

The payment amount

Example:
9.99
currency
string required nullable

The currency code

Example:
EUR
capture
string
Enumeration:
ON_HOLD
AUTOMATIC

roadmap

Example:
ON_HOLD
entity
Object

The order to be paid. Provided by CRM.COM

type
string
Enumeration:
INVOICE
ORDER
id
string GUID
Example:
f98f384f-f415-82d6-9fb3-c9941dda2c8a
statement_info
string

Details to add to Customer Statement for the payment. Manually specified by the front-end

Example:
Payment for Order O125435 - Date 01.01.2010

Responses

200 OK
Body
Object
client_secret
string
error_code
string
error_description
string
state
string
Enumeration:
REQUIRES_CAPTURING

Payment Intent’s capturing was set to On hold on its creation

PENDING

Payment Intent was successfully logged at the payment gateway but there’s a delayed response about its success or failure to collect the money

COMPLETED

Payment Intent was successfully completed and money was collected from the payment method

REJECTED

Payment Intent was rejectes since money cannot be collected due to the payen tmethod’s insufficient funds.

CANCELLED

Roadmap. Payment intent cancelled after its initial creation. If money was put on hold, then the amount is released.

Example:
COMPLETED
400 Bad Request

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

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

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

404 Not Found

The requested resource does not exist

500 Internal Server Error

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

502 Bad Gateway

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

503 Service Unavailable

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

504 Gateway Timeout

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

Example 1
POST https://sandbox.crm.com/backoffice/v1/payment_gateways/intents HTTP/1.1 

Content-Type: application/json

{
    "id": "215bbff9-a423-2fef-1943-330e52d75abc",
    "contact": {
        "id": "915bbff9-a420-2fef-1943-330e52d75ddc",
        "name": "",
        "code": ""
    },
    "payment_method": {
        "id": "d6ee0df7-0ab7-a3cc-4700-9955f6f613d8",
        "type": "WALLET",
        "fingerprint": "",
        "account_debit": {
            "account_name": "John Doe",
            "iban": "CY17002001280000001200527600",
            "swift": "BCYPCY2N",
            "mandate": {
                "reference": "d9fd84de378f191067da",
                "sign_date": 1633951353
            }
        }
    },
    "amount": 9.99,
    "currency": "EUR",
    "capture": "ON_HOLD",
    "entity": {
        "type": "ORDER",
        "id": "f98f384f-f415-82d6-9fb3-c9941dda2c8a"
    },
    "statement_info": "Payment for Order O125435 - Date 01.01.2010"
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "client_secret": "",
    "error_code": "",
    "error_description": "",
    "state": "COMPLETED"
}
Update Payment Intent (perform actions)
PUT /payment_gateways/intents

Update a payment intent

Request body

Object
id
string nullable

The payment intent’s unique identifier. Either the id or client secret must be provided.

client_secret
string nullable

The payment intent’s unique identifier. Either the id or client secret must be provided. Note tht in front-end systems, only the client secret is known.

actions
string
Enumeration:
CAPTURE

Applicable when the payment intent was initially created with capturing method On hold. This parameter will ask the integrtaor to capture the money (move the money from the customer’s acccount to the merchant’s account)

CONFIRM

Confirms payment intent to the payment gateway

CANCEL

Roadmap. Applicable hwen the payment intent is no longer valid at server side so it should also be cancelled in the payment gateway as well. IF money was put on hold, then cancelling the intents also releases the funds.

Responses

200 OK
Body
Object
id
string GUID

The payment intent identifier

Example:
0f51ee18-51a1-7233-510c-046f45e12ade
client_secret
string
error_code
string
error_description
string
state
string
Enumeration:
REQUIRES_CAPTURING

Payment Intent’s capturing was set to On hold on its creation

PENDING

Payment Intent was successfully logged at the payment gateway but there’s a delayed response about its success or failure to collect the money

COMPLETED

Payment Intent was successfully completed and money was collected from the payment method

REJECTED

Payment Intent was rejectes since money cannot be collected due to the payen tmethod’s insufficient funds.

CANCELLED

Roadmap. Payment intent cancelled after its initial creation. If money was put on hold, then the amount is released.

Example:
COMPLETED
400 Bad Request

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

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

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

404 Not Found

The requested resource does not exist

500 Internal Server Error

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

502 Bad Gateway

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

503 Service Unavailable

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

504 Gateway Timeout

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

Example 1
PUT https://sandbox.crm.com/backoffice/v1/payment_gateways/intents HTTP/1.1 

Content-Type: application/json

{
    "client_secret": "",
    "intent_id": "",
    "state": ""
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "0f51ee18-51a1-7233-510c-046f45e12ade",
    "client_secret": "",
    "error_code": "",
    "error_description": "",
    "state": "PENDING"
}
Refunds
POST /payment_gateways/refunds

Refunds one of the contact’s payments. Since the payment gaetway is the side managing the payment intents, this Web APi accepts the payment intent that will be fully or partially refunded.

Request body

Object
payment_id
string nullable

Issue the Refund based on a payment. Either a payment or a payment intent must be specified

intent_id
string nullable

Issue the Refund based on a payment intent. Either a payment or a payment intent must be specified

issue_reason
string
amount
number

The refund’s amount. If not specified, then the initial transaction is fully refunded.

Example:
9.99
currency
string
Example:
EUR

Responses

201 Created
Body
Object
id
string

A unique id for the refund transaction

client_secret
string
error_code
string
error_description
string
state
string
Enumeration:
REQUIRES_CAPTURING

Payment Intent’s capturing was set to On hold on its creation

PENDING

Payment Intent was successfully logged at the payment gateway but there’s a delayed response about its success or failure to collect the money

COMPLETED

Payment Intent was successfully completed and money was collected from the payment method

REJECTED

Payment Intent was rejectes since money cannot be collected due to the payen tmethod’s insufficient funds.

CANCELLED

Roadmap. Payment intent cancelled after its initial creation. If money was put on hold, then the amount is released.

Example:
COMPLETED
400 Bad Request

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

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

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

404 Not Found

The requested resource does not exist

500 Internal Server Error

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

502 Bad Gateway

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

503 Service Unavailable

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

504 Gateway Timeout

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

Example 1
POST https://sandbox.crm.com/backoffice/v1/payment_gateways/refunds HTTP/1.1 

Content-Type: application/json

{
    "payment_id": "",
    "intent_id": "",
    "issue_reason": "",
    "amount": 9.99,
    "currency": "EUR"
}

HTTP/1.1 201 Created 

Content-Type: application/json

{
    "id": "",
    "client_secret": "",
    "error_code": "",
    "error_description": "",
    "state": "COMPLETED"
}
Payouts
POST /payment_gateways/payouts

Request body

Object
issue_reason
string
amount
number required

The payout’s amount.

Example:
9.99
curency
string required
Example:
EUR
payment_method_id
string

The payment method to which the payout will be sent to. It should be a payment method of type Account Debit.

Responses

201 Created
Body
Object
id
string

A unique id for the refund transaction

error_code
string
error_description
string
state
string
Enumeration:
REQUIRES_CAPTURING

Payment Intent’s capturing was set to On hold on its creation

PENDING

Payment Intent was successfully logged at the payment gateway but there’s a delayed response about its success or failure to collect the money

COMPLETED

Payment Intent was successfully completed and money was collected from the payment method

REJECTED

Payment Intent was rejectes since money cannot be collected due to the payen tmethod’s insufficient funds.

CANCELLED

Roadmap. Payment intent cancelled after its initial creation. If money was put on hold, then the amount is released.

Example:
COMPLETED
400 Bad Request

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

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

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

404 Not Found

The requested resource does not exist

500 Internal Server Error

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

502 Bad Gateway

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

503 Service Unavailable

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

504 Gateway Timeout

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

Example 1
POST https://sandbox.crm.com/backoffice/v1/payment_gateways/refunds HTTP/1.1 

Content-Type: application/json

{
    "id": "",
    "type": "PAYMENT_INTENT",
    "issue_reason": "",
    "amount": 9.99,
    "curency": "EUR"
}

HTTP/1.1 201 Created 

Content-Type: application/json

{
    "id": "",
    "error_code": "",
    "error_description": "",
    "state": "COMPLETED"
}
Settings - Configuration
PUT /plugins/settings
GET /plugins/settings
POST /plugins/apikeys
Set Provider Attributes
PUT /plugins/settings

Send the required provider attributes (as defined in the provisioning provider adapter) as specified within CRM

Request headers

api_key
string required

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

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

Request body

Object
parameters
Array required

A set of parameters required for successfully integrating with the 3rd party provider

Object
key
string required

The parameter key

Example:
hostname
value
string required

The parameter value

Example:
crm.com/provider

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 https://plugin.com/plugins/settings HTTP/1.1 

api_key: 4dc0809f-ed91-4b68-b912-5bd6064d901e
Content-Type: application/json

{
    "parameters": [
        {
            "key": "hostname",
            "value": "crm.com/provider"
        }
    ]
}

HTTP/1.1 200 OK 
Get Provider Attributes
GET /plugins/settings

Retrieve the required attributes (as defined in the provisioning provider adapter) that need to be set within CRM, when setting up the provider. Part of the reponse, the provider media (image) is returned as well (if any)

Request headers

api_key
string required

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

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

Responses

200 OK
Body
Object
media_url
string

The provisioning provider media URL

Example:
crm.com/provider.png
parameters
Array

A set of parameters required for successfully integrating with the 3rd party provider

Object
key
string

The parameter key

Example:
hostname
value
string

The parameter value

Example:
crm.com/provider
label
string

The parameter label, used for display purposes

Example:
Hostname
type
string

The parameter type

Enumeration:
INTEGER
STRING
NUMBER
BOOLEAN
400 Bad Request

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

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

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

404 Not Found

The requested resource does not exist

500 Internal Server Error

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

502 Bad Gateway

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

503 Service Unavailable

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

504 Gateway Timeout

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

Example 1
GET https://plugin.com/plugins/settings HTTP/1.1

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

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "media_url": "crm.com/provider.png",
    "parameters": [
        {
            "key": "hostname",
            "value": "crm.com/provider",
            "label": "Hostname",
            "type": "INTEGER"
        }
    ]
}
Generate Provider Key
POST /plugins/apikeys

Generate a random API Key that will be used for authenticating/authorising requests made to the provider

Notes

CORE BEHAVIOR

API Key should be created as part of the process of creating a new provider (e.g. payment gateway provider).

Request body

Object
organisation_id
string GUID required

The organisation (ext identifier) on which the provider will be associated with

Example:
ccc740f9-7482-b689-54ee-bd78e065d550
organisation_name
string required

The organisation (name) on which the provider will be associated with

Example:
crm

Responses

200 OK
Body
Object
key
string

The non-encrypted api key value that will be used for subsuquent provisioning authentication

Example:
key-123456789
400 Bad Request

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

401 Unauthorized

The provided API Key or Token is invalid

403 Forbidden

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

404 Not Found

The requested resource does not exist

500 Internal Server Error

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

502 Bad Gateway

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

503 Service Unavailable

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

504 Gateway Timeout

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

Example 1
POST https://plugin.com/plugins/apikeys HTTP/1.1 

Content-Type: application/json

{
    "organisation_id": "ccc740f9-7482-b689-54ee-bd78e065d550",
    "organisation_name": "crm"
}