Introduction
How ClearSale works
We can split the Clearsale integration process into two layers, frontend, and backend. Clearsale will provide you Javascript code snippets which must be set in the frontend website to help collecting information to help to identify navigation behaviors.
In the backend, the integration is based on the Clearsale API, which is responsible for providing the way to send orders to the Clearsale Analysis.
Front-end
Back-end
The Clearsale API is responsible for providing the way to send orders to the Clearsale Analysis. The orders must be submitted in a POST request over HTTPS, using JSON as the data format.
A webhook sends the analysis results following the SLA contracts.
Authentication
Our Integration team is responsible for providing you the credentials to have access to the Clearsale API. The credentials are composed of API Key, Client Id, Client Secret. In the authentication process, the API will provide a token, which needs to be used in all request to the Clearsale API. The login Token is expired after 24 hours of been generated.
Mandatory fields
Order ID | |
Date & Time | Billing Address |
IP Address | Shipping Address |
Total Value | Phone |
Original Currency | Items |
Full Name | PaymentType |
Important fields but not mandatory:
Those fields are significant to provide a better performance of the Clearsale Analysis.
First 6 Digits of Credit Card (BIN) | AVS Result |
Last 4 Digits of Credit Card | CVV Result |
Cardholder Name |
Testing
Our sandbox environment (https://sandbox.clear.sale) will provide you with the possibility to test the order cycle-life workflow. You have all the orders details which will help you make sure that all information has been integrated, and it's possible to simulate the approval and declined scenarios to cover all possible interaction with the Clearsale API.
Glossary
REST
Representational State Transfer (REST) is an architectural style that defines a set of constraints to be used for creating web services. Web services that conform to the REST architectural style, or RESTful web services, provide interoperability between computer systems on the Internet. REST-compliant web services allow the requesting systems to access and manipulate textual representations of web resources by using a uniform and predefined set of stateless operations.
POST
The POST method requests that the server accept the entity enclosed in the request as a new subordinate of the web resource identified by the URI. The data POSTed might be, for example, an annotation for existing resources; a message for a bulletin board, newsgroup, mailing list, or comment thread; a block of data that is the result of submitting a web form to a data-handling process; or an item to add to a database.
JSON
In computing, JavaScript Object Notation or JSON is an open-standard file format that uses human-readable text to transmit data objects consisting of attribute–value pairs and array data types (or any other serializable value). It is a very common data format used for asynchronous browser–server communication, including as a replacement for XML in some AJAX-style systems.
HTTPS
Hypertext Transfer Protocol Secure (HTTPS) is an extension of the Hypertext Transfer Protocol (HTTP) for secure communication over a computer network, and is widely used on the Internet.In HTTPS, the communication protocol is encrypted using Transport Layer Security (TLS), or formerly, its predecessor, Secure Sockets Layer (SSL). The protocol is therefore also often referred to as HTTP over TLS, or HTTP over SSL.
REANALYSIS
The process used to resend an order to ClearSale after an information update.
FINGERPRINT
The process used to identify a device as unique—to recognize the device purchase history.
MAPPER
The technology responsible for monitoring the environment and interactions, recognizing navigation behavior patterns.
JAVASCRIPT
JavaScript often abbreviated as JS, is a high-level, interpreted programming language. It is a language which is also characterized as dynamic, weakly typed, prototype-based and multi-paradigm.
Alongside HTML and CSS, JavaScript is one of the three core technologies of the World Wide Web. JavaScript enables interactive web pages and thus is an essential part of web applications. The vast majority of websites use it, and all major web browsers have a dedicated JavaScript engine to execute it.
F.A.Q
Should I call the ClearSale API before or after the gateway?
The best flow is sending an order to ClearSale after the gateway pre-authorization. Avoiding analyzing orders that will be denied by the gateway to reduce unnecessary refunds.
What is the response time for sending orders to ClearSale?
The average response time is 1 second. It’s important to understand that response time doesn’t mean order decision response. You will be informed of the order decision response by webhook following the SLA.
What I can consult to see whether my order has been integrated successfully?
In the sandbox environment, you have an orders filter with which you can reach any order that has been integrated.
I need to update some information, but the order has already been integrated. What do I need to do?
Send the updated order, marking “true” in the Reanalysis field.