Postman Collection
Aerosync Postman Collection
The provided instructions were designed to assist any team member/tester/stakeholder in following and executing properly the Postman Collection. The Aerosync Postman Collection can be used to validate requests and responses from the Aerosync API suite.
Step 1 - Import Environment and Collection files
Copy and paste the following environment as shown in the following steps.
Step 1- Click the Import
button.
Step 2- Copy the JSON that is in this guide so you can add the environment, remember to copy it in the bar.
Aerosync APIs- Staging
{
"id": "1756d231-8186-4d84-8ce6-7667fc4d7ee1",
"name": "Aerosync APIs- Staging",
"values": [
{
"key": "base_url",
"value": "http://api.staging.aerosync.com",
"type": "default",
"enabled": true
},
{
"key": "api_key",
"value": "test1",
"type": "default",
"enabled": true
},
{
"key": "api_secret",
"value": "test1",
"type": "default",
"enabled": true
},
{
"key": "user_id",
"value": "b93c061c3ad44fa8acb786fa958f64e9",
"type": "default",
"enabled": true
},
{
"key": "admin_key",
"value": "5fc261ba-1341-4111-b1c0-224dcb6bf0ec",
"type": "default",
"enabled": true
},
{
"key": "admin_secret",
"value": "0ceb8a44-d7a5-4e21-90ed-b00db37b1ca9",
"type": "default",
"enabled": true
},
{
"key": "token",
"value": "",
"type": "default",
"enabled": true
}
],
"_postman_variable_scope": "environment",
"_postman_exported_at": "2024-12-20T14:10:37.871Z",
"_postman_exported_using": "Postman/11.23.1"
}
Step 3- Click to accept the import.
Step 4- Validate that the environment was imported correctly.
AEROSYNC APIs- External V2
Next, you'll need to import the collection. Importing the collection is similar to importing the environment, except you'll be using the "Collections" tab to verify that it was imported successfully.
{
"info": {
"_postman_id": "04c41eda-8e25-443c-9172-8debc1ebe998",
"name": "AEROSYNC APIS- External V2",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
"_exporter_id": "27310382",
"_collection_link": "https://aeropay.postman.co/workspace/Aerosync-APIs-2.0~46013fcc-da4a-412a-99d1-d4e49037f56a/collection/27310382-04c41eda-8e25-443c-9172-8debc1ebe998?action=share&source=collection_link&creator=27310382"
},
"item": [
{
"name": "Token",
"item": [
{
"name": "/token",
"event": [
{
"listen": "test",
"script": {
"exec": [
"var jsonData = pm.response.json()\r",
"token = jsonData.token\r",
"\r",
"const Schema = {\r",
" \"type\": \"object\",\r",
" \"properties\": {\r",
" \"status\": {\r",
" \"type\": \"string\"\r",
" },\r",
" \"statusCode\": {\r",
" \"type\": \"integer\"\r",
" },\r",
" \"TTL\": {\r",
" \"type\": \"string\"\r",
" },\r",
" \"token\": {\r",
" \"type\": \"string\"\r",
" }\r",
" },\r",
" \"required\": [\r",
" \"status\",\r",
" \"statusCode\",\r",
" \"TTL\",\r",
" \"token\"\r",
" ]\r",
"}\r",
"\r",
"pm.environment.set(\"token\",token)\r",
"\r",
"pm.test(\"Response time is less than 8000ms\", function () {\r",
" pm.expect(pm.response.responseTime).to.be.below(8000);\r",
"});\r",
"\r",
"pm.test(\"Status code is 200\", function () {\r",
" pm.response.to.have.status(200);\r",
"});\r",
"\r",
"pm.test(\"Validate the json response Schema\",function()\r",
"{\r",
"\r",
"pm.response.to.have.jsonSchema(Schema);\r",
"\r",
"});\r",
""
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\r\n \"apiKey\":\"{{api_key}}\",\r\n \"apiSecret\": \"{{api_secret}}\"\r\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{base_url}}/v2/token",
"host": [
"{{base_url}}"
],
"path": [
"v2",
"token"
]
},
"description": "Generated from cURL: curl --location 'http://api.qa.aerosync.com/v1/token' \\\r\n--header 'Content-Type: application/json' \\\r\n--data '{\r\n \"apiKey\":\"test1\",\r\n \"apiSecret\": \"test1\"\r\n}'"
},
"response": []
}
]
},
{
"name": "Account",
"item": [
{
"name": "/accounts_check",
"event": [
{
"listen": "test",
"script": {
"exec": [
"const Schema = {\r",
" \"type\": \"object\",\r",
" \"properties\": {\r",
" \"status\": {\r",
" \"type\": \"string\"\r",
" },\r",
" \"statusCode\": {\r",
" \"type\": \"integer\"\r",
" },\r",
" \"account\": {\r",
" \"type\": \"object\",\r",
" \"properties\": {\r",
" \"accountNickname\": {\r",
" \"type\": \"string\"\r",
" },\r",
" \"accountNumber\": {\r",
" \"type\": \"string\"\r",
" },\r",
" \"routingNumber\": {\r",
" \"type\": \"string\"\r",
" },\r",
" \"accountType\": {\r",
" \"type\": \"string\"\r",
" },\r",
" \"bankName\": {\r",
" \"type\": \"string\"\r",
" },\r",
" \"canFetchBalance\": {\r",
" \"type\": \"boolean\"\r",
" },\r",
" \"connectionMethod\": {\r",
" \"type\": \"integer\"\r",
" }\r",
" },\r",
" \"required\": [\r",
" \"accountNickname\",\r",
" \"accountNumber\",\r",
" \"routingNumber\",\r",
" \"accountType\",\r",
" \"bankName\",\r",
" \"canFetchBalance\",\r",
" \"connectionMethod\"\r",
" ]\r",
" }\r",
" },\r",
" \"required\": [\r",
" \"status\",\r",
" \"statusCode\",\r",
" \"account\"\r",
" ]\r",
"}\r",
"\r",
"pm.test(\"Response time is less than 8000ms\", function () {\r",
" pm.expect(pm.response.responseTime).to.be.below(8000);\r",
"});\r",
"\r",
"pm.test(\"Status code is 200\", function () {\r",
" pm.response.to.have.status(200);\r",
"});\r",
"\r",
"pm.test(\"Validate the json response Schema\",function()\r",
"{\r",
"\r",
"pm.response.to.have.jsonSchema(Schema);\r",
"\r",
"});\r",
""
],
"type": "text/javascript",
"packages": {}
}
},
{
"listen": "prerequest",
"script": {
"exec": [
"const apiKey = pm.environment.get(\"api_key\");\r",
"const apiSecret = pm.environment.get(\"api_secret\");\r",
"const baseUrl = pm.environment.get(\"base_url\");\r",
"\r",
"pm.sendRequest({\r",
" url: baseUrl+'/v2/token',\r",
" method: 'POST',\r",
" header: {\r",
" 'Content-Type': 'application/json'\r",
" },\r",
" body: {\r",
" mode: 'raw',\r",
" raw: JSON.stringify({\r",
" apiKey: apiKey,\r",
" apiSecret: apiSecret\r",
" })\r",
" }\r",
"}, function (err, res) {\r",
" if (err) {\r",
" console.log(\"Token request failed:\", err);\r",
" } else {\r",
" // Parse the response to extract the token\r",
" const jsonData = res.json();\r",
" // Assuming the token is in jsonData.token\r",
" pm.environment.set(\"token\", jsonData.token);\r",
" }\r",
"});"
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{token}}",
"type": "string"
}
]
},
"method": "GET",
"header": [],
"url": {
"raw": "{{base_url}}/v2/accounts/:user_id",
"host": [
"{{base_url}}"
],
"path": [
"v2",
"accounts",
":user_id"
],
"variable": [
{
"key": "user_id",
"value": "{{user_id}}"
}
]
}
},
"response": [
{
"name": "success",
"originalRequest": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{token}}"
}
],
"url": {
"raw": "{{base_url}}/v2/accounts/:user_id",
"host": [
"{{base_url}}"
],
"path": [
"v2",
"accounts",
":user_id"
],
"variable": [
{
"key": "user_id",
"value": "{{user_id}}"
}
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Content-Length",
"value": "301"
},
{
"key": "Connection",
"value": "keep-alive"
},
{
"key": "Date",
"value": "Thu, 12 Dec 2024 21:10:10 GMT"
},
{
"key": "X-Amzn-Trace-Id",
"value": "Root=1-675b512b-72e0c99b09ebf601395e7755"
},
{
"key": "x-amzn-RequestId",
"value": "3de51016-768d-4ebc-a2ee-7d510ce6c85c"
},
{
"key": "Access-Control-Allow-Origin",
"value": "*"
},
{
"key": "x-amz-apigw-id",
"value": "Csme7HIroAMEt0g="
},
{
"key": "Cache-Control",
"value": "max-age=30"
},
{
"key": "X-Cache",
"value": "Miss from cloudfront"
},
{
"key": "Via",
"value": "1.1 0eae140cb47e1df2572b33198dae08ca.cloudfront.net (CloudFront)"
},
{
"key": "X-Amz-Cf-Pop",
"value": "CMH68-P4"
},
{
"key": "X-Amz-Cf-Id",
"value": "6lOH5Efpysn8HqnZ0ji1Zch2bojTX-CKmZG3uazJ6HaG-PFv7DY4Qg=="
}
],
"cookie": [],
"body": "{\n \"status\": \"success\",\n \"statusCode\": 200,\n \"account\": {\n \"accountNickname\": \"PREMIER PLATINUM CHECK\",\n \"accountNumber\": \"12345\",\n \"routingNumber\": \"307074551\",\n \"accountType\": \"checking\",\n \"bankName\": \"Fiserv - Direct Connect\",\n \"canFetchBalance\": true,\n \"supportsFasterPayments\": false,\n \"connectionMethod\": 1\n }\n}"
},
{
"name": "failure (user not found)",
"originalRequest": {
"method": "GET",
"header": [],
"url": {
"raw": "{{base_url}}/v2/accounts/:user_id",
"host": [
"{{base_url}}"
],
"path": [
"v2",
"accounts",
":user_id"
],
"variable": [
{
"key": "user_id",
"value": "{{user_id}}"
}
]
}
},
"status": "Not Found",
"code": 404,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Content-Length",
"value": "90"
},
{
"key": "Connection",
"value": "keep-alive"
},
{
"key": "Date",
"value": "Tue, 17 Dec 2024 14:28:13 GMT"
},
{
"key": "X-Amzn-Trace-Id",
"value": "Root=1-67618a7d-1542715e059a022770da9acf"
},
{
"key": "x-amzn-RequestId",
"value": "31711075-76a0-4832-8836-b9ea41002b4d"
},
{
"key": "Access-Control-Allow-Origin",
"value": "*"
},
{
"key": "x-amz-apigw-id",
"value": "C8KTpHm5oAMEoKw="
},
{
"key": "Cache-Control",
"value": "max-age=30"
},
{
"key": "X-Cache",
"value": "Error from cloudfront"
},
{
"key": "Via",
"value": "1.1 f21e3e9a304f8d928ae6a7ae28c35ce8.cloudfront.net (CloudFront)"
},
{
"key": "X-Amz-Cf-Pop",
"value": "CMH68-P4"
},
{
"key": "X-Amz-Cf-Id",
"value": "byo2fYy876O4fDNUe_qK6m0vKOY0QSzoK_3E1LhDxvWbAGXTGNBD0A=="
}
],
"cookie": [],
"body": "{\n \"error\": {\n \"code\": \"AC-102\",\n \"message\": \"User 761268fe79af4bcca602b3cdb307962 not found\"\n }\n}"
}
]
},
{
"name": "/account_info",
"event": [
{
"listen": "prerequest",
"script": {
"exec": [
"const apiKey = pm.environment.get(\"api_key\");\r",
"const apiSecret = pm.environment.get(\"api_secret\");\r",
"const baseUrl = pm.environment.get(\"base_url\");\r",
"\r",
"pm.sendRequest({\r",
" url: baseUrl+'/v2/token',\r",
" method: 'POST',\r",
" header: {\r",
" 'Content-Type': 'application/json'\r",
" },\r",
" body: {\r",
" mode: 'raw',\r",
" raw: JSON.stringify({\r",
" apiKey: apiKey,\r",
" apiSecret: apiSecret\r",
" })\r",
" }\r",
"}, function (err, res) {\r",
" if (err) {\r",
" console.log(\"Token request failed:\", err);\r",
" } else {\r",
" // Parse the response to extract the token\r",
" const jsonData = res.json();\r",
" // Assuming the token is in jsonData.token\r",
" pm.environment.set(\"token\", jsonData.token);\r",
" }\r",
"});"
],
"type": "text/javascript",
"packages": {}
}
},
{
"listen": "test",
"script": {
"exec": [
"\r",
"const Schema = {\r",
" \"type\": \"object\",\r",
" \"properties\": {\r",
" \"status\": {\r",
" \"type\": \"string\"\r",
" },\r",
" \"statusCode\": {\r",
" \"type\": \"integer\"\r",
" },\r",
" \"account\": {\r",
" \"type\": \"object\",\r",
" \"properties\": {\r",
" \"accountNickname\": {\r",
" \"type\": \"string\"\r",
" },\r",
" \"accountHolderName\": {\r",
" \"type\": \"string\"\r",
" },\r",
" \"accountNumber\": {\r",
" \"type\": \"string\"\r",
" },\r",
" \"routingNumber\": {\r",
" \"type\": \"string\"\r",
" },\r",
" \"accountType\": {\r",
" \"type\": \"string\"\r",
" },\r",
" \"bankName\": {\r",
" \"type\": \"string\"\r",
" },\r",
" \"availableBalance\": {\r",
" \"type\": \"number\"\r",
" },\r",
" \"currentBalance\": {\r",
" \"type\": \"number\"\r",
" },\r",
" \"currency\": {\r",
" \"type\": \"string\"\r",
" },\r",
" \"lastRefreshTimestamp\": {\r",
" \"type\": \"string\"\r",
" },\r",
" \"canFetchBalance\": {\r",
" \"type\": \"boolean\"\r",
" },\r",
" \"connectionMethod\": {\r",
" \"type\": \"integer\"\r",
" },\r",
" \"connectionStatus\": {\r",
" \"type\": \"object\",\r",
" \"properties\": {\r",
" \"status\": {\r",
" \"type\": \"string\"\r",
" },\r",
" \"code\": {\r",
" \"type\": \"null\"\r",
" },\r",
" \"details\": {\r",
" \"type\": \"null\"\r",
" }\r",
" },\r",
" \"required\": [\r",
" \"status\",\r",
" \"code\",\r",
" \"details\"\r",
" ]\r",
" }\r",
" },\r",
" \"required\": [\r",
" \"accountNickname\",\r",
" \"accountHolderName\",\r",
" \"accountNumber\",\r",
" \"routingNumber\",\r",
" \"accountType\",\r",
" \"bankName\",\r",
" \"availableBalance\",\r",
" \"currentBalance\",\r",
" \"currency\",\r",
" \"lastRefreshTimestamp\",\r",
" \"canFetchBalance\",\r",
" \"connectionMethod\",\r",
" \"connectionStatus\"\r",
" ]\r",
" }\r",
" },\r",
" \"required\": [\r",
" \"status\",\r",
" \"statusCode\",\r",
" \"account\"\r",
" ]\r",
"\r",
"}\r",
"\r",
"pm.test(\"Response time is less than 8000ms\", function () {\r",
" pm.expect(pm.response.responseTime).to.be.below(8000);\r",
"});\r",
"\r",
"pm.test(\"Status code is 200\", function () {\r",
" pm.response.to.have.status(200);\r",
"});\r",
"\r",
"pm.test(\"Validate the json response Schema\",function()\r",
"{\r",
"\r",
"pm.response.to.have.jsonSchema(Schema);\r",
"\r",
"});\r",
""
],
"type": "text/javascript",
"packages": {}
}
}
],
"protocolProfileBehavior": {
"disableBodyPruning": true
},
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{token}}",
"type": "string"
}
]
},
"method": "GET",
"header": [],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{base_url}}/v2/account_info/:user_id",
"host": [
"{{base_url}}"
],
"path": [
"v2",
"account_info",
":user_id"
],
"variable": [
{
"key": "user_id",
"value": "{{user_id}}"
}
]
}
},
"response": [
{
"name": "failure (invalid credentials)",
"originalRequest": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"userId\": \"4c73976af23a4a63a939d6c05a9585f7\",\n \"userPassword\": \"3e8293ceb64c473e80e8b6e7c16b150d\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "http://api.qa.aerosync.com/v1/account_info",
"protocol": "http",
"host": [
"api",
"qa",
"aerosync",
"com"
],
"path": [
"v1",
"account_info"
]
}
},
"status": "Bad Request",
"code": 400,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Content-Length",
"value": "131"
},
{
"key": "Connection",
"value": "keep-alive"
},
{
"key": "Date",
"value": "Mon, 08 Jul 2024 20:05:48 GMT"
},
{
"key": "x-amzn-RequestId",
"value": "52cbdf70-381d-4b1f-b36e-ed6fd499e713"
},
{
"key": "Access-Control-Allow-Origin",
"value": "*"
},
{
"key": "x-amz-apigw-id",
"value": "am_4fGXZIAMEUhw="
},
{
"key": "Cache-Control",
"value": "max-age=30"
},
{
"key": "X-Amzn-Trace-Id",
"value": "Root=1-668c469c-0b91211f42edb43043c4babf"
},
{
"key": "X-Cache",
"value": "Error from cloudfront"
},
{
"key": "Via",
"value": "1.1 5385bfb0a91e0a945790f9ce0c0045ac.cloudfront.net (CloudFront)"
},
{
"key": "X-Amz-Cf-Pop",
"value": "SCL51-P3"
},
{
"key": "X-Amz-Cf-Id",
"value": "kFBgaTxJAf851qnK7kPi70rs_z7F59yNCHjljUfP8A43L326Ex4N-g=="
}
],
"cookie": [],
"body": "{\n \"error\": {\n \"code\": \"AC-202\",\n \"message\": \"Invalid bank login credentials provided. We were unable to authenticate with your bank.\"\n }\n}"
},
{
"name": "failure (null on param)",
"originalRequest": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"userId\": null,\n \"userPassword\": \"3e8293ceb64c473e80e8b6e7c16b150d\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "http://api.qa.aerosync.com/v1/account_info",
"protocol": "http",
"host": [
"api",
"qa",
"aerosync",
"com"
],
"path": [
"v1",
"account_info"
]
}
},
"status": "Bad Request",
"code": 400,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Content-Length",
"value": "101"
},
{
"key": "Connection",
"value": "keep-alive"
},
{
"key": "Date",
"value": "Mon, 08 Jul 2024 20:06:24 GMT"
},
{
"key": "x-amzn-RequestId",
"value": "9d707f52-436a-45dd-a556-8ce250a0bf8c"
},
{
"key": "Access-Control-Allow-Origin",
"value": "*"
},
{
"key": "x-amz-apigw-id",
"value": "am_-IHMkIAMEgdQ="
},
{
"key": "Cache-Control",
"value": "max-age=30"
},
{
"key": "X-Amzn-Trace-Id",
"value": "Root=1-668c46c0-78f4bd9112ab4e440eace050"
},
{
"key": "X-Cache",
"value": "Error from cloudfront"
},
{
"key": "Via",
"value": "1.1 5385bfb0a91e0a945790f9ce0c0045ac.cloudfront.net (CloudFront)"
},
{
"key": "X-Amz-Cf-Pop",
"value": "SCL51-P3"
},
{
"key": "X-Amz-Cf-Id",
"value": "6ZyOfODNApczzbN_8TBfUB_5xI45f4yPvwovUK9X_4ybUoll1057zQ=="
}
],
"cookie": [],
"body": "{\n \"error\": {\n \"code\": \"AC-100\",\n \"message\": \"Required attributes are missing or not in a valid format.\"\n }\n}"
},
{
"name": "success",
"originalRequest": {
"method": "GET",
"header": [],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{base_url}}/v2/account_info/:user_id",
"host": [
"{{base_url}}"
],
"path": [
"v2",
"account_info",
":user_id"
],
"variable": [
{
"key": "user_id",
"value": "{{user_id}}"
}
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Content-Length",
"value": "519"
},
{
"key": "Connection",
"value": "keep-alive"
},
{
"key": "Date",
"value": "Thu, 12 Dec 2024 21:08:36 GMT"
},
{
"key": "X-Amzn-Trace-Id",
"value": "Root=1-675b50c9-0c39114545845ec43881cc92"
},
{
"key": "x-amzn-RequestId",
"value": "4cf297c6-236a-4d91-a6a6-25549d5ee6a3"
},
{
"key": "Access-Control-Allow-Origin",
"value": "*"
},
{
"key": "x-amz-apigw-id",
"value": "CsmPiGF0oAMEe2g="
},
{
"key": "Cache-Control",
"value": "max-age=30"
},
{
"key": "X-Cache",
"value": "Miss from cloudfront"
},
{
"key": "Via",
"value": "1.1 0d28f7015cfb69cd3eb6e14359add86e.cloudfront.net (CloudFront)"
},
{
"key": "X-Amz-Cf-Pop",
"value": "CMH68-P4"
},
{
"key": "X-Amz-Cf-Id",
"value": "iARTuMafybYQ3lBwD7uY6J746mfHQVIeHxoMgRhG4o2yz8XMZudcFw=="
}
],
"cookie": [],
"body": "{\n \"status\": \"success\",\n \"statusCode\": 200,\n \"account\": {\n \"bankName\": \"Fiserv - Direct Connect\",\n \"accountHolderName\": null,\n \"accountNumber\": \"12345\",\n \"routingNumber\": \"307074551\",\n \"accountType\": \"CHECKING\",\n \"accountNickname\": \"PREMIER PLATINUM CHECK\",\n \"availableBalance\": 0,\n \"currentBalance\": 5,\n \"currency\": \"USD\",\n \"lastRefreshTimestamp\": \"2024-12-12T18:59:07Z\",\n \"connectionMethod\": 1,\n \"canFetchBalance\": true,\n \"supportsFasterPayments\": false,\n \"connectionStatus\": {\n \"status\": \"CONNECTED\",\n \"code\": null,\n \"details\": null\n }\n }\n}"
}
]
}
]
},
{
"name": "Identity",
"item": [
{
"name": "/identity",
"event": [
{
"listen": "test",
"script": {
"exec": [
"\r",
"const Schema = {\r",
"\"type\": \"object\",\r",
" \"properties\": {\r",
" \"status\": {\r",
" \"type\": \"string\"\r",
" },\r",
" \"statusCode\": {\r",
" \"type\": \"integer\"\r",
" },\r",
" \"identity\": {\r",
" \"type\": \"object\",\r",
" \"properties\": {\r",
" \"accountHolderName\": {\r",
" \"type\": \"string\"\r",
" },\r",
" \"address\": {\r",
" \"type\": \"string\"\r",
" },\r",
" \"email\": {\r",
" \"type\": \"string\"\r",
" },\r",
" \"phone\": {\r",
" \"type\": \"string\"\r",
" },\r",
" \"userId\": {\r",
" \"type\": \"string\"\r",
" }\r",
" },\r",
" \"required\": [\r",
" \"accountHolderName\",\r",
" \"address\",\r",
" \"email\",\r",
" \"phone\",\r",
" \"userId\"\r",
" ]\r",
" }\r",
" },\r",
" \"required\": [\r",
" \"status\",\r",
" \"statusCode\",\r",
" \"identity\"\r",
" ]\r",
"}\r",
"\r",
"pm.test(\"Response time is less than 8000ms\", function () {\r",
" pm.expect(pm.response.responseTime).to.be.below(8000);\r",
"});\r",
"\r",
"pm.test(\"Status code is 200\", function () {\r",
" pm.response.to.have.status(200);\r",
"});\r",
"\r",
"pm.test(\"Validate the json response Schema\",function()\r",
"{\r",
"pm.response.to.have.jsonSchema(Schema);\r",
"\r",
"});"
],
"type": "text/javascript",
"packages": {}
}
},
{
"listen": "prerequest",
"script": {
"exec": [
"const apiKey = pm.environment.get(\"api_key\");\r",
"const apiSecret = pm.environment.get(\"api_secret\");\r",
"const baseUrl = pm.environment.get(\"base_url\");\r",
"\r",
"pm.sendRequest({\r",
" url: baseUrl+'/v2/token',\r",
" method: 'POST',\r",
" header: {\r",
" 'Content-Type': 'application/json'\r",
" },\r",
" body: {\r",
" mode: 'raw',\r",
" raw: JSON.stringify({\r",
" apiKey: apiKey,\r",
" apiSecret: apiSecret\r",
" })\r",
" }\r",
"}, function (err, res) {\r",
" if (err) {\r",
" console.log(\"Token request failed:\", err);\r",
" } else {\r",
" // Parse the response to extract the token\r",
" const jsonData = res.json();\r",
" // Assuming the token is in jsonData.token\r",
" pm.environment.set(\"token\", jsonData.token);\r",
" }\r",
"});\r",
""
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{token}}",
"type": "string"
}
]
},
"method": "GET",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"url": {
"raw": "{{base_url}}/v2/accounts/:user_id/identity",
"host": [
"{{base_url}}"
],
"path": [
"v2",
"accounts",
":user_id",
"identity"
],
"variable": [
{
"key": "user_id",
"value": "{{user_id}}"
}
]
}
},
"response": [
{
"name": "success",
"originalRequest": {
"method": "GET",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"url": {
"raw": "{{base_url}}/v2/accounts/:user_id/identity",
"host": [
"{{base_url}}"
],
"path": [
"v2",
"accounts",
":user_id",
"identity"
],
"variable": [
{
"key": "user_id",
"value": "{{user_id}}"
}
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Content-Length",
"value": "174"
},
{
"key": "Connection",
"value": "keep-alive"
},
{
"key": "Date",
"value": "Fri, 13 Dec 2024 17:24:59 GMT"
},
{
"key": "X-Amzn-Trace-Id",
"value": "Root=1-675c6dea-43415b8158fe736d33046db4"
},
{
"key": "x-amzn-RequestId",
"value": "7ee6ea4e-6556-47dc-a504-9730ed652921"
},
{
"key": "Access-Control-Allow-Origin",
"value": "*"
},
{
"key": "x-amz-apigw-id",
"value": "CvYcpHOUIAMEDpQ="
},
{
"key": "Cache-Control",
"value": "max-age=30"
},
{
"key": "X-Cache",
"value": "Miss from cloudfront"
},
{
"key": "Via",
"value": "1.1 60a4019a365a195cb4f354a7c8fdb39a.cloudfront.net (CloudFront)"
},
{
"key": "X-Amz-Cf-Pop",
"value": "CMH68-P4"
},
{
"key": "X-Amz-Cf-Id",
"value": "bKcULTCTaamqvZg47P_gECL0-p_xusNrZJHKyhr4w0JcJ3UAiSMEtA=="
}
],
"cookie": [],
"body": "{\n \"status\": \"success\",\n \"statusCode\": 200,\n \"identity\": {\n \"accountHolderName\": null,\n \"address\": null,\n \"email\": null,\n \"phone\": null,\n \"userId\": \"070c4836340a430286a3a0299681ef3d\"\n }\n}"
},
{
"name": "failure (user not found)",
"originalRequest": {
"method": "GET",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"url": {
"raw": "{{base_url}}/v2/accounts/:user_id/identity",
"host": [
"{{base_url}}"
],
"path": [
"v2",
"accounts",
":user_id",
"identity"
],
"variable": [
{
"key": "user_id",
"value": "{{user_id}}"
}
]
}
},
"status": "Not Found",
"code": 404,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Content-Length",
"value": "90"
},
{
"key": "Connection",
"value": "keep-alive"
},
{
"key": "Date",
"value": "Wed, 18 Dec 2024 15:10:29 GMT"
},
{
"key": "X-Amzn-Trace-Id",
"value": "Root=1-6762e5e5-2fce5acc2d41f4167416f569"
},
{
"key": "x-amzn-RequestId",
"value": "a4313e24-29de-4d34-a888-7de2cc99fa9f"
},
{
"key": "Access-Control-Allow-Origin",
"value": "*"
},
{
"key": "x-amz-apigw-id",
"value": "C_jb4HMyIAMEMrw="
},
{
"key": "Cache-Control",
"value": "max-age=30"
},
{
"key": "X-Cache",
"value": "Error from cloudfront"
},
{
"key": "Via",
"value": "1.1 b3f79c7629585fd4818d306efdc55e44.cloudfront.net (CloudFront)"
},
{
"key": "X-Amz-Cf-Pop",
"value": "CMH68-P4"
},
{
"key": "X-Amz-Cf-Id",
"value": "1IlR38o9mu536diV3VojJaCxgTuuW1RNZVGFweP4H_5cQT7j8E4bqQ=="
}
],
"cookie": [],
"body": "{\n \"error\": {\n \"code\": \"AC-102\",\n \"message\": \"User 761268fe79af4bcca602b3cdb307962 not found\"\n }\n}"
}
]
},
{
"name": "/identity_post",
"event": [
{
"listen": "test",
"script": {
"exec": [
"//Response object\r",
"var jsonData = pm.response.json();\r",
"job= jsonData.jobId;\r",
"//Set job_id collection variables for next apis (job_status)\r",
"pm.collectionVariables.set(\"job_id\", job);\r",
"\r",
"const Schema = {\r",
" \"type\": \"object\",\r",
" \"properties\": {\r",
" \"status\": {\r",
" \"type\": \"string\"\r",
" },\r",
" \"statusCode\": {\r",
" \"type\": \"integer\"\r",
" },\r",
" \"identityStatus\": {\r",
" \"type\": \"string\"\r",
" },\r",
" \"jobId\": {\r",
" \"type\": \"string\"\r",
" },\r",
" \"userId\": {\r",
" \"type\": \"string\"\r",
" }\r",
" },\r",
" \"required\": [\r",
" \"status\",\r",
" \"statusCode\",\r",
" \"identityStatus\",\r",
" \"jobId\",\r",
" \"userId\"\r",
" ]\r",
"}\r",
"\r",
"pm.test(\"Response time is less than 8000ms\", function () {\r",
" pm.expect(pm.response.responseTime).to.be.below(8000);\r",
"});\r",
"\r",
"pm.test(\"Status code is 200\", function () {\r",
" pm.response.to.have.status(200);\r",
"});\r",
"\r",
"pm.test(\"Validate the json response Schema\",function()\r",
"{\r",
"pm.response.to.have.jsonSchema(Schema);\r",
"\r",
"});"
],
"type": "text/javascript",
"packages": {}
}
},
{
"listen": "prerequest",
"script": {
"exec": [
"const apiKey = pm.environment.get(\"api_key\");\r",
"const apiSecret = pm.environment.get(\"api_secret\");\r",
"const baseUrl = pm.environment.get(\"base_url\");\r",
"\r",
"pm.sendRequest({\r",
" url: baseUrl+'/v2/token',\r",
" method: 'POST',\r",
" header: {\r",
" 'Content-Type': 'application/json'\r",
" },\r",
" body: {\r",
" mode: 'raw',\r",
" raw: JSON.stringify({\r",
" apiKey: apiKey,\r",
" apiSecret: apiSecret\r",
" })\r",
" }\r",
"}, function (err, res) {\r",
" if (err) {\r",
" console.log(\"Token request failed:\", err);\r",
" } else {\r",
" // Parse the response to extract the token\r",
" const jsonData = res.json();\r",
" // Assuming the token is in jsonData.token\r",
" pm.environment.set(\"token\", jsonData.token);\r",
" }\r",
"});"
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{token}}",
"type": "string"
}
]
},
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"url": {
"raw": "{{base_url}}/v2/accounts/:user_id/identity",
"host": [
"{{base_url}}"
],
"path": [
"v2",
"accounts",
":user_id",
"identity"
],
"variable": [
{
"key": "user_id",
"value": "{{user_id}}"
}
]
}
},
"response": [
{
"name": "success",
"originalRequest": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"url": {
"raw": "{{base_url}}/v2/accounts/:user_id/identity",
"host": [
"{{base_url}}"
],
"path": [
"v2",
"accounts",
":user_id",
"identity"
],
"variable": [
{
"key": "user_id",
"value": "{{user_id}}"
}
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Content-Length",
"value": "166"
},
{
"key": "Connection",
"value": "keep-alive"
},
{
"key": "Date",
"value": "Fri, 13 Dec 2024 17:25:27 GMT"
},
{
"key": "X-Amzn-Trace-Id",
"value": "Root=1-675c6e06-2b8b0d546eecf2a32fdcafad"
},
{
"key": "x-amzn-RequestId",
"value": "72d13dba-c996-4867-aac9-aca9a45c3731"
},
{
"key": "Access-Control-Allow-Origin",
"value": "*"
},
{
"key": "x-amz-apigw-id",
"value": "CvYhIHFjIAMEVqQ="
},
{
"key": "Cache-Control",
"value": "max-age=30"
},
{
"key": "X-Cache",
"value": "Miss from cloudfront"
},
{
"key": "Via",
"value": "1.1 60a4019a365a195cb4f354a7c8fdb39a.cloudfront.net (CloudFront)"
},
{
"key": "X-Amz-Cf-Pop",
"value": "CMH68-P4"
},
{
"key": "X-Amz-Cf-Id",
"value": "cMBUz_UVKAcQWwU6t9QWB0l7JVgaF2AcTnFMZzZnsqpbKGyRJeOrTQ=="
}
],
"cookie": [],
"body": "{\n \"status\": \"success\",\n \"statusCode\": 200,\n \"identityStatus\": \"Initiated\",\n \"jobId\": \"IDT-6ac9236ba91c40159eacc78219c3ac80\",\n \"userId\": \"070c4836340a430286a3a0299681ef3d\"\n}"
},
{
"name": "failure (user not found)",
"originalRequest": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"url": {
"raw": "{{base_url}}/v2/accounts/:user_id/identity",
"host": [
"{{base_url}}"
],
"path": [
"v2",
"accounts",
":user_id",
"identity"
],
"variable": [
{
"key": "user_id",
"value": "{{user_id}}"
}
]
}
},
"status": "Not Found",
"code": 404,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Content-Length",
"value": "90"
},
{
"key": "Connection",
"value": "keep-alive"
},
{
"key": "Date",
"value": "Wed, 18 Dec 2024 15:11:11 GMT"
},
{
"key": "X-Amzn-Trace-Id",
"value": "Root=1-6762e60b-6bf54c682fc636123d77042d"
},
{
"key": "x-amzn-RequestId",
"value": "d9ed2820-d6e5-4a13-ac2e-77f9465fa644"
},
{
"key": "Access-Control-Allow-Origin",
"value": "*"
},
{
"key": "x-amz-apigw-id",
"value": "C_jhzGCTIAMEZ3Q="
},
{
"key": "Cache-Control",
"value": "max-age=30"
},
{
"key": "X-Cache",
"value": "Error from cloudfront"
},
{
"key": "Via",
"value": "1.1 b3f79c7629585fd4818d306efdc55e44.cloudfront.net (CloudFront)"
},
{
"key": "X-Amz-Cf-Pop",
"value": "CMH68-P4"
},
{
"key": "X-Amz-Cf-Id",
"value": "vahucf-3X9TaIRx6DqyTfH5kO1TB_yfSknmnSCnSStFMD_s01GYUmg=="
}
],
"cookie": [],
"body": "{\n \"error\": {\n \"code\": \"AC-102\",\n \"message\": \"User 761268fe79af4bcca602b3cdb307962 not found\"\n }\n}"
}
]
},
{
"name": "/job-status",
"event": [
{
"listen": "prerequest",
"script": {
"exec": [
"const apiKey = pm.environment.get(\"api_key\");\r",
"const apiSecret = pm.environment.get(\"api_secret\");\r",
"const baseUrl = pm.environment.get(\"base_url\");\r",
"\r",
"pm.sendRequest({\r",
" url: baseUrl+'/v2/token',\r",
" method: 'POST',\r",
" header: {\r",
" 'Content-Type': 'application/json'\r",
" },\r",
" body: {\r",
" mode: 'raw',\r",
" raw: JSON.stringify({\r",
" apiKey: apiKey,\r",
" apiSecret: apiSecret\r",
" })\r",
" }\r",
"}, function (err, res) {\r",
" if (err) {\r",
" console.log(\"Token request failed:\", err);\r",
" } else {\r",
" // Parse the response to extract the token\r",
" const jsonData = res.json();\r",
" // Assuming the token is in jsonData.token\r",
" pm.environment.set(\"token\", jsonData.token);\r",
" }\r",
"});"
],
"type": "text/javascript",
"packages": {}
}
},
{
"listen": "test",
"script": {
"exec": [
"const Schema = {\r",
" \"type\": \"object\",\r",
" \"properties\": {\r",
" \"status\": {\r",
" \"type\": \"string\"\r",
" },\r",
" \"statusCode\": {\r",
" \"type\": \"integer\"\r",
" },\r",
" \"jobStatus\": {\r",
" \"type\": \"string\"\r",
" },\r",
" \"mfaTriggered\": {\r",
" \"type\": \"boolean\"\r",
" },\r",
" \"jobId\": {\r",
" \"type\": \"string\"\r",
" },\r",
" \"userId\": {\r",
" \"type\": \"string\"\r",
" }\r",
" },\r",
" \"required\": [\r",
" \"status\",\r",
" \"statusCode\",\r",
" \"jobStatus\",\r",
" \"mfaTriggered\",\r",
" \"jobId\",\r",
" \"userId\"\r",
" ]\r",
"}\r",
"\r",
"pm.test(\"Response time is less than 8000ms\", function () {\r",
" pm.expect(pm.response.responseTime).to.be.below(8000);\r",
"});\r",
"\r",
"pm.test(\"Status code is 200\", function () {\r",
" pm.response.to.have.status(200);\r",
"});\r",
"\r",
"pm.test(\"Validate the json response Schema\",function()\r",
"{\r",
"pm.response.to.have.jsonSchema(Schema);\r",
"\r",
"});"
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{token}}",
"type": "string"
}
]
},
"method": "GET",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Authorization",
"value": "Bearer {{token}}"
}
],
"url": {
"raw": "{{base_url}}/v2/accounts/:user_id/job/:job_id",
"host": [
"{{base_url}}"
],
"path": [
"v2",
"accounts",
":user_id",
"job",
":job_id"
],
"variable": [
{
"key": "user_id",
"value": "{{user_id}}"
},
{
"key": "job_id",
"value": "{{job_id}}",
"description": "This variable is called from previous endpoint."
}
]
}
},
"response": [
{
"name": "success",
"originalRequest": {
"method": "GET",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Authorization",
"value": "Bearer {{token}}"
}
],
"url": {
"raw": "{{base_url}}/v2/accounts/:user_id/job/:job_id",
"host": [
"{{base_url}}"
],
"path": [
"v2",
"accounts",
":user_id",
"job",
":job_id"
],
"variable": [
{
"key": "user_id",
"value": "{{user_id}}"
},
{
"key": "job_id",
"value": "{{job_id}}",
"description": "This variable is called from previous endpoint."
}
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Content-Length",
"value": "184"
},
{
"key": "Connection",
"value": "keep-alive"
},
{
"key": "Date",
"value": "Fri, 13 Dec 2024 17:50:43 GMT"
},
{
"key": "X-Amzn-Trace-Id",
"value": "Root=1-675c73ef-3cc2214234281be338af01e0"
},
{
"key": "x-amzn-RequestId",
"value": "68bf7bea-a34e-4ea6-8b19-04d9bbc92bfa"
},
{
"key": "Access-Control-Allow-Origin",
"value": "*"
},
{
"key": "x-amz-apigw-id",
"value": "CvcNaHHXIAMEdJA="
},
{
"key": "Cache-Control",
"value": "max-age=30"
},
{
"key": "X-Cache",
"value": "Miss from cloudfront"
},
{
"key": "Via",
"value": "1.1 87d7664d4d5a16632f7453ca9cc45a74.cloudfront.net (CloudFront)"
},
{
"key": "X-Amz-Cf-Pop",
"value": "CMH68-P4"
},
{
"key": "X-Amz-Cf-Id",
"value": "9SxMfHGA95iBkvd95Lswjt5giJCw36owz_Hpgid3vf348WGEqO-x4g=="
}
],
"cookie": [],
"body": "{\n \"status\": \"success\",\n \"statusCode\": 200,\n \"jobStatus\": \"Completed\",\n \"mfaTriggered\": false,\n \"jobId\": \"REF-7951da09a0844aa5a330b2b19ac2e78d\",\n \"userId\": \"070c4836340a430286a3a0299681ef3d\"\n}"
},
{
"name": "failure (user not found)",
"originalRequest": {
"method": "GET",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Authorization",
"value": "Bearer {{token}}"
}
],
"url": {
"raw": "{{base_url}}/v2/accounts/:user_id/job/:job_id",
"host": [
"{{base_url}}"
],
"path": [
"v2",
"accounts",
":user_id",
"job",
":job_id"
],
"variable": [
{
"key": "user_id",
"value": "{{user_id}}"
},
{
"key": "job_id",
"value": "{{job_id}}",
"description": "This variable is called from previous endpoint."
}
]
}
},
"status": "Not Found",
"code": 404,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Content-Length",
"value": "90"
},
{
"key": "Connection",
"value": "keep-alive"
},
{
"key": "Date",
"value": "Wed, 18 Dec 2024 14:46:54 GMT"
},
{
"key": "X-Amzn-Trace-Id",
"value": "Root=1-6762e059-2c517f9526abec987ad2d418"
},
{
"key": "x-amzn-RequestId",
"value": "508bf765-8d83-4c95-9155-46ec010cfe7b"
},
{
"key": "Access-Control-Allow-Origin",
"value": "*"
},
{
"key": "x-amz-apigw-id",
"value": "C_f-AFxDIAMElGg="
},
{
"key": "Cache-Control",
"value": "max-age=30"
},
{
"key": "X-Cache",
"value": "Error from cloudfront"
},
{
"key": "Via",
"value": "1.1 141cc765667839ffa8c4ad646af354cc.cloudfront.net (CloudFront)"
},
{
"key": "X-Amz-Cf-Pop",
"value": "CMH68-P4"
},
{
"key": "X-Amz-Cf-Id",
"value": "01SyMUPSizXEQzvO-rjQHDLFhHvu2JwI-9FKe5tdGruqLaMKfH42dw=="
}
],
"cookie": [],
"body": "{\n \"error\": {\n \"code\": \"AC-102\",\n \"message\": \"User 761268fe79af4bcca602b3cdb307962 not found\"\n }\n}"
}
]
}
]
},
{
"name": "Balance",
"item": [
{
"name": "/balance",
"event": [
{
"listen": "prerequest",
"script": {
"exec": [
"const apiKey = pm.environment.get(\"api_key\");\r",
"const apiSecret = pm.environment.get(\"api_secret\");\r",
"const baseUrl = pm.environment.get(\"base_url\");\r",
"\r",
"pm.sendRequest({\r",
" url: baseUrl+'/v2/token',\r",
" method: 'POST',\r",
" header: {\r",
" 'Content-Type': 'application/json'\r",
" },\r",
" body: {\r",
" mode: 'raw',\r",
" raw: JSON.stringify({\r",
" apiKey: apiKey,\r",
" apiSecret: apiSecret\r",
" })\r",
" }\r",
"}, function (err, res) {\r",
" if (err) {\r",
" console.log(\"Token request failed:\", err);\r",
" } else {\r",
" // Parse the response to extract the token\r",
" const jsonData = res.json();\r",
" // Assuming the token is in jsonData.token\r",
" pm.environment.set(\"token\", jsonData.token);\r",
" }\r",
"});"
],
"type": "text/javascript",
"packages": {}
}
},
{
"listen": "test",
"script": {
"exec": [
"const Schema = {\r",
" \"type\": \"object\",\r",
" \"properties\": {\r",
" \"status\": {\r",
" \"type\": \"string\"\r",
" },\r",
" \"statusCode\": {\r",
" \"type\": \"integer\"\r",
" },\r",
" \"account\": {\r",
" \"type\": \"object\",\r",
" \"properties\": {\r",
" \"availableBalance\": {\r",
" \"type\": \"number\"\r",
" },\r",
" \"currentBalance\": {\r",
" \"type\": \"number\"\r",
" },\r",
" \"lastRefreshTimeStamp\": {\r",
" \"type\": \"string\"\r",
" },\r",
" \"currency\": {\r",
" \"type\": \"string\"\r",
" },\r",
" \"userId\": {\r",
" \"type\": \"string\"\r",
" }\r",
" },\r",
" \"required\": [\r",
" \"availableBalance\",\r",
" \"currentBalance\",\r",
" \"lastRefreshTimeStamp\",\r",
" \"currency\",\r",
" \"userId\"\r",
" ]\r",
" }\r",
" },\r",
" \"required\": [\r",
" \"status\",\r",
" \"statusCode\",\r",
" \"account\"\r",
" ]\r",
"}\r",
"\r",
"pm.test(\"Response time is less than 8000ms\", function () {\r",
" pm.expect(pm.response.responseTime).to.be.below(8000);\r",
"});\r",
"\r",
"pm.test(\"Status code is 200\", function () {\r",
" pm.response.to.have.status(200);\r",
"});\r",
"\r",
"pm.test(\"Validate the json response Schema\",function()\r",
"{\r",
"\r",
"pm.response.to.have.jsonSchema(Schema);\r",
"\r",
"});\r",
"\r",
""
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{token}}",
"type": "string"
}
]
},
"method": "GET",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"url": {
"raw": "{{base_url}}/v2/accounts/:user_id/balance",
"host": [
"{{base_url}}"
],
"path": [
"v2",
"accounts",
":user_id",
"balance"
],
"variable": [
{
"key": "user_id",
"value": "{{user_id}}"
}
]
}
},
"response": [
{
"name": "success",
"originalRequest": {
"method": "GET",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"url": {
"raw": "{{base_url}}/v2/accounts/:user_id/balance",
"host": [
"{{base_url}}"
],
"path": [
"v2",
"accounts",
":user_id",
"balance"
],
"variable": [
{
"key": "user_id",
"value": "{{user_id}}"
}
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Content-Length",
"value": "214"
},
{
"key": "Connection",
"value": "keep-alive"
},
{
"key": "Date",
"value": "Fri, 13 Dec 2024 17:49:46 GMT"
},
{
"key": "X-Amzn-Trace-Id",
"value": "Root=1-675c73b4-74aba39741aafd0236a531ee"
},
{
"key": "x-amzn-RequestId",
"value": "b113edf4-4019-4c91-96fd-40d78287a3b4"
},
{
"key": "Access-Control-Allow-Origin",
"value": "*"
},
{
"key": "x-amz-apigw-id",
"value": "CvcEPGC4IAMEZ3Q="
},
{
"key": "Cache-Control",
"value": "max-age=30"
},
{
"key": "X-Cache",
"value": "Miss from cloudfront"
},
{
"key": "Via",
"value": "1.1 87d7664d4d5a16632f7453ca9cc45a74.cloudfront.net (CloudFront)"
},
{
"key": "X-Amz-Cf-Pop",
"value": "CMH68-P4"
},
{
"key": "X-Amz-Cf-Id",
"value": "P7jAI4AXaki_BI6I1JOwIWRiPWJ3BDEMN6hM1AJGart0DXPl0Moijw=="
}
],
"cookie": [],
"body": "{\n \"status\": \"success\",\n \"statusCode\": 200,\n \"account\": {\n \"availableBalance\": 0,\n \"currentBalance\": 5,\n \"currency\": \"USD\",\n \"lastRefreshTimestamp\": \"2024-12-12T21:12:07Z\",\n \"userId\": \"070c4836340a430286a3a0299681ef3d\"\n }\n}"
},
{
"name": "failure (user not found)",
"originalRequest": {
"method": "GET",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"url": {
"raw": "{{base_url}}/v2/accounts/:user_id/balance",
"host": [
"{{base_url}}"
],
"path": [
"v2",
"accounts",
":user_id",
"balance"
],
"variable": [
{
"key": "user_id",
"value": "{{user_id}}"
}
]
}
},
"status": "Not Found",
"code": 404,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Content-Length",
"value": "58"
},
{
"key": "Connection",
"value": "keep-alive"
},
{
"key": "Date",
"value": "Wed, 18 Dec 2024 14:40:09 GMT"
},
{
"key": "X-Amzn-Trace-Id",
"value": "Root=1-6762dec9-320449bb4b7644cf100a6d4b"
},
{
"key": "x-amzn-RequestId",
"value": "a98cbe87-2a9c-44cd-960e-34dc45409437"
},
{
"key": "Access-Control-Allow-Origin",
"value": "*"
},
{
"key": "x-amz-apigw-id",
"value": "C_e_jGK5IAMEb-Q="
},
{
"key": "Cache-Control",
"value": "max-age=30"
},
{
"key": "X-Cache",
"value": "Error from cloudfront"
},
{
"key": "Via",
"value": "1.1 f21e3e9a304f8d928ae6a7ae28c35ce8.cloudfront.net (CloudFront)"
},
{
"key": "X-Amz-Cf-Pop",
"value": "CMH68-P4"
},
{
"key": "X-Amz-Cf-Id",
"value": "Ht_amSS-lK545XO4papusZ9SHnArAeguCmZYJZEqRaOzK3iigCW5CA=="
}
],
"cookie": [],
"body": "{\n \"error\": {\n \"code\": \"AC-102\",\n \"message\": \"User not found\"\n }\n}"
}
]
},
{
"name": "/refresh",
"event": [
{
"listen": "test",
"script": {
"exec": [
"//Response object\r",
"var jsonData = pm.response.json();\r",
"job= jsonData.account.jobId;\r",
"//Set job_id collection variables for next apis (job_status)\r",
"pm.collectionVariables.set(\"job_id\", job);\r",
"\r",
"const Schema = {\r",
" \"type\": \"object\",\r",
" \"properties\": {\r",
" \"status\": {\r",
" \"type\": \"string\"\r",
" },\r",
" \"statusCode\": {\r",
" \"type\": \"integer\"\r",
" },\r",
" \"account\": {\r",
" \"type\": \"object\",\r",
" \"properties\": {\r",
" \"refreshStatus\": {\r",
" \"type\": \"string\"\r",
" },\r",
" \"jobId\": {\r",
" \"type\": \"string\"\r",
" },\r",
" \"userId\": {\r",
" \"type\": \"string\"\r",
" }\r",
" },\r",
" \"required\": [\r",
" \"refreshStatus\",\r",
" \"jobId\",\r",
" \"userId\"\r",
" ]\r",
" }\r",
" },\r",
" \"required\": [\r",
" \"status\",\r",
" \"statusCode\",\r",
" \"account\"\r",
" ]\r",
"\r",
"}\r",
"pm.test(\"Response time is less than 8000ms\", function () {\r",
" pm.expect(pm.response.responseTime).to.be.below(8000);\r",
"});\r",
"\r",
"pm.test(\"Status code is 200\", function () {\r",
" pm.response.to.have.status(200);\r",
"});\r",
"\r",
"pm.test(\"Validate the json response Schema\",function()\r",
"{\r",
"\r",
"pm.response.to.have.jsonSchema(Schema);\r",
"\r",
"});\r",
"\r",
"\r",
""
],
"type": "text/javascript",
"packages": {}
}
},
{
"listen": "prerequest",
"script": {
"exec": [
"const apiKey = pm.environment.get(\"api_key\");\r",
"const apiSecret = pm.environment.get(\"api_secret\");\r",
"const baseUrl = pm.environment.get(\"base_url\");\r",
"\r",
"pm.sendRequest({\r",
" url: baseUrl+'/v2/token',\r",
" method: 'POST',\r",
" header: {\r",
" 'Content-Type': 'application/json'\r",
" },\r",
" body: {\r",
" mode: 'raw',\r",
" raw: JSON.stringify({\r",
" apiKey: apiKey,\r",
" apiSecret: apiSecret\r",
" })\r",
" }\r",
"}, function (err, res) {\r",
" if (err) {\r",
" console.log(\"Token request failed:\", err);\r",
" } else {\r",
" // Parse the response to extract the token\r",
" const jsonData = res.json();\r",
" // Assuming the token is in jsonData.token\r",
" pm.environment.set(\"token\", jsonData.token);\r",
" }\r",
"});"
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{token}}",
"type": "string"
}
]
},
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"url": {
"raw": "{{base_url}}/v2/accounts/:user_id/refresh",
"host": [
"{{base_url}}"
],
"path": [
"v2",
"accounts",
":user_id",
"refresh"
],
"variable": [
{
"key": "user_id",
"value": "{{user_id}}"
}
]
}
},
"response": [
{
"name": "success",
"originalRequest": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"url": {
"raw": "{{base_url}}/v2/accounts/:user_id/refresh",
"host": [
"{{base_url}}"
],
"path": [
"v2",
"accounts",
":user_id",
"refresh"
],
"variable": [
{
"key": "user_id",
"value": "{{user_id}}"
}
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Content-Length",
"value": "178"
},
{
"key": "Connection",
"value": "keep-alive"
},
{
"key": "Date",
"value": "Fri, 13 Dec 2024 17:50:18 GMT"
},
{
"key": "X-Amzn-Trace-Id",
"value": "Root=1-675c73d3-796d66cd4f0c41af3fcd7ccf"
},
{
"key": "x-amzn-RequestId",
"value": "f3271d8a-8c9c-452c-ae77-6800b0f68309"
},
{
"key": "Access-Control-Allow-Origin",
"value": "*"
},
{
"key": "x-amz-apigw-id",
"value": "CvcJJFN0IAMEl2g="
},
{
"key": "Cache-Control",
"value": "max-age=30"
},
{
"key": "X-Cache",
"value": "Miss from cloudfront"
},
{
"key": "Via",
"value": "1.1 87d7664d4d5a16632f7453ca9cc45a74.cloudfront.net (CloudFront)"
},
{
"key": "X-Amz-Cf-Pop",
"value": "CMH68-P4"
},
{
"key": "X-Amz-Cf-Id",
"value": "VvEy18bloHXvDMRKsy2H0HSwgsRsuyu6n0LBUtWQb6asrnq-h1jNkA=="
}
],
"cookie": [],
"body": "{\n \"status\": \"success\",\n \"statusCode\": 200,\n \"account\": {\n \"refreshStatus\": \"Initiated\",\n \"jobId\": \"REF-7951da09a0844aa5a330b2b19ac2e78d\",\n \"userId\": \"070c4836340a430286a3a0299681ef3d\"\n }\n}"
},
{
"name": "failure (user not found)",
"originalRequest": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"url": {
"raw": "{{base_url}}/v2/accounts/:user_id/refresh",
"host": [
"{{base_url}}"
],
"path": [
"v2",
"accounts",
":user_id",
"refresh"
],
"variable": [
{
"key": "user_id",
"value": "{{user_id}}"
}
]
}
},
"status": "Not Found",
"code": 404,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Content-Length",
"value": "92"
},
{
"key": "Connection",
"value": "keep-alive"
},
{
"key": "Date",
"value": "Wed, 18 Dec 2024 14:43:06 GMT"
},
{
"key": "X-Amzn-Trace-Id",
"value": "Root=1-6762df7a-6357e0576a52fe0b23a2506d"
},
{
"key": "x-amzn-RequestId",
"value": "0ba0cfda-29f6-44f5-ac13-8d23b73af447"
},
{
"key": "Access-Control-Allow-Origin",
"value": "*"
},
{
"key": "x-amz-apigw-id",
"value": "C_fbQH8RoAMEVxw="
},
{
"key": "Cache-Control",
"value": "max-age=30"
},
{
"key": "X-Cache",
"value": "Error from cloudfront"
},
{
"key": "Via",
"value": "1.1 0d28f7015cfb69cd3eb6e14359add86e.cloudfront.net (CloudFront)"
},
{
"key": "X-Amz-Cf-Pop",
"value": "CMH68-P4"
},
{
"key": "X-Amz-Cf-Id",
"value": "1IvodXZFhIAZt0Sb5B6hxhHP-HXjBUKYlmF85VXzg5Pw4JEBRKhJZg=="
}
],
"cookie": [],
"body": "{\n \"error\": {\n \"code\": \"AC-102\",\n \"message\": \"User [761268fe79af4bcca602b3cdb307962] not found\"\n }\n}"
}
]
},
{
"name": "/job-status",
"event": [
{
"listen": "prerequest",
"script": {
"exec": [
"const apiKey = pm.environment.get(\"api_key\");\r",
"const apiSecret = pm.environment.get(\"api_secret\");\r",
"const baseUrl = pm.environment.get(\"base_url\");\r",
"\r",
"pm.sendRequest({\r",
" url: baseUrl+'/v2/token',\r",
" method: 'POST',\r",
" header: {\r",
" 'Content-Type': 'application/json'\r",
" },\r",
" body: {\r",
" mode: 'raw',\r",
" raw: JSON.stringify({\r",
" apiKey: apiKey,\r",
" apiSecret: apiSecret\r",
" })\r",
" }\r",
"}, function (err, res) {\r",
" if (err) {\r",
" console.log(\"Token request failed:\", err);\r",
" } else {\r",
" // Parse the response to extract the token\r",
" const jsonData = res.json();\r",
" // Assuming the token is in jsonData.token\r",
" pm.environment.set(\"token\", jsonData.token);\r",
" }\r",
"});"
],
"type": "text/javascript",
"packages": {}
}
},
{
"listen": "test",
"script": {
"exec": [
"const Schema = {\r",
" \"type\": \"object\",\r",
" \"properties\": {\r",
" \"status\": {\r",
" \"type\": \"string\"\r",
" },\r",
" \"statusCode\": {\r",
" \"type\": \"integer\"\r",
" },\r",
" \"jobStatus\": {\r",
" \"type\": \"string\"\r",
" },\r",
" \"mfaTriggered\": {\r",
" \"type\": \"boolean\"\r",
" },\r",
" \"jobId\": {\r",
" \"type\": \"string\"\r",
" },\r",
" \"userId\": {\r",
" \"type\": \"string\"\r",
" }\r",
" },\r",
" \"required\": [\r",
" \"status\",\r",
" \"statusCode\",\r",
" \"jobStatus\",\r",
" \"mfaTriggered\",\r",
" \"jobId\",\r",
" \"userId\"\r",
" ]\r",
"}\r",
"\r",
"pm.test(\"Response time is less than 8000ms\", function () {\r",
" pm.expect(pm.response.responseTime).to.be.below(8000);\r",
"});\r",
"\r",
"pm.test(\"Status code is 200\", function () {\r",
" pm.response.to.have.status(200);\r",
"});\r",
"\r",
"pm.test(\"Validate the json response Schema\",function()\r",
"{\r",
"pm.response.to.have.jsonSchema(Schema);\r",
"\r",
"});"
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{token}}",
"type": "string"
}
]
},
"method": "GET",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Authorization",
"value": "Bearer {{token}}"
}
],
"url": {
"raw": "{{base_url}}/v2/accounts/:user_id/job/:job_id",
"host": [
"{{base_url}}"
],
"path": [
"v2",
"accounts",
":user_id",
"job",
":job_id"
],
"variable": [
{
"key": "user_id",
"value": "{{user_id}}"
},
{
"key": "job_id",
"value": "{{job_id}}",
"description": "This variable is called from previous endpoint."
}
]
}
},
"response": [
{
"name": "success",
"originalRequest": {
"method": "GET",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Authorization",
"value": "Bearer {{token}}"
}
],
"url": {
"raw": "{{base_url}}/v2/accounts/:user_id/job/:job_id",
"host": [
"{{base_url}}"
],
"path": [
"v2",
"accounts",
":user_id",
"job",
":job_id"
],
"variable": [
{
"key": "user_id",
"value": "{{user_id}}"
},
{
"key": "job_id",
"value": "{{job_id}}",
"description": "This variable is called from previous endpoint."
}
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Content-Length",
"value": "184"
},
{
"key": "Connection",
"value": "keep-alive"
},
{
"key": "Date",
"value": "Fri, 13 Dec 2024 17:50:43 GMT"
},
{
"key": "X-Amzn-Trace-Id",
"value": "Root=1-675c73ef-3cc2214234281be338af01e0"
},
{
"key": "x-amzn-RequestId",
"value": "68bf7bea-a34e-4ea6-8b19-04d9bbc92bfa"
},
{
"key": "Access-Control-Allow-Origin",
"value": "*"
},
{
"key": "x-amz-apigw-id",
"value": "CvcNaHHXIAMEdJA="
},
{
"key": "Cache-Control",
"value": "max-age=30"
},
{
"key": "X-Cache",
"value": "Miss from cloudfront"
},
{
"key": "Via",
"value": "1.1 87d7664d4d5a16632f7453ca9cc45a74.cloudfront.net (CloudFront)"
},
{
"key": "X-Amz-Cf-Pop",
"value": "CMH68-P4"
},
{
"key": "X-Amz-Cf-Id",
"value": "9SxMfHGA95iBkvd95Lswjt5giJCw36owz_Hpgid3vf348WGEqO-x4g=="
}
],
"cookie": [],
"body": "{\n \"status\": \"success\",\n \"statusCode\": 200,\n \"jobStatus\": \"Completed\",\n \"mfaTriggered\": false,\n \"jobId\": \"REF-7951da09a0844aa5a330b2b19ac2e78d\",\n \"userId\": \"070c4836340a430286a3a0299681ef3d\"\n}"
},
{
"name": "failure (user not found)",
"originalRequest": {
"method": "GET",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Authorization",
"value": "Bearer {{token}}"
}
],
"url": {
"raw": "{{base_url}}/v2/accounts/:user_id/job/:job_id",
"host": [
"{{base_url}}"
],
"path": [
"v2",
"accounts",
":user_id",
"job",
":job_id"
],
"variable": [
{
"key": "user_id",
"value": "{{user_id}}"
},
{
"key": "job_id",
"value": "{{job_id}}",
"description": "This variable is called from previous endpoint."
}
]
}
},
"status": "Not Found",
"code": 404,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Content-Length",
"value": "90"
},
{
"key": "Connection",
"value": "keep-alive"
},
{
"key": "Date",
"value": "Wed, 18 Dec 2024 14:46:54 GMT"
},
{
"key": "X-Amzn-Trace-Id",
"value": "Root=1-6762e059-2c517f9526abec987ad2d418"
},
{
"key": "x-amzn-RequestId",
"value": "508bf765-8d83-4c95-9155-46ec010cfe7b"
},
{
"key": "Access-Control-Allow-Origin",
"value": "*"
},
{
"key": "x-amz-apigw-id",
"value": "C_f-AFxDIAMElGg="
},
{
"key": "Cache-Control",
"value": "max-age=30"
},
{
"key": "X-Cache",
"value": "Error from cloudfront"
},
{
"key": "Via",
"value": "1.1 141cc765667839ffa8c4ad646af354cc.cloudfront.net (CloudFront)"
},
{
"key": "X-Amz-Cf-Pop",
"value": "CMH68-P4"
},
{
"key": "X-Amz-Cf-Id",
"value": "01SyMUPSizXEQzvO-rjQHDLFhHvu2JwI-9FKe5tdGruqLaMKfH42dw=="
}
],
"cookie": [],
"body": "{\n \"error\": {\n \"code\": \"AC-102\",\n \"message\": \"User 761268fe79af4bcca602b3cdb307962 not found\"\n }\n}"
}
]
}
]
},
{
"name": "MFA",
"item": [
{
"name": "/MFA",
"event": [
{
"listen": "test",
"script": {
"exec": [
"// Fixed TypeError by checking for existence of mfaAttributes\r",
"var jsonData = pm.response.json();\r",
"var guid = (jsonData.verifyPollAttributes.mfaAttributes && jsonData.verifyPollAttributes.mfaAttributes.length > 0) ? jsonData.verifyPollAttributes.mfaAttributes[0].guid : null;\r",
"console.log(guid);\r",
"\r",
"// Set mfa_type collection variables for next APIs (resolve-mfa)\r",
"pm.collectionVariables.set(\"mfa_type\", guid);\r",
"\r",
"pm.test(\"Response time is less than 8000ms\", function () {\r",
" pm.expect(pm.response.responseTime).to.be.below(8000);\r",
"});\r",
"\r",
"pm.test(\"Status code is 200\", function () {\r",
" pm.response.to.have.status(200);\r",
"});"
],
"type": "text/javascript",
"packages": {}
}
},
{
"listen": "prerequest",
"script": {
"exec": [
"const apiKey = pm.environment.get(\"api_key\");\r",
"const apiSecret = pm.environment.get(\"api_secret\");\r",
"const baseUrl = pm.environment.get(\"base_url\");\r",
"\r",
"pm.sendRequest({\r",
" url: baseUrl+'/v2/token',\r",
" method: 'POST',\r",
" header: {\r",
" 'Content-Type': 'application/json'\r",
" },\r",
" body: {\r",
" mode: 'raw',\r",
" raw: JSON.stringify({\r",
" apiKey: apiKey,\r",
" apiSecret: apiSecret\r",
" })\r",
" }\r",
"}, function (err, res) {\r",
" if (err) {\r",
" console.log(\"Token request failed:\", err);\r",
" } else {\r",
" // Parse the response to extract the token\r",
" const jsonData = res.json();\r",
" // Assuming the token is in jsonData.token\r",
" pm.environment.set(\"token\", jsonData.token);\r",
" }\r",
"});"
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{token}}",
"type": "string"
}
]
},
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"url": {
"raw": "{{base_url}}/v2/accounts/:user_id/mfa/:job_id",
"host": [
"{{base_url}}"
],
"path": [
"v2",
"accounts",
":user_id",
"mfa",
":job_id"
],
"variable": [
{
"key": "user_id",
"value": "{{user_id}}"
},
{
"key": "job_id",
"value": "{{job_id}}"
}
]
}
},
"response": [
{
"name": "success",
"originalRequest": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"url": {
"raw": "{{base_url}}/v2/accounts/:user_id/mfa/:job_id",
"host": [
"{{base_url}}"
],
"path": [
"v2",
"accounts",
":user_id",
"mfa",
":job_id"
],
"variable": [
{
"key": "user_id",
"value": "{{user_id}}"
},
{
"key": "job_id",
"value": "{{job_id}}"
}
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Content-Length",
"value": "1707"
},
{
"key": "Connection",
"value": "keep-alive"
},
{
"key": "Date",
"value": "Fri, 13 Dec 2024 18:18:17 GMT"
},
{
"key": "X-Amzn-Trace-Id",
"value": "Root=1-675c7a64-5b149b726de7df302e3b6b8a"
},
{
"key": "x-amzn-RequestId",
"value": "f8af0593-e9bb-4e14-a05a-9775f50d27a9"
},
{
"key": "Access-Control-Allow-Origin",
"value": "*"
},
{
"key": "x-amz-apigw-id",
"value": "CvgPuFsvoAMEnjQ="
},
{
"key": "Cache-Control",
"value": "max-age=30"
},
{
"key": "X-Cache",
"value": "Miss from cloudfront"
},
{
"key": "Via",
"value": "1.1 f05c21b1a65ba96f308520ba91f14d92.cloudfront.net (CloudFront)"
},
{
"key": "X-Amz-Cf-Pop",
"value": "CMH68-P4"
},
{
"key": "X-Amz-Cf-Id",
"value": "dfH-VZrI_75XqnPdFxMkXKydvvFuGAp-3nDK5IkrzT3apHtckj5P3g=="
}
],
"cookie": [],
"body": "{\n \"status\": \"success\",\n \"statusCode\": 200,\n \"verifyPollAttributes\": {\n \"connectionStatus\": \"CHALLENGED\",\n \"isBeingAggregated\": true,\n \"mfaAttributes\": [\n {\n \"field_name\": null,\n \"guid\": \"CRD-89350623-f81b-4bbe-bf49-8286cde4ad7a\",\n \"label\": \"What city were you born in?\",\n \"type\": \"TEXT\"\n }\n ]\n },\n \"jobId\": \"IDT-a50049dd15a64a2fae0afba067fe0d68\",\n \"bankInfo\": {\n \"id\": 38900,\n \"institutionId\": \"mxbank\",\n \"institutionName\": \"Aerosync Bank (MFA Trigger)\",\n \"institutionWebsite\": \"https://www.aerosync.com/\",\n \"defaultLogo\": \"https://assets.aerosync.com/bankLogos/38900.svg\",\n \"fallbackLogo\": \"https://d2ufr9ji57xwvj.cloudfront.net/30087.png\",\n \"configurationDetails\": {\n \"url\": \"https://www.mx.com\",\n \"code\": \"mxbank\",\n \"name\": \"MX Bank\",\n \"small_logo_url\": \"https://content.moneydesktop.com/storage/MD_Assets/Ipad%20Logos/50x50/INS-1572a04c-912b-59bf-5841-332c7dfafaef_50x50.png\",\n \"supports_oauth\": false,\n \"medium_logo_url\": \"https://content.moneydesktop.com/storage/MD_Assets/Ipad%20Logos/100x100/INS-1572a04c-912b-59bf-5841-332c7dfafaef_100x100.png\",\n \"instructional_text\": null,\n \"supports_tax_document\": false,\n \"supports_account_statement\": false,\n \"supports_transaction_history\": true,\n \"supports_account_verification\": true,\n \"supports_account_identification\": true\n },\n \"country\": \"US\",\n \"connectionType\": \"MX\"\n },\n \"account\": {\n \"sessionId\": \"IDT-a50049dd15a64a2fae0afba067fe0d68\",\n \"loginParameterInfo\": {\n \"credentials\": [\n {\n \"guid\": \"CRD-9f61fb4c-912c-bd1e-b175-ccc7f0275cc1\",\n \"type\": \"LOGIN\",\n \"label\": \"Username\",\n \"field_name\": \"LOGIN\",\n \"field_type\": \"LOGIN\",\n \"display_order\": 1\n },\n {\n \"guid\": \"CRD-e3d7ea81-aac7-05e9-fbdd-4b493c6e474d\",\n \"type\": \"PASSWORD\",\n \"label\": \"Password\",\n \"field_name\": \"PASSWORD\",\n \"field_type\": \"PASSWORD\",\n \"display_order\": 2\n }\n ]\n }\n }\n}"
},
{
"name": "failure (user not found)",
"originalRequest": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"url": {
"raw": "{{base_url}}/v2/accounts/:user_id/mfa/:job_id",
"host": [
"{{base_url}}"
],
"path": [
"v2",
"accounts",
":user_id",
"mfa",
":job_id"
],
"variable": [
{
"key": "user_id",
"value": "{{user_id}}"
},
{
"key": "job_id",
"value": "{{job_id}}"
}
]
}
},
"status": "Not Found",
"code": 404,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Content-Length",
"value": "90"
},
{
"key": "Connection",
"value": "keep-alive"
},
{
"key": "Date",
"value": "Wed, 18 Dec 2024 15:14:29 GMT"
},
{
"key": "X-Amzn-Trace-Id",
"value": "Root=1-6762e6cf-62ad31ea4c6eb7224cf9a7f8"
},
{
"key": "x-amzn-RequestId",
"value": "db218c48-308c-4407-80ba-c8f9bf42863a"
},
{
"key": "Access-Control-Allow-Origin",
"value": "*"
},
{
"key": "x-amz-apigw-id",
"value": "C_kAfHzeIAMEjhA="
},
{
"key": "Cache-Control",
"value": "max-age=30"
},
{
"key": "X-Cache",
"value": "Error from cloudfront"
},
{
"key": "Via",
"value": "1.1 0e3c225d58500145a5360bc7903299fe.cloudfront.net (CloudFront)"
},
{
"key": "X-Amz-Cf-Pop",
"value": "CMH68-P4"
},
{
"key": "X-Amz-Cf-Id",
"value": "8EhHsCgxDnYQpZcR3EJDJhXLL9qe5OFm8ohXXv-BacrerHGnYqnAig=="
}
],
"cookie": [],
"body": "{\n \"error\": {\n \"code\": \"AC-102\",\n \"message\": \"User 761268fe79af4bcca602b3cdb307962 not found\"\n }\n}"
}
]
},
{
"name": "/resolve-mfa",
"event": [
{
"listen": "test",
"script": {
"exec": [
"const Schema = {\r",
" \"type\": \"object\",\r",
" \"properties\": {\r",
" \"status\": {\r",
" \"type\": \"string\"\r",
" },\r",
" \"statusCode\": {\r",
" \"type\": \"integer\"\r",
" },\r",
" \"verifyAttributes\": {\r",
" \"type\": \"object\",\r",
" \"properties\": {\r",
" \"connectionStatus\": {\r",
" \"type\": \"string\"\r",
" }\r",
" },\r",
" \"required\": [\r",
" \"connectionStatus\"\r",
" ]\r",
" },\r",
" \"sessionId\": {\r",
" \"type\": \"null\"\r",
" },\r",
" \"jobId\": {\r",
" \"type\": \"string\"\r",
" }\r",
" },\r",
" \"required\": [\r",
" \"status\",\r",
" \"statusCode\",\r",
" \"verifyAttributes\",\r",
" \"sessionId\",\r",
" \"jobId\"\r",
" ]\r",
"\r",
"}\r",
"\r",
"pm.test(\"Response time is less than 8000ms\", function () {\r",
" pm.expect(pm.response.responseTime).to.be.below(8000);\r",
"});\r",
"\r",
"pm.test(\"Status code is 200\", function () {\r",
" pm.response.to.have.status(200);\r",
"});\r",
"\r",
"pm.test(\"Validate the json response Schema\",function()\r",
"{\r",
"pm.response.to.have.jsonSchema(Schema);\r",
"\r",
"});"
],
"type": "text/javascript",
"packages": {}
}
},
{
"listen": "prerequest",
"script": {
"exec": [
"const apiKey = pm.environment.get(\"api_key\");\r",
"const apiSecret = pm.environment.get(\"api_secret\");\r",
"const baseUrl = pm.environment.get(\"base_url\");\r",
"\r",
"pm.sendRequest({\r",
" url: baseUrl+'/v2/token',\r",
" method: 'POST',\r",
" header: {\r",
" 'Content-Type': 'application/json'\r",
" },\r",
" body: {\r",
" mode: 'raw',\r",
" raw: JSON.stringify({\r",
" apiKey: apiKey,\r",
" apiSecret: apiSecret\r",
" })\r",
" }\r",
"}, function (err, res) {\r",
" if (err) {\r",
" console.log(\"Token request failed:\", err);\r",
" } else {\r",
" // Parse the response to extract the token\r",
" const jsonData = res.json();\r",
" // Assuming the token is in jsonData.token\r",
" pm.environment.set(\"token\", jsonData.token);\r",
" }\r",
"});"
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{token}}",
"type": "string"
}
]
},
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\r\n \"mfaAttributes\": {\r\n \"type\": \"{{mfa_type}}\",\r\n \"answer\": \"correct\"\r\n }\r\n}"
},
"url": {
"raw": "{{base_url}}/v2/accounts/:user_id/mfa/:job_id/resolve",
"host": [
"{{base_url}}"
],
"path": [
"v2",
"accounts",
":user_id",
"mfa",
":job_id",
"resolve"
],
"variable": [
{
"key": "user_id",
"value": "{{user_id}}"
},
{
"key": "job_id",
"value": "{{job_id}}"
}
]
}
},
"response": [
{
"name": "success",
"originalRequest": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\r\n \"mfaAttributes\": {\r\n \"type\": \"{{mfa_type}}\",\r\n \"answer\": \"correct\"\r\n }\r\n}"
},
"url": {
"raw": "{{base_url}}/v2/accounts/:user_id/mfa/:job_id/resolve",
"host": [
"{{base_url}}"
],
"path": [
"v2",
"accounts",
":user_id",
"mfa",
":job_id",
"resolve"
],
"variable": [
{
"key": "user_id",
"value": "{{user_id}}"
},
{
"key": "job_id",
"value": "{{job_id}}"
}
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Content-Length",
"value": "161"
},
{
"key": "Connection",
"value": "keep-alive"
},
{
"key": "Date",
"value": "Fri, 13 Dec 2024 18:19:14 GMT"
},
{
"key": "X-Amzn-Trace-Id",
"value": "Root=1-675c7a9c-01a5e7b440d59cb74b684cf8"
},
{
"key": "x-amzn-RequestId",
"value": "169caf63-fc70-4620-8936-7eb95ee9a7b5"
},
{
"key": "Access-Control-Allow-Origin",
"value": "*"
},
{
"key": "x-amz-apigw-id",
"value": "CvgYlEvjIAMEFgA="
},
{
"key": "Cache-Control",
"value": "max-age=30"
},
{
"key": "X-Cache",
"value": "Miss from cloudfront"
},
{
"key": "Via",
"value": "1.1 f05c21b1a65ba96f308520ba91f14d92.cloudfront.net (CloudFront)"
},
{
"key": "X-Amz-Cf-Pop",
"value": "CMH68-P4"
},
{
"key": "X-Amz-Cf-Id",
"value": "BH2_emSoeC83Cn34QM70PVqQb8gjmi2paSYHOG_Zz_wMWRS-f8V_DA=="
}
],
"cookie": [],
"body": "{\n \"status\": \"success\",\n \"statusCode\": 200,\n \"verifyAttributes\": {\n \"connectionStatus\": \"RESUMED\"\n },\n \"sessionId\": null,\n \"jobId\": \"IDT-a50049dd15a64a2fae0afba067fe0d68\"\n}"
},
{
"name": "failure (user not found)",
"originalRequest": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\r\n \"mfaAttributes\": {\r\n \"type\": \"{{mfa_type}}\",\r\n \"answer\": \"correct\"\r\n }\r\n}"
},
"url": {
"raw": "{{base_url}}/v2/accounts/:user_id/mfa/:job_id/resolve",
"host": [
"{{base_url}}"
],
"path": [
"v2",
"accounts",
":user_id",
"mfa",
":job_id",
"resolve"
],
"variable": [
{
"key": "user_id",
"value": "{{user_id}}"
},
{
"key": "job_id",
"value": "{{job_id}}"
}
]
}
},
"status": "Not Found",
"code": 404,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Content-Length",
"value": "90"
},
{
"key": "Connection",
"value": "keep-alive"
},
{
"key": "Date",
"value": "Wed, 18 Dec 2024 15:22:12 GMT"
},
{
"key": "X-Amzn-Trace-Id",
"value": "Root=1-6762e89f-31486c210cd0d8502015feed"
},
{
"key": "x-amzn-RequestId",
"value": "8911924d-bd31-4f99-bca7-e1d77c47ebfc"
},
{
"key": "Access-Control-Allow-Origin",
"value": "*"
},
{
"key": "x-amz-apigw-id",
"value": "C_lI_EZhIAMEjoQ="
},
{
"key": "Cache-Control",
"value": "max-age=30"
},
{
"key": "X-Cache",
"value": "Error from cloudfront"
},
{
"key": "Via",
"value": "1.1 4b1f2d5e8ba06f891aac0914bfcf0ce0.cloudfront.net (CloudFront)"
},
{
"key": "X-Amz-Cf-Pop",
"value": "CMH68-P4"
},
{
"key": "X-Amz-Cf-Id",
"value": "zjeCY2SFwN3AmOohp-RFfOluctd7EyD2DcmoRgNS-Dv-QOUzSqBGEA=="
}
],
"cookie": [],
"body": "{\n \"error\": {\n \"code\": \"AC-102\",\n \"message\": \"User 761268fe79af4bcca602b3cdb307962 not found\"\n }\n}"
},
{
"name": "failure (invalid or missing attributes)",
"originalRequest": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\r\n \"mfaAttributes\": {\r\n \"type\": \"{{mfa_type}}\",\r\n \"answer\": \"correct\"\r\n }\r\n}"
},
"url": {
"raw": "{{base_url}}/v2/accounts/:user_id/mfa/:job_id/resolve",
"host": [
"{{base_url}}"
],
"path": [
"v2",
"accounts",
":user_id",
"mfa",
":job_id",
"resolve"
],
"variable": [
{
"key": "user_id",
"value": "{{user_id}}"
},
{
"key": "job_id",
"value": "{{job_id}}"
}
]
}
},
"status": "Bad Request",
"code": 400,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Content-Length",
"value": "101"
},
{
"key": "Connection",
"value": "keep-alive"
},
{
"key": "Date",
"value": "Wed, 18 Dec 2024 15:24:13 GMT"
},
{
"key": "X-Amzn-Trace-Id",
"value": "Root=1-6762e91d-72d0ccca648fd8e33b96e121"
},
{
"key": "x-amzn-RequestId",
"value": "e4214a3b-6d0d-4af5-adb9-e0e18a9cac94"
},
{
"key": "Access-Control-Allow-Origin",
"value": "*"
},
{
"key": "x-amz-apigw-id",
"value": "C_lcoEfRIAMEKtA="
},
{
"key": "Cache-Control",
"value": "max-age=30"
},
{
"key": "X-Cache",
"value": "Error from cloudfront"
},
{
"key": "Via",
"value": "1.1 4b1f2d5e8ba06f891aac0914bfcf0ce0.cloudfront.net (CloudFront)"
},
{
"key": "X-Amz-Cf-Pop",
"value": "CMH68-P4"
},
{
"key": "X-Amz-Cf-Id",
"value": "zp1vfYMDhLwzKCZxnigl_fRiuX05frk1zU4fmaafjLdTr5K8Rbquow=="
}
],
"cookie": [],
"body": "{\n \"error\": {\n \"code\": \"AC-100\",\n \"message\": \"Required attributes are missing or not in a valid format.\"\n }\n}"
}
]
}
]
},
{
"name": "Transactions",
"item": [
{
"name": "/transactions",
"event": [
{
"listen": "prerequest",
"script": {
"exec": [
"const apiKey = pm.environment.get(\"api_key\");\r",
"const apiSecret = pm.environment.get(\"api_secret\");\r",
"const baseUrl = pm.environment.get(\"base_url\");\r",
"\r",
"pm.sendRequest({\r",
" url: baseUrl+'/v2/token',\r",
" method: 'POST',\r",
" header: {\r",
" 'Content-Type': 'application/json'\r",
" },\r",
" body: {\r",
" mode: 'raw',\r",
" raw: JSON.stringify({\r",
" apiKey: apiKey,\r",
" apiSecret: apiSecret\r",
" })\r",
" }\r",
"}, function (err, res) {\r",
" if (err) {\r",
" console.log(\"Token request failed:\", err);\r",
" } else {\r",
" // Parse the response to extract the token\r",
" const jsonData = res.json();\r",
" // Assuming the token is in jsonData.token\r",
" pm.environment.set(\"token\", jsonData.token);\r",
" }\r",
"});"
],
"type": "text/javascript",
"packages": {}
}
},
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"Response time is less than 8000ms\", function () {\r",
" pm.expect(pm.response.responseTime).to.be.below(8000);\r",
"});\r",
"\r",
"pm.test(\"Status code is 200\", function () {\r",
" pm.response.to.have.status(200);\r",
"});"
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{token}}",
"type": "string"
}
]
},
"method": "GET",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"url": {
"raw": "{{base_url}}/v2/accounts/:user_id/transactions?start_date=2023-11-01&end_date=2023-12-13",
"host": [
"{{base_url}}"
],
"path": [
"v2",
"accounts",
":user_id",
"transactions"
],
"query": [
{
"key": "start_date",
"value": "2023-11-01"
},
{
"key": "end_date",
"value": "2023-12-13"
}
],
"variable": [
{
"key": "user_id",
"value": "{{user_id}}"
}
]
}
},
"response": [
{
"name": "success",
"originalRequest": {
"method": "GET",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"url": {
"raw": "{{base_url}}/v2/accounts/:user_id/transactions?start_date=2023-11-01&end_date=2023-12-13",
"host": [
"{{base_url}}"
],
"path": [
"v2",
"accounts",
":user_id",
"transactions"
],
"query": [
{
"key": "start_date",
"value": "2023-11-01"
},
{
"key": "end_date",
"value": "2023-12-13"
}
],
"variable": [
{
"key": "user_id",
"value": "{{user_id}}"
}
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Content-Length",
"value": "446"
},
{
"key": "Connection",
"value": "keep-alive"
},
{
"key": "Date",
"value": "Fri, 13 Dec 2024 17:51:47 GMT"
},
{
"key": "X-Amzn-Trace-Id",
"value": "Root=1-675c742d-07d75066329cbf831c0e1a4e"
},
{
"key": "x-amzn-RequestId",
"value": "20d7aa3e-1e32-46b0-8271-bbc2f210049f"
},
{
"key": "Access-Control-Allow-Origin",
"value": "*"
},
{
"key": "x-amz-apigw-id",
"value": "CvcXGEWEoAMEdKQ="
},
{
"key": "Cache-Control",
"value": "max-age=30"
},
{
"key": "X-Cache",
"value": "Miss from cloudfront"
},
{
"key": "Via",
"value": "1.1 252d91a64bfdc4045e9d843f4a37a3e6.cloudfront.net (CloudFront)"
},
{
"key": "X-Amz-Cf-Pop",
"value": "CMH68-P4"
},
{
"key": "X-Amz-Cf-Id",
"value": "0ypMuPL2TQ21Z4ppap27Ti-ppNI8QSHC4ayhYl2k1IyCwEOqaBLDMg=="
}
],
"cookie": [],
"body": "{\n \"status\": \"success\",\n \"statusCode\": 200,\n \"transactions\": [\n {\n \"id\": 23293260,\n \"type\": \"Debit\",\n \"date\": \"2023-12-10\",\n \"amount\": 100,\n \"currency\": \"USD\",\n \"description\": \"THE ACADEMY OF PERFORM\",\n \"category\": \"Uncategorized\",\n \"subcategory\": \"Uncategorized\"\n },\n {\n \"id\": 23293261,\n \"type\": \"Debit\",\n \"date\": \"2023-11-10\",\n \"amount\": 10,\n \"currency\": \"USD\",\n \"description\": \"TRANSFER To 6010504-5\",\n \"category\": \"Uncategorized\",\n \"subcategory\": \"Uncategorized\"\n }\n ]\n}"
},
{
"name": "failure (missing parameters)",
"originalRequest": {
"method": "GET",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"url": {
"raw": "{{base_url}}/v2/accounts/:user_id/transactions",
"host": [
"{{base_url}}"
],
"path": [
"v2",
"accounts",
":user_id",
"transactions"
],
"variable": [
{
"key": "user_id",
"value": "{{user_id}}"
}
]
}
},
"status": "Bad Request",
"code": 400,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Content-Length",
"value": "129"
},
{
"key": "Connection",
"value": "keep-alive"
},
{
"key": "Date",
"value": "Fri, 13 Dec 2024 17:52:09 GMT"
},
{
"key": "X-Amzn-Trace-Id",
"value": "Root=1-675c7449-733177ee10600c9119446419"
},
{
"key": "x-amzn-RequestId",
"value": "ba065513-6c69-474d-967a-09ee99a1d501"
},
{
"key": "Access-Control-Allow-Origin",
"value": "*"
},
{
"key": "x-amz-apigw-id",
"value": "CvcbhEwTIAMEAJw="
},
{
"key": "Cache-Control",
"value": "max-age=30"
},
{
"key": "X-Cache",
"value": "Error from cloudfront"
},
{
"key": "Via",
"value": "1.1 252d91a64bfdc4045e9d843f4a37a3e6.cloudfront.net (CloudFront)"
},
{
"key": "X-Amz-Cf-Pop",
"value": "CMH68-P4"
},
{
"key": "X-Amz-Cf-Id",
"value": "66mVYTuiLs8hsdh06xqLmQoPB1f6oLMeAL1sXVELgiNEb90I9a-sFw=="
}
],
"cookie": [],
"body": "{\n \"error\": {\n \"code\": \"AC-100\",\n \"message\": \"Validation error; user_id, start_date, or end_date is missing or in an invalid format\"\n }\n}"
},
{
"name": "failure (user not found)",
"originalRequest": {
"method": "GET",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"url": {
"raw": "{{base_url}}/v2/accounts/:user_id/transactions?start_date=2023-11-01&end_date=2023-12-13",
"host": [
"{{base_url}}"
],
"path": [
"v2",
"accounts",
":user_id",
"transactions"
],
"query": [
{
"key": "start_date",
"value": "2023-11-01"
},
{
"key": "end_date",
"value": "2023-12-13"
}
],
"variable": [
{
"key": "user_id",
"value": "{{user_id}}"
}
]
}
},
"status": "Not Found",
"code": 404,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Content-Length",
"value": "90"
},
{
"key": "Connection",
"value": "keep-alive"
},
{
"key": "Date",
"value": "Wed, 18 Dec 2024 15:15:09 GMT"
},
{
"key": "X-Amzn-Trace-Id",
"value": "Root=1-6762e6f8-3c3b19417e87dff71efa1aa7"
},
{
"key": "x-amzn-RequestId",
"value": "e4cb0189-9ec9-4c79-86f9-c4887c5d1020"
},
{
"key": "Access-Control-Allow-Origin",
"value": "*"
},
{
"key": "x-amz-apigw-id",
"value": "C_kG7GJjIAMELjA="
},
{
"key": "Cache-Control",
"value": "max-age=30"
},
{
"key": "X-Cache",
"value": "Error from cloudfront"
},
{
"key": "Via",
"value": "1.1 0e3c225d58500145a5360bc7903299fe.cloudfront.net (CloudFront)"
},
{
"key": "X-Amz-Cf-Pop",
"value": "CMH68-P4"
},
{
"key": "X-Amz-Cf-Id",
"value": "LiBiWsfKmgrPspx8BRZgOqAMsNwJJ8cFXNDYAvslAVWne5u3sKz7Pg=="
}
],
"cookie": [],
"body": "{\n \"error\": {\n \"code\": \"AC-102\",\n \"message\": \"User 761268fe79af4bcca602b3cdb307962 not found\"\n }\n}"
}
]
},
{
"name": "/transaction_post",
"event": [
{
"listen": "test",
"script": {
"exec": [
"//Response object\r",
"var jsonData = pm.response.json();\r",
"job= jsonData.jobId;\r",
"//Set job_id collection variables for next apis (job_status)\r",
"pm.collectionVariables.set(\"job_id\", job);\r",
"\r",
"\r",
"const Schema = {\r",
" \"type\": \"object\",\r",
" \"properties\": {\r",
" \"status\": {\r",
" \"type\": \"string\"\r",
" },\r",
" \"statusCode\": {\r",
" \"type\": \"integer\"\r",
" },\r",
" \"transactionStatus\": {\r",
" \"type\": \"string\"\r",
" },\r",
" \"jobId\": {\r",
" \"type\": \"string\"\r",
" },\r",
" \"userId\": {\r",
" \"type\": \"string\"\r",
" }\r",
" },\r",
" \"required\": [\r",
" \"status\",\r",
" \"statusCode\",\r",
" \"transactionStatus\",\r",
" \"jobId\",\r",
" \"userId\"\r",
" ]\r",
"\r",
"}\r",
"\r",
"pm.test(\"Response time is less than 8000ms\", function () {\r",
" pm.expect(pm.response.responseTime).to.be.below(8000);\r",
"});\r",
"\r",
"pm.test(\"Status code is 200\", function () {\r",
" pm.response.to.have.status(200);\r",
"});\r",
"\r",
"pm.test(\"Validate the json response Schema\",function()\r",
"{\r",
"pm.response.to.have.jsonSchema(Schema);\r",
"\r",
"});"
],
"type": "text/javascript",
"packages": {}
}
},
{
"listen": "prerequest",
"script": {
"exec": [
"const apiKey = pm.environment.get(\"api_key\");\r",
"const apiSecret = pm.environment.get(\"api_secret\");\r",
"const baseUrl = pm.environment.get(\"base_url\");\r",
"\r",
"pm.sendRequest({\r",
" url: baseUrl+'/v2/token',\r",
" method: 'POST',\r",
" header: {\r",
" 'Content-Type': 'application/json'\r",
" },\r",
" body: {\r",
" mode: 'raw',\r",
" raw: JSON.stringify({\r",
" apiKey: apiKey,\r",
" apiSecret: apiSecret\r",
" })\r",
" }\r",
"}, function (err, res) {\r",
" if (err) {\r",
" console.log(\"Token request failed:\", err);\r",
" } else {\r",
" // Parse the response to extract the token\r",
" const jsonData = res.json();\r",
" // Assuming the token is in jsonData.token\r",
" pm.environment.set(\"token\", jsonData.token);\r",
" }\r",
"});"
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{token}}",
"type": "string"
}
]
},
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"url": {
"raw": "{{base_url}}/v2/accounts/:user_id/transactions",
"host": [
"{{base_url}}"
],
"path": [
"v2",
"accounts",
":user_id",
"transactions"
],
"variable": [
{
"key": "user_id",
"value": "{{user_id}}"
}
]
}
},
"response": [
{
"name": "success",
"originalRequest": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"url": {
"raw": "{{base_url}}/v2/accounts/:user_id/transactions",
"host": [
"{{base_url}}"
],
"path": [
"v2",
"accounts",
":user_id",
"transactions"
],
"variable": [
{
"key": "user_id",
"value": "{{user_id}}"
}
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Content-Length",
"value": "169"
},
{
"key": "Connection",
"value": "keep-alive"
},
{
"key": "Date",
"value": "Fri, 13 Dec 2024 17:53:14 GMT"
},
{
"key": "X-Amzn-Trace-Id",
"value": "Root=1-675c7486-5902c0de39529cc320e89784"
},
{
"key": "x-amzn-RequestId",
"value": "1e75f50f-249d-4ac4-9aa6-6c6f0b53c57c"
},
{
"key": "Access-Control-Allow-Origin",
"value": "*"
},
{
"key": "x-amz-apigw-id",
"value": "CvclAEwZoAMERDQ="
},
{
"key": "Cache-Control",
"value": "max-age=30"
},
{
"key": "X-Cache",
"value": "Miss from cloudfront"
},
{
"key": "Via",
"value": "1.1 141cc765667839ffa8c4ad646af354cc.cloudfront.net (CloudFront)"
},
{
"key": "X-Amz-Cf-Pop",
"value": "CMH68-P4"
},
{
"key": "X-Amz-Cf-Id",
"value": "98qbjkNDaZ7-SRTqp3p_pR4GhTPcfdnLbfiNzGVNj8jkxycgWQ0Jxg=="
}
],
"cookie": [],
"body": "{\n \"status\": \"success\",\n \"statusCode\": 200,\n \"transactionStatus\": \"Initiated\",\n \"jobId\": \"TRN-3cd2c2d9d19045678fb5bde45884e4ae\",\n \"userId\": \"070c4836340a430286a3a0299681ef3d\"\n}"
},
{
"name": "failure (user not found)",
"originalRequest": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"url": {
"raw": "{{base_url}}/v2/accounts/:user_id/transactions",
"host": [
"{{base_url}}"
],
"path": [
"v2",
"accounts",
":user_id",
"transactions"
],
"variable": [
{
"key": "user_id",
"value": "{{user_id}}"
}
]
}
},
"status": "Not Found",
"code": 404,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Content-Length",
"value": "90"
},
{
"key": "Connection",
"value": "keep-alive"
},
{
"key": "Date",
"value": "Wed, 18 Dec 2024 15:15:53 GMT"
},
{
"key": "X-Amzn-Trace-Id",
"value": "Root=1-6762e724-0cb3e8d7415c1c9f77b8643e"
},
{
"key": "x-amzn-RequestId",
"value": "e0170019-9ef3-4186-9e4a-afa9f60ba5da"
},
{
"key": "Access-Control-Allow-Origin",
"value": "*"
},
{
"key": "x-amz-apigw-id",
"value": "C_kN0GKNIAMEKhw="
},
{
"key": "Cache-Control",
"value": "max-age=30"
},
{
"key": "X-Cache",
"value": "Error from cloudfront"
},
{
"key": "Via",
"value": "1.1 0e3c225d58500145a5360bc7903299fe.cloudfront.net (CloudFront)"
},
{
"key": "X-Amz-Cf-Pop",
"value": "CMH68-P4"
},
{
"key": "X-Amz-Cf-Id",
"value": "sTtu9ZGkqMi20E5lmfflJG_RcpVLCh7AoIFSbvWG5ad2XMQ0zkrDRA=="
}
],
"cookie": [],
"body": "{\n \"error\": {\n \"code\": \"AC-102\",\n \"message\": \"User 761268fe79af4bcca602b3cdb307962 not found\"\n }\n}"
}
]
},
{
"name": "/job-status",
"event": [
{
"listen": "prerequest",
"script": {
"exec": [
"const apiKey = pm.environment.get(\"api_key\");\r",
"const apiSecret = pm.environment.get(\"api_secret\");\r",
"const baseUrl = pm.environment.get(\"base_url\");\r",
"\r",
"pm.sendRequest({\r",
" url: baseUrl+'/v2/token',\r",
" method: 'POST',\r",
" header: {\r",
" 'Content-Type': 'application/json'\r",
" },\r",
" body: {\r",
" mode: 'raw',\r",
" raw: JSON.stringify({\r",
" apiKey: apiKey,\r",
" apiSecret: apiSecret\r",
" })\r",
" }\r",
"}, function (err, res) {\r",
" if (err) {\r",
" console.log(\"Token request failed:\", err);\r",
" } else {\r",
" // Parse the response to extract the token\r",
" const jsonData = res.json();\r",
" // Assuming the token is in jsonData.token\r",
" pm.environment.set(\"token\", jsonData.token);\r",
" }\r",
"});"
],
"type": "text/javascript",
"packages": {}
}
},
{
"listen": "test",
"script": {
"exec": [
"const Schema = {\r",
" \"type\": \"object\",\r",
" \"properties\": {\r",
" \"status\": {\r",
" \"type\": \"string\"\r",
" },\r",
" \"statusCode\": {\r",
" \"type\": \"integer\"\r",
" },\r",
" \"jobStatus\": {\r",
" \"type\": \"string\"\r",
" },\r",
" \"mfaTriggered\": {\r",
" \"type\": \"boolean\"\r",
" },\r",
" \"jobId\": {\r",
" \"type\": \"string\"\r",
" },\r",
" \"userId\": {\r",
" \"type\": \"string\"\r",
" }\r",
" },\r",
" \"required\": [\r",
" \"status\",\r",
" \"statusCode\",\r",
" \"jobStatus\",\r",
" \"mfaTriggered\",\r",
" \"jobId\",\r",
" \"userId\"\r",
" ]\r",
"}\r",
"\r",
"pm.test(\"Response time is less than 8000ms\", function () {\r",
" pm.expect(pm.response.responseTime).to.be.below(8000);\r",
"});\r",
"\r",
"pm.test(\"Status code is 200\", function () {\r",
" pm.response.to.have.status(200);\r",
"});\r",
"\r",
"pm.test(\"Validate the json response Schema\",function()\r",
"{\r",
"pm.response.to.have.jsonSchema(Schema);\r",
"\r",
"});"
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{token}}",
"type": "string"
}
]
},
"method": "GET",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Authorization",
"value": "Bearer {{token}}"
}
],
"url": {
"raw": "{{base_url}}/v2/accounts/:user_id/job/:job_id",
"host": [
"{{base_url}}"
],
"path": [
"v2",
"accounts",
":user_id",
"job",
":job_id"
],
"variable": [
{
"key": "user_id",
"value": "{{user_id}}"
},
{
"key": "job_id",
"value": "{{job_id}}",
"description": "This variable is called from previous endpoint."
}
]
}
},
"response": [
{
"name": "success",
"originalRequest": {
"method": "GET",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Authorization",
"value": "Bearer {{token}}"
}
],
"url": {
"raw": "{{base_url}}/v2/accounts/:user_id/job/:job_id",
"host": [
"{{base_url}}"
],
"path": [
"v2",
"accounts",
":user_id",
"job",
":job_id"
],
"variable": [
{
"key": "user_id",
"value": "{{user_id}}"
},
{
"key": "job_id",
"value": "{{job_id}}",
"description": "This variable is called from previous endpoint."
}
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Content-Length",
"value": "184"
},
{
"key": "Connection",
"value": "keep-alive"
},
{
"key": "Date",
"value": "Fri, 13 Dec 2024 17:50:43 GMT"
},
{
"key": "X-Amzn-Trace-Id",
"value": "Root=1-675c73ef-3cc2214234281be338af01e0"
},
{
"key": "x-amzn-RequestId",
"value": "68bf7bea-a34e-4ea6-8b19-04d9bbc92bfa"
},
{
"key": "Access-Control-Allow-Origin",
"value": "*"
},
{
"key": "x-amz-apigw-id",
"value": "CvcNaHHXIAMEdJA="
},
{
"key": "Cache-Control",
"value": "max-age=30"
},
{
"key": "X-Cache",
"value": "Miss from cloudfront"
},
{
"key": "Via",
"value": "1.1 87d7664d4d5a16632f7453ca9cc45a74.cloudfront.net (CloudFront)"
},
{
"key": "X-Amz-Cf-Pop",
"value": "CMH68-P4"
},
{
"key": "X-Amz-Cf-Id",
"value": "9SxMfHGA95iBkvd95Lswjt5giJCw36owz_Hpgid3vf348WGEqO-x4g=="
}
],
"cookie": [],
"body": "{\n \"status\": \"success\",\n \"statusCode\": 200,\n \"jobStatus\": \"Completed\",\n \"mfaTriggered\": false,\n \"jobId\": \"REF-7951da09a0844aa5a330b2b19ac2e78d\",\n \"userId\": \"070c4836340a430286a3a0299681ef3d\"\n}"
},
{
"name": "failure (user not found)",
"originalRequest": {
"method": "GET",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Authorization",
"value": "Bearer {{token}}"
}
],
"url": {
"raw": "{{base_url}}/v2/accounts/:user_id/job/:job_id",
"host": [
"{{base_url}}"
],
"path": [
"v2",
"accounts",
":user_id",
"job",
":job_id"
],
"variable": [
{
"key": "user_id",
"value": "{{user_id}}"
},
{
"key": "job_id",
"value": "{{job_id}}",
"description": "This variable is called from previous endpoint."
}
]
}
},
"status": "Not Found",
"code": 404,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Content-Length",
"value": "90"
},
{
"key": "Connection",
"value": "keep-alive"
},
{
"key": "Date",
"value": "Wed, 18 Dec 2024 14:46:54 GMT"
},
{
"key": "X-Amzn-Trace-Id",
"value": "Root=1-6762e059-2c517f9526abec987ad2d418"
},
{
"key": "x-amzn-RequestId",
"value": "508bf765-8d83-4c95-9155-46ec010cfe7b"
},
{
"key": "Access-Control-Allow-Origin",
"value": "*"
},
{
"key": "x-amz-apigw-id",
"value": "C_f-AFxDIAMElGg="
},
{
"key": "Cache-Control",
"value": "max-age=30"
},
{
"key": "X-Cache",
"value": "Error from cloudfront"
},
{
"key": "Via",
"value": "1.1 141cc765667839ffa8c4ad646af354cc.cloudfront.net (CloudFront)"
},
{
"key": "X-Amz-Cf-Pop",
"value": "CMH68-P4"
},
{
"key": "X-Amz-Cf-Id",
"value": "01SyMUPSizXEQzvO-rjQHDLFhHvu2JwI-9FKe5tdGruqLaMKfH42dw=="
}
],
"cookie": [],
"body": "{\n \"error\": {\n \"code\": \"AC-102\",\n \"message\": \"User 761268fe79af4bcca602b3cdb307962 not found\"\n }\n}"
}
]
}
]
}
],
"event": [
{
"listen": "prerequest",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
},
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
}
],
"variable": [
{
"key": "job_id",
"value": "",
"type": "string"
},
{
"key": "mfa_type",
"value": "",
"type": "string"
}
]
}
Pre-Condition
To begin testing the Aeropay APIs, you'll need to generate a user_id and modify it in the environment variable. The user_id is a unique identifier for a bank connection that will be used to fetch data for that bank. This user_id is returned from the Aerosync widget after a user successfully links a bank.
If you're interested in diving into testing the Aerosync APIs before you've built a working bank connection widget, the following steps will walk you through how to retrieve a user_id value to begin testing.
Step 1:
Select the https://staging.aerosync.com?token=xxxx/ (Remember to generate a widget token and add it to the URL).
Step 2: After successfully entering to the site, click on the "Continue" button to go to the bank list.
Step 3: Choose a bank to link a new account during this step right click on the page, select "Inspect" and click the "Network" tab.
Step 4: Do all the steps of a bank link process and validate the payload from the create_accounts, there you will find the user_id and user_password.
Note: Keep both the user_id and user_password in a notepad or bloc to use for future testing.
APIs TESTING STEPS
Step 1: Go to the environment variables and change the value of the user_id from the previous pre-conditions step.
Step 2: Select the environment in this case Aerosync APIs- Staging (This is according to which environment the user_id was generated).
Step 3: Select any API from the collection and click on send and review the response.
END
Updated 10 days ago