{
	"info": {
		"_postman_id": "bc58f90a-91d0-4707-8bcc-c05d4d647947",
		"name": "SECUTIX - Removing movement from open order",
		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
	},
	"item": [
		{
			"name": "1. Auth",
			"event": [
				{
					"listen": "test",
					"script": {
						"exec": [
							"var jsonData = JSON.parse(responseBody);\r",
							"pm.collectionVariables.set(\"token\",jsonData.token);"
						],
						"type": "text/javascript"
					}
				}
			],
			"request": {
				"auth": {
					"type": "noauth"
				},
				"method": "POST",
				"header": [],
				"body": {
					"mode": "raw",
					"raw": "{\r\n  \"operator\": \"PLAY_B2C\",\r\n  \"secret\": \"P@ssw0rd\"\r\n}",
					"options": {
						"raw": {
							"language": "json"
						}
					}
				},
				"url": {
					"raw": "https://play.demo-ws.secutix.com/tnci/backend-apis/v1/auth",
					"protocol": "https",
					"host": [
						"play",
						"demo-ws",
						"secutix",
						"com"
					],
					"path": [
						"tnci",
						"backend-apis",
						"v1",
						"auth"
					]
				}
			},
			"response": []
		},
		{
			"name": "2. Create order",
			"event": [
				{
					"listen": "test",
					"script": {
						"exec": [
							"var jsonData = JSON.parse(responseBody);\r",
							"pm.collectionVariables.set(\"orderId\",jsonData.orderUpdateData.orderId);\r",
							"pm.collectionVariables.set(\"movementId\",jsonData.orderUpdateData.movementDataUpdates[0].movementId);"
						],
						"type": "text/javascript"
					}
				}
			],
			"request": {
				"auth": {
					"type": "bearer",
					"bearer": [
						{
							"key": "token",
							"value": "{{token}}",
							"type": "string"
						}
					]
				},
				"method": "POST",
				"header": [],
				"body": {
					"mode": "raw",
					"raw": "{\r\n  \"pointOfSalesId\": 101053522324,\r\n  \"orderType\": \"SALE\",\r\n  \"purchasersInfo\": [{\r\n      \"contactReference\":2258\r\n  }],\r\n  \"singleEntryAttributionOperations\":[{\r\n      \"forceSnakeOrderAttribution\":false,\r\n      \"mandatoryPreferences\":true,\r\n      \"operationAttributions\":[{\r\n          \"audienceSubCategoryId\":101053580099,\r\n          \"checkPrice\":false,\r\n          \"quantity\":1,\r\n          \"performanceId\":101073876956,\r\n          \"seatCategoryId\":101073877561\r\n      },\r\n      {\r\n          \"audienceSubCategoryId\":101053580099,\r\n          \"checkPrice\":false,\r\n          \"quantity\":1,\r\n          \"performanceId\":101073876957,\r\n          \"seatCategoryId\":101073877561\r\n      }]\r\n  }]\r\n}",
					"options": {
						"raw": {
							"language": "json"
						}
					}
				},
				"url": {
					"raw": "https://play.demo-ws.secutix.com/tnseb/backend-apis/externalOrderFacade/v1_33/createOrUpdateOrder",
					"protocol": "https",
					"host": [
						"play",
						"demo-ws",
						"secutix",
						"com"
					],
					"path": [
						"tnseb",
						"backend-apis",
						"externalOrderFacade",
						"v1_33",
						"createOrUpdateOrder"
					]
				}
			},
			"response": []
		},
		{
			"name": "3. Remove movement",
			"request": {
				"auth": {
					"type": "bearer",
					"bearer": [
						{
							"key": "token",
							"value": "{{token}}",
							"type": "string"
						}
					]
				},
				"method": "POST",
				"header": [],
				"body": {
					"mode": "raw",
					"raw": "{\r\n    \"orderId\": {{orderId}},\r\n    \"movementIds\":[{{movementId}}]\r\n}",
					"options": {
						"raw": {
							"language": "json"
						}
					}
				},
				"url": {
					"raw": "https://play.demo-ws.secutix.com/tnseb/backend-apis/externalOrderService/v1_33/abandonMovements",
					"protocol": "https",
					"host": [
						"play",
						"demo-ws",
						"secutix",
						"com"
					],
					"path": [
						"tnseb",
						"backend-apis",
						"externalOrderService",
						"v1_33",
						"abandonMovements"
					]
				}
			},
			"response": []
		},
		{
			"name": "4. Check order",
			"request": {
				"auth": {
					"type": "bearer",
					"bearer": [
						{
							"key": "token",
							"value": "{{token}}",
							"type": "string"
						}
					]
				},
				"method": "POST",
				"header": [],
				"body": {
					"mode": "raw",
					"raw": "{\r\n    \"orderId\": {{orderId}},\r\n    \"granularity\": \"TICKET\"\r\n}",
					"options": {
						"raw": {
							"language": "json"
						}
					}
				},
				"url": {
					"raw": "https://play.demo-ws.secutix.com/tnseb/backend-apis/externalOrderService/v1_33/getOrderDetails",
					"protocol": "https",
					"host": [
						"play",
						"demo-ws",
						"secutix",
						"com"
					],
					"path": [
						"tnseb",
						"backend-apis",
						"externalOrderService",
						"v1_33",
						"getOrderDetails"
					]
				}
			},
			"response": []
		}
	],
	"event": [
		{
			"listen": "prerequest",
			"script": {
				"type": "text/javascript",
				"exec": [
					""
				]
			}
		},
		{
			"listen": "test",
			"script": {
				"type": "text/javascript",
				"exec": [
					""
				]
			}
		}
	],
	"variable": [
		{
			"key": "token",
			"value": ""
		},
		{
			"key": "orderId",
			"value": ""
		},
		{
			"key": "movementId",
			"value": ""
		}
	]
}