{
	"info": {
		"_postman_id": "a15e2511-c77b-4ded-bb85-089cb5d2e16d",
		"name": "MSB Pay API v2",
		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
		"_exporter_id": "3813833"
	},
	"item": [
		{
			"name": "Utility",
			"item": [
				{
					"name": "GET Version",
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "AppAuthorization",
								"value": "{{appauthheader}}"
							}
						],
						"url": {
							"raw": "{{url}}/msbpay/v2",
							"host": [
								"{{url}}"
							],
							"path": [
								"msbpay",
								"v2"
							]
						}
					},
					"response": []
				},
				{
					"name": "GET Test Exceptions",
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "Accept",
								"value": "application/json"
							},
							{
								"key": "AppAuthorization",
								"value": "{{appauthheader}}"
							},
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"url": {
							"raw": "{{url}}/msbpay/v2/testExceptions",
							"host": [
								"{{url}}"
							],
							"path": [
								"msbpay",
								"v2",
								"testExceptions"
							],
							"query": [
								{
									"key": "jakarta.ws.rs.NotAuthorizedException",
									"value": "",
									"disabled": true
								},
								{
									"key": "NotAuthorizedException",
									"value": "",
									"disabled": true
								},
								{
									"key": "ForbiddenException",
									"value": "",
									"disabled": true
								},
								{
									"key": "NotFoundException",
									"value": "",
									"disabled": true
								},
								{
									"key": "jakarta.ws.rs.NotAllowedException",
									"value": "",
									"disabled": true
								},
								{
									"key": "NotAllowedException",
									"value": "",
									"disabled": true
								},
								{
									"key": "NotAcceptableException",
									"value": "",
									"disabled": true
								},
								{
									"key": "NotSupportedException",
									"value": "",
									"disabled": true
								},
								{
									"key": "ClientErrorException",
									"value": "",
									"disabled": true
								},
								{
									"key": "InternalServerErrorException",
									"value": "",
									"disabled": true
								},
								{
									"key": "ServiceUnavailableException",
									"value": "",
									"disabled": true
								},
								{
									"key": "ServerErrorException",
									"value": "",
									"disabled": true
								},
								{
									"key": "WebApplicationException",
									"value": "",
									"disabled": true
								},
								{
									"key": "RuntimeException",
									"value": "",
									"disabled": true
								},
								{
									"key": "BadRequestException",
									"value": "cat",
									"disabled": true
								},
								{
									"key": "NullPointerException",
									"value": "meow",
									"disabled": true
								}
							]
						}
					},
					"response": []
				},
				{
					"name": "READ WhoAmI",
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "AppAuthorization",
								"value": "{{appauthheader}}"
							}
						],
						"url": {
							"raw": "{{url}}/msbpay/v2/whoAmI",
							"host": [
								"{{url}}"
							],
							"path": [
								"msbpay",
								"v2",
								"whoAmI"
							]
						}
					},
					"response": []
				}
			]
		},
		{
			"name": "District",
			"item": [
				{
					"name": "READ Client Departments",
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "AppAuthorization",
								"value": "{{appauthheader}}"
							}
						],
						"url": {
							"raw": "{{url}}/msbpay/v2/clients/{{clientId}}/departments",
							"host": [
								"{{url}}"
							],
							"path": [
								"msbpay",
								"v2",
								"clients",
								"{{clientId}}",
								"departments"
							],
							"query": [
								{
									"key": "searchText",
									"value": "tes",
									"disabled": true
								},
								{
									"key": "page",
									"value": "2",
									"disabled": true
								},
								{
									"key": "rowCount",
									"value": "7",
									"disabled": true
								}
							]
						},
						"description": "clientId: <i>string</i><br />\nsearch: <i>string</i><br />\npage: [1..n] <i>(default = 1)</i><br />\nrowCount: [1..100] <i>(default = 100)</i>"
					},
					"response": []
				},
				{
					"name": "READ Client GL Accounts",
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "AppAuthorization",
								"value": "{{appauthheader}}"
							}
						],
						"url": {
							"raw": "{{url}}/msbpay/v2/clients/{{clientId}}/glAccounts",
							"host": [
								"{{url}}"
							],
							"path": [
								"msbpay",
								"v2",
								"clients",
								"{{clientId}}",
								"glAccounts"
							],
							"query": [
								{
									"key": "searchText",
									"value": "food_",
									"disabled": true
								},
								{
									"key": "page",
									"value": "",
									"disabled": true
								},
								{
									"key": "rowCount",
									"value": "",
									"disabled": true
								}
							]
						},
						"description": "search: <i>string</i><br />\npage: [1..n] <i>(default = 1)</i><br />\nrowCount: [1..100] <i>(default = 100)</i>"
					},
					"response": []
				},
				{
					"name": "READ Client Payment Methods",
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "AppAuthorization",
								"value": "{{appauthheader}}"
							}
						],
						"url": {
							"raw": "{{url}}/msbpay/v2/clients/{{clientId}}/paymentMethods",
							"host": [
								"{{url}}"
							],
							"path": [
								"msbpay",
								"v2",
								"clients",
								"{{clientId}}",
								"paymentMethods"
							],
							"query": [
								{
									"key": "page",
									"value": "3",
									"disabled": true
								},
								{
									"key": "rowCount",
									"value": "2",
									"disabled": true
								},
								{
									"key": "searchText",
									"value": "auto",
									"disabled": true
								}
							]
						},
						"description": "clientId: <i>string</i><br />\nsearch: <i>string</i><br />\npage: [1..n] <i>(default = 1)</i><br />\nrowCount: [1..100] <i>(default = 100)</i>"
					},
					"response": []
				},
				{
					"name": "READ Client Stores",
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "AppAuthorization",
								"value": "{{appauthheader}}"
							}
						],
						"url": {
							"raw": "{{url}}/msbpay/v2/clients/{{clientId}}/stores",
							"host": [
								"{{url}}"
							],
							"path": [
								"msbpay",
								"v2",
								"clients",
								"{{clientId}}",
								"stores"
							],
							"query": [
								{
									"key": "page",
									"value": "1",
									"disabled": true
								},
								{
									"key": "rowCount",
									"value": "1",
									"disabled": true
								},
								{
									"key": "searchText",
									"value": "a",
									"disabled": true
								}
							]
						},
						"description": "search: <i>string</i><br />\npage: [1..n] <i>(default = 1)</i><br />\nrowCount: [1..100] <i>(default = 100)</i>"
					},
					"response": []
				}
			]
		},
		{
			"name": "Cart (pre-checkout)",
			"item": [
				{
					"name": "CREATE Cart",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"postman.setEnvironmentVariable(\"cartId\", JSON.parse(responseBody).cartId);",
									""
								],
								"type": "text/javascript"
							}
						}
					],
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "AppAuthorization",
								"value": "{{appauthheader}}"
							},
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"cartItems\": [\n    {\n    \t\"clientId\": \"APIDistrictapi1216_09122018\",\n    \t\"itemId\": \"product_A_Generic_Item\",\n    \t\"itemName\": \"A_Generic_Item\",\n    \t\"quantity\": \"1\",\n    \t\"unitPrice\": \"100.00\",\n    \t\"paymentMethodId\": \"hss2649\"\n    }\n  ],\n  \"loginPolicy\": \"none\",\n  \"redirectUrl\": \"https://www.google.com\"\n}\n"
						},
						"url": {
							"raw": "{{url}}/msbpay/v2/carts",
							"host": [
								"{{url}}"
							],
							"path": [
								"msbpay",
								"v2",
								"carts"
							],
							"query": [
								{
									"key": "extendmodel",
									"value": "true",
									"disabled": true,
									"description": "true|false"
								}
							]
						}
					},
					"response": []
				},
				{
					"name": "CREATE Cart (fullpay policy)",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"postman.setEnvironmentVariable(\"cartId\", JSON.parse(responseBody).cartId);",
									""
								],
								"type": "text/javascript"
							}
						}
					],
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "AppAuthorization",
								"value": "{{appauthheader}}"
							},
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"cartItems\": [\n    {\n      \"itemId\": \"product_A_Generic_Item\",\n      \"itemName\": \"A_Generic_Item\",\n      \"quantity\": \"1\",\n      \"unitPrice\": \"100.00\",\n      \"reference\": \"FID_1234567\"\n    }\n  ],\n  \"loginPolicy\": \"none\",\n  \"paymentPreauthPolicy\": \"fullpay\",\n  \"redirectUrl\": \"https://www.google.com\",\n  \"returnToSiteUrl\": \"https://www.yahoo.com\"\n}\n"
						},
						"url": {
							"raw": "{{url}}/msbpay/v2/carts",
							"host": [
								"{{url}}"
							],
							"path": [
								"msbpay",
								"v2",
								"carts"
							],
							"query": [
								{
									"key": "extendmodel",
									"value": "true",
									"disabled": true,
									"description": "true|false"
								}
							]
						}
					},
					"response": []
				},
				{
					"name": "CREATE Cart with ALL subscriptions",
					"event": [
						{
							"listen": "test",
							"script": {
								"type": "text/javascript",
								"exec": [
									"postman.setEnvironmentVariable(\"cartId\", JSON.parse(responseBody).cartId);",
									""
								]
							}
						}
					],
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "AppAuthorization",
								"value": "{{appauthheader}}"
							},
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"cartItems\": [\n    {\n      \"clientId\": \"{{clientId}}\",\n      \"itemId\": \"product_A_Generic_Item\",\n      \"itemName\": \"A_Generic_Item\",\n      \"quantity\": \"1\",\n      \"unitPrice\": \"111.00\",\n      \"reference\": \"FID_1234567\"\n    }\n  ],\n  \"webhookSubscriptions\": [\n    {\n      \"notifyUrl\" : \"{{notifyUrl}}\",\n      \"type\" : \"cart.processed\"\n    },\n    {\n      \"notifyUrl\" : \"{{notifyUrl}}\",\n      \"type\" : \"cart.canceled\"\n    },\n    {\n      \"notifyUrl\" : \"{{notifyUrl}}\",\n      \"type\" : \"cart.authorized\"\n    },\n    {\n      \"notifyUrl\" : \"{{notifyUrl}}\",\n      \"type\" : \"payment.failed\"\n    },\n    {\n      \"notifyUrl\" : \"{{notifyUrl}}\",\n      \"type\" : \"payment.refunded\"\n    },\n    {\n      \"notifyUrl\" : \"{{notifyUrl}}\",\n      \"type\" : \"payment.settled\"\n    },\n    {\n      \"notifyUrl\" : \"{{notifyUrl}}\",\n      \"type\" : \"payment.authorized\"\n    }\n  ],\n  \"redirectUrl\": \"{{redirectUrl}}\"\n}\n"
						},
						"url": {
							"raw": "{{url}}/msbpay/v2/carts",
							"host": [
								"{{url}}"
							],
							"path": [
								"msbpay",
								"v2",
								"carts"
							],
							"query": [
								{
									"key": "extendmodel",
									"value": "true",
									"disabled": true,
									"description": "true|false"
								}
							]
					    }
					},
					"response": []
				},
				{
					"name": "READ Cart Status/Items",
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "AppAuthorization",
								"value": "{{appauthheader}}"
							}
						],
						"url": {
							"raw": "{{url}}/msbpay/v2/carts/{{cartId}}",
							"host": [
								"{{url}}"
							],
							"path": [
								"msbpay",
								"v2",
								"carts",
								"{{cartId}}"
							]
						}
					},
					"response": []
				},
				{
					"name": "READ Cart list",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"var responseJSON = JSON.parse(responseBody);",
									"var cartId = responseJSON.carts[0].id;",
									"postman.setEnvironmentVariable(\"cartId\", cartId);",
									""
								],
								"type": "text/javascript"
							}
						}
					],
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "AppAuthorization",
								"value": "{{appauthheader}}"
							}
						],
						"url": {
							"raw": "{{url}}/msbpay/v2/carts?status=pending&createdDateStart=2018-10-26T21:00:00Z",
							"host": [
								"{{url}}"
							],
							"path": [
								"msbpay",
								"v2",
								"carts"
							],
							"query": [
								{
									"key": "status",
									"value": "pending",
									"description": "pending|authorized|closed|canceled"
								},
								{
									"key": "createdDateStart",
									"value": "2018-10-26T21:00:00Z"
								},
								{
									"key": "createdDateEnd",
									"value": "",
									"disabled": true
								},
								{
									"key": "updatedDateStart",
									"value": "",
									"disabled": true
								},
								{
									"key": "updatedDateEnd",
									"value": "",
									"disabled": true
								},
								{
									"key": "clientId",
									"value": "",
									"disabled": true
								},
								{
									"key": "storeId",
									"value": "",
									"disabled": true
								},
								{
									"key": "paymentMethodId",
									"value": "",
									"disabled": true
								},
								{
									"key": "departmentId",
									"value": "",
									"disabled": true
								},
								{
									"key": "itemId",
									"value": "",
									"disabled": true
								},
								{
									"key": "itemName",
									"value": "Chair Pocket Rental",
									"disabled": true
								},
								{
									"key": "reference",
									"value": "",
									"disabled": true
								},
								{
									"key": "studentName",
									"value": "",
									"disabled": true
								},
								{
									"key": "page",
									"value": "",
									"disabled": true
								},
								{
									"key": "rowCount",
									"value": "",
									"disabled": true
								}
							]
						},
						"description": "status: [pending|canceled|authorized|closed]<br />\ncreatedDateStart: YYYY-MM-DD'T'HH:MM(:SS.sss)(Z|[+|-]HH:MM)<br />\ncreatedDateEnd: YYYY-MM-DD'T'HH:MM(:SS.sss)(Z|[+|-]HH:MM)<br />\nupdatedDateStart: YYYY-MM-DD'T'HH:MM(:SS.sss)(Z|[+|-]HH:MM)<br />\nupdatedDateEnd: YYYY-MM-DD'T'HH:MM(:SS.sss)(Z|[+|-]HH:MM)<br />\nclientId: <i>string</i><br />\nstoreId: <i>string</i><br />\npaymentMethodId: <i>string</i><br />\ndepartmentId: <i>string</i><br />\nitemId: <i>string</i><br />\nitemName: <i>string</i><br />\nreference: <i>string</i><br />\nstudentName: <i>string</i><br />\npage: [1..n] <i>(default = 1)</i><br />\nrowCount: [1..100] <i>(default = 100)</i>"
					},
					"response": []
				},
				{
					"name": "UPDATE Cart edit/replace",
					"request": {
						"method": "PUT",
						"header": [
							{
								"key": "AppAuthorization",
								"value": "{{appauthheader}}"
							},
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"cartItems\": [\n    {\n      \"clientId\": \"test_client\",\n      \"itemId\": \"1234567\",\n      \"itemName\": \"test2\",\n      \"quantity\": \"2\",\n      \"unitPrice\": \"10\",\n      \"storeId\": \"payApiStoreToDelete\",\n      \"paymentMethodId\": \"AutomationPaymentMethod\",\n      \"departmentId\": \"AutomationDepartment\",\n      \"reference\": \"Testing update cart\",\n      \"properties\": [\n        {\n          \"name\": \"prop1\",\n          \"value\": \"newval1\"\n        },\n        {\n          \"name\": \"prop2\",\n          \"value\": \"newval2\"\n        }\n      ]\n    },\n    {\n      \"clientId\": \"test_client\",\n      \"itemId\": \"56789\",\n      \"itemName\": \"test2\",\n      \"quantity\": \"9\",\n      \"unitPrice\": \"7\",\n      \"storeId\": \"store_AutomationStore\",\n      \"paymentMethodId\": \"AutomationPaymentMethod\",\n      \"reference\": \"Testing update cart\",\n      \"properties\": [\n        {\n          \"name\": \"Size\",\n          \"value\": \"Large\"\n        },\n        {\n          \"name\": \"Color\",\n          \"value\": \"White\"\n        }\n      ]\n    }\n  ],\n  \"redirectUrl\": \"http://www.google.com\"\n}\n"
						},
						"url": {
							"raw": "{{url}}/msbpay/v2/carts/{{cartId}}",
							"host": [
								"{{url}}"
							],
							"path": [
								"msbpay",
								"v2",
								"carts",
								"{{cartId}}"
							],
							"query": [
								{
									"key": "extendmodel",
									"value": "true",
									"disabled": true,
									"description": "true|false"
								}
							]
						}
					},
					"response": []
				},
				{
					"name": "UPDATE Cart edit/replace with ALL subscriptions",
					"request": {
						"method": "PUT",
						"header": [
							{
								"key": "AppAuthorization",
								"value": "{{appauthheader}}"
							},
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"cartItems\": [\n    {\n      \"clientId\": \"{{clientId}}\",\n      \"itemId\": \"product_A_Generic_Item\",\n      \"itemName\": \"A_Generic_Item\",\n      \"quantity\": \"1\",\n      \"unitPrice\": \"111.00\",\n      \"reference\": \"FID_1234567\"\n    }\n  ],\n  \"webhookSubscriptions\": [\n    {\n      \"notifyUrl\" : \"{{notifyUrl}}\",\n      \"type\" : \"cart.processed\"\n    },\n    {\n      \"notifyUrl\" : \"{{notifyUrl}}\",\n      \"type\" : \"cart.canceled\"\n    },\n    {\n      \"notifyUrl\" : \"{{notifyUrl}}\",\n      \"type\" : \"cart.authorized\"\n    },\n    {\n      \"notifyUrl\" : \"{{notifyUrl}}\",\n      \"type\" : \"payment.failed\"\n    },\n    {\n      \"notifyUrl\" : \"{{notifyUrl}}\",\n      \"type\" : \"payment.refunded\"\n    },\n    {\n      \"notifyUrl\" : \"{{notifyUrl}}\",\n      \"type\" : \"payment.settled\"\n    },\n    {\n      \"notifyUrl\" : \"{{notifyUrl}}\",\n      \"type\" : \"payment.authorized\"\n    }\n  ],\n  \"redirectUrl\": \"{{redirectUrl}}\"\n}\n"
						},
						"url": {
							"raw": "{{url}}/msbpay/v2/carts/{{cartId}}",
							"host": [
								"{{url}}"
							],
							"path": [
								"msbpay",
								"v2",
								"carts",
								"{{cartId}}"
							],
							"query": [
								{
									"key": "extendmodel",
									"value": "true",
									"disabled": true,
									"description": "true|false"
								}
							]
						}
					},
					"response": []
				},
				{
					"name": "POST Cart add item",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "AppAuthorization",
								"value": "{{appauthheader}}"
							},
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"cartItems\": [\n    {\n      \"clientId\": \"test_client\",\n      \"itemId\": \"1234567\",\n      \"itemName\": \"test2\",\n      \"quantity\": \"2\",\n      \"unitPrice\": \"10\",\n      \"storeId\": \"payApiStoreToDelete\",\n      \"paymentMethodId\": \"AutomationPaymentMethod\",\n      \"departmentId\": \"AutomationDepartment\",\n      \"reference\": \"Testing add to cart\",\n      \"properties\": [\n        {\n          \"name\": \"prop3\",\n          \"value\": \"val4\"\n        },\n        {\n          \"name\": \"prop5\",\n          \"value\": \"val5\"\n        }\n      ]\n    }\n  ]\n}\n"
						},
						"url": {
							"raw": "{{url}}/msbpay/v2/carts/{{cartId}}/addItems",
							"host": [
								"{{url}}"
							],
							"path": [
								"msbpay",
								"v2",
								"carts",
								"{{cartId}}",
								"addItems"
							],
							"query": [
								{
									"key": "extendmodel",
									"value": "true",
									"disabled": true,
									"description": "true|false"
								}
							]
						}
					},
					"response": []
				},
				{
					"name": "DELETE Cart cancel",
					"request": {
						"method": "DELETE",
						"header": [
							{
								"key": "AppAuthorization",
								"value": "{{appauthheader}}"
							}
						],
						"body": {
							"mode": "raw",
							"raw": ""
						},
						"url": {
							"raw": "{{url}}/msbpay/v2/carts/{{cartId}}",
							"host": [
								"{{url}}"
							],
							"path": [
								"msbpay",
								"v2",
								"carts",
								"{{cartId}}"
							]
						}
					},
					"response": []
				},
				{
					"name": "CREATE Cart w/GL",
					"event": [
						{
							"listen": "test",
							"script": {
								"type": "text/javascript",
								"exec": [
									"postman.setEnvironmentVariable(\"cartId\", JSON.parse(responseBody).cartId);",
									""
								]
							}
						}
					],
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "AppAuthorization",
								"value": "{{appauthheader}}"
							},
							{
								"key": "Content-Type",
								"value": "application/json"
							},
							{
								"key": "url",
								"value": "{{url}}"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"cartItems\": [\n    {\n      \"clientId\": \"{{clientId}}\",\n      \"itemId\": \"product_A_Generic_Item\",\n      \"itemName\": \"A_Generic_Item\",\n      \"quantity\": \"1\",\n      \"unitPrice\": \"111.00\",\n      \"glAccountId\":\"\",\n     \"glCashAcctId\":\"\",\n     \"glSalesTaxAcctId\":\"\",\n     \"glExpenditureAcctId\":\"\",\n     \"glAcctSegment\":\"\",\n      \"reference\": \"FID_1234567\"\n    }\n  ],\n  \"redirectUrl\": \"{{redirectUrl}}\"\n}\n"
						},
						"url": {
							"raw": "{{url}}/msbpay/v2/carts",
							"host": [
								"{{url}}"
							],
							"path": [
								"msbpay",
								"v2",
								"carts"
							],
							"query": [
								{
									"key": "extendmodel",
									"value": "true",
									"disabled": true,
									"description": "true|false"
								}
							]
						}
					},
					"response": []
				},
				{
					"name": "CREATE Cart (All ACH gateway types)",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"postman.setEnvironmentVariable(\"cartId\", JSON.parse(responseBody).cartId);",
									""
								],
								"type": "text/javascript"
							}
						}
					],
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "AppAuthorization",
								"value": "{{appauthheader}}"
							},
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"cartItems\": [\n        {\n            \"clientId\": \"APIDistrictapi1216_09122018\",\n            \"itemId\": \"product_A_Generic_Item\",\n            \"itemName\": \"A_Generic_Item\",\n            \"quantity\": \"1\",\n            \"unitPrice\": \"100.00\",\n            \"paymentMethodId\": \"hss2649\"\n        },\n        {\n            \"clientId\": \"APIDistrictapi1216_09122018\",\n            \"itemId\": \"product_A_Generic_Item\",\n            \"itemName\": \"A_Generic_Item\",\n            \"quantity\": \"1\",\n            \"unitPrice\": \"100.00\",\n            \"paymentMethodId\": \"hss2650\"\n        },\n        {\n            \"clientId\": \"APIDistrictapi1216_09122018\",\n            \"itemId\": \"product_A_Generic_Item\",\n            \"itemName\": \"A_Generic_Item\",\n            \"quantity\": \"1\",\n            \"unitPrice\": \"100.00\",\n            \"paymentMethodId\": \"hss2651\"\n        },\n        {\n            \"clientId\": \"APIDistrictapi1216_09122018\",\n            \"itemId\": \"product_A_Generic_Item\",\n            \"itemName\": \"A_Generic_Item\",\n            \"quantity\": \"1\",\n            \"unitPrice\": \"100.00\",\n            \"paymentMethodId\": \"hss2652\"\n        },\n        {\n            \"clientId\": \"APIDistrictapi1216_09122018\",\n            \"itemId\": \"product_A_Generic_Item\",\n            \"itemName\": \"A_Generic_Item\",\n            \"quantity\": \"1\",\n            \"unitPrice\": \"100.00\",\n            \"paymentMethodId\": \"hss2653\"\n        },\n        {\n            \"clientId\": \"APIDistrictapi1216_09122018\",\n            \"itemId\": \"product_A_Generic_Item\",\n            \"itemName\": \"A_Generic_Item\",\n            \"quantity\": \"1\",\n            \"unitPrice\": \"100.00\",\n            \"paymentMethodId\": \"hss2654\"\n        }\n    ],\n    \"loginPolicy\": \"none\",\n    \"redirectUrl\": \"https://www.google.com\"\n}\n"
						},
						"url": {
							"raw": "{{url}}/msbpay/v2/carts",
							"host": [
								"{{url}}"
							],
							"path": [
								"msbpay",
								"v2",
								"carts"
							],
							"query": [
								{
									"key": "extendmodel",
									"value": "true",
									"disabled": true,
									"description": "true|false"
								}
							]
						}
					},
					"response": []
				},
				{
					"name": "POST authorize cart",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "AppAuthorization",
								"value": "{{appauthheader}}"
							},
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n\t\"userId\": null,\n\t\"cashierPaymentBeans\": [\n\t\t{\n\t\t\t\"paymentType\": \"CASH\",\n\t\t\t\"paymentNumber\": null\n\t\t}\n\t]\n}\n"
						},
						"url": {
							"raw": "{{url}}/msbpay/v2/carts/{{cartId}}/authorize",
							"host": [
								"{{url}}"
							],
							"path": [
								"msbpay",
								"v2",
								"carts",
								"{{cartId}}",
								"authorize"
							],
							"query": [
								{
									"key": "includeprocess",
									"value": "true",
									"disabled": true,
									"description": "true|false"
								}
							]
						}
					},
					"response": []
				}
			]
		},
		{
			"name": "Payments (post-checkout)",
			"item": [
				{
					"name": "CREATE Cart Process",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "AppAuthorization",
								"value": "{{appauthheader}}"
							},
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": ""
						},
						"url": {
							"raw": "{{url}}/msbpay/v2/carts/{{cartId}}/process",
							"host": [
								"{{url}}"
							],
							"path": [
								"msbpay",
								"v2",
								"carts",
								"{{cartId}}",
								"process"
							],
							"query": [
								{
									"key": "includeOrder",
									"value": "true",
									"disabled": true,
									"description": "true|false"
								},
								{
									"key": "includeDBAName",
									"value": "false",
									"disabled": true,
									"description": "true|false"
								}
	                        ]
						}
					},
					"response": []
				},
				{
					"name": "READ Cart Orders",
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "AppAuthorization",
								"value": "{{appauthheader}}"
							}
						],
						"url": {
							"raw": "{{url}}/msbpay/v2/carts/{{cartId}}/orders",
							"host": [
								"{{url}}"
							],
							"path": [
								"msbpay",
								"v2",
								"carts",
								"{{cartId}}",
								"orders"
							]
						}
					},
					"response": []
				},
				{
					"name": "READ Cart Payments",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"var responseJSON = JSON.parse(responseBody);",
									"var cartId = responseJSON.cartPayments[0].cartId;",
									"var paymentId = responseJSON.cartPayments[0].id;",
									"postman.setEnvironmentVariable(\"cartId\", cartId);",
									"postman.setEnvironmentVariable(\"paymentId\", paymentId);",
									""
								],
								"type": "text/javascript"
							}
						}
					],
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "AppAuthorization",
								"value": "{{appauthheader}}"
							}
						],
						"url": {
							"raw": "{{url}}/msbpay/v2/carts/{{cartId}}/payments",
							"host": [
								"{{url}}"
							],
							"path": [
								"msbpay",
								"v2",
								"carts",
								"{{cartId}}",
								"payments"
							]
						}
					},
					"response": []
				},
				{
					"name": "REFUND Cart - Full",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "AppAuthorization",
								"value": "{{appauthheader}}"
							},
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"refundFullAmount\": true,\n  \"refundReason\": \"Test transaction\"\n}\n"
						},
						"url": {
							"raw": "{{url}}/msbpay/v2/carts/{{cartId}}/payments/{{paymentId}}/refund",
							"host": [
								"{{url}}"
							],
							"path": [
								"msbpay",
								"v2",
								"carts",
								"{{cartId}}",
								"payments",
								"{{paymentId}}",
								"refund"
							]
						}
					},
					"response": []
				},
				{
					"name": "REFUND Cart - Partial",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "AppAuthorization",
								"value": "{{appauthheader}}"
							},
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"refundItems\": [\n    {\n        \"itemName\": \"FamilyID Registration\",\n        \"itemId\": \"fid-registrations\",\n        \"unitPrice\": 50,\n        \"quantity\": 1,\n       \"properties\": [\n            {\n                \"name\": \"Fee type\",\n                \"value\": \"Hockey - Tryouts - East\"\n            }\n        ],\n        \"studentName\": \"Aobrfsl Aal\"\n    }\n  ],\n  \"refundFullAmount\": false,\n  \"refundReason\": \"Test transaction 6\"\n}\n"
						},
						"url": {
							"raw": "{{url}}/msbpay/v2/carts/{{cartId}}/payments/{{paymentId}}/refund",
							"host": [
								"{{url}}"
							],
							"path": [
								"msbpay",
								"v2",
								"carts",
								"{{cartId}}",
								"payments",
								"{{paymentId}}",
								"refund"
							]
						}
					},
					"response": []
				},
				{
					"name": "READ Client Payment list",
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "AppAuthorization",
								"value": "{{appauthheader}}"
							}
						],
						"url": {
							"raw": "{{url}}/msbpay/v2/clients/{{clientId}}/payments",
							"host": [
								"{{url}}"
							],
							"path": [
								"msbpay",
								"v2",
								"clients",
								"{{clientId}}",
								"payments"
							],
							"query": [
								{
									"key": "cartId",
									"value": "",
									"disabled": true
								},
								{
									"key": "transferConfirmed",
									"value": "",
									"disabled": true
								},
								{
									"key": "paymentType",
									"value": "",
									"disabled": true
								},
								{
									"key": "startDate",
									"value": "",
									"disabled": true
								},
								{
									"key": "endDate",
									"value": "",
									"disabled": true
								},
								{
									"key": "page",
									"value": "",
									"disabled": true
								},
								{
									"key": "rowCount",
									"value": "",
									"disabled": true
								}
							]
						},
						"description": "cartId: <i>string</i><br />\ntransferConfirmed: (true|false)<br />\npaymentType: (sale|credit)<br />\nstartDate: YYYY-MM-DD'T'HH:MM(:SS.sss)(Z|[+|-]HH:MM)<br />\nendDate: YYYY-MM-DD'T'HH:MM(:SS.sss)(Z|[+|-]HH:MM)<br />\npage: [1..n] <i>(default = 1)</i><br />\nrowCount: [1..100] <i>(default = 100)</i>"
					},
					"response": []
				},
				{
					"name": "CONFIRM Client Payment",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "AppAuthorization",
								"value": "{{appauthheader}}"
							}
						],
						"body": {
							"mode": "raw",
							"raw": ""
						},
						"url": {
							"raw": "{{url}}/msbpay/v2/clients/{{clientId}}/payments/{{paymentId}}/confirmTransfer",
							"host": [
								"{{url}}"
							],
							"path": [
								"msbpay",
								"v2",
								"clients",
								"{{clientId}}",
								"payments",
								"{{paymentId}}",
								"confirmTransfer"
							]
						}
					},
					"response": []
				}
			],
			"event": [
				{
					"listen": "prerequest",
					"script": {
						"type": "text/javascript",
						"exec": [
							""
						]
					}
				},
				{
					"listen": "test",
					"script": {
						"type": "text/javascript",
						"exec": [
							""
						]
					}
				}
			]
		}
	],
	"event": [
		{
			"listen": "prerequest",
			"script": {
				"type": "text/javascript",
				"exec": [
					"var moment = require('moment');",
					"",
					"postman.setGlobalVariable(\"past1Week\", moment().add(-1, 'week').toISOString());",
					"postman.setGlobalVariable(\"past2Weeks\", moment().add(-2, 'week').toISOString());",
					"postman.setGlobalVariable(\"past1Month\", moment().add(-1, 'month').toISOString());",
					"postman.setGlobalVariable(\"past3Months\", moment().add(-3, 'month').toISOString());",
					
					"//get the authstring header value from the environment variable",
					"var authstring = postman.getEnvironmentVariable(\"authstring\");",
					
					"//assign the value to environemnt variable so it can be used in call",
					"postman.setEnvironmentVariable(\"appauthheader\", authstring);",
				    ""
				]
			}
		},
		{
			"listen": "test",
			"script": {
				"type": "text/javascript",
				"exec": [
					""
				]
			}
		}
	]
}