{
	"info": {
		"_postman_id": "00c9b1db-6a0d-4aa4-bbc1-ac741b274b3d",
		"name": "Xledger GraphQL purchase orders",
		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
		"_exporter_id": "12513583",
		"_collection_link": "https://winter-capsule-318580.postman.co/workspace/Zendesk~81e2f28b-3903-4602-9742-2f866356dd43/collection/12513583-00c9b1db-6a0d-4aa4-bbc1-ac741b274b3d?action=share&source=collection_link&creator=12513583"
	},
	"item": [
		{
			"name": "Create Purchase Order Header",
			"request": {
				"method": "POST",
				"header": [],
				"body": {
					"mode": "graphql",
					"graphql": {
						"query": "mutation {\r\n  addPurchaseOrders(inputs: [{node: {\r\n    orderNumber: 123456\r\n    orderAt: \"2023-01-01\"\r\n    #subledger: {code: \"Supplier code\"}\r\n    poOrderType: {name: \"PURCHASE_ORDER\"}\r\n    purchaseAt: \"2023-01-01\"\r\n    #headerInfo: \"Header description\"\r\n    #glObject1: {code: \"\"}\r\n    #glObject2: {code: \"\"}\r\n    #glObject3: {code: \"\"}\r\n    #glObject4: {code: \"\"}\r\n    #glObject5: {code: \"\"}\r\n    #xgl: {code: \"\"}\r\n    currency: {code: \"GBP\"}\r\n    #account: {code: \"Account code\"}\r\n    amount: 50.00\r\n    invoiceAmount: 50.00\r\n    }}]) {\r\n    edges {\r\n      node {\r\n        dbId\r\n      }\r\n    }\r\n  }\r\n}\r\n \r\n",
						"variables": ""
					}
				},
				"url": {
					"raw": "{{url}}",
					"host": [
						"{{url}}"
					]
				}
			},
			"response": []
		},
		{
			"name": "Create Purchase Order Detail",
			"request": {
				"method": "POST",
				"header": [],
				"body": {
					"mode": "graphql",
					"graphql": {
						"query": "mutation {\r\n  addPurchaseOrderDetails(inputs: [{node: {\r\n    #purchaseOrderHeader: {dbId: \"Use the dbId generated from purchase Order Header\"}\r\n    lineNumber: 1\r\n    #product: {code: \"Product code\"}\r\n    unit: {description: \"EA\"}\r\n    #glObject1: {code: \"\"}\r\n    #glObject2: {code: \"\"}\r\n    #glObject3: {code: \"\"}\r\n    #glObject4: {code: \"\"}\r\n    #glObject5: {code: \"\"}\r\n    #xgl: {code: \"\"}\r\n    quantity: 1\r\n    unitPrice: 50.00\r\n    amount: 50.00\r\n    invoiceAmount: 50.00\r\n    #text: \"free text field\"\r\n    #taxRule: {code: \"Tax rule code\"}\r\n    #account: {code: \"Account code\"}\r\n  }}]) {\r\n    edges {\r\n      node {\r\n        dbId\r\n      }\r\n    }\r\n  }\r\n}\r\n \r\n\r\n",
						"variables": ""
					}
				},
				"url": {
					"raw": "{{url}}",
					"host": [
						"{{url}}"
					]
				}
			},
			"response": []
		},
		{
			"name": "Update Purchase Order",
			"request": {
				"method": "POST",
				"header": [],
				"body": {
					"mode": "graphql",
					"graphql": {
						"query": "mutation{\r\n  updatePurchaseOrders(inputs:[{node:{\r\n    #poOrderLevel: {name: \"Enter the status you wish the Purcahse Order to be in\"}\r\n    #dbId: use the dbId generated from the Purchase Order Header\r\n  }}]) {\r\n    edges {\r\n      node {\r\n        dbId\r\n      }\r\n    }\r\n  }\r\n}\r\n\r\n",
						"variables": ""
					}
				},
				"url": {
					"raw": "{{url}}",
					"host": [
						"{{url}}"
					]
				}
			},
			"response": []
		},
		{
			"name": "Get Purchase Orders",
			"request": {
				"method": "POST",
				"header": [],
				"body": {
					"mode": "graphql",
					"graphql": {
						"query": "{\r\n  purchaseOrders(last: 10, filter: {modifiedAt_lt: \"2023-01-01T00:15:00\"}) {\r\n    edges {\r\n      node {\r\n        dbId\r\n        description\r\n        createdAt\r\n        modifiedAt\r\n        orderNumber\r\n        amount\r\n        invoiceAmount\r\n        posted\r\n        receivedAmount\r\n        headerInfo\r\n        account {\r\n          code\r\n          description\r\n        }\r\n        subledger {\r\n          code\r\n          description\r\n        }\r\n      }\r\n    }\r\n  }\r\n}\r\n",
						"variables": ""
					}
				},
				"url": {
					"raw": "{{url}}",
					"host": [
						"{{url}}"
					]
				}
			},
			"response": []
		}
	],
	"auth": {
		"type": "apikey",
		"apikey": [
			{
				"key": "value",
				"value": "token your_token",
				"type": "string"
			},
			{
				"key": "key",
				"value": "Authorization",
				"type": "string"
			}
		]
	},
	"event": [
		{
			"listen": "prerequest",
			"script": {
				"type": "text/javascript",
				"requests": {},
				"exec": [
					""
				]
			}
		},
		{
			"listen": "test",
			"script": {
				"type": "text/javascript",
				"requests": {},
				"exec": [
					""
				]
			}
		}
	],
	"variable": [
		{
			"key": "url",
			"value": "https://demo.xledger.net/graphql"
		}
	]
}