{
	"info": {
		"_postman_id": "7c0a2beb-5f13-4ac7-a353-fa27513c73f3",
		"name": "BBL Sandbox API - App2App",
		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
		"_exporter_id": "31445597",
		"_collection_link": "https://planetary-sunset-338525.postman.co/workspace/BBL-Projects~ab5a354a-2bd4-495d-8502-52b6b96a65dd/collection/31445597-7c0a2beb-5f13-4ac7-a353-fa27513c73f3?action=share&source=collection_link&creator=31445597"
	},
	"item": [
		{
			"name": "[OAuth] access token",
			"request": {
				"auth": {
					"type": "basic",
					"basic": [
						{
							"key": "password",
							"value": "<<appSecret from DevPortal>>",
							"type": "string"
						},
						{
							"key": "username",
							"value": "<<appKey from DevPortal>>",
							"type": "string"
						}
					]
				},
				"method": "POST",
				"header": [
					{
						"key": "Authorization",
						"value": "",
						"type": "text",
						"disabled": true
					}
				],
				"body": {
					"mode": "urlencoded",
					"urlencoded": [
						{
							"key": "grant_type",
							"value": "client_credentials",
							"type": "text"
						},
						{
							"key": "scope",
							"value": "CREATE READ",
							"type": "text"
						},
						{
							"key": "scope",
							"value": "",
							"type": "text",
							"disabled": true
						}
					]
				},
				"url": {
					"raw": "https://api-sandbox.bangkokbank.com/oauth/accesstoken",
					"protocol": "https",
					"host": [
						"api-sandbox",
						"bangkokbank",
						"com"
					],
					"path": [
						"oauth",
						"accesstoken"
					]
				}
			},
			"response": []
		},
		{
			"name": "[App2App] Payment-Request",
			"request": {
				"auth": {
					"type": "bearer",
					"bearer": [
						{
							"key": "token",
							"value": "<<your access token>>",
							"type": "string"
						}
					]
				},
				"method": "POST",
				"header": [
					{
						"key": "Signature",
						"value": "<<generate signature from jwt utility api>>",
						"type": "text"
					}
				],
				"body": {
					"mode": "raw",
					"raw": "{\n    \"transType\": \"APP2APP\",\n    \"serviceCode\": \"BBLSANDBOX\",\n    \"billerId\": \"111222333456789\",  // <<Get from dev portal after create apps>>\n    \"reference1\": \"1124579998\",\n    \"reference2\": \"78897\",\n    \"shippingFee\": 300.01,\n    \"totalAmount\": 250111111.01,\n    \"shopName\": \"shopNameTest\",\n    \"shopImage\": \"UE5HDQoaCgAAAA1JSERSAAAAGAAAABgIBAAAAEp+cwAAAARnQU1BAAALYQUAAAAgY0hSTQAAeiYAAAAAAAAAAAB1MAAAYAAAOgAAF3BRPAAAAAJiS0dEAAAjMgAAAAlwSFlzAAAOAAAOASsOGwAAAAd0SU1FBwQTBTAHAAABPklEQVQ4L0xbURQPDShUEzJDMhQTAGokEwVDJkkwWzIzRUItMDEgOGpqNmAwZitZdxARXmsaSHNzXjoKcU9GcEcmQiUqQghiKS8DKlZcFjo2bAhtCVk/WxIVKypCb0I4N2kJUnxwUiRYEHERahwIQit0fUUGD3VrYUcITWkQLGsKbWpXPl81TDFsL01lVRNAQQsORksaGHMvPDBPHUh2XXt3AWEjCgAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxOS0wNC0xOVQwMzo0ODowNyswMjowMBZ8AAAAJXRFWHRkYXRlOm1vZGlmeQAyMDE5LTA0LTE5VDAzOjQ4OjA3KzAyOjAwZ3EAAAAZdEVYdFNvZnR3YXJlAHd3dy5pbmtzY2FwZS5vcmc8GgAAAABJRU5EQmA=\",\n    \"osPlatform\": \"ANDROID\",\n    \"currencyCode\": \"THB\",\n    \"partnerAppUrl\": \"com.bangkokbank.mobilepartnersandbox://payment\",\n    \"buyerName\": \"TestBuyerName\",\n    \"additionalInfo\": [\n        {\n            \"Name\": \"TESTNAME1\",\n            \"Value\": \"TESTVALUE\"\n        },\n        {\n            \"Name\": \"TESTNAME2\",\n            \"Value\": \"TESTVALUE\"\n        }\n    ]\n}",
					"options": {
						"raw": {
							"language": "json"
						}
					}
				},
				"url": {
					"raw": "https://api-sandbox.bangkokbank.com/apptoapp/v1/paymentinitiation/payment-requests",
					"protocol": "https",
					"host": [
						"api-sandbox",
						"bangkokbank",
						"com"
					],
					"path": [
						"apptoapp",
						"v1",
						"paymentinitiation",
						"payment-requests"
					]
				}
			},
			"response": []
		},
		{
			"name": "[App2App] Get-Payment-Result",
			"request": {
				"auth": {
					"type": "bearer",
					"bearer": [
						{
							"key": "token",
							"value": "<<your access token>>",
							"type": "string"
						}
					]
				},
				"method": "GET",
				"header": [
					{
						"key": "Authorization",
						"value": "",
						"type": "text",
						"disabled": true
					}
				],
				"url": {
					"raw": "https://api-sandbox.bangkokbank.com/apptoapp/v1/paymentinitiation/payment-requests/8312B322-F8E4-4A12-99B5-191B9C4DF4BA",
					"protocol": "https",
					"host": [
						"api-sandbox",
						"bangkokbank",
						"com"
					],
					"path": [
						"apptoapp",
						"v1",
						"paymentinitiation",
						"payment-requests",
						"8312B322-F8E4-4A12-99B5-191B9C4DF4BA"
					]
				}
			},
			"response": []
		},
		{
			"name": "[Notification] Type:AppToApp",
			"request": {
				"auth": {
					"type": "basic",
					"basic": [
						{
							"key": "password",
							"value": "BBL_Sandbox",
							"type": "string"
						},
						{
							"key": "username",
							"value": "bbl-sandbox",
							"type": "string"
						}
					]
				},
				"method": "POST",
				"header": [
					{
						"key": "Signature",
						"value": "<<generate signature from jwt utility api>>",
						"type": "text"
					}
				],
				"body": {
					"mode": "raw",
					"raw": "{\n    \"type\": \"AppToApp\",\n    \"data\": {\n        \"serviceCode\": \"BBLSANDBOX\",\n        \"billerId\": \"111222333456789\",   // <<Get from dev portal after create apps>>\n        \"reference1\": \"1124579998112\",\n        \"reference2\": \"22555347AB\",\n        \"totalAmount\": \"999999999.01\",\n        \"currencyCode\": \"THB\",\n        \"paymentStatus\": \"success\",\n        \"paymentAccount\": \"xxx-x-x0055-x\",\n        \"paymentDateTime\": \"2017-02-15T15:23:11.001+07:00\",\n        \"paymentReferenceID\": \"123456\",\n        \"slipImage\": \"iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==\"\n    }\n}",
					"options": {
						"raw": {
							"language": "json"
						}
					}
				},
				"url": {
					"raw": "https://api-sandbox.bangkokbank.com/notification/v1",
					"protocol": "https",
					"host": [
						"api-sandbox",
						"bangkokbank",
						"com"
					],
					"path": [
						"notification",
						"v1"
					]
				}
			},
			"response": []
		},
		{
			"name": "[JWTGenerator] Payment Request, Payment Result",
			"request": {
				"auth": {
					"type": "bearer",
					"bearer": [
						{
							"key": "token",
							"value": "<<your access token>>",
							"type": "string"
						}
					]
				},
				"method": "POST",
				"header": [],
				"body": {
					"mode": "raw",
					"raw": "{\n    \"transType\": \"APP2APP\",\n    \"serviceCode\": \"BBLSANDBOX\",\n    \"billerId\": \"111222333456789\",  // <<Get from dev portal after create apps>>\n    \"reference1\": \"1124579998\",\n    \"reference2\": \"78897\",\n    \"shippingFee\": 300.01,\n    \"totalAmount\": 250111111.01,\n    \"shopName\": \"shopNameTest\",\n    \"shopImage\": \"UE5HDQoaCgAAAA1JSERSAAAAGAAAABgIBAAAAEp+cwAAAARnQU1BAAALYQUAAAAgY0hSTQAAeiYAAAAAAAAAAAB1MAAAYAAAOgAAF3BRPAAAAAJiS0dEAAAjMgAAAAlwSFlzAAAOAAAOASsOGwAAAAd0SU1FBwQTBTAHAAABPklEQVQ4L0xbURQPDShUEzJDMhQTAGokEwVDJkkwWzIzRUItMDEgOGpqNmAwZitZdxARXmsaSHNzXjoKcU9GcEcmQiUqQghiKS8DKlZcFjo2bAhtCVk/WxIVKypCb0I4N2kJUnxwUiRYEHERahwIQit0fUUGD3VrYUcITWkQLGsKbWpXPl81TDFsL01lVRNAQQsORksaGHMvPDBPHUh2XXt3AWEjCgAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxOS0wNC0xOVQwMzo0ODowNyswMjowMBZ8AAAAJXRFWHRkYXRlOm1vZGlmeQAyMDE5LTA0LTE5VDAzOjQ4OjA3KzAyOjAwZ3EAAAAZdEVYdFNvZnR3YXJlAHd3dy5pbmtzY2FwZS5vcmc8GgAAAABJRU5EQmA=\",\n    \"osPlatform\": \"ANDROID\",\n    \"currencyCode\": \"THB\",\n    \"partnerAppUrl\": \"com.bangkokbank.mobilepartnersandbox://payment\",\n    \"buyerName\": \"TestBuyerName\",\n    \"additionalInfo\": [\n        {\n            \"Name\": \"TESTNAME1\",\n            \"Value\": \"TESTVALUE\"\n        },\n        {\n            \"Name\": \"TESTNAME2\",\n            \"Value\": \"TESTVALUE\"\n        }\n    ]\n}",
					"options": {
						"raw": {
							"language": "json"
						}
					}
				},
				"url": {
					"raw": "https://api-sandbox.bangkokbank.com/jwt/partner",
					"protocol": "https",
					"host": [
						"api-sandbox",
						"bangkokbank",
						"com"
					],
					"path": [
						"jwt",
						"partner"
					]
				}
			},
			"response": []
		},
		{
			"name": "[JWTGenerator] Payment Notification",
			"request": {
				"auth": {
					"type": "bearer",
					"bearer": [
						{
							"key": "token",
							"value": "<<your access token>>",
							"type": "string"
						}
					]
				},
				"method": "POST",
				"header": [
					{
						"key": "Transmit-Date-Time",
						"value": "2017-03-15T15:23:11.001+07:00",
						"type": "text"
					},
					{
						"key": "Request-Ref",
						"value": "d849f8-f6c1-11ec-b939-0242ac120002",
						"type": "text"
					},
					{
						"key": "Authorization",
						"value": "",
						"type": "text",
						"disabled": true
					}
				],
				"body": {
					"mode": "raw",
					"raw": "{\n    \"type\": \"AppToApp\",\n    \"data\": {\n        \"serviceCode\": \"BBLSANDBOX\",\n        \"billerId\": \"111222333456789\",   // <<Get from dev portal after create apps>>\n        \"reference1\": \"1124579998112\",\n        \"reference2\": \"22555347AB\",\n        \"totalAmount\": \"999999999.01\",\n        \"currencyCode\": \"THB\",\n        \"paymentStatus\": \"success\",\n        \"paymentAccount\": \"xxx-x-x0055-x\",\n        \"paymentDateTime\": \"2017-02-15T15:23:11.001+07:00\",\n        \"paymentReferenceID\": \"123456\",\n        \"slipImage\": \"iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==\"\n    }\n}",
					"options": {
						"raw": {
							"language": "json"
						}
					}
				},
				"url": {
					"raw": "https://api-sandbox.bangkokbank.com/jwt/bbl",
					"protocol": "https",
					"host": [
						"api-sandbox",
						"bangkokbank",
						"com"
					],
					"path": [
						"jwt",
						"bbl"
					]
				}
			},
			"response": []
		}
	]
}