{
	"info": {
		"_postman_id": "1a20b091-b0bb-410c-ab70-a3d343d4e72f",
		"name": "ProcessingSystem",
		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
	},
	"item": [
		{
			"name": "createInvoice",
			"event": [
				{
					"listen": "test",
					"script": {
						"exec": [
							"var jsonData = JSON.parse(responseBody);",
							"postman.setEnvironmentVariable(\"invoice_id\", jsonData.invoice.id);",
							"postman.setEnvironmentVariable(\"invoice_access_token\", jsonData.invoiceAccessToken.payload);"
						],
						"type": "text/javascript"
					}
				},
				{
					"listen": "prerequest",
					"script": {
						"exec": [
							"//Prefer relative invoice dueDate",
							"var Now = new Date();",
							"Now.setHours(Now.getHours() + 1);",
							"postman.setEnvironmentVariable('now_plus_1h',(Now).toISOString())"
						],
						"type": "text/javascript"
					}
				}
			],
			"request": {
				"method": "POST",
				"header": [
					{
						"key": "Authorization",
						"value": "Bearer {{api_key}}"
					},
					{
						"key": "X-Request-ID",
						"value": "{{$timestamp}}"
					},
					{
						"key": "Content-Type",
						"value": "application/json; charset=utf-8"
					}
				],
				"body": {
					"mode": "raw",
					"raw": "{\n  \"shopID\": \"{{shop_id}}\",\n  \"dueDate\": \"{{now_plus_1h}}\",\n  \"amount\": 6000, //Сумма товаров, указанных в инвойсе\n  \"currency\": \"RUB\",\n  \"product\": \"Order num 12345\", // Наименование предлагаемых товаров и услуг\n  \"description\": \"Products name\", // Опиание предлагаемых товаров или услуг\n    \"cart\": [ // Корзина товаров\n        {\n            \"price\": 5000,\n            \"product\": \"Product 1\",\n            \"quantity\": 1,\n            \"taxMode\": {\n                \"rate\": \"10%\",\n                \"type\": \"InvoiceLineTaxVAT\"\n            }\n        },\n        {\n            \"price\": 1000,\n            \"product\": \"Product 2\",\n            \"quantity\": 1,\n            \"taxMode\": {\n                \"rate\": \"18%\",\n                \"type\": \"InvoiceLineTaxVAT\"\n            }\n        }\n    ],  \n\"metadata\": \n  { \n    \"order_id\": \"Internal order num 13123298761\"\n  }\n}"
				},
				"url": {
					"raw": "{{api_endpoint}}/processing/invoices",
					"host": [
						"{{api_endpoint}}"
					],
					"path": [
						"processing",
						"invoices"
					]
				}
			},
			"response": []
		},
		{
			"name": "createInvoiceAccessToken",
			"event": [
				{
					"listen": "test",
					"script": {
						"type": "text/javascript",
						"exec": [
							"var jsonData = JSON.parse(responseBody);",
							"postman.setEnvironmentVariable(\"invoice_access_token\", jsonData.payload);"
						]
					}
				}
			],
			"request": {
				"method": "POST",
				"header": [
					{
						"key": "Authorization",
						"value": "Bearer {{api_key}}"
					},
					{
						"key": "X-Request-ID",
						"value": "{{$timestamp}}"
					},
					{
						"key": "Content-Type",
						"value": "application/json; charset=utf-8"
					}
				],
				"body": {
					"mode": "raw",
					"raw": ""
				},
				"url": {
					"raw": "{{api_endpoint}}/processing/invoices/{{invoice_id}}/access-tokens",
					"host": [
						"{{api_endpoint}}"
					],
					"path": [
						"processing",
						"invoices",
						"{{invoice_id}}",
						"access-tokens"
					]
				}
			},
			"response": []
		},
		{
			"name": "createPaymentResource",
			"event": [
				{
					"listen": "test",
					"script": {
						"exec": [
							"var jsonData = JSON.parse(responseBody);",
							"postman.setEnvironmentVariable(\"payment_tool_token\", jsonData.paymentToolToken);",
							"postman.setEnvironmentVariable(\"payment_session\", jsonData.paymentSession);"
						],
						"type": "text/javascript"
					}
				}
			],
			"request": {
				"method": "POST",
				"header": [
					{
						"key": "Authorization",
						"value": "Bearer {{invoice_access_token}}"
					},
					{
						"key": "X-Request-ID",
						"value": "{{$timestamp}}"
					},
					{
						"key": "Content-Type",
						"value": "application/json; charset=utf-8"
					}
				],
				"body": {
					"mode": "raw",
					"raw": "{\n  \"paymentTool\": {\n    \"paymentToolType\": \"CardData\",\n    \"cardNumber\": \"4242424242424242\",\n    \"expDate\": \"12/24\",\n    \"cvv\": \"123\",\n    \"cardHolder\": \"SUCCESS CARD\"\n  },\n  \"clientInfo\": {\n  \"fingerprint\": \"123\"\n}\n}"
				},
				"url": {
					"raw": "{{api_endpoint}}/processing/payment-resources",
					"host": [
						"{{api_endpoint}}"
					],
					"path": [
						"processing",
						"payment-resources"
					]
				}
			},
			"response": []
		},
		{
			"name": "createCustomer",
			"event": [
				{
					"listen": "test",
					"script": {
						"type": "text/javascript",
						"exec": [
							"var jsonData = JSON.parse(responseBody);",
							"postman.setEnvironmentVariable(\"customer_id\", jsonData.customer.id);",
							"postman.setEnvironmentVariable(\"customer_access_token\", jsonData.customerAccessToken.payload);"
						]
					}
				},
				{
					"listen": "prerequest",
					"script": {
						"type": "text/javascript",
						"exec": [
							"//Prefer relative invoice dueDate",
							"var Now = new Date();",
							"Now.setHours(Now.getHours() + 1);",
							"postman.setEnvironmentVariable('now_plus_1h',(Now).toISOString())"
						]
					}
				}
			],
			"request": {
				"method": "POST",
				"header": [
					{
						"key": "X-Request-ID",
						"value": "{{$timestamp}}"
					},
					{
						"key": "Content-Type",
						"value": "application/json; charset=utf-8"
					},
					{
						"key": "Authorization",
						"value": "Bearer {{api_key}}"
					}
				],
				"body": {
					"mode": "raw",
					"raw": "{\r\n  \"shopID\": \"{{shop_id}}\",\r\n  \"contactInfo\": {\r\n    \"email\": \"user@example.com\",\r\n    \"phoneNumber\": \"79876543210\"\r\n  },\r\n  \"metadata\": {}\r\n}"
				},
				"url": {
					"raw": "{{api_endpoint}}/processing/customers",
					"host": [
						"{{api_endpoint}}"
					],
					"path": [
						"processing",
						"customers"
					]
				}
			},
			"response": []
		},
		{
			"name": "createCustomerBinding",
			"event": [
				{
					"listen": "test",
					"script": {
						"exec": [
							""
						],
						"type": "text/javascript"
					}
				},
				{
					"listen": "prerequest",
					"script": {
						"exec": [
							"//Prefer relative invoice dueDate",
							"var Now = new Date();",
							"Now.setHours(Now.getHours() + 1);",
							"postman.setEnvironmentVariable('now_plus_1h',(Now).toISOString())"
						],
						"type": "text/javascript"
					}
				}
			],
			"request": {
				"method": "POST",
				"header": [
					{
						"key": "Authorization",
						"value": "Bearer {{api_key}}"
					},
					{
						"key": "X-Request-ID",
						"value": "{{$timestamp}}"
					},
					{
						"key": "Content-Type",
						"value": "application/json; charset=utf-8"
					}
				],
				"body": {
					"mode": "raw",
					"raw": "// Создание связки плательщик-платежное средство\r\n{\r\n  \"paymentResource\": {\r\n    \"paymentToolToken\": \"{{payment_tool_token}}\",\r\n    \"paymentSession\": \"{{payment_session}}\"\r\n  }\r\n}"
				},
				"url": {
					"raw": "{{api_endpoint}}/processing/customers/{{customer_id}}/bindings",
					"host": [
						"{{api_endpoint}}"
					],
					"path": [
						"processing",
						"customers",
						"{{customer_id}}",
						"bindings"
					]
				}
			},
			"response": []
		},
		{
			"name": "createPayment(type=PaymentFlowInstant)",
			"event": [
				{
					"listen": "test",
					"script": {
						"exec": [
							"var jsonData = JSON.parse(responseBody);",
							"postman.setEnvironmentVariable(\"payment_id\", jsonData.id);"
						],
						"type": "text/javascript"
					}
				}
			],
			"request": {
				"method": "POST",
				"header": [
					{
						"key": "Authorization",
						"value": "Bearer {{invoice_access_token}}"
					},
					{
						"key": "X-Request-ID",
						"value": "{{$timestamp}}"
					},
					{
						"key": "Content-Type",
						"value": "application/json; charset=utf-8"
					}
				],
				"body": {
					"mode": "raw",
					"raw": "// Создание моментального платежа (без холдрования)\n{\n  \"flow\": {\n    \"type\": \"PaymentFlowInstant\"\n  },\n  \"payer\": {\n  \t  \"payerType\": \"PaymentResourcePayer\",\n\t  \"paymentToolToken\":\"{{payment_tool_token}}\",\n\t  \"paymentSession\":\"{{payment_session}}\",\n\t  \"contactInfo\":\n\t    {\n\t      \"email\":\"{{notifications_email}}\",\n\t      \"phoneNumber\":\"9876543210\"\n\t    }\n  }\n}"
				},
				"url": {
					"raw": "{{api_endpoint}}/processing/invoices/{{invoice_id}}/payments",
					"host": [
						"{{api_endpoint}}"
					],
					"path": [
						"processing",
						"invoices",
						"{{invoice_id}}",
						"payments"
					]
				}
			},
			"response": []
		},
		{
			"name": "createCustomerInstantPayment",
			"event": [
				{
					"listen": "test",
					"script": {
						"type": "text/javascript",
						"exec": [
							"var jsonData = JSON.parse(responseBody);",
							"postman.setEnvironmentVariable(\"payment_id\", jsonData.id);"
						]
					}
				}
			],
			"request": {
				"method": "POST",
				"header": [
					{
						"key": "Authorization",
						"value": "Bearer {{invoice_access_token}}"
					},
					{
						"key": "X-Request-ID",
						"value": "{{$timestamp}}"
					},
					{
						"key": "Content-Type",
						"value": "application/json; charset=utf-8"
					}
				],
				"body": {
					"mode": "raw",
					"raw": "{\r\n  \"flow\": {\r\n    \"type\": \"PaymentFlowInstant\"\r\n  },\r\n  \"payer\": {\r\n    \"payerType\": \"CustomerPayer\",\r\n    \"customerID\": \"{{customer_id}}\"\r\n  }\r\n}"
				},
				"url": {
					"raw": "{{api_endpoint}}/processing/invoices/{{invoice_id}}/payments",
					"host": [
						"{{api_endpoint}}"
					],
					"path": [
						"processing",
						"invoices",
						"{{invoice_id}}",
						"payments"
					]
				}
			},
			"response": []
		},
		{
			"name": "createPayment(type=PaymentFlowHold)",
			"event": [
				{
					"listen": "test",
					"script": {
						"exec": [
							"var jsonData = JSON.parse(responseBody);",
							"postman.setEnvironmentVariable(\"payment_id\", jsonData.id);"
						],
						"type": "text/javascript"
					}
				}
			],
			"request": {
				"method": "POST",
				"header": [
					{
						"key": "Authorization",
						"value": "Bearer {{invoice_access_token}}"
					},
					{
						"key": "X-Request-ID",
						"value": "{{$timestamp}}"
					},
					{
						"key": "Content-Type",
						"value": "application/json; charset=utf-8"
					}
				],
				"body": {
					"mode": "raw",
					"raw": "// Создание холдированного платежа\n{\n  \"flow\": {\n    \"type\": \"PaymentFlowHold\",\n    \"onHoldExpiration\": \"cancel\"\n  },\n  \"payer\": {\n  \t  \"payerType\": \"PaymentResourcePayer\",\n\t  \"paymentToolToken\":\"{{payment_tool_token}}\",\n\t  \"paymentSession\":\"{{payment_session}}\",\n\t  \"contactInfo\":\n\t    {\n\t      \"email\":\"{{notifications_email}}\",\n\t      \"phoneNumber\":\"9876543210\"\n\t    }\n  }\n}"
				},
				"url": {
					"raw": "{{api_endpoint}}/processing/invoices/{{invoice_id}}/payments",
					"host": [
						"{{api_endpoint}}"
					],
					"path": [
						"processing",
						"invoices",
						"{{invoice_id}}",
						"payments"
					]
				}
			},
			"response": []
		},
		{
			"name": "capturePayment",
			"request": {
				"method": "POST",
				"header": [
					{
						"key": "Authorization",
						"value": "Bearer {{invoice_access_token}}"
					},
					{
						"key": "X-Request-ID",
						"value": "{{$timestamp}}"
					},
					{
						"key": "Content-Type",
						"value": "application/json; charset=utf-8"
					}
				],
				"body": {
					"mode": "raw",
					"raw": "{\n\t\"reason\": \"capture\"\n}"
				},
				"url": {
					"raw": "{{api_endpoint}}/processing/invoices/{{invoice_id}}/payments/{{payment_id}}/capture",
					"host": [
						"{{api_endpoint}}"
					],
					"path": [
						"processing",
						"invoices",
						"{{invoice_id}}",
						"payments",
						"{{payment_id}}",
						"capture"
					]
				}
			},
			"response": []
		},
		{
			"name": "cancelPayment",
			"request": {
				"method": "POST",
				"header": [
					{
						"key": "Authorization",
						"value": "Bearer {{invoice_access_token}}"
					},
					{
						"key": "X-Request-ID",
						"value": "{{$timestamp}}"
					},
					{
						"key": "Content-Type",
						"value": "application/json; charset=utf-8"
					}
				],
				"body": {
					"mode": "raw",
					"raw": "{\n\t\"reason\": \"cancel\"\n}"
				},
				"url": {
					"raw": "{{api_endpoint}}/processing/invoices/{{invoice_id}}/payments/{{payment_id}}/cancel",
					"host": [
						"{{api_endpoint}}"
					],
					"path": [
						"processing",
						"invoices",
						"{{invoice_id}}",
						"payments",
						"{{payment_id}}",
						"cancel"
					]
				}
			},
			"response": []
		},
		{
			"name": "createRefund",
			"event": [
				{
					"listen": "test",
					"script": {
						"exec": [
							""
						],
						"type": "text/javascript"
					}
				},
				{
					"listen": "prerequest",
					"script": {
						"exec": [
							"//Prefer relative invoice dueDate",
							"var Now = new Date();",
							"Now.setHours(Now.getHours() + 1);",
							"postman.setEnvironmentVariable('now_plus_1h',(Now).toISOString())"
						],
						"type": "text/javascript"
					}
				}
			],
			"request": {
				"method": "POST",
				"header": [
					{
						"key": "Authorization",
						"value": "Bearer {{api_key}}"
					},
					{
						"key": "X-Request-ID",
						"value": "{{$timestamp}}"
					},
					{
						"key": "Content-Type",
						"value": "application/json; charset=utf-8"
					}
				],
				"body": {
					"mode": "raw",
					"raw": "/*Данным методом создаются частичные и полные возвраты. Для полного возврата необходимо указать полную сумму платежа*/\r\n{\r\n  \"amount\": 100, //сумма возврата, не превышающая сумму платежа\r\n  \"currency\": \"RUB\",\r\n  \"reason\": \"string\"\r\n}"
				},
				"url": {
					"raw": "{{api_endpoint}}/processing/invoices/{{invoice_id}}/payments/{{payment_id}}/refunds",
					"host": [
						"{{api_endpoint}}"
					],
					"path": [
						"processing",
						"invoices",
						"{{invoice_id}}",
						"payments",
						"{{payment_id}}",
						"refunds"
					]
				}
			},
			"response": []
		},
		{
			"name": "getInvoiceById",
			"protocolProfileBehavior": {
				"disableBodyPruning": true
			},
			"request": {
				"method": "GET",
				"header": [
					{
						"key": "Authorization",
						"value": "Bearer {{invoice_access_token}}"
					},
					{
						"key": "X-Request-ID",
						"value": "{{$timestamp}}"
					},
					{
						"key": "Content-Type",
						"value": "application/json; charset=utf-8"
					}
				],
				"body": {
					"mode": "raw",
					"raw": "//Получить данные по инвойсу"
				},
				"url": {
					"raw": "{{api_endpoint}}/processing/invoices/{{invoice_id}}",
					"host": [
						"{{api_endpoint}}"
					],
					"path": [
						"processing",
						"invoices",
						"{{invoice_id}}"
					]
				}
			},
			"response": []
		},
		{
			"name": "getCustomerById",
			"protocolProfileBehavior": {
				"disableBodyPruning": true
			},
			"request": {
				"method": "GET",
				"header": [
					{
						"key": "Authorization",
						"value": "Bearer {{api_key}}"
					},
					{
						"key": "X-Request-ID",
						"value": "{{$timestamp}}"
					},
					{
						"key": "Content-Type",
						"value": "application/json; charset=utf-8"
					}
				],
				"body": {
					"mode": "raw",
					"raw": "//Получить данные о плательщике"
				},
				"url": {
					"raw": "{{api_endpoint}}/processing/customers/{{customer_id}}",
					"host": [
						"{{api_endpoint}}"
					],
					"path": [
						"processing",
						"customers",
						"{{customer_id}}"
					]
				}
			},
			"response": []
		},
		{
			"name": "getCustomerEvents",
			"protocolProfileBehavior": {
				"disableBodyPruning": true
			},
			"request": {
				"method": "GET",
				"header": [
					{
						"key": "Authorization",
						"value": "Bearer {{api_key}}"
					},
					{
						"key": "X-Request-ID",
						"value": "{{$timestamp}}"
					},
					{
						"key": "Content-Type",
						"value": "application/json; charset=utf-8"
					}
				],
				"body": {
					"mode": "raw",
					"raw": "// Получить события плательщика"
				},
				"url": {
					"raw": "{{api_endpoint}}/processing/customers/{{customer_id}}/events?limit={{limit}}",
					"host": [
						"{{api_endpoint}}"
					],
					"path": [
						"processing",
						"customers",
						"{{customer_id}}",
						"events"
					],
					"query": [
						{
							"key": "limit",
							"value": "{{limit}}"
						}
					]
				}
			},
			"response": []
		},
		{
			"name": "getInvoicePaymentMethods",
			"protocolProfileBehavior": {
				"disableBodyPruning": true
			},
			"request": {
				"method": "GET",
				"header": [
					{
						"key": "Authorization",
						"value": "Bearer {{invoice_access_token}}"
					},
					{
						"key": "X-Request-ID",
						"value": "{{$timestamp}}"
					},
					{
						"key": "Content-Type",
						"value": "application/json; charset=utf-8"
					}
				],
				"body": {
					"mode": "raw",
					"raw": "// Получить информацию о методах оплаты инвойса"
				},
				"url": {
					"raw": "{{api_endpoint}}/processing/invoices/{{invoice_id}}",
					"host": [
						"{{api_endpoint}}"
					],
					"path": [
						"processing",
						"invoices",
						"{{invoice_id}}"
					]
				}
			},
			"response": []
		},
		{
			"name": "getPaymentById",
			"protocolProfileBehavior": {
				"disableBodyPruning": true
			},
			"request": {
				"method": "GET",
				"header": [
					{
						"key": "Authorization",
						"value": "Bearer {{invoice_access_token}}"
					},
					{
						"key": "X-Request-ID",
						"value": "{{$timestamp}}"
					},
					{
						"key": "Content-Type",
						"value": "application/json; charset=utf-8"
					}
				],
				"body": {
					"mode": "raw",
					"raw": "// Получить информацию о платеже"
				},
				"url": {
					"raw": "{{api_endpoint}}/processing/invoices/{{invoice_id}}/payments/{{payment_id}}",
					"host": [
						"{{api_endpoint}}"
					],
					"path": [
						"processing",
						"invoices",
						"{{invoice_id}}",
						"payments",
						"{{payment_id}}"
					]
				}
			},
			"response": []
		},
		{
			"name": "getInvoiceEvents",
			"protocolProfileBehavior": {
				"disableBodyPruning": true
			},
			"request": {
				"method": "GET",
				"header": [
					{
						"key": "Authorization",
						"value": "Bearer {{api_key}}"
					},
					{
						"key": "X-Request-ID",
						"value": "{{$timestamp}}"
					}
				],
				"body": {
					"mode": "raw",
					"raw": "// Получить события по указанному инвойсу"
				},
				"url": {
					"raw": "{{api_endpoint}}/processing/invoices/{{invoice_id}}/events?limit={{limit}}",
					"host": [
						"{{api_endpoint}}"
					],
					"path": [
						"processing",
						"invoices",
						"{{invoice_id}}",
						"events"
					],
					"query": [
						{
							"key": "limit",
							"value": "{{limit}}"
						}
					]
				}
			},
			"response": []
		},
		{
			"name": "getInvoices",
			"protocolProfileBehavior": {
				"disableBodyPruning": true
			},
			"request": {
				"method": "GET",
				"header": [
					{
						"key": "Authorization",
						"value": "Bearer {{api_key}}"
					},
					{
						"key": "X-Request-ID",
						"value": "{{$timestamp}}"
					},
					{
						"key": "Content-Type",
						"value": "application/json; charset=utf-8"
					}
				],
				"body": {
					"mode": "raw",
					"raw": "// Получить данные о созданных инвойсах"
				},
				"url": {
					"raw": "{{api_endpoint}}/analytics/shops/{{shop_id}}/invoices?fromTime={{from_time}}&toTime={{to_time}}&limit={{limit}}",
					"host": [
						"{{api_endpoint}}"
					],
					"path": [
						"analytics",
						"shops",
						"{{shop_id}}",
						"invoices"
					],
					"query": [
						{
							"key": "fromTime",
							"value": "{{from_time}}"
						},
						{
							"key": "toTime",
							"value": "{{to_time}}"
						},
						{
							"key": "limit",
							"value": "{{limit}}"
						}
					]
				}
			},
			"response": []
		},
		{
			"name": "fulfillInvoice",
			"request": {
				"method": "POST",
				"header": [
					{
						"key": "Authorization",
						"value": "Bearer {{api_key}}"
					},
					{
						"key": "X-Request-ID",
						"value": "{{$timestamp}}"
					},
					{
						"key": "Content-Type",
						"value": "application/json; charset=utf-8"
					}
				],
				"body": {
					"mode": "raw",
					"raw": "// Погасить инвойс\n{\n  \"reason\": \"Purchase delivered\"\n}"
				},
				"url": {
					"raw": "{{api_endpoint}}/processing/invoices/{{invoice_id}}/fulfill",
					"host": [
						"{{api_endpoint}}"
					],
					"path": [
						"processing",
						"invoices",
						"{{invoice_id}}",
						"fulfill"
					]
				}
			},
			"response": []
		},
		{
			"name": "getWebhooks",
			"protocolProfileBehavior": {
				"disableBodyPruning": true
			},
			"request": {
				"auth": {
					"type": "bearer",
					"bearer": [
						{
							"key": "token",
							"value": "{{api_key}}",
							"type": "string"
						}
					]
				},
				"method": "GET",
				"header": [
					{
						"key": "X-Request-ID",
						"value": "{{$timestamp}}"
					},
					{
						"key": "Content-Type",
						"value": "application/json"
					}
				],
				"body": {
					"mode": "raw",
					"raw": "// Получить данные об установленных вебхуках"
				},
				"url": {
					"raw": "{{api_endpoint}}/processing/webhooks",
					"host": [
						"{{api_endpoint}}"
					],
					"path": [
						"processing",
						"webhooks"
					]
				}
			},
			"response": []
		}
	]
}