{
	"info": {
		"_postman_id": "1ada067e-b3ff-4dea-b8ca-a2d48e1c5b4d",
		"name": "Withdrawals API",
		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
	},
	"item": [
		{
			"name": "Create Withdrawal",
			"event": [
				{
					"listen": "test",
					"script": {
						"exec": [
							"if (pm.response.code == '200') {",
							"    pm.globals.set(\"withdrawal_uid\", pm.response.json().uid)",
							"}"
						],
						"type": "text/javascript"
					}
				}
			],
			"request": {
				"auth": {
					"type": "bearer",
					"bearer": [
						{
							"key": "token",
							"value": "{{api_key}}",
							"type": "string"
						}
					]
				},
				"method": "POST",
				"header": [],
				"body": {
					"mode": "formdata",
					"formdata": [
						{
							"key": "amount",
							"value": "100",
							"type": "text"
						},
						{
							"key": "reference",
							"value": "withdrawal-ABC{{$randomInt}}",
							"type": "text"
						},
						{
							"key": "notify_url",
							"value": "{{notify_url}}",
							"type": "text"
						},
						{
							"key": "description",
							"value": "withdrawal",
							"type": "text"
						},
						{
							"key": "****************************************************",
							"value": "OPTIONAL PARAMETERS",
							"type": "text",
							"disabled": true
						},
						{
							"key": "metadata[key]",
							"value": "data",
							"type": "text",
							"disabled": true
						},
						{
							"key": "partner_fee",
							"value": "10",
							"type": "text",
							"disabled": true
						},
						{
							"key": "execution_date",
							"value": "2022-05-29 01:00:00",
							"type": "text",
							"disabled": true
						}
					]
				},
				"url": {
					"raw": "{{url}}/v1/merchants/:merchant_uid/withdrawals",
					"host": [
						"{{url}}"
					],
					"path": [
						"v1",
						"merchants",
						":merchant_uid",
						"withdrawals"
					],
					"variable": [
						{
							"key": "merchant_uid",
							"value": "{{merchant_uid}}"
						}
					]
				}
			},
			"response": []
		},
		{
			"name": "Create Withdrawal for specific Profile",
			"event": [
				{
					"listen": "test",
					"script": {
						"exec": [
							"if (pm.response.code == '200') {",
							"    pm.globals.set(\"withdrawal_uid\", pm.response.json().uid)",
							"}"
						],
						"type": "text/javascript"
					}
				}
			],
			"request": {
				"auth": {
					"type": "bearer",
					"bearer": [
						{
							"key": "token",
							"value": "{{api_key}}",
							"type": "string"
						}
					]
				},
				"method": "POST",
				"header": [],
				"body": {
					"mode": "formdata",
					"formdata": [
						{
							"key": "amount",
							"value": "100",
							"type": "text"
						},
						{
							"key": "reference",
							"value": "withdrawal-ABC{{$randomInt}}",
							"type": "text"
						},
						{
							"key": "notify_url",
							"value": "{{notify_url}}",
							"type": "text"
						},
						{
							"key": "description",
							"value": "withdrawal",
							"type": "text"
						},
						{
							"key": "****************************************************",
							"value": "OPTIONAL PARAMETERS",
							"type": "text",
							"disabled": true
						},
						{
							"key": "metadata[key]",
							"value": "data",
							"type": "text",
							"disabled": true
						},
						{
							"key": "partner_fee",
							"value": "10",
							"type": "text",
							"disabled": true
						},
						{
							"key": "execution_date",
							"value": "2022-05-01 01:00:00",
							"type": "text",
							"disabled": true
						}
					]
				},
				"url": {
					"raw": "{{url}}/v1/merchants/:merchant_uid/profiles/:profile_uid/withdrawals",
					"host": [
						"{{url}}"
					],
					"path": [
						"v1",
						"merchants",
						":merchant_uid",
						"profiles",
						":profile_uid",
						"withdrawals"
					],
					"variable": [
						{
							"key": "merchant_uid",
							"value": "{{merchant_uid}}"
						},
						{
							"key": "profile_uid",
							"value": "{{profile_uid}}"
						}
					]
				}
			},
			"response": []
		},
		{
			"name": "Get Withdrawals per merchant",
			"request": {
				"auth": {
					"type": "bearer",
					"bearer": [
						{
							"key": "token",
							"value": "{{api_key}}",
							"type": "string"
						}
					]
				},
				"method": "GET",
				"header": [],
				"url": {
					"raw": "{{url}}/v1/merchants/:merchant_uid/withdrawals",
					"host": [
						"{{url}}"
					],
					"path": [
						"v1",
						"merchants",
						":merchant_uid",
						"withdrawals"
					],
					"variable": [
						{
							"key": "merchant_uid",
							"value": "{{merchant_uid}}"
						}
					]
				}
			},
			"response": []
		},
		{
			"name": "Get Specific Withdrawal",
			"request": {
				"auth": {
					"type": "bearer",
					"bearer": [
						{
							"key": "token",
							"value": "{{api_key}}",
							"type": "string"
						}
					]
				},
				"method": "GET",
				"header": [],
				"url": {
					"raw": "{{url}}/v1/merchants/:merchant_uid/withdrawals/:withdrawal_uid",
					"host": [
						"{{url}}"
					],
					"path": [
						"v1",
						"merchants",
						":merchant_uid",
						"withdrawals",
						":withdrawal_uid"
					],
					"variable": [
						{
							"key": "merchant_uid",
							"value": "{{merchant_uid}}"
						},
						{
							"key": "withdrawal_uid",
							"value": "{{withdrawal_uid}}"
						}
					]
				}
			},
			"response": []
		},
		{
			"name": "Get All Withdrawals",
			"request": {
				"auth": {
					"type": "bearer",
					"bearer": [
						{
							"key": "token",
							"value": "{{api_key}}",
							"type": "string"
						}
					]
				},
				"method": "GET",
				"header": [],
				"url": {
					"raw": "{{url}}/v1/withdrawals",
					"host": [
						"{{url}}"
					],
					"path": [
						"v1",
						"withdrawals"
					]
				}
			},
			"response": []
		},
		{
			"name": "Delete Withdrawal",
			"request": {
				"auth": {
					"type": "bearer",
					"bearer": [
						{
							"key": "token",
							"value": "{{api_key}}",
							"type": "string"
						}
					]
				},
				"method": "DELETE",
				"header": [],
				"url": {
					"raw": "{{url}}/v1/withdrawals/:withdrawal_uid",
					"host": [
						"{{url}}"
					],
					"path": [
						"v1",
						"withdrawals",
						":withdrawal_uid"
					],
					"variable": [
						{
							"key": "withdrawal_uid",
							"value": "{{withdrawal_uid}}"
						}
					]
				}
			},
			"response": []
		}
	]
}