{
	"info": {
		"_postman_id": "96d8dd82-28d0-4964-afe5-7d962ef73e53",
		"name": "Partner Docs (docs)",
		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
		"_exporter_id": "26595805"
	},
	"item": [
		{
			"name": "Onboarding from Grandparent",
			"item": [
				{
					"name": "Grandparent Token",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"",
									"pm.test(\"token generated successfully\", function(){",
									"    var resp = JSON.parse(responseBody);",
									"    pm.collectionVariables.set(\"grandparent_token\", resp.access_token);",
									"})"
								],
								"type": "text/javascript",
								"packages": {}
							}
						}
					],
					"request": {
						"auth": {
							"type": "noauth"
						},
						"method": "POST",
						"header": [],
						"body": {
							"mode": "urlencoded",
							"urlencoded": [
								{
									"key": "client_id",
									"value": "{{grandparent_client_id}}",
									"type": "text"
								},
								{
									"key": "client_secret",
									"value": "{{grandparent_client_secret}}",
									"type": "text"
								},
								{
									"key": "grant_type",
									"value": "client_credentials",
									"type": "text"
								},
								{
									"key": "scope",
									"value": "grandparent",
									"type": "text"
								},
								{
									"key": "response_type",
									"value": "token",
									"type": "text"
								},
								{
									"key": "",
									"value": "",
									"type": "text",
									"disabled": true
								}
							]
						},
						"url": {
							"raw": "{{auth_url}}/token",
							"host": [
								"{{auth_url}}"
							],
							"path": [
								"token"
							]
						},
						"description": "This endpoint is used to generate JWT tokens, that then be used to make server-server requests using the authorisation bearer token header"
					},
					"response": []
				},
				{
					"name": "Parent",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"",
									"pm.test(\"parent onboarded successfully\", function(){",
									"    var resp = JSON.parse(responseBody);",
									"    console.log(resp);",
									"    pm.collectionVariables.set(\"parent_client_id\", resp.parentId);",
									"    pm.collectionVariables.set(\"parent_client_secret\", resp.authSecret);",
									"})"
								],
								"type": "text/javascript",
								"packages": {}
							}
						}
					],
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{grandparent_token}}",
									"type": "string"
								}
							]
						},
						"method": "POST",
						"header": [],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"parentName\": \"test - parent {{$guid}}\",\n  \"status\": true\n  // \"theme\": {\n  //   \"logo\": \"text\",\n  //   \"leftSidebarBgColor\": \"text\",\n  //   \"leftSidebarActiveColor\": \"text\",\n  //   \"leftSidebarHoverColor\": \"text\",\n  //   \"leftSidebarTextColor\": \"text\",\n  //   \"topBarTextColor\": \"text\",\n  //   \"topBarBgColor\": \"text\",\n  //   \"paymentLinkMenuAlias\": \"text\"\n  // },\n  // \"grandparentId\": \"text\",\n  // \"slug\": {}\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "{{api_url}}/parents/create",
							"host": [
								"{{api_url}}"
							],
							"path": [
								"parents",
								"create"
							]
						}
					},
					"response": []
				},
				{
					"name": "Merchant",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"",
									"pm.test(\"merchant onboarded successfully\", function(){",
									"    var resp = JSON.parse(responseBody);",
									"    pm.collectionVariables.set(\"merchant_client_id\", resp.authClientId);",
									"    pm.collectionVariables.set(\"merchant_client_secret\", resp.authClientSecret);",
									"})"
								],
								"type": "text/javascript",
								"packages": {}
							}
						}
					],
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{grandparent_token}}",
									"type": "string"
								}
							]
						},
						"method": "POST",
						"header": [],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"merchantName\": \"test merchant - {{$guid}}\",\n  \"status\": true,\n  \"parentId\": \"{{parent_client_id}}\" // client Id and ID are the same (will default to auth parent if you have parent scope\n  // \"theme\": {\n  //   \"logo\": \"text\",\n  //   \"leftSidebarBgColor\": \"text\",\n  //   \"leftSidebarActiveColor\": \"text\",\n  //   \"leftSidebarHoverColor\": \"text\",\n  //   \"leftSidebarTextColor\": \"text\",\n  //   \"topBarTextColor\": \"text\",\n  //   \"topBarBgColor\": \"text\",\n  //   \"paymentLinkMenuAlias\": \"text\"\n  // },\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "{{api_url}}/merchants/create",
							"host": [
								"{{api_url}}"
							],
							"path": [
								"merchants",
								"create"
							]
						}
					},
					"response": []
				}
			]
		},
		{
			"name": "Onboarding from Parent",
			"item": [
				{
					"name": "Parent Token",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"",
									"pm.test(\"token generated successfully\", function(){",
									"    var resp = JSON.parse(responseBody);",
									"    pm.collectionVariables.set(\"parent_token\", resp.access_token);",
									"})"
								],
								"type": "text/javascript",
								"packages": {}
							}
						}
					],
					"request": {
						"auth": {
							"type": "noauth"
						},
						"method": "POST",
						"header": [],
						"body": {
							"mode": "urlencoded",
							"urlencoded": [
								{
									"key": "client_id",
									"value": "{{parent_client_id}}",
									"type": "text"
								},
								{
									"key": "client_secret",
									"value": "{{parent_client_secret}}",
									"type": "text"
								},
								{
									"key": "grant_type",
									"value": "client_credentials",
									"type": "text"
								},
								{
									"key": "scope",
									"value": "parent",
									"type": "text"
								},
								{
									"key": "response_type",
									"value": "token",
									"type": "text"
								},
								{
									"key": "",
									"value": "",
									"type": "text",
									"disabled": true
								}
							]
						},
						"url": {
							"raw": "{{auth_url}}/token",
							"host": [
								"{{auth_url}}"
							],
							"path": [
								"token"
							]
						},
						"description": "This endpoint is used to generate JWT tokens, that then be used to make server-server requests using the authorisation bearer token header"
					},
					"response": []
				},
				{
					"name": "Merchant",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"",
									"pm.test(\"merchant onboarded successfully\", function(){",
									"    var resp = JSON.parse(responseBody);",
									"    pm.collectionVariables.set(\"merchant_client_id\", resp.authClientId);",
									"    pm.collectionVariables.set(\"merchant_client_secret\", resp.authClientSecret);",
									"})"
								],
								"type": "text/javascript",
								"packages": {}
							}
						}
					],
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{parent_token}}",
									"type": "string"
								}
							]
						},
						"method": "POST",
						"header": [],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"merchantName\": \"text\",\n  \"status\": true\n  // \"theme\": {\n  //   \"logo\": \"text\",\n  //   \"leftSidebarBgColor\": \"text\",\n  //   \"leftSidebarActiveColor\": \"text\",\n  //   \"leftSidebarHoverColor\": \"text\",\n  //   \"leftSidebarTextColor\": \"text\",\n  //   \"topBarTextColor\": \"text\",\n  //   \"topBarBgColor\": \"text\",\n  //   \"paymentLinkMenuAlias\": \"text\"\n  // },\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "{{api_url}}/merchants/create",
							"host": [
								"{{api_url}}"
							],
							"path": [
								"merchants",
								"create"
							]
						}
					},
					"response": []
				}
			]
		},
		{
			"name": "Merchant Payment Method Configuration",
			"item": [
				{
					"name": "Merchant Token",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"",
									"pm.test(\"token generated successfully\", function(){",
									"    var resp = JSON.parse(responseBody);",
									"    pm.collectionVariables.set(\"merchant_token\", resp.access_token);",
									"})"
								],
								"type": "text/javascript",
								"packages": {}
							}
						}
					],
					"request": {
						"auth": {
							"type": "noauth"
						},
						"method": "POST",
						"header": [],
						"body": {
							"mode": "urlencoded",
							"urlencoded": [
								{
									"key": "client_id",
									"value": "{{merchant_client_id}}",
									"type": "text"
								},
								{
									"key": "client_secret",
									"value": "{{merchant_client_secret}}",
									"type": "text"
								},
								{
									"key": "grant_type",
									"value": "client_credentials",
									"type": "text"
								},
								{
									"key": "scope",
									"value": "merchant",
									"type": "text"
								},
								{
									"key": "response_type",
									"value": "token",
									"type": "text"
								},
								{
									"key": "",
									"value": "",
									"type": "text",
									"disabled": true
								}
							]
						},
						"url": {
							"raw": "{{auth_url}}/token",
							"host": [
								"{{auth_url}}"
							],
							"path": [
								"token"
							]
						},
						"description": "This endpoint is used to generate JWT tokens, that then be used to make server-server requests using the authorisation bearer token header"
					},
					"response": []
				},
				{
					"name": "New Providers",
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{merchant_token}}",
									"type": "string"
								}
							]
						},
						"method": "GET",
						"header": [],
						"url": {
							"raw": "{{api_url}}/merchant/provider/new",
							"host": [
								"{{api_url}}"
							],
							"path": [
								"merchant",
								"provider",
								"new"
							]
						}
					},
					"response": []
				},
				{
					"name": "Activiate Provider",
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{merchant_token}}",
									"type": "string"
								}
							]
						},
						"method": "POST",
						"header": [],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"credentials\": {\n        \"apiKey\": \"8e65ed69-d84e-4ddd-82a9-031de6181869\",\n        \"apiSecret\": \"klarna_test_api_dUZoaVVIYkticTB2LWhhd0QyMUhBbDIzU2ExIVg5d1EsOGU2NWVkNjktZDg0ZS00ZGRkLTgyYTktMDMxZGU2MTgxODY5LDEsQitidkE1SnJzckZuUXZIUDZJM1pXQTFKTmZZSzJnTGVBMW1rbTY4aUcyaz0\"\n    },\n    \"provider\": \"KLARNA_AU\",\n    \"currency\": \"AUD\",\n    \"channels\": []\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "{{api_url}}/merchant/provider/activate/new",
							"host": [
								"{{api_url}}"
							],
							"path": [
								"merchant",
								"provider",
								"activate",
								"new"
							]
						}
					},
					"response": []
				},
				{
					"name": "Active Providers",
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{merchant_token}}",
									"type": "string"
								}
							]
						},
						"method": "GET",
						"header": [],
						"url": {
							"raw": "{{api_url}}/merchant/provider/available",
							"host": [
								"{{api_url}}"
							],
							"path": [
								"merchant",
								"provider",
								"available"
							]
						}
					},
					"response": []
				}
			]
		}
	],
	"event": [
		{
			"listen": "prerequest",
			"script": {
				"type": "text/javascript",
				"packages": {},
				"exec": [
					""
				]
			}
		},
		{
			"listen": "test",
			"script": {
				"type": "text/javascript",
				"packages": {},
				"exec": [
					""
				]
			}
		}
	],
	"variable": [
		{
			"key": "api_url",
			"value": "https://api.qa.optty.com",
			"type": "default"
		},
		{
			"key": "auth_url",
			"value": "https://auth.qa.optty.com",
			"type": "default"
		},
		{
			"key": "grandparent_client_id",
			"value": "",
			"type": "default"
		},
		{
			"key": "grandparent_client_secret",
			"value": "",
			"type": "default"
		},
		{
			"key": "grandparent_token",
			"value": "",
			"type": "default"
		},
		{
			"key": "parent_client_id",
			"value": "",
			"type": "default"
		},
		{
			"key": "parent_client_secret",
			"value": "",
			"type": "default"
		},
		{
			"key": "parent_token",
			"value": "",
			"type": "default"
		},
		{
			"key": "merchant_client_id",
			"value": "",
			"type": "default"
		},
		{
			"key": "merchant_client_secret",
			"value": "",
			"type": "default"
		},
		{
			"key": "merchant_token",
			"value": "",
			"type": "default"
		},
		{
			"key": "token",
			"value": ""
		},
		{
			"key": "theme",
			"value": "",
			"type": "string",
			"disabled": true
		},
		{
			"key": "logo",
			"value": "https://totaltele.com/wp-content/uploads/2025/05/01.-ipsum-logo-chevron-blue-1-4.png",
			"type": "string"
		},
		{
			"key": "leftSidebarBgColor",
			"value": "#000000",
			"type": "string"
		},
		{
			"key": "leftSidebarActiveColor",
			"value": "#C83224",
			"type": "string"
		},
		{
			"key": "leftSidebarHoverColor",
			"value": "#E8943E",
			"type": "string"
		},
		{
			"key": "leftSidebarTextColor",
			"value": "#EFF1F4",
			"type": "string"
		},
		{
			"key": "topBarTextColor",
			"value": "#FFFFFF",
			"type": "string"
		},
		{
			"key": "topBarBgColor",
			"value": "#E8943E",
			"type": "string"
		}
	]
}