{
	"info": {
		"_postman_id": "82f6ca3e-7326-4da1-b9d0-e7780a97e2dc",
		"name": "API Partners Federated for Docu",
		"description": "# **GraphQL API Partners Exploration Collection**\n\n[https://partner-api.docmorris.de/doc/](https://partner-api.docmorris.de/doc/)\n\n> Welcome to our GraphQL API Partners Exploration Collection! This collection is designed to provide partners with a comprehensive understanding of our API and the ability to test its various endpoints. \n  \n\n- **Documentation:** Each request in this collection includes detailed documentation, ensuring clarity on the purpose and usage of the specific endpoint.\n- **Simplified Authentication:** We've simplified the authentication process for your convenience. You can make authenticated requests effortlessly by following these steps:\n    1. Import the provided environment variable file along with this collection.\n    2. Modify the following environment variables with your specific information:\n        - `api_partners_url`\n        - `username`\n        - `password`\n\nOnce you've set these variables, you'll be able to make authenticated API requests seamlessly.\n\n##### **Note:** If you prefer manual authentication or encounter any issues with the automated JavaScript procedure, you can disable it by clicking on the \"Pre-Request-Script\" section (Over the Collection title) and removing or commenting out all the code. Then, manually authenticate your requests by using the endpoint to get a JWT and set it as the Bearer Token value in the Postman Auth section.",
		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
		"_exporter_id": "24955520",
		"_collection_link": "https://universal-flare-861588.postman.co/workspace/Sellers~787c0c9e-b62c-477e-990e-b04faf85ff74/collection/24955520-82f6ca3e-7326-4da1-b9d0-e7780a97e2dc?action=share&source=collection_link&creator=24955520"
	},
	"item": [
		{
			"name": "Queries (Read Only)",
			"item": [
				{
					"name": "Orders",
					"item": [
						{
							"name": "SearchOrders",
							"event": [
								{
									"listen": "prerequest",
									"script": {
										"exec": [
											""
										],
										"type": "text/javascript"
									}
								}
							],
							"request": {
								"auth": {
									"type": "bearer",
									"bearer": [
										{
											"key": "token",
											"value": "{{token}}",
											"type": "string"
										}
									]
								},
								"method": "POST",
								"header": [
									{
										"key": "locale",
										"value": "de_DE",
										"type": "text"
									}
								],
								"body": {
									"mode": "graphql",
									"graphql": {
										"query": "query Orders($filters: OrdersFilter, $pagination: PaginationArgs) {\n  orders(filters: $filters, pagination: $pagination) {\n    collection {\n      id\n      code\n      createdAt\n      approvedAt\n      updatedAt\n      user {\n        id\n        profile {\n          birthday\n          gender\n          email\n        }\n      }\n      shippingAddress {\n        name\n        lastName\n        street\n        streetNumber\n        city\n        administrativeArea\n        postalCode\n        country\n        phone\n      }\n      billingAddress {\n        name\n        lastName\n        street\n        streetNumber\n        city\n        administrativeArea\n        postalCode\n        country\n        phone\n      }\n      subOrders {\n        id\n        seller {\n          externalId\n        }\n        items {\n          id\n          unitsToSend\n          product {\n            id\n            name\n            nationalCodes {\n              code\n              acronym\n              country\n            }\n            eans {\n              code\n            }\n          }\n          unitPrice {\n            amount\n            currency\n          }\n          vat\n          cancellations {\n            status\n            type\n            reason\n            units\n          }\n        }\n        orderId\n        totalPricePerUnitsToSend {\n          amount\n          currency\n        }\n        totalPriceWithDiscountPerUnitsToSendWithShippingCosts {\n          amount\n          currency\n        }\n        customerShippingCost {\n          amount\n          currency\n        }\n        cancellations {\n          id\n          status\n          type\n          createdAt\n          shipment {\n            id\n          }\n        }\n        shipments {\n          delivery {\n            commitment\n            type\n          }\n          costs {\n            amount\n            currency\n          }\n          timeSlot {\n            from\n            to\n          }\n          courier {\n            id\n            name\n          }\n          trackingNumber\n          status\n        }\n      }\n    }\n    metadata {\n      totalItems\n      totalPages\n      currentPage\n    }\n  }\n}",
										"variables": "{\n  \"pagination\": {\n    \"page\": 1,\n    \"size\": 20\n  },\n  \"filters\": {\n    \"code\": {\n      \"eq\": null\n    },\n    \"itemStatus\": null,\n    \"id\": {\n      \"eq\": null\n    },\n    \"hasShipment\": {\n      \"eq\": null\n    },\n    \"updatedAt\": {\n      \"from\": \"2023-09-01T15:50:00+0000\",\n      \"to\": \"2023-12-30T15:50:00+0000\"\n    },\n    \"sort\": {\n      \"criteria\": [\n        {\n          \"field\":\"created_at\",\n          \"type\": \"DESC\"\n        }\n      ]\n    }\n  }\n}"
									}
								},
								"url": {
									"raw": "{{api_partners_url}}",
									"host": [
										"{{api_partners_url}}"
									]
								},
								"description": "This query is used to list orders based on various optional filters that can be provided. It retrieves orders from Docmorris system, based on the specified criteria. In the example provided, you can see various parameters that can be included in the request to filter and customize the results.\n\nIt's important to note that you don't have to request all the possible data shown in the example. You can choose which data points are relevant to your specific needs and include only those in your request. Simply remove any parameters that you don't wish to use. The flexibility of this query allows you to tailor the response to your exact requirements.\n\nFor detailed information on each parameter and their usage, you can refer to the official API documentation, which provides comprehensive guidance on how to use this query effectively."
							},
							"response": []
						},
						{
							"name": "Get Order Detail",
							"request": {
								"auth": {
									"type": "bearer",
									"bearer": [
										{
											"key": "token",
											"value": "{{token}}",
											"type": "string"
										}
									]
								},
								"method": "POST",
								"header": [
									{
										"key": "Accept-Language",
										"value": "de_DE",
										"type": "text"
									},
									{
										"key": "locale",
										"value": "de_DE",
										"type": "text"
									}
								],
								"body": {
									"mode": "graphql",
									"graphql": {
										"query": "query ExampleQuery($orderId: ID!) {\n  order(id: $orderId) {\n    id\n    code\n    createdAt\n    approvedAt\n    updatedAt\n    user {\n      id\n      profile {\n        birthday\n        gender\n        email\n      }\n    }\n    shippingAddress {\n      name\n      lastName\n      street\n      streetNumber\n      city\n      administrativeArea\n      postalCode\n      country\n      phone\n    }\n    billingAddress {\n      name\n      lastName\n      street\n      streetNumber\n      city\n      administrativeArea\n      postalCode\n      country\n      phone\n    }\n    subOrders {\n      id\n      seller {\n        externalId\n      }\n      items {\n        id\n        unitsToSend\n        product {\n          id\n          name\n          nationalCodes {\n            code\n            acronym\n            country\n          }\n          eans {\n            code\n          }\n        }\n        unitPrice {\n          amount\n          currency\n        }\n        vat\n        cancellations {\n          status\n          type\n          reason\n          units\n        }\n      }\n      orderId\n      totalPricePerUnitsToSend {\n        amount\n        currency\n      }\n      totalPriceWithDiscountPerUnitsToSendWithShippingCosts {\n        amount\n        currency\n      }\n      customerShippingCost {\n        amount\n        currency\n      }\n      cancellations {\n        id\n        status\n        type\n        createdAt\n        shipment {\n          id\n        }\n      }\n      shipments {\n        delivery {\n          commitment\n          type\n        }\n        costs {\n          amount\n          currency\n        }\n        timeSlot {\n          from\n          to\n        }\n        courier {\n          id\n          name\n        }\n        trackingNumber\n        status\n      }\n    }\n  }\n}\n",
										"variables": "{\n  \"orderId\": \"{{order_id}}\"\n}"
									}
								},
								"url": {
									"raw": "{{api_partners_url}}",
									"host": [
										"{{api_partners_url}}"
									]
								},
								"description": "This query is designed to retrieve the detailed information of a specific order. By providing the unique identifier or order ID as a parameter, you can request all the specific details related to that particular order.\n\nThis query is particularly useful when you need comprehensive information about a specific order, including items ordered, quantities, prices, shipping details, customer information, and any other relevant data associated with that order.\n\nTo use this query effectively, you would typically include the order ID as a parameter in your request. The response will then contain all the specific details of the requested order, allowing you to access and utilize this information as needed in your application or system.\n\nFor further guidance on how to structure your request and interpret the response, you can refer to our official API documentation, which provides detailed instructions for utilizing this query."
							},
							"response": []
						},
						{
							"name": "Get Cancelation Reasons",
							"event": [
								{
									"listen": "prerequest",
									"script": {
										"exec": [
											""
										],
										"type": "text/javascript"
									}
								}
							],
							"request": {
								"auth": {
									"type": "bearer",
									"bearer": [
										{
											"key": "token",
											"value": "{{token}}",
											"type": "string"
										}
									]
								},
								"method": "POST",
								"header": [],
								"body": {
									"mode": "graphql",
									"graphql": {
										"query": "query OrderReasons($filters: OrderReasonsTypesFilters) {\n  orderReasons(filters: $filters) {\n    type\n    reasons {\n      value\n    }\n  }\n}",
										"variables": ""
									}
								},
								"url": {
									"raw": "{{api_partners_url}}",
									"host": [
										"{{api_partners_url}}"
									]
								},
								"description": "This query is designed to retrieve a list of reasons for which an order can be canceled. It provides valuable information about the various cancellation reasons available within the system.\n\nWhen you're dealing with the cancellation of an order through a mutation, it's important to note that a random or arbitrary reason cannot be used. Instead, the cancellation reason must be explicitly specified, and it must be one of the reasons provided by this query. This requirement ensures that cancellations are processed with clear and valid justifications.\n\nFor instance, if a user wants to cancel an order, they would need to select a cancellation reason from the list obtained through this query. The selected reason must accurately represent the cause for canceling the order, such as \"Out of Stock,\" \"Change of Mind,\" \"Delayed Shipment,\" or any other valid reason.\n\nBy using this query, applications can offer users a predefined set of cancellation reasons, improving clarity and consistency in the cancellation process. This also ensures that the cancellation reasons provided align with the policies and procedures of the system.\n\nTo integrate this query effectively, refer to the official API documentation for guidance on how to structure the query and handle its responses. Additionally, make sure to enforce the requirement that users select a valid cancellation reason when initiating a cancellation mutation to maintain order accuracy and transparency."
							},
							"response": []
						}
					],
					"description": "## Queries related with Orders"
				},
				{
					"name": "Shipments",
					"item": [
						{
							"name": "Get Couriers",
							"event": [
								{
									"listen": "prerequest",
									"script": {
										"exec": [
											""
										],
										"type": "text/javascript"
									}
								}
							],
							"request": {
								"auth": {
									"type": "bearer",
									"bearer": [
										{
											"key": "token",
											"value": "{{token}}",
											"type": "string"
										}
									]
								},
								"method": "POST",
								"header": [],
								"body": {
									"mode": "graphql",
									"graphql": {
										"query": "query Couriers($countryCode: String!) {\n  couriers(countryCode: $countryCode) {\n    id\n    name\n  }\n}",
										"variables": "{\n    \"countryCode\": \"{{country_code}}\"\n}"
									}
								},
								"url": {
									"raw": "{{api_partners_url}}",
									"host": [
										"{{api_partners_url}}"
									]
								},
								"description": "This query serves the purpose of retrieving a list of couriers, which are companies or services responsible for delivering packages and shipments. It provides the flexibility to filter these courier listings based on the country of operation.\n\nThe query accepts optional parameters, allowing you to specify a filter by country. This is particularly useful when you want to narrow down the list to couriers that operate exclusively or primarily within a specific country or region.\n\nTo use this query effectively, you can provide the desired country as a filter. The system will then return a list of couriers that meet this criteria.\n\nFor instance, if you want to find couriers operating in Germany, you would specify \"DE\" or the relevant country code as the filter parameter.\n\nThis query is a valuable tool for applications that involve shipping and logistics, as it enables you to access a curated list of couriers based on your specific geographical requirements.\n\nTo ensure successful integration, please consult our official API documentation for guidance on structuring your query, handling responses, and addressing any potential errors that may occur during the retrieval of courier data. This will help you seamlessly incorporate courier information into your application's shipping and logistics processes."
							},
							"response": []
						}
					],
					"description": "## Queries related with Shipments"
				}
			],
			"description": "# **Orders Queries Directory**\n\nIn this directory, you'll find a collection of GraphQL queries, specifically designed for read-only operations.\n\nThese queries retrieve various data related to customer orders from our partners. GraphQL queries are a powerful way to fetch precisely the data you need, minimizing unnecessary network requests and optimizing the efficiency of your applications.\n\nFeel free to explore these queries to gain insights into customer orders, order history, and related information. These queries provide a wealth of data that can be invaluable for your applications and integrations."
		},
		{
			"name": "Mutations (Write)",
			"item": [
				{
					"name": "Orders",
					"item": [
						{
							"name": "Cancer Order",
							"event": [
								{
									"listen": "prerequest",
									"script": {
										"exec": [
											""
										],
										"type": "text/javascript"
									}
								}
							],
							"request": {
								"auth": {
									"type": "bearer",
									"bearer": [
										{
											"key": "token",
											"value": "{{token}}",
											"type": "string"
										}
									]
								},
								"method": "POST",
								"header": [
									{
										"key": "Accept-Language",
										"value": "de_DE",
										"type": "text",
										"disabled": true
									},
									{
										"key": "locale",
										"value": "de_DE",
										"type": "text",
										"disabled": true
									}
								],
								"body": {
									"mode": "graphql",
									"graphql": {
										"query": "mutation OrderCancel($orderCancelId: ID!, $cancellationType: CancellationType!, $items: [CancellationItemInput!]!) {\n  orderCancel(id: $orderCancelId, cancellationType: $cancellationType, items: $items) {\n    message\n    errors {\n      code\n      message\n    }\n  }\n}\n",
										"variables": "{\n  \"orderCancelId\": null,\n  \"cancellationType\": null,\n  \"items\": [\n    {\n      \"orderItemId\": null,\n      \"cancellationReason\": null,\n      \"units\": null\n    }\n  ]\n}"
									}
								},
								"url": {
									"raw": "{{api_partners_url}}",
									"host": [
										"{{api_partners_url}}"
									]
								},
								"description": "This mutation serves the purpose of canceling an existing order within the system. By providing the unique order identifier as a parameter, you can initiate the cancellation process for a specific order.\n\nCancellation of orders is a critical function in managing orders, especially in scenarios where customers change their minds or encounter issues with their orders. This mutation allows you to trigger the cancellation process programmatically.\n\nTo use this mutation effectively, you would typically include the order ID of the order you wish to cancel as a parameter in your request. Once the mutation is executed successfully, the specified order will be marked as canceled in the system, and any associated actions, such as refunding payment or restocking items, may be triggered depending on your application's logic.\n\nIt's important to refer to the official API documentation for guidance on how to structure your request, handle potential errors, and understand the responses returned by the mutation to ensure seamless order cancellation within your application or system."
							},
							"response": []
						}
					],
					"description": "## Mutations related with Orders"
				},
				{
					"name": "Shipments",
					"item": [
						{
							"name": "Notify Shipment Pickup",
							"event": [
								{
									"listen": "prerequest",
									"script": {
										"exec": [
											""
										],
										"type": "text/javascript"
									}
								}
							],
							"request": {
								"auth": {
									"type": "bearer",
									"bearer": [
										{
											"key": "token",
											"value": "{{token}}",
											"type": "string"
										}
									]
								},
								"method": "POST",
								"header": [
									{
										"key": "Accept-Language",
										"value": "de_DE",
										"type": "text",
										"disabled": true
									},
									{
										"key": "locale",
										"value": "de_DE",
										"type": "text",
										"disabled": true
									}
								],
								"body": {
									"mode": "graphql",
									"graphql": {
										"query": "mutation Mutation($orderId: ID!, $subOrderId: ID!, $sellerId: ID!, $products: [NotifyShipmentPickupProductsInput!]!, $courierId: ID, $trackingNumber: String) {\n  notifyShipmentPickup(orderId: $orderId, subOrderId: $subOrderId, sellerId: $sellerId, products: $products, courierId: $courierId, trackingNumber: $trackingNumber) {\n    message\n    errors {\n      code\n      message\n    }\n  }\n}",
										"variables": "{\n  \"orderId\": null,\n  \"subOrderId\": null,\n  \"sellerId\": null,\n  \"products\": null,\n  \"courierId\": null,\n  \"trackingNumber\": null\n}"
									}
								},
								"url": {
									"raw": "{{api_partners_url}}",
									"host": [
										"{{api_partners_url}}"
									]
								},
								"description": "This mutation facilitates the process of notifying the system that a shipment pickup is scheduled or has taken place. It plays a crucial role in the logistics and tracking of orders.\n\nTo use this mutation, you typically provide details related to the shipment and pickup. This may include shipment identifiers, scheduled pickup times, the pickup location, and any other relevant information.\n\nWhen executed successfully, this mutation triggers the system to update the status of the shipment, reflecting that it has been scheduled for pickup or has already been picked up. This is particularly important for tracking and ensuring that shipments are moving efficiently through the logistics pipeline.\n\nIn practice, you would include the necessary parameters specific to your shipment and pickup scenario. The mutation should be called with the appropriate data to accurately reflect the pickup status in your application.\n\nFor comprehensive details on how to structure the request, handle potential errors, and interpret the responses, please refer to the official API documentation. This will help you seamlessly integrate shipment pickup notifications into your logistics or shipping management system."
							},
							"response": []
						}
					],
					"description": "## Mutations related with Shipments"
				},
				{
					"name": "Auth",
					"item": [
						{
							"name": "Get Application Token",
							"request": {
								"method": "POST",
								"header": [],
								"body": {
									"mode": "graphql",
									"graphql": {
										"query": "mutation GetApplicationToken($username: String!, $password: String!) {\n  getApplicationToken(username: $username, password: $password) {\n    tokens {\n      accessToken {\n        value\n        expiresIn\n      }\n      refreshToken {\n        value\n        expiresIn\n      }\n    }\n  }\n}",
										"variables": "{\n  \"username\": \"{{username}}\",\n  \"password\": \"{{password}}\"\n}"
									}
								},
								"url": {
									"raw": "{{api_partners_url}}",
									"host": [
										"{{api_partners_url}}"
									]
								},
								"description": "This mutation serves the purpose of requesting the essential token required to make authenticated requests to the system's API. It's important to note that nearly all API requests, except for this one, necessitate this authentication token for access."
							},
							"response": []
						}
					],
					"description": "## Mutations related with Auth"
				}
			],
			"description": "# **Orders Mutations Directory**\n\nIn this directory, you'll discover a collection of GraphQL mutations tailored for write operations. Mutations are used to create, update, or delete data within our system, allowing you to interact with customer orders in various ways.\n\nThese mutations empower you to take action, such as placing new orders, modifying existing orders, or canceling orders when necessary. GraphQL mutations provide a flexible and efficient means to perform these operations, ensuring your applications can interact seamlessly with our order management system.\n\nExplore these mutations to see how you can integrate them into your workflows and applications. Whether you're automating order processing or managing order changes, these mutations offer the tools you need to interact with our platform effectively."
		},
		{
			"name": "Applied Examples",
			"item": [
				{
					"name": "Orders",
					"item": [
						{
							"name": "Get All Pending Orders",
							"event": [
								{
									"listen": "prerequest",
									"script": {
										"exec": [
											""
										],
										"type": "text/javascript"
									}
								}
							],
							"request": {
								"auth": {
									"type": "bearer",
									"bearer": [
										{
											"key": "token",
											"value": "{{token}}",
											"type": "string"
										}
									]
								},
								"method": "POST",
								"header": [
									{
										"key": "locale",
										"value": "de_DE",
										"type": "text"
									}
								],
								"body": {
									"mode": "graphql",
									"graphql": {
										"query": "query Orders($filters: OrdersFilter, $pagination: PaginationArgs) {\n  orders(filters: $filters, pagination: $pagination) {\n    collection {\n      id\n      code\n      createdAt\n      approvedAt\n      updatedAt\n      user {\n        id\n        profile {\n          birthday\n          gender\n          email\n        }\n      }\n      shippingAddress {\n        name\n        lastName\n        street\n        streetNumber\n        city\n        administrativeArea\n        postalCode\n        country\n        phone\n      }\n      billingAddress {\n        name\n        lastName\n        street\n        streetNumber\n        city\n        administrativeArea\n        postalCode\n        country\n        phone\n      }\n      subOrders {\n        id\n        seller {\n          externalId\n        }\n        items {\n          id\n          unitsToSend\n          product {\n            id\n            name\n            nationalCodes {\n              code\n              acronym\n              country\n            }\n            eans {\n              code\n            }\n          }\n          unitPrice {\n            amount\n            currency\n          }\n          vat\n          cancellations {\n            status\n            type\n            reason\n            units\n          }\n        }\n        orderId\n        totalPricePerUnitsToSend {\n          amount\n          currency\n        }\n        totalPriceWithDiscountPerUnitsToSendWithShippingCosts {\n          amount\n          currency\n        }\n        customerShippingCost {\n          amount\n          currency\n        }\n        cancellations {\n          id\n          status\n          type\n          createdAt\n          shipment {\n            id\n          }\n        }\n        shipments {\n          delivery {\n            commitment\n            type\n          }\n          costs {\n            amount\n            currency\n          }\n          timeSlot {\n            from\n            to\n          }\n          courier {\n            id\n            name\n          }\n          trackingNumber\n          status\n        }\n      }\n    }\n    metadata {\n      totalItems\n      totalPages\n      currentPage\n    }\n  }\n}",
										"variables": "{\n  \"pagination\": {\n    \"page\": 1,\n    \"size\": 20\n  },\n  \"filters\": {\n    \"code\": {\n      \"eq\": null\n    },\n    \"itemStatus\": \"pendingToSend\",\n    \"id\": {\n      \"eq\": null\n    },\n    \"hasShipment\": {\n      \"eq\": null\n    },\n    \"updatedAt\": {\n      \"from\": \"2023-09-01T15:50:00+0000\",\n      \"to\": \"2023-12-30T15:50:00+0000\"\n    },\n    \"sort\": {\n      \"criteria\": [\n        {\n          \"field\":\"created_at\",\n          \"type\": \"DESC\"\n        }\n      ]\n    }\n  }\n}"
									}
								},
								"url": {
									"raw": "{{api_partners_url}}",
									"host": [
										"{{api_partners_url}}"
									]
								},
								"description": "This query is used to list orders based on various optional filters that can be provided. It retrieves orders from Docmorris system, based on the specified criteria. In the example provided, you can see various parameters that can be included in the request to filter and customize the results.\n\nIt's important to note that you don't have to request all the possible data shown in the example. You can choose which data points are relevant to your specific needs and include only those in your request. Simply remove any parameters that you don't wish to use. The flexibility of this query allows you to tailor the response to your exact requirements.\n\nFor detailed information on each parameter and their usage, you can refer to the official API documentation, which provides comprehensive guidance on how to use this query effectively."
							},
							"response": []
						},
						{
							"name": "Get All Processed/Completed Orders",
							"event": [
								{
									"listen": "prerequest",
									"script": {
										"exec": [
											""
										],
										"type": "text/javascript"
									}
								}
							],
							"request": {
								"auth": {
									"type": "bearer",
									"bearer": [
										{
											"key": "token",
											"value": "{{token}}",
											"type": "string"
										}
									]
								},
								"method": "POST",
								"header": [
									{
										"key": "locale",
										"value": "de_DE",
										"type": "text"
									}
								],
								"body": {
									"mode": "graphql",
									"graphql": {
										"query": "query Orders($filters: OrdersFilter, $pagination: PaginationArgs) {\n  orders(filters: $filters, pagination: $pagination) {\n    collection {\n      id\n      code\n      createdAt\n      approvedAt\n      updatedAt\n      user {\n        id\n        profile {\n          birthday\n          gender\n          email\n        }\n      }\n      shippingAddress {\n        name\n        lastName\n        street\n        streetNumber\n        city\n        administrativeArea\n        postalCode\n        country\n        phone\n      }\n      billingAddress {\n        name\n        lastName\n        street\n        streetNumber\n        city\n        administrativeArea\n        postalCode\n        country\n        phone\n      }\n      subOrders {\n        id\n        seller {\n          externalId\n        }\n        items {\n          id\n          unitsToSend\n          product {\n            id\n            name\n            nationalCodes {\n              code\n              acronym\n              country\n            }\n            eans {\n              code\n            }\n          }\n          unitPrice {\n            amount\n            currency\n          }\n          vat\n          cancellations {\n            status\n            type\n            reason\n            units\n          }\n        }\n        orderId\n        totalPricePerUnitsToSend {\n          amount\n          currency\n        }\n        totalPriceWithDiscountPerUnitsToSendWithShippingCosts {\n          amount\n          currency\n        }\n        customerShippingCost {\n          amount\n          currency\n        }\n        cancellations {\n          id\n          status\n          type\n          createdAt\n          shipment {\n            id\n          }\n        }\n        shipments {\n          delivery {\n            commitment\n            type\n          }\n          costs {\n            amount\n            currency\n          }\n          timeSlot {\n            from\n            to\n          }\n          courier {\n            id\n            name\n          }\n          trackingNumber\n          status\n        }\n      }\n    }\n    metadata {\n      totalItems\n      totalPages\n      currentPage\n    }\n  }\n}",
										"variables": "{\n  \"pagination\": {\n    \"page\": 1,\n    \"size\": 20\n  },\n  \"filters\": {\n    \"code\": {\n      \"eq\": null\n    },\n    \"itemStatus\": \"pendingToSend\",\n    \"id\": {\n      \"eq\": null\n    },\n    \"hasShipment\": {\n      \"eq\": null\n    },\n    \"updatedAt\": {\n      \"from\": \"2023-09-01T15:50:00+0000\",\n      \"to\": \"2023-12-30T15:50:00+0000\"\n    },\n    \"sort\": {\n      \"criteria\": [\n        {\n          \"field\":\"created_at\",\n          \"type\": \"DESC\"\n        }\n      ]\n    }\n  }\n}"
									}
								},
								"url": {
									"raw": "{{api_partners_url}}",
									"host": [
										"{{api_partners_url}}"
									]
								},
								"description": "This query is used to list orders based on various optional filters that can be provided. It retrieves orders from Docmorris system, based on the specified criteria. In the example provided, you can see various parameters that can be included in the request to filter and customize the results.\n\nIt's important to note that you don't have to request all the possible data shown in the example. You can choose which data points are relevant to your specific needs and include only those in your request. Simply remove any parameters that you don't wish to use. The flexibility of this query allows you to tailor the response to your exact requirements.\n\nFor detailed information on each parameter and their usage, you can refer to the official API documentation, which provides comprehensive guidance on how to use this query effectively."
							},
							"response": []
						},
						{
							"name": "Get All Cancelled Orders",
							"event": [
								{
									"listen": "prerequest",
									"script": {
										"exec": [
											""
										],
										"type": "text/javascript"
									}
								}
							],
							"request": {
								"auth": {
									"type": "bearer",
									"bearer": [
										{
											"key": "token",
											"value": "{{token}}",
											"type": "string"
										}
									]
								},
								"method": "POST",
								"header": [
									{
										"key": "locale",
										"value": "de_DE",
										"type": "text"
									}
								],
								"body": {
									"mode": "graphql",
									"graphql": {
										"query": "query Orders($filters: OrdersFilter, $pagination: PaginationArgs) {\n  orders(filters: $filters, pagination: $pagination) {\n    collection {\n      id\n      code\n      createdAt\n      approvedAt\n      updatedAt\n      user {\n        id\n        profile {\n          birthday\n          gender\n          email\n        }\n      }\n      shippingAddress {\n        name\n        lastName\n        street\n        streetNumber\n        city\n        administrativeArea\n        postalCode\n        country\n        phone\n      }\n      billingAddress {\n        name\n        lastName\n        street\n        streetNumber\n        city\n        administrativeArea\n        postalCode\n        country\n        phone\n      }\n      subOrders {\n        id\n        seller {\n          externalId\n        }\n        items {\n          id\n          unitsToSend\n          product {\n            id\n            name\n            nationalCodes {\n              code\n              acronym\n              country\n            }\n            eans {\n              code\n            }\n          }\n          unitPrice {\n            amount\n            currency\n          }\n          vat\n          cancellations {\n            status\n            type\n            reason\n            units\n          }\n        }\n        orderId\n        totalPricePerUnitsToSend {\n          amount\n          currency\n        }\n        totalPriceWithDiscountPerUnitsToSendWithShippingCosts {\n          amount\n          currency\n        }\n        customerShippingCost {\n          amount\n          currency\n        }\n        cancellations {\n          id\n          status\n          type\n          createdAt\n          shipment {\n            id\n          }\n        }\n        shipments {\n          delivery {\n            commitment\n            type\n          }\n          costs {\n            amount\n            currency\n          }\n          timeSlot {\n            from\n            to\n          }\n          courier {\n            id\n            name\n          }\n          trackingNumber\n          status\n        }\n      }\n    }\n    metadata {\n      totalItems\n      totalPages\n      currentPage\n    }\n  }\n}",
										"variables": "{\n  \"pagination\": {\n    \"page\": 1,\n    \"size\": 20\n  },\n  \"filters\": {\n    \"code\": {\n      \"eq\": null\n    },\n    \"itemStatus\": \"pendingToSend\",\n    \"id\": {\n      \"eq\": null\n    },\n    \"hasShipment\": {\n      \"eq\": null\n    },\n    \"updatedAt\": {\n      \"from\": \"2023-09-01T15:50:00+0000\",\n      \"to\": \"2023-12-30T15:50:00+0000\"\n    },\n    \"sort\": {\n      \"criteria\": [\n        {\n          \"field\":\"created_at\",\n          \"type\": \"DESC\"\n        }\n      ]\n    }\n  }\n}"
									}
								},
								"url": {
									"raw": "{{api_partners_url}}",
									"host": [
										"{{api_partners_url}}"
									]
								},
								"description": "This query is used to list orders based on various optional filters that can be provided. It retrieves orders from Docmorris system, based on the specified criteria. In the example provided, you can see various parameters that can be included in the request to filter and customize the results.\n\nIt's important to note that you don't have to request all the possible data shown in the example. You can choose which data points are relevant to your specific needs and include only those in your request. Simply remove any parameters that you don't wish to use. The flexibility of this query allows you to tailor the response to your exact requirements.\n\nFor detailed information on each parameter and their usage, you can refer to the official API documentation, which provides comprehensive guidance on how to use this query effectively."
							},
							"response": []
						}
					]
				}
			]
		}
	],
	"event": [
		{
			"listen": "prerequest",
			"script": {
				"type": "text/javascript",
				"exec": [
					"/******************************* ENV VARS DEFINED **********************/",
					"const TOKEN_ENV_VAR = 'token';",
					"const EXPIRATION_TIME_ENV_VAR = 'expiration_time';",
					"const TOKEN_EXPIRATION_TIME_ENV_VAR = 'token_expiration_time';",
					"const USERNAME_ENV_VAR = 'username';",
					"const PASSWORD_ENV_VAR = 'password';",
					"const API_PARTNERS_URL_ENV_VAR = 'api_partners_url';",
					"/***********************************************************************/",
					"/************************ DEFAULT VALUES FOR ENV VARS ******************/",
					"const DEFAULT_TOKEN_VALUE = 'empty_token';",
					"const DEFAULT_EXPIRATION_TIME = '1';",
					"const DEFAULT_TOKEN_EXPIRATIOM_TIME = '0';",
					"/************************************************************************/",
					"",
					"const currentTokenValue = pm.environment.get( TOKEN_ENV_VAR );",
					"const currentExpirationTime = pm.environment.get( EXPIRATION_TIME_ENV_VAR );",
					"const currentTokenExpirationTime = pm.environment.get( TOKEN_EXPIRATION_TIME_ENV_VAR );",
					"",
					"/************************ EXECUTION FLOW *********************************/",
					"if ( currentTokenValue == DEFAULT_TOKEN_VALUE ) {",
					"    launchGetTokenRequest();",
					"} else if ( !isJWT( currentTokenValue ) ) {",
					"    launchGetTokenRequest();",
					"} else if ( isTokenExpired() ) {",
					"    launchGetTokenRequest();",
					"}",
					"",
					"",
					"function setTokenEnvVar( tokenValue ) {",
					"    pm.environment.set( TOKEN_ENV_VAR, tokenValue );",
					"}",
					"",
					"function setExpirationTimeEnvVar( expirationTimeValue ) {",
					"    pm.environment.set( EXPIRATION_TIME_ENV_VAR, expirationTimeValue );",
					"}",
					"",
					"function setTokenExpirationTimeEnvVar( expirationTimeValue ) {",
					"    const currentTimestamp = new Date().getTime();",
					"    const newTokenExpirationTime = currentTimestamp + expirationTimeValue;",
					"",
					"    pm.environment.set( TOKEN_EXPIRATION_TIME_ENV_VAR, newTokenExpirationTime );",
					"}",
					"",
					"function isJWT( token ) {",
					"    const parts = token.split( '.' );",
					"",
					"    return Array.isArray( parts ) && parts.length === 3;",
					"}",
					"",
					"function isTokenExpired() {",
					"    return new Date().getTime() > currentTokenExpirationTime;",
					"}",
					"",
					"function launchGetTokenRequest() {",
					"    pm.sendRequest( {",
					"        url: pm.environment.get( API_PARTNERS_URL_ENV_VAR ),",
					"        method: 'POST',",
					"        header: {",
					"            'Content-Type': 'application/json',",
					"        },",
					"        body: {",
					"            mode: 'raw',",
					"            raw: JSON.stringify( {",
					"                query: `",
					"        mutation GetApplicationToken($username: String!, $password: String!) {",
					"          getApplicationToken(username: $username, password: $password) {",
					"            tokens {",
					"              accessToken {",
					"                value,",
					"                expiresIn",
					"              }",
					"            }",
					"          }",
					"        }",
					"      `,",
					"                variables: {",
					"                    username: pm.variables.get( USERNAME_ENV_VAR ),",
					"                    password: pm.variables.get( PASSWORD_ENV_VAR ),",
					"                },",
					"            } )",
					"        }",
					"    }, function ( err, res ) {",
					"        let jsonResponse = res.json();",
					"        setTokenEnvVar( jsonResponse.data.getApplicationToken.tokens.accessToken.value );",
					"        setExpirationTimeEnvVar( jsonResponse.data.getApplicationToken.tokens.accessToken.expiresIn );",
					"        setTokenExpirationTimeEnvVar( jsonResponse.data.getApplicationToken.tokens.accessToken.expiresIn );",
					"    } );",
					"}",
					""
				]
			}
		},
		{
			"listen": "test",
			"script": {
				"type": "text/javascript",
				"exec": [
					""
				]
			}
		}
	]
}