API Sandbox

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.ph/api/v1/loans/sandbox-api-traffic/?request_url=https://lender.tld/api/receiver
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.ph/api/v1/loans/sandbox-api-traffic/?request_url=https://lender.tld/api/receiver
200: OK
View the response from your endpoint like Cashcat.
Response example
{
"message": "POST request to https://lender.tld/api/receiver was sent.",
"status": "response code from endpoint 200",
"text": "{\"application_id\": \"x3y47qfx4qsn99ve\", \"timestamp\": 1555891846, \"affiliate\": {\"name\": \"cashcat\", \"website\": \"https://cashcat.ph\", \"postback_url\": \"https://cashcat.ph/postback/demo-lender\", \"request_id\": \"533fannt5jymq9t2\"}, \"lead\": {\"person\": {\"first_name\": \"Steven\", \"middle_name\": \"St.\", \"last_name\": \"Chan\", \"birth_date\": \"1987-04-09\", \"gender\": \"Male\", \"country_residence\": \"Philippines\", \"home_town\": \"Manila\", \"mobile_phone\": \"09055821123\", \"email\": \"steven@cashcat.ph\", \"employer_name\": \"Cashcat Marketing Solutions\"}, \"documents\": [{\"type\": \"TIN\", \"id\": \"343242342\"}, {\"type\": \"SSS\", \"id\": \"64654654\"}], \"loan\": {\"amount\": \"8000.00\", \"currency\": \"PHP\", \"term\": 14, \"duration_period\": \"days\", \"purpose\": \"other\", \"purpose_detailed\": \"I need money for urgent travel to Japan\", \"type\": \"Bank Account\"}}, \"meta\": {\"first_seen_on\": 1555890539, \"filling_duration\": 3600, \"filling_duration_meta\": \"very_slow\", \"ua_agent\": {\"raw_uagent\": \"Mozilla/5.0 (Linux; Android 8.1.0; SM-J730G Build/M1AJQ; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/73.0.3683.90 Mobile Safari/537.36 [FB_IAB/FB4A;FBAV/217.0.0.45.98;]\", \"is_mobile\": true, \"is_touchable\": true, \"is_tablet\": false, \"is_pc\": false}, \"web_pushes_subscribed\": true, \"email_subscribed\": true, \"lead_source\": \"facebook\", \"ip\": \"120.29.100.237\", \"browser_accept_language\": \"en-gb\"}}"
}

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

Pay attention that text 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 in the response with escape "/" symbols.

3. Cashcat will make POST request

Example of JSON in the request
{
"application_id": "6s26t0m0477p28c8",
"timestamp": 1553766725957,
"affiliate": {
"name": "cashcat",
"website": "http://127.0.0.1:8000",
"postback_url": "http://127.0.0.1:8000/postback/company-id/",
"request_id": "vc7z8pz149q46hy1"
},
"lead": {
"person": {
"first_name": "Steven",
"middle_name": "St.",
"last_name": "Chan",
"birth_date": "1990-10-24",
"gender": "Male",
"country_residence": "Philippines",
"home_town": "Manila",
"mobile_phone": "09187793976",
"email": "chanchan@gmail.com",
"employer_name": "BDO"
},
"documents": [
{
"type": "SSS",
"id": "12345678901"
},
{
"type": "TIN",
"id": "123456789012"
}
],
"loan": {
"amount": 5000.0,
"currency": "PHP",
"term": 14,
"duration_period": "days",
"purpose": "other",
"purpose_detailed": "I need money for urgent family needs",
"type": "Bank Card"
}
},
"meta": {
"first_seen_on": 1553766725957,
"filling_duration": 245,
"filling_duration_meta": "very_low|low|medium|fast|very_fast",
"ua_agent": {
"raw_uagent": "Mozilla/5.0 (Macintosh; Intel Mac OS X x.y; rv:42.0) Gecko/20100101 Firefox/42.0",
"is_mobile": true,
"is_touchable": true,
"is_tablet": false,
"is_pc": false
},
"web_pushes_subscribed": true,
"email_subscribed": true,
"lead_source": "facebook|direct|ad|affiliate",
"ip": "127.0.0.1",
"browser_accept_language": "en-gb"
}
}

Pay attention that data is uft-8 encoded

Postbacks Sandbox

You can use endpoint /postback/sandbox/ to send test posbacks.

Local endpoints

Country

URL

Philippines

https://cashcat.ph/postback/sandbox/

Ukraine

https://cashcat.ua/postback/sandbox/

Mexico

https://cashcat.mx/postback/sandbox/

Vietnam

https://cashcat.vn/postback/sandbox/

South Africa

https://cashcat.co.za/postback/sandbox/

get
Send test postback

https://cashcat.ph/postback/sandbox/
Request
Response
Query Parameters
status
required
string
A one of available statuses
request_id
required
string
ID of the API request
200: OK
Successfull postback
{
"status": "OK",
"message": "postback accepted"
}
400: Bad Request
Bad request sent
{
"status": "error",
"message": "`request_id` or `status` not provided"
}
404: Not Found
If wrong status
{
"status": "error",
"message": "not found status pending123 in possible variants [pending, accepted, rejected]"
}

Can I use sandbox with my integration tests?

Yes, you can! Make you test driven development process whatever you like.