{
	"info": {
		"_postman_id": "6a91c462-10fc-4959-b482-5fc856d4e2c3",
		"name": "myAGA API v2",
		"description": "Collection of sample queries for myAGA APIs",
		"schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json",
		"_exporter_id": "15205841",
		"_collection_link": "https://red-firefly-513793.postman.co/workspace/My-Workspace~e42a49c1-70bb-48d8-86f6-06d9ea0cf4b1/collection/15205841-6a91c462-10fc-4959-b482-5fc856d4e2c3?action=share&source=collection_link&creator=15205841"
	},
	"item": [
		{
			"name": "uploadApplication",
			"request": {
				"method": "POST",
				"header": [
					{
						"key": "Content-Type",
						"name": "Content-Type",
						"value": "application/json",
						"type": "text"
					}
				],
				"body": {
					"mode": "raw",
					"raw": "{\n    \"exporterAgaIdentifier\": {\n        \"personNo\": \"100123456\",\n        \"registrationId\": \"Test-Company-registration\",\n        \"registrationCourt\": \"Amtsgericht\"\n    },\n    \"applicationDate\": \"2023-06-01\",\n    \"exportCountryCode\": \"412\",\n    \"exportCountrySubdivisionCode\": \"MX\",\n    \"importerAgaIdentifier\": {\n        \"personNo\": \"100654321\",\n        \"registrationId\": \"Test-Company-importer\",\n        \"registrationCourt\": \"Importer Amtsgericht\"\n    },\n    \"importerAddress\": {\n        \"companyName\": \"Test Company\",\n        \"countryCode\": \"412\",\n        \"subdivisionCode\": \"MX\",\n        \"addressLine1\": \"Address Line 1\",\n        \"addressLine2\": \"Address Line 2\",\n        \"addressLine3\": null,\n        \"streetNumber\": \"9\",\n        \"streetName\": \"Hopfensack\",\n        \"town\": \"Hamburg\",\n        \"postalCode\": \"22000\",\n        \"postalCodeTypeCode\": null,\n        \"postOfficeBox\": \"12345\",\n        \"isMainAddress\": true,\n        \"alphabetCode\": null\n    },\n    \"hasAlternativeShipmentAddress\": true,\n    \"shipmentAddress\": {\n        \"companyName\": \"Shipping Company Name\",\n        \"countryCode\": \"657\",\n        \"subdivisionCode\": null,\n        \"addressLine1\": \"Shipping Address Line 1\",\n        \"addressLine2\": null,\n        \"addressLine3\": null,\n        \"streetNumber\": \"10\",\n        \"streetName\": \"Shipping Strret 10\",\n        \"town\": \"Shipping Town\",\n        \"postalCode\": \"98765\",\n        \"postalCodeTypeCode\": null,\n        \"postOfficeBox\": null,\n        \"isMainAddress\": true,\n        \"alphabetCode\": null\n    },\n    \"hasPaymentExperience\": true,\n    \"typeOfGoodsCode\": \"INVESTMENT\",\n    \"sectorCode\": \"PRIVATE\",\n    \"isMilitary\": false,\n    \"shortDescription\": \"My Short Description\",\n    \"industrialSector\": \"03\",\n    \"kindOfGoodsGroup\": \"03.02\",\n    \"kindOfGoods\": \"03.02.99\",\n    \"usageSector\": \"01\",\n    \"usageSectorGroup\": \"01.03\",\n    \"usageSectorCustomer\": \"01.03.03\",\n    \"projectDescription\": \"My Multi Line Project Description\",\n    \"bidding\": true,\n    \"sparePartsPercentage\": 25.5,\n    \"serviceStartDate\": \"2023-06-08\",\n    \"serviceEndDate\": \"2023-06-23\",\n    \"advancePaymentVolume\": 100010.0,\n    \"advancePaymentDateCode\": \"PRE_SHIPMENT\",\n    \"paymentRate\": \"HALF_YEAR\",\n    \"paymentStartCode\": \"FIRST_SHIPMENT\",\n    \"numberOfPayments\": 5,\n    \"hasCollaterals\": true,\n    \"hasCustomerInfluence\": true,\n    \"previousRevenueAmount\": 22222222,\n    \"previousRevenueCurrencyCode\": \"EUR\",\n    \"isContractSigned\": true,\n    \"signedContracts\": [\n        {\n            \"contractSignedDate\": \"2023-01-01\",\n            \"contractReference\": \"My Contract Reference\"\n        }\n    ],\n    \"hasCertificateOfOrigin\": false,\n    \"hasForeignSupplies\": true,\n    \"foreignSupplies\": [\n        {\n            \"countryCode\": \"AE\",\n            \"countrySubdivisionCode\": \"EA-AZ\",\n            \"supplyCurrencyCode\": \"USD\",\n            \"supplyAmount\": 1000\n        }\n    ],\n    \"exportCurrencyCode\": \"USD\",\n    \"estimatedEurValueAmount\": 850000,\n    \"estimatedCreditMonths\": 5,\n    \"orderCurrencyCode\": \"JPY\",\n    \"orderValueAmount\": 65000,\n    \"shipmentVolumes\": [\n        {\n            \"shipmentVolumeCurrencyCode\": \"USD\",\n            \"shipmentVolumeAmount\": 1000\n        },\n        {\n            \"shipmentVolumeCurrencyCode\": \"JPY\",\n            \"shipmentVolumeAmount\": 40000\n        }\n    ],\n    \"shipmentValueAmount\": 23000,\n    \"servicesValueAmount\": 24000,\n    \"servicesVolumes\": [\n        {\n            \"servicesVolumeCurrencyCode\": \"USD\",\n            \"servicesVolumeAmount\": 2000\n        },\n        {\n            \"servicesVolumeCurrencyCode\": \"JPY\",\n            \"servicesVolumeAmount\": 20000\n        }\n    ],\n    \"hasServices\": true,\n    \"isOverallProject\": true,\n    \"isUsedGoods\": true,\n    \"isExportLicenceNeeded\": true,\n    \"deliveryDate\": \"2023-06-05\",\n    \"hasMultipleDeliveries\": true,\n    \"lastDeliveryDate\": \"2023-07-01\",\n    \"isCoverageCostIncluded\": null,\n    \"buyerCreditAmount\": 10000\n}",
					"options": {
						"raw": {
							"language": "json"
						}
					}
				},
				"url": "{{host}}/api/myaga/export/v2/exportCoverageApplications",
				"description": "save new application in the exporter's workspace"
			},
			"response": []
		},
		{
			"name": "getApplications",
			"request": {
				"method": "GET",
				"header": [],
				"url": {
					"raw": "{{host}}/api/myaga/export/v2/exportCoverageApplications?page=1&size=20",
					"host": [
						"{{host}}"
					],
					"path": [
						"api",
						"myaga",
						"export",
						"v2",
						"exportCoverageApplications"
					],
					"query": [
						{
							"key": "page",
							"value": "1",
							"description": "requested page, starting with 1"
						},
						{
							"key": "size",
							"value": "20",
							"description": "reuested page size"
						}
					]
				},
				"description": "loads a page of applications in submmitted state that are assigned to the API user's id\nThe number of items (Total-Items) and pages (Total-Pages) are expected to be returned in the response header."
			},
			"response": []
		},
		{
			"name": "getApplication",
			"request": {
				"method": "GET",
				"header": [],
				"url": {
					"raw": "{{host}}/api/myaga/export/v2/exportCoverageApplications/:applicationId",
					"host": [
						"{{host}}"
					],
					"path": [
						"api",
						"myaga",
						"export",
						"v2",
						"exportCoverageApplications",
						":applicationId"
					],
					"variable": [
						{
							"key": "applicationId",
							"value": "123",
							"description": "id of the application as returned by getAppplications"
						}
					]
				},
				"description": "Readsa single application"
			},
			"response": []
		},
		{
			"name": "uploadAttachment",
			"request": {
				"method": "POST",
				"header": [],
				"body": {
					"mode": "formdata",
					"formdata": [
						{
							"key": "metadata",
							"value": "{\"JSON\": \"metadata...\"}",
							"type": "text"
						},
						{
							"key": "file",
							"type": "file",
							"src": "/home/friedrichpothast/Schreibtisch/eAkte TestDownload/category_names/Kontakt_Anhang.txt"
						},
						{
							"key": "categoryCode",
							"value": "OTHER",
							"type": "text"
						}
					]
				},
				"url": {
					"raw": "{{host}}/api/myaga/export/v2/exportCoverageApplications/:applicationId/attachments",
					"host": [
						"{{host}}"
					],
					"path": [
						"api",
						"myaga",
						"export",
						"v2",
						"exportCoverageApplications",
						":applicationId",
						"attachments"
					],
					"query": [
						{
							"key": "categoryCode",
							"value": "OTHER",
							"disabled": true
						}
					],
					"variable": [
						{
							"key": "applicationId",
							"value": "124"
						}
					]
				},
				"description": "uploads a document-stream and its metadata"
			},
			"response": []
		},
		{
			"name": "getAttachments",
			"request": {
				"method": "GET",
				"header": [],
				"url": {
					"raw": "{{host}}/api/myaga/export/v2/exportCoverageApplications/:applicationId/attachments",
					"host": [
						"{{host}}"
					],
					"path": [
						"api",
						"myaga",
						"export",
						"v2",
						"exportCoverageApplications",
						":applicationId",
						"attachments"
					],
					"variable": [
						{
							"key": "applicationId",
							"value": "123",
							"description": "loads list for this application "
						}
					]
				},
				"description": "reads a page of metadata from attachments"
			},
			"response": []
		},
		{
			"name": "getAttachment",
			"request": {
				"method": "GET",
				"header": [],
				"url": {
					"raw": "{{host}}/api/myaga/export/v2/exportCoverageApplications/:applicationId/attachments/:attachmentId",
					"host": [
						"{{host}}"
					],
					"path": [
						"api",
						"myaga",
						"export",
						"v2",
						"exportCoverageApplications",
						":applicationId",
						"attachments",
						":attachmentId"
					],
					"variable": [
						{
							"key": "applicationId",
							"value": "123"
						},
						{
							"key": "attachmentId",
							"value": "1510"
						}
					]
				},
				"description": "download stream of one attachemnt"
			},
			"response": []
		},
		{
			"name": "getAttachmentCategories",
			"request": {
				"method": "GET",
				"header": [
					{
						"key": "Accept-Language",
						"type": "text",
						"value": "de"
					}
				],
				"url": "{{host}}/api/myaga/export/v2/exportCoverageApplications/refData/attachmentCategories",
				"description": "loadas the reference data of all attachment categories vaid for the cattegory attribute"
			},
			"response": []
		},
		{
			"name": "getCustomerData",
			"request": {
				"method": "GET",
				"header": [],
				"url": {
					"raw": "{{host}}/api/myaga/export/v2/baseData/connectedAccount/:connectToken",
					"host": [
						"{{host}}"
					],
					"path": [
						"api",
						"myaga",
						"export",
						"v2",
						"baseData",
						"connectedAccount",
						":connectToken"
					],
					"variable": [
						{
							"key": "connectToken",
							"value": "589406"
						}
					]
				}
			},
			"response": []
		},
		{
			"name": "isAlive",
			"request": {
				"method": "GET",
				"header": [],
				"url": "{{host}}/api/myaga/export/v2/isAlive"
			},
			"response": []
		}
	],
	"auth": {
		"type": "oauth2",
		"oauth2": {
			"clientSecret": "{{ClientId}}",
			"clientId": "{{Client Secret}}",
			"tokenName": "OAuth Token Public Api v2",
			"scope": "read write",
			"grant_type": "client_credentials",
			"client_authentication": "header",
			"accessTokenUrl": "{{host}}/oauth/token",
			"addTokenTo": "header"
		}
	},
	"event": [
		{
			"listen": "prerequest",
			"script": {
				"type": "text/javascript",
				"exec": [
					""
				]
			}
		},
		{
			"listen": "test",
			"script": {
				"type": "text/javascript",
				"exec": [
					""
				]
			}
		}
	],
	"variable": [
		{
			"key": "host",
			"value": "https://test-api.agaportal.de"
		},
		{
			"value": "",
			"type": "string"
		}
	]
}