API Sandbox

Last updated 2 months ago

Describes how to easy develop and test API

API Traffic Sandbox

1. Select Sandbox endpoint

Sandbox can made POST request to your endpoint on-demand. To make POST request with dummy leads' data you need to send GET request to sandbox endpoint with request_url parameter.

You can use one of endpoints depends on what country your company from:

Country

Sandbox Endpoint

Ukraine

https://cashcat.com.ua/api/v1/loans/sandbox-api-traffic/

Philippines

https://cashcat.ph/api/v1/loans/sandbox-api-traffic/

South Africa

https://cashcat.co.za/api/v1/loans/sandbox-api-traffic/

Mexico

https://cashcat.mx/api/v1/loans/sandbox-api-traffic/

​

2. Initiate request from Cashcat

get
Initiate POST request to your endpoint

https://cashcat.com.ua/
api/v1/loans/sandbox-api-traffic/
Use request_url parameter to pass your endpoint URL.
Request
Response
Path Parameters
request_url
required
string
URL of your endpoint that you need to test for getting Leads' data. On this endpoint Cashcat will send dummy POST request with leads' data in a format and structure as described in API Traffic section. Example: https://cashcat.com.ua/api/v1/loans/sandbox-api-traffic/?request_url=https://lender.tld/api/leads
200: OK
View the response from your endpoint like Cashcat.
Response example
{
"status_code": 200,
"message": "200 status code from https://....",
"returned_headers": "...",
"returned_raw_body": "..."
}

You can view what Cashcat gets from your endpoint in Response section in status_code, returned_headers, returned_raw_bodyCashcat will copy-paste headers and body to request. Now you could test it whatever you want.

Pay attention that returned_raw_body is a raw text data, that Cashcat getting in a body of the response. If you passing there a JSON payload, it will be displayed with escape "/" symbols.

3. Cashcat will make POST request

Example of JSON in the request
{
"timestamp": 1549318516005,
"affiliate": {
"name": "cashcat",
"website": "https://cashcat.com.ua",
"postback_url": "https://cashcat.com.ua/postback/paydayloan-ltd/",
"request_id": "2fn3ifkaks"
},
"lead": {
"person": {
"first_name": "\u0410\u043b\u0435\u043a\u0441\u0430\u043d\u0434\u0440",
"middle_name": "\u0421\u0435\u043c\u0451\u043d\u043e\u0432\u0438\u0447",
"last_name": "\u0425\u043e\u043c\u0443\u0442\u0435\u043d\u043a\u043e",
"birth_date": "1990-10-24",
"gender": "Male",
"country_residence": "Ukraine",
"home_town": "\u041a\u0430\u043c\u044f\u043d\u0435\u0446-\u041f\u043e\u0434\u043e\u043b\u044c\u0441\u043a\u0438\u0439",
"mobile_phone": "0634001122",
"email": "alexander.semenovich@gmailll.com",
"employer_name": "\u0417\u0410\u041e \u0423\u043a\u0440\u0442\u0435\u043b\u0435\u043a\u043e\u043c \u0424\u0438\u043b\u0438\u0430\u043b \u21162 \u0432 \u0433.\u041a\u0438\u0435\u0432"
},
"documents": [
{
"type": "passport",
"id": "\u0419\u0424325632"
},
{
"type": "tax_number",
"id": "2382947271",
"check_sum": "verified"
}
],
"loan": {
"amount": 5000.0,
"currency": "UAH",
"term": 14,
"duration_period": "days",
"purpose": "other",
"purpose_detailed": "\u041e\u0447\u0435\u043d\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430 \u0434\u043b\u044f \u0441\u0440\u043e\u0447\u043d\u043e\u0433\u043e \u0440\u0435\u043c\u043e\u043d\u0442\u0430 \u043a\u0432\u0430\u0440\u0442\u0438\u0440\u044b",
"type": "Bank Card"
}
}
}

Pay attention that data is uft-8 encoded. You could see this in the example.

Can I use sandbox with my integration tests?

Yes, you can! Make you test driven development process whatever you like. You can be sure that sandbox endpoint will make POST request to you backend while this service provides.