{
	"info": {
		"_postman_id": "090471fc-7ccf-417a-9545-45471f79bf4e",
		"name": "BBL Sandbox API - ThaiQR",
		"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-090471fc-7ccf-417a-9545-45471f79bf4e?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": "[JWT Generator] QR-Generation",
			"event": [
				{
					"listen": "prerequest",
					"script": {
						"exec": [
							"pm.collectionVariables.unset(\"request-ref\");",
							"pm.collectionVariables.unset(\"reference1\");",
							"",
							"const moment = require('moment');",
							"",
							"pm.collectionVariables.set(\"request-ref\", moment().format(\"yyyyMMDDHHmmss\"));",
							"pm.collectionVariables.set(\"reference1\", moment().format(\"yyyyMMDDHHmmss01\"));",
							"pm.collectionVariables.set(\"requestDate\", moment().format(\"yyyy-MM-DD\"));",
							"pm.collectionVariables.set(\"requestTime\", moment().format(\"HH:mm:ss\"));",
							"pm.collectionVariables.set(\"transmit-date-time\", moment().format(\"yyyy-MM-DDTHH:mm:ss.855+07:00\"));"
						],
						"type": "text/javascript",
						"packages": {}
					}
				},
				{
					"listen": "test",
					"script": {
						"exec": [
							"pm.test(\"Response body is JSON\", function () {",
							"    pm.test(\"Status code is 200\", function () {",
							"        pm.response.to.have.status(200);",
							"    });",
							"    let response = pm.response.json();",
							"    pm.collectionVariables.set(\"partner_signature\", response.signature);",
							"});"
						],
						"type": "text/javascript",
						"packages": {}
					}
				}
			],
			"request": {
				"auth": {
					"type": "bearer",
					"bearer": [
						{
							"key": "token",
							"value": "<<your access token>>",
							"type": "string"
						}
					]
				},
				"method": "POST",
				"header": [
					{
						"key": "Authorization",
						"value": "",
						"type": "text",
						"disabled": true
					}
				],
				"body": {
					"mode": "raw",
					"raw": "{\n    \"requestDate\": \"2024-09-05\",\n    \"requestTime\": \"17:30:00\",\n    \"merchantCountry\": \"TH\",\n    \"merchantName\": \"ABC SHOP\",\n    \"amount\": \"1.20\",\n    \"cardNetworkPermList\": \n    [\n      {\n        \"cardNetworkPerm\": \"01\"\n      }\n    ],\n    \"qrPromptpayInfo\": {\n        \"billerId\": \"112233445566778\",  // <<Get from dev portal after create apps>>\n        \"reference1\": \"000002205500101\",\n        \"reference2\": \"1234567890\",\n        \"reference3\": \"1234567891\"\n    },\n    \"extra1\": \"Remark1\",\n    \"extra2\": \"Remark2\"\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": "[ThaiQR] QR-Generation",
			"event": [
				{
					"listen": "prerequest",
					"script": {
						"exec": [
							""
						],
						"type": "text/javascript",
						"packages": {}
					}
				},
				{
					"listen": "test",
					"script": {
						"exec": [
							"pm.test(\"Response body is JSON\", function () {",
							"    pm.response.to.be.json;",
							"    pm.test(\"Status code is 200\", function () {",
							"        pm.response.to.have.status(200);",
							"    });",
							"    pm.test(\"Body contains string\",() => {",
							"        let jsonData = pm.response.json()",
							"        pm.expect(jsonData.responseCode).to.include(\"000\");",
							"        pm.expect(jsonData.responseMesg).to.include(\"Success\");",
							"    });",
							"    let response = pm.response.json();",
							"    pm.collectionVariables.set(\"qrCodeId\", response.data.qrCodeId);",
							"});",
							"setTimeout(function(){}, 1000);"
						],
						"type": "text/javascript",
						"packages": {}
					}
				}
			],
			"request": {
				"auth": {
					"type": "bearer",
					"bearer": [
						{
							"key": "token",
							"value": "<<your access token>>",
							"type": "string"
						}
					]
				},
				"method": "POST",
				"header": [
					{
						"key": "Signature",
						"value": "<<generated signature>>",
						"type": "text"
					},
					{
						"key": "Transmit-Date-Time",
						"value": "2024-09-05T17:30:00.001+07:00",
						"type": "text"
					},
					{
						"key": "Request-Ref",
						"value": "d849f8-f6c1-11ec-b939-0242ac120002",
						"type": "text"
					},
					{
						"key": "Origin",
						"value": "http://something.com",
						"type": "text"
					}
				],
				"body": {
					"mode": "raw",
					"raw": "{\n    \"requestDate\": \"2024-09-05\",\n    \"requestTime\": \"17:30:00\",\n    \"merchantCountry\": \"TH\",\n    \"merchantName\": \"ABC SHOP\",\n    \"amount\": \"1.20\",\n    \"cardNetworkPermList\": \n    [\n      {\n        \"cardNetworkPerm\": \"01\"\n      }\n    ],\n    \"qrPromptpayInfo\": {\n        \"billerId\": \"112233445566778\",   // <<Get from dev portal after create apps>>\n        \"reference1\": \"000002205500101\",\n        \"reference2\": \"1234567890\",\n        \"reference3\": \"1234567891\"\n    },\n    \"extra1\": \"Remark1\",\n    \"extra2\": \"Remark2\"\n}",
					"options": {
						"raw": {
							"language": "json"
						}
					}
				},
				"url": {
					"raw": "https://api-sandbox.bangkokbank.com/biller/v1/qr-generate",
					"protocol": "https",
					"host": [
						"api-sandbox",
						"bangkokbank",
						"com"
					],
					"path": [
						"biller",
						"v1",
						"qr-generate"
					]
				}
			},
			"response": []
		},
		{
			"name": "[JWTGenerator] Verify,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\": \"SmartBill\",\n    \"data\": {\n        \"billerId\": \"123456789012345\",  // <<Get from dev portal after create apps>>\n        \"reference1\": \"1124579998112\",\n        \"reference2\": \"22555347AB\",\n        \"reference3\": \"20171106151550\",\n        \"payeeId\": \"1234567890123\",\n        \"transDate\": \"2017-11-16\",\n        \"transTime\": \"17:50:50\",\n        \"transRef\": \"100999123456789\",\n        \"channel\": \"C\",\n        \"termId\": \"010125\",\n        \"amount\": \"999999999.01\",\n        \"fromBank\": \"002\",\n        \"fromBranch\": \"0147\",\n        \"fromName\": \"ABCD\",\n        \"bankRef\": \"BBL\",\n        \"approvalCode\": \"EXAMPL\",\n        \"txnType\": \"C\",\n        \"retryFlag\": \"Y\"\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": []
		},
		{
			"name": "[ThaiQR] QR-Verify",
			"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": "<<generated signature>>",
						"type": "text"
					}
				],
				"body": {
					"mode": "raw",
					"raw": "{\n    \"billerId\": \"112233445566778\",  // <<Get from dev portal after create apps>>\n    \"transDate\": \"2022-05-30\",\n    \"transTime\": \"12:30:32\",\n    \"amount\": \"12345.01\",\n    \"reference1\": \"PARTNERREF1\",\n    \"reference2\": \"PARTNERREF2\",\n    \"reference3\": \"PARTNERREF3\"\n}",
					"options": {
						"raw": {
							"language": "json"
						}
					}
				},
				"url": {
					"raw": "https://api-sandbox.bangkokbank.com/biller/v1/qr-verify",
					"protocol": "https",
					"host": [
						"api-sandbox",
						"bangkokbank",
						"com"
					],
					"path": [
						"biller",
						"v1",
						"qr-verify"
					]
				}
			},
			"response": []
		},
		{
			"name": "[Notification] Type:ThaiQR",
			"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": "<<generated signature>>",
						"type": "text"
					},
					{
						"key": "Authorization",
						"value": "Basic dGhpc2lzdXNlcm5hbWU6dGhpc2lzcGFzc3dvcmQ=",
						"type": "text",
						"disabled": true
					}
				],
				"body": {
					"mode": "raw",
					"raw": "{\n    \"type\": \"ThaiQR\",\n    \"data\": {\n        \"providerId\": \"BBLSANDBOX\",\n        \"billerId\": \"123456789012345\",  // <<Get from dev portal after create apps>>\n        \"reference1\": \"1124579998112\",\n        \"reference2\": \"22555347AB\",\n        \"reference3\": \"20171106151550\",\n        \"transDate\": \"2017-11-16\",\n        \"transTime\": \"17:50:50\",\n        \"termType\": \"80\",\n        \"amount\": \"999999999.01\",\n        \"fromBank\": \"002\",\n        \"fromBranch\": \"0147\",\n        \"fromName\": \"ABCD\",\n        \"bankRef\": \"BBL\",\n        \"approvalCode\": \"EXAMPL\",\n        \"retryFlag\": \"Y\"\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": "[JWT Generator] QR-Inquiry",
			"event": [
				{
					"listen": "prerequest",
					"script": {
						"exec": [
							"//pm.collectionVariables.unset(\"request-ref\");",
							"//pm.collectionVariables.unset(\"reference1\");",
							"",
							"const moment = require('moment');",
							"",
							"//pm.collectionVariables.set(\"request-ref\", moment().format(\"yyyyMMDDHHmmss\"));",
							"//pm.collectionVariables.set(\"reference1\", moment().format(\"yyyyMMDDHHmmss01\"));",
							"//pm.collectionVariables.set(\"requestDate\", moment().format(\"yyyy-MM-DD\"));",
							"//pm.collectionVariables.set(\"requestTime\", moment().format(\"HH:mm:ss\"));",
							"//pm.collectionVariables.set(\"transmit-date-time\", moment().format(\"yyyy-MM-DDTHH:mm:ss.855+07:00\"));"
						],
						"type": "text/javascript",
						"packages": {}
					}
				},
				{
					"listen": "test",
					"script": {
						"exec": [
							"let response = pm.response.json();",
							"pm.collectionVariables.set(\"partner_signature\", response.signature);"
						],
						"type": "text/javascript",
						"packages": {}
					}
				}
			],
			"request": {
				"auth": {
					"type": "bearer",
					"bearer": [
						{
							"key": "token",
							"value": "<<your access token>>",
							"type": "string"
						}
					]
				},
				"method": "POST",
				"header": [
					{
						"key": "Authorization",
						"value": "",
						"type": "text",
						"disabled": true
					}
				],
				"body": {
					"mode": "raw",
					"raw": "{\n    \"billerId\": \"123456789012301\",  // <<Get from dev portal after create apps>>\n    \"transDate\": \"2024-02-22\",\n    \"transTime\": \"15:23:11\",\n    \"amount\": \"500.00\",\n    \"reference1\": \"MOCK9999999991\",\n    \"reference2\": \"120213405T\",\n    \"reference3\": \"120213405Y\"\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": "[ThaiQR] QR-Inquiry",
			"event": [
				{
					"listen": "prerequest",
					"script": {
						"exec": [
							""
						],
						"type": "text/javascript",
						"packages": {}
					}
				},
				{
					"listen": "test",
					"script": {
						"exec": [
							"pm.test(\"Response body is JSON\", function () {",
							"    pm.response.to.be.json;",
							"",
							"    pm.test(\"Status code is 200\", function () {",
							"        pm.response.to.have.status(200);",
							"    });",
							"",
							"    pm.test(\"Schema is valid\",() => {",
							"        const schema = {",
							"            type: 'object',",
							"            properties: {",
							"                responseCode: {",
							"                    type: 'string'",
							"                },",
							"                responseMesg: {",
							"                    type: 'string'",
							"                },",
							"                data: {",
							"                        qrCodeId: {",
							"                            type: 'string'",
							"                        },",
							"                        qrReference: {",
							"                            type: 'string'",
							"                        },",
							"                        qrData: {",
							"                            type: 'string'",
							"                        }",
							"                }",
							"            }",
							"        };",
							"        pm.response.to.have.jsonSchema(schema);",
							"    });",
							"    let response = pm.response.json();",
							"    pm.collectionVariables.set(\"qrCodeId\", response.data.qrCodeId);",
							"});"
						],
						"type": "text/javascript",
						"packages": {}
					}
				}
			],
			"protocolProfileBehavior": {
				"disabledSystemHeaders": {}
			},
			"request": {
				"auth": {
					"type": "bearer",
					"bearer": [
						{
							"key": "token",
							"value": "<<your access token>>",
							"type": "string"
						}
					]
				},
				"method": "POST",
				"header": [
					{
						"key": "Signature",
						"value": "<<generated signature>>"
					},
					{
						"key": "Transmit-Date-Time",
						"value": "2024-09-05T17:30:00.001+07:00"
					},
					{
						"key": "Request-Ref",
						"value": "d849f8-f6c1-11ec-b939-0242ac120002"
					},
					{
						"key": "Origin",
						"value": "http://something.com"
					},
					{
						"key": "apiLog",
						"value": "off",
						"disabled": true
					},
					{
						"key": "Accept-Encoding",
						"value": "gzip, deflate",
						"type": "text",
						"disabled": true
					}
				],
				"body": {
					"mode": "raw",
					"raw": "{\n    \"billerId\": \"123456789012301\",  // <<Get from dev portal after create apps>>\n    \"transDate\": \"2024-02-22\",\n    \"transTime\": \"15:23:11\",\n    \"amount\": \"500.00\",\n    \"reference1\": \"MOCK9999999991\",\n    \"reference2\": \"120213405T\",\n    \"reference3\": \"120213405Y\"\n}",
					"options": {
						"raw": {
							"language": "json"
						}
					}
				},
				"url": {
					"raw": "https://api-sandbox.bangkokbank.com/biller/v1/qr-inquiry",
					"protocol": "https",
					"host": [
						"api-sandbox",
						"bangkokbank",
						"com"
					],
					"path": [
						"biller",
						"v1",
						"qr-inquiry"
					]
				}
			},
			"response": []
		},
		{
			"name": "[JWT Generator] Payment-Inquiry",
			"event": [
				{
					"listen": "prerequest",
					"script": {
						"exec": [
							""
						],
						"type": "text/javascript",
						"packages": {}
					}
				},
				{
					"listen": "test",
					"script": {
						"exec": [
							"let response = pm.response.json();",
							"pm.collectionVariables.set(\"partner_signature\", response.signature);",
							""
						],
						"type": "text/javascript",
						"packages": {}
					}
				}
			],
			"request": {
				"auth": {
					"type": "bearer",
					"bearer": [
						{
							"key": "token",
							"value": "<<your access token>>",
							"type": "string"
						}
					]
				},
				"method": "POST",
				"header": [
					{
						"key": "Authorization",
						"value": "",
						"type": "text",
						"disabled": true
					}
				],
				"body": {
					"mode": "raw",
					"raw": "{\n    \"inquiryDate\": \"2024-09-05\",\n    \"inquiryTime\": \"17:30:00\",\n    \"amount\": \"1.27\",\n    \"qrCodeId\": \"ca9777ae4ee6c63d5811\",\n    \"qrPromptpayInfo\": {\n        \"billerId\": \"112233445566778\",  // <<Get from dev portal after create apps>>\n        \"reference1\": \"000002205500101\"\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": "[ThaiQR] Payment-Inquiry",
			"event": [
				{
					"listen": "test",
					"script": {
						"exec": [
							"pm.test(\"Status code is 200\", function () {",
							"    pm.response.to.have.status(200);",
							"});",
							"pm.test(\"Body contains string\",() => {",
							"    let jsonData = pm.response.json()",
							"    pm.expect(jsonData.data.statusMesg).to.include(\"PAID\");",
							"    pm.expect(jsonData.data.cardNetworkCode).to.include(\"01\");",
							"    pm.expect(jsonData.data.qrPromptpayInfo.termType).to.include(\"10\");",
							"    pm.expect(jsonData.data.qrPromptpayInfo.fromBank).to.include(\"BBL\");",
							"    pm.expect(jsonData.data.qrCardInfo).not.exist",
							"});"
						],
						"type": "text/javascript",
						"packages": {}
					}
				}
			],
			"request": {
				"auth": {
					"type": "bearer",
					"bearer": [
						{
							"key": "token",
							"value": "<<your access token>>",
							"type": "string"
						}
					]
				},
				"method": "POST",
				"header": [
					{
						"key": "Signature",
						"value": "<<generated signature>>",
						"type": "text"
					},
					{
						"key": "Transmit-Date-Time",
						"value": "2024-09-05T17:30:00.001+07:00",
						"type": "text"
					},
					{
						"key": "Request-Ref",
						"value": "d849f8-f6c1-11ec-b939-0242ac120002",
						"type": "text"
					},
					{
						"key": "Origin",
						"value": "http://something.com",
						"type": "text"
					},
					{
						"key": "delay",
						"value": "200",
						"type": "text",
						"disabled": true
					},
					{
						"key": "mockup",
						"value": "true",
						"type": "text",
						"disabled": true
					}
				],
				"body": {
					"mode": "raw",
					"raw": "{\n    \"inquiryDate\": \"2024-09-05\",\n    \"inquiryTime\": \"17:30:00\",\n    \"amount\": \"1.27\",\n    \"qrCodeId\": \"ca9777ae4ee6c63d5811\",\n    \"qrPromptpayInfo\": {\n        \"billerId\": \"112233445566778\",      // <<Get from dev portal after create apps>>\n        \"reference1\": \"000002205500101\"\n    }\n}",
					"options": {
						"raw": {
							"language": "json"
						}
					}
				},
				"url": {
					"raw": "https://api-sandbox.bangkokbank.com/biller/v1/payment-inquiry",
					"protocol": "https",
					"host": [
						"api-sandbox",
						"bangkokbank",
						"com"
					],
					"path": [
						"biller",
						"v1",
						"payment-inquiry"
					]
				}
			},
			"response": []
		},
		{
			"name": "[JWT Generator] Refund Verification",
			"event": [
				{
					"listen": "prerequest",
					"script": {
						"exec": [
							""
						],
						"type": "text/javascript",
						"packages": {}
					}
				},
				{
					"listen": "test",
					"script": {
						"exec": [
							"let response = pm.response.json();",
							"pm.collectionVariables.set(\"partner_signature\", response.signature);"
						],
						"type": "text/javascript",
						"packages": {}
					}
				}
			],
			"request": {
				"auth": {
					"type": "bearer",
					"bearer": [
						{
							"key": "token",
							"value": "<<your access token>>",
							"type": "string"
						}
					]
				},
				"method": "POST",
				"header": [
					{
						"key": "Authorization",
						"value": "",
						"type": "text",
						"disabled": true
					}
				],
				"body": {
					"mode": "raw",
					"raw": "{\n    \"transDate\": \"2024-09-05\",\n    \"transTime\": \"17:30:00\",\n    \"amount\": \"1.15\",\n    \"approvalCode\": \"c13882\",\n    \"cardNetworkCode\": \"01\",\n    \"qrPromptpayInfo\": {\n        \"billerId\": \"112233445566778\",  // <<Get from dev portal after create apps>>\n        \"reference1\": \"000002205500101\"\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": "[ThaiQR] Refund Verification",
			"event": [
				{
					"listen": "test",
					"script": {
						"exec": [
							"pm.test(\"Response body is JSON\", function () {",
							"    pm.response.to.be.json;",
							"    pm.test(\"Status code is 200\", function () {",
							"        pm.response.to.have.status(200);",
							"    });",
							"    pm.test(\"Body contains string\",() => {",
							"        let jsonData = pm.response.json()",
							"        pm.expect(jsonData.responseCode).to.include(\"000\");",
							"        pm.expect(jsonData.responseMesg).to.include(\"Success\");",
							"        pm.expect(jsonData.data.transactionId).exist;",
							"    });",
							"});"
						],
						"type": "text/javascript",
						"packages": {}
					}
				}
			],
			"request": {
				"auth": {
					"type": "bearer",
					"bearer": [
						{
							"key": "token",
							"value": "<<your access token>>",
							"type": "string"
						}
					]
				},
				"method": "POST",
				"header": [
					{
						"key": "Signature",
						"value": "<<generated signature>>",
						"type": "text"
					},
					{
						"key": "Transmit-Date-Time",
						"value": "2024-09-05T17:30:00.001+07:00",
						"type": "text"
					},
					{
						"key": "Request-Ref",
						"value": "d849f8-f6c1-11ec-b939-0242ac120002",
						"type": "text"
					},
					{
						"key": "Origin",
						"value": "http://something.com",
						"type": "text"
					},
					{
						"key": "delay",
						"value": "200",
						"type": "text",
						"disabled": true
					},
					{
						"key": "mockup",
						"value": "true",
						"type": "text",
						"disabled": true
					}
				],
				"body": {
					"mode": "raw",
					"raw": "{\n    \"transDate\": \"2024-09-05\",\n    \"transTime\": \"17:30:00\",\n    \"amount\": \"1.15\",\n    \"approvalCode\": \"c13882\",\n    \"cardNetworkCode\": \"01\",\n    \"qrPromptpayInfo\": {\n        \"billerId\": \"112233445566778\",  // <<Get from dev portal after create apps>>\n        \"reference1\": \"000002205500101\"\n    }\n}",
					"options": {
						"raw": {
							"language": "json"
						}
					}
				},
				"url": {
					"raw": "https://api-sandbox.bangkokbank.com/biller/v1/refund/verification",
					"protocol": "https",
					"host": [
						"api-sandbox",
						"bangkokbank",
						"com"
					],
					"path": [
						"biller",
						"v1",
						"refund",
						"verification"
					]
				}
			},
			"response": []
		},
		{
			"name": "[JWT Generator] Refund Reversal",
			"event": [
				{
					"listen": "prerequest",
					"script": {
						"exec": [
							""
						],
						"type": "text/javascript",
						"packages": {}
					}
				},
				{
					"listen": "test",
					"script": {
						"exec": [
							"let response = pm.response.json();",
							"pm.collectionVariables.set(\"partner_signature\", response.signature);"
						],
						"type": "text/javascript",
						"packages": {}
					}
				}
			],
			"request": {
				"auth": {
					"type": "bearer",
					"bearer": [
						{
							"key": "token",
							"value": "<<your access token>>",
							"type": "string"
						}
					]
				},
				"method": "POST",
				"header": [
					{
						"key": "Authorization",
						"value": "",
						"type": "text",
						"disabled": true
					}
				],
				"body": {
					"mode": "raw",
					"raw": "{\n    \"transDate\": \"2024-09-05\",\n    \"transTime\": \"17:30:00\",\n    \"amount\": \"1.20\",\n    \"approvalCode\": \"c13882\",\n    \"cardNetworkCode\": \"01\",\n    \"qrPromptpayInfo\": {\n        \"billerId\": \"112233445566778\",  // <<Get from dev portal after create apps>>\n        \"reference1\": \"000002205500101\",\n        \"reference2\":\"REF1002\",\n        \"reference3\":\"REF1003\"\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": "[ThaiQR] Refund Reversal",
			"event": [
				{
					"listen": "test",
					"script": {
						"exec": [
							"pm.test(\"Response body is JSON\", function () {",
							"    pm.response.to.be.json;",
							"    pm.test(\"Status code is 200\", function () {",
							"        pm.response.to.have.status(200);",
							"    });",
							"    pm.test(\"Body contains string\",() => {",
							"        let jsonData = pm.response.json()",
							"        pm.expect(jsonData.responseCode).to.include(\"000\");",
							"        pm.expect(jsonData.responseMesg).to.include(\"Success\");",
							"        pm.expect(jsonData.data.transactionId).exist;",
							"    });",
							"});"
						],
						"type": "text/javascript",
						"packages": {}
					}
				}
			],
			"request": {
				"auth": {
					"type": "bearer",
					"bearer": [
						{
							"key": "token",
							"value": "<<your access token>>",
							"type": "string"
						}
					]
				},
				"method": "POST",
				"header": [
					{
						"key": "Signature",
						"value": "<<generated signature>>",
						"type": "text"
					},
					{
						"key": "Transmit-Date-Time",
						"value": "2024-09-05T17:30:00.001+07:00",
						"type": "text"
					},
					{
						"key": "Request-Ref",
						"value": "d849f8-f6c1-11ec-b939-0242ac120002",
						"type": "text"
					},
					{
						"key": "Origin",
						"value": "http://something.com",
						"type": "text"
					},
					{
						"key": "delay",
						"value": "200",
						"type": "text",
						"disabled": true
					},
					{
						"key": "mockup",
						"value": "true",
						"type": "text",
						"disabled": true
					}
				],
				"body": {
					"mode": "raw",
					"raw": "{\n    \"transDate\": \"2024-09-05\",\n    \"transTime\": \"17:30:00\",\n    \"amount\": \"1.20\",\n    \"approvalCode\": \"c13882\",\n    \"cardNetworkCode\": \"01\",\n    \"qrPromptpayInfo\": {\n        \"billerId\": \"112233445566778\",  // <<Get from dev portal after create apps>>\n        \"reference1\": \"000002205500101\",\n        \"reference2\":\"REF1002\",\n        \"reference3\":\"REF1003\"\n    }\n}",
					"options": {
						"raw": {
							"language": "json"
						}
					}
				},
				"url": {
					"raw": "https://api-sandbox.bangkokbank.com/biller/v1/refund/reversal",
					"protocol": "https",
					"host": [
						"api-sandbox",
						"bangkokbank",
						"com"
					],
					"path": [
						"biller",
						"v1",
						"refund",
						"reversal"
					]
				}
			},
			"response": []
		},
		{
			"name": "[JWT Generator] Refund Advice",
			"event": [
				{
					"listen": "prerequest",
					"script": {
						"exec": [
							""
						],
						"type": "text/javascript",
						"packages": {}
					}
				},
				{
					"listen": "test",
					"script": {
						"exec": [
							"let response = pm.response.json();",
							"pm.collectionVariables.set(\"partner_signature\", response.signature);"
						],
						"type": "text/javascript",
						"packages": {}
					}
				}
			],
			"request": {
				"auth": {
					"type": "bearer",
					"bearer": [
						{
							"key": "token",
							"value": "<<your access token>>",
							"type": "string"
						}
					]
				},
				"method": "POST",
				"header": [
					{
						"key": "Authorization",
						"value": "",
						"type": "text",
						"disabled": true
					}
				],
				"body": {
					"mode": "raw",
					"raw": "{\n    \"transDate\": \"2024-09-05\",\n    \"transTime\": \"17:30:00\",\n    \"amount\": \"1.16\",\n    \"approvalCode\": \"c13882\",\n    \"cardNetworkCode\": \"01\",\n    \"qrPromptpayInfo\": {\n        \"billerId\": \"112233445566778\",  // <<Get from dev portal after create apps>>\n        \"reference1\": \"000002205500101\",\n        \"reference2\":\"REF1002\",\n        \"reference3\":\"REF1003\"\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": "[ThaiQR] Refund Advice",
			"event": [
				{
					"listen": "test",
					"script": {
						"exec": [
							"pm.test(\"Response body is JSON\", function () {",
							"    pm.response.to.be.json;",
							"    pm.test(\"Status code is 200\", function () {",
							"        pm.response.to.have.status(200);",
							"    });",
							"    pm.test(\"Body contains string\",() => {",
							"        let jsonData = pm.response.json()",
							"        pm.expect(jsonData.responseCode).to.include(\"000\");",
							"        pm.expect(jsonData.responseMesg).to.include(\"Success\");",
							"        pm.expect(jsonData.data.transactionId).exist;",
							"    });",
							"});"
						],
						"type": "text/javascript",
						"packages": {}
					}
				}
			],
			"request": {
				"auth": {
					"type": "bearer",
					"bearer": [
						{
							"key": "token",
							"value": "<<your access token>>",
							"type": "string"
						}
					]
				},
				"method": "POST",
				"header": [
					{
						"key": "Signature",
						"value": "<<generated signature>>",
						"type": "text"
					},
					{
						"key": "Transmit-Date-Time",
						"value": "2024-09-05T17:30:00.001+07:00",
						"type": "text"
					},
					{
						"key": "Request-Ref",
						"value": "d849f8-f6c1-11ec-b939-0242ac120002",
						"type": "text"
					},
					{
						"key": "Origin",
						"value": "http://something.com",
						"type": "text"
					},
					{
						"key": "delay",
						"value": "200",
						"type": "text",
						"disabled": true
					},
					{
						"key": "mockup",
						"value": "true",
						"type": "text",
						"disabled": true
					}
				],
				"body": {
					"mode": "raw",
					"raw": "{\n    \"transDate\": \"2024-09-05\",\n    \"transTime\": \"17:30:00\",\n    \"amount\": \"1.16\",\n    \"approvalCode\": \"c13882\",\n    \"cardNetworkCode\": \"01\",\n    \"qrPromptpayInfo\": {\n        \"billerId\": \"112233445566778\",  // <<Get from dev portal after create apps>>\n        \"reference1\": \"000002205500101\",\n        \"reference2\":\"REF1002\",\n        \"reference3\":\"REF1003\"\n    }\n}",
					"options": {
						"raw": {
							"language": "json"
						}
					}
				},
				"url": {
					"raw": "https://api-sandbox.bangkokbank.com/biller/v1/refund/advice",
					"protocol": "https",
					"host": [
						"api-sandbox",
						"bangkokbank",
						"com"
					],
					"path": [
						"biller",
						"v1",
						"refund",
						"advice"
					]
				}
			},
			"response": []
		},
		{
			"name": "[JWT Generator] Pull Payment",
			"event": [
				{
					"listen": "prerequest",
					"script": {
						"exec": [
							"pm.collectionVariables.unset(\"request-ref\");",
							"pm.collectionVariables.unset(\"reference1\");",
							"//pm.collectionVariables.unset(\"billerId\");",
							"",
							"const moment = require('moment');",
							"",
							"pm.collectionVariables.set(\"request-ref\", moment().format(\"yyyyMMDDHHmmss\"));",
							"pm.collectionVariables.set(\"reference1\", moment().format(\"yyyyMMDDHHmmss01\"));",
							"pm.collectionVariables.set(\"billerId-pullpayment\", \"010553609264199\");",
							"pm.collectionVariables.set(\"requestDate\", moment().format(\"yyyy-MM-DD\"));",
							"pm.collectionVariables.set(\"requestTime\", moment().format(\"HH:mm:ss\"));",
							"pm.collectionVariables.set(\"transmit-date-time\", moment().format(\"yyyy-MM-DDTHH:mm:ss.855+07:00\"));"
						],
						"type": "text/javascript",
						"packages": {}
					}
				},
				{
					"listen": "test",
					"script": {
						"exec": [
							"let response = pm.response.json();",
							"pm.collectionVariables.set(\"partner_signature\", response.signature);"
						],
						"type": "text/javascript",
						"packages": {}
					}
				}
			],
			"request": {
				"auth": {
					"type": "bearer",
					"bearer": [
						{
							"key": "token",
							"value": "<<your access token>>",
							"type": "string"
						}
					]
				},
				"method": "POST",
				"header": [
					{
						"key": "Authorization",
						"value": "",
						"type": "text",
						"disabled": true
					}
				],
				"body": {
					"mode": "raw",
					"raw": "{\n    \"billerId\": \"112233445566778\",  // <<Get from dev portal after create apps>>\n    \"destBank\": \"098\",\n    \"transRef\": \"325012011110IMF2063A57AB\",\n    \"reference1\": \"000002205500101\",\n    \"reference2\": \"4500990218052100001\",\n    \"reference3\": \"45009902\",\n    \"amount\": \"104.02\"\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": "[ThaiQR] Pull Payment",
			"event": [
				{
					"listen": "test",
					"script": {
						"exec": [
							"pm.test(\"Response body is JSON\", function () {",
							"    pm.response.to.be.json;",
							"",
							"    pm.test(\"Status code is 200\", function () {",
							"        pm.response.to.have.status(200);",
							"    });",
							"",
							"    pm.test(\"Schema is valid\",() => {",
							"        const schema = {",
							"            type: 'object',",
							"            properties: {",
							"                status: {",
							"                    code: {",
							"                        type: 'string'",
							"                    },",
							"                    message: {",
							"                    type: 'string'",
							"                    }",
							"                },",
							"                data: {",
							"                        transRef: {",
							"                            type: 'string'",
							"                        },",
							"                        sendingBank: {",
							"                            type: 'string'",
							"                        },",
							"                        receivingBank: {",
							"                            type: 'string'",
							"                        },",
							"                        transDate: {",
							"                            type: 'string'",
							"                        },",
							"                        transTime: {",
							"                            type: 'string'",
							"                        },",
							"                        amount: {",
							"                            type: 'string'",
							"                        },",
							"                        countryCode: {",
							"                            type: 'string'",
							"                        },",
							"                        ref1: {",
							"                            type: 'string'",
							"                        },",
							"                        ref2: {",
							"                            type: 'string'",
							"                        },",
							"                        ref3: {",
							"                            type: 'string'",
							"                        },",
							"                        sender: {",
							"                            displayName: {",
							"                                type: 'string'",
							"                            },",
							"                            name: {",
							"                                type: 'string' ",
							"                            }",
							"                        },",
							"                        proxy: {",
							"                            type: {",
							"                                type: 'string'",
							"                            },",
							"                            value: {",
							"                                type: 'string' ",
							"                            }",
							"                        },",
							"                        account: {",
							"                            type: {",
							"                                type: 'string'",
							"                            },",
							"                            value: {",
							"                                type: 'string' ",
							"                            }",
							"                        }",
							"                },",
							"                receiver: {",
							"                        displayName: {",
							"                            type: 'string'",
							"                        },",
							"                        proxy: {",
							"                            type: {",
							"                                type: 'string'",
							"                            },",
							"                            value: {",
							"                                type: 'string' ",
							"                            }",
							"                        },",
							"                        additionalProperties: false",
							"                },",
							"                additionalProperties: false",
							"            }",
							"        };",
							"        pm.response.to.have.jsonSchema(schema);",
							"    });",
							"    let response = pm.response.json();",
							"    pm.collectionVariables.set(\"qrCodeId\", response.data.qrCodeId);",
							"});"
						],
						"type": "text/javascript",
						"packages": {}
					}
				}
			],
			"request": {
				"auth": {
					"type": "bearer",
					"bearer": [
						{
							"key": "token",
							"value": "<<your access token>>",
							"type": "string"
						}
					]
				},
				"method": "POST",
				"header": [
					{
						"key": "Signature",
						"value": "<<generated signature>>",
						"type": "text"
					},
					{
						"key": "Transmit-Date-Time",
						"value": "2024-09-05T17:30:00.001+07:00",
						"type": "text"
					},
					{
						"key": "Request-Ref",
						"value": "d849f8-f6c1-11ec-b939-0242ac120002",
						"type": "text"
					},
					{
						"key": "Origin",
						"value": "http://something.com",
						"type": "text"
					}
				],
				"body": {
					"mode": "raw",
					"raw": "{\n    \"billerId\": \"112233445566778\",  // <<Get from dev portal after create apps>>\n    \"destBank\": \"098\",\n    \"transRef\": \"325012011110IMF2063A57AB\",\n    \"reference1\": \"000002205500101\",\n    \"reference2\": \"4500990218052100001\",\n    \"reference3\": \"45009902\",\n    \"amount\": \"104.02\"\n}",
					"options": {
						"raw": {
							"language": "json"
						}
					}
				},
				"url": {
					"raw": "https://api-sandbox.bangkokbank.com/biller/v1/pull-payment",
					"protocol": "https",
					"host": [
						"api-sandbox",
						"bangkokbank",
						"com"
					],
					"path": [
						"biller",
						"v1",
						"pull-payment"
					]
				}
			},
			"response": []
		}
	]
}