{
    "variable": [
        {
            "id": "baseUrl",
            "key": "baseUrl",
            "type": "string",
            "name": "string",
            "value": "https:\/\/paysuite.tech"
        }
    ],
    "info": {
        "name": "PaySuite",
        "_postman_id": "7e0ac5b2-1838-4c10-8f1f-ad02afda5f1f",
        "description": "",
        "schema": "https:\/\/schema.getpostman.com\/json\/collection\/v2.1.0\/collection.json"
    },
    "item": [
        {
            "name": "Payment Requests",
            "description": "\nAPIs for managing payment requests",
            "item": [
                {
                    "name": "Create Payment Request",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/v1\/payments",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/v1\/payments"
                        },
                        "method": "POST",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": {
                            "mode": "raw",
                            "raw": "{\"amount\":\"100.50\",\"reference\":\"INV2024001\",\"description\":\"Payment for invoice INV2024001\",\"return_url\":\"https:\\\/\\\/example.com\\\/success\"}"
                        },
                        "description": "Creates a new payment request in the system."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 201,
                            "body": "{\n    \"status\": \"success\",\n    \"data\": {\n        \"id\": \"550e8400-e29b-41d4-a716-446655440000\",\n        \"amount\": 100.50,\n        \"reference\": \"INV2024001\",\n        \"status\": \"pending\",\n        \"checkout_url\": \"https:\/\/paysuite.test\/checkout\/550e8400-e29b-41d4-a716-446655440000\"\n    }\n}",
                            "name": ""
                        },
                        {
                            "header": [],
                            "code": 422,
                            "body": "{\n    \"status\": \"error\",\n    \"message\": \"Invalid input\"\n}",
                            "name": ""
                        }
                    ]
                },
                {
                    "name": "Get Payment Request",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/v1\/payments\/:id",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/v1\/payments\/:id",
                            "variable": [
                                {
                                    "id": "id",
                                    "key": "id",
                                    "value": "01H8X9V8X9Y8Z9A8B8C8D8E8F8",
                                    "description": "ULID of the payment request."
                                }
                            ]
                        },
                        "method": "GET",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": null,
                        "description": "Returns the details of a specific payment request."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\n    \"status\": \"success\",\n    \"data\": {\n        \"id\": \"550e8400-e29b-41d4-a716-446655440000\",\n        \"amount\": 100.50,\n        \"reference\": \"INV2024001\",\n        \"status\": \"paid\",\n        \"transaction\": {\n            \"id\": 1,\n            \"status\": \"completed\",\n            \"transaction_id\": \"MPESA123456\",\n            \"paid_at\": \"2024-02-10T10:15:00.000000Z\"\n        }\n    }\n}",
                            "name": ""
                        },
                        {
                            "header": [],
                            "code": 404,
                            "body": "{\n    \"status\": \"error\",\n    \"message\": \"Payment request not found.\"\n}",
                            "name": ""
                        }
                    ]
                }
            ]
        },
        {
            "name": "Payout Requests",
            "description": "\nAPIs for managing payout requests. Payout statuses: pending, completed, failed, cancelled.",
            "item": [
                {
                    "name": "List Payouts",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/v1\/payouts",
                            "query": [
                                {
                                    "key": "page",
                                    "value": "1",
                                    "description": "Page number.",
                                    "disabled": false
                                },
                                {
                                    "key": "limit",
                                    "value": "15",
                                    "description": "Number of items per page.",
                                    "disabled": false
                                }
                            ],
                            "raw": "{{baseUrl}}\/api\/v1\/payouts?page=1&limit=15"
                        },
                        "method": "GET",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": {
                            "mode": "raw",
                            "raw": "{\"page\":11,\"limit\":12}"
                        },
                        "description": "Returns a paginated list of payouts for the authenticated account."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\n    \"data\": [\n        {\n            \"id\": \"550e8400-e29b-41d4-a716-446655440000\",\n            \"amount\": 100.00,\n            \"reference\": \"PO123ABC456\",\n            \"status\": \"pending\",\n            \"description\": \"Payout request\",\n            \"method\": \"mpesa\",\n            \"beneficiary\": {\"phone\": \"841234567\", \"holder\": \"John Doe\"},\n            \"created_at\": \"2024-02-28T10:00:00.000000Z\"\n        }\n    ],\n    \"links\": {...},\n    \"meta\": {...}\n}",
                            "name": ""
                        }
                    ]
                },
                {
                    "name": "Get Payout",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/v1\/payouts\/:id",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/v1\/payouts\/:id",
                            "variable": [
                                {
                                    "id": "id",
                                    "key": "id",
                                    "value": "01H8X9V8X9Y8Z9A8B8C8D8E8F8",
                                    "description": "ULID of the payout."
                                }
                            ]
                        },
                        "method": "GET",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": null,
                        "description": "Returns the details of a specific payout."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\n    \"data\": {\n        \"id\": \"550e8400-e29b-41d4-a716-446655440000\",\n        \"amount\": 100.00,\n        \"reference\": \"PO123ABC456\",\n        \"status\": \"pending\",\n        \"description\": \"Payout request\",\n        \"method\": \"mpesa\",\n        \"beneficiary\": {\"phone\": \"841234567\", \"holder\": \"John Doe\"},\n        \"created_at\": \"2024-02-28T10:00:00.000000Z\"\n    }\n}",
                            "name": ""
                        },
                        {
                            "header": [],
                            "code": 404,
                            "body": "{\n    \"message\": \"Payout not found.\"\n}",
                            "name": ""
                        }
                    ]
                }
            ]
        },
        {
            "name": "Refunds",
            "description": "\nAPIs for managing refunds. Refund statuses: pending, processing, completed, failed, cancelled.",
            "item": [
                {
                    "name": "List Refunds",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/v1\/refunds",
                            "query": [
                                {
                                    "key": "page",
                                    "value": "1",
                                    "description": "Page number.",
                                    "disabled": false
                                },
                                {
                                    "key": "limit",
                                    "value": "20",
                                    "description": "Number of items per page.",
                                    "disabled": false
                                }
                            ],
                            "raw": "{{baseUrl}}\/api\/v1\/refunds?page=1&limit=20"
                        },
                        "method": "GET",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": {
                            "mode": "raw",
                            "raw": "{\"page\":4,\"limit\":25}"
                        },
                        "description": "Returns a paginated list of refunds for the authenticated account."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\n    \"data\": [\n        {\n            \"id\": \"01H8X9V8X9Y8Z9A8B8C8D8E8F8\",\n            \"payment_id\": \"01H8X9V8X9Y8Z9A8B8C8D8E8F8\",\n            \"amount\": 50.00,\n            \"status\": \"completed\",\n            \"reason\": \"Customer requested refund\"\n        }\n    ],\n    \"links\": {...},\n    \"meta\": {...}\n}",
                            "name": ""
                        },
                        {
                            "header": [],
                            "code": 422,
                            "body": "{\n    \"message\": \"The limit field must not be greater than 100.\"\n}",
                            "name": ""
                        }
                    ]
                },
                {
                    "name": "Create Refund",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/v1\/refunds",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/v1\/refunds"
                        },
                        "method": "POST",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": {
                            "mode": "raw",
                            "raw": "{\"payment_id\":\"01H8X9V8X9Y8Z9A8B8C8D8E8F8\",\"amount\":\"50.00\",\"reason\":\"Customer requested refund\"}"
                        },
                        "description": "Creates a new refund request for a completed payment."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 201,
                            "body": "{\n    \"status\": \"success\",\n    \"data\": {\n        \"id\": \"01H8X9V8X9Y8Z9A8B8C8D8E8F8\",\n        \"payment_id\": \"01H8X9V8X9Y8Z9A8B8C8D8E8F8\",\n        \"amount\": 50.00,\n        \"status\": \"pending\",\n        \"reason\": \"Customer requested refund\"\n    }\n}",
                            "name": ""
                        },
                        {
                            "header": [],
                            "code": 404,
                            "body": "{\n    \"status\": \"error\",\n    \"message\": \"Payment not found.\"\n}",
                            "name": ""
                        },
                        {
                            "header": [],
                            "code": 422,
                            "body": "{\n    \"status\": \"error\",\n    \"message\": \"Payment cannot be refunded. It must be completed and have available refund amount.\"\n}",
                            "name": ""
                        },
                        {
                            "header": [],
                            "code": 422,
                            "body": "{\n    \"status\": \"error\",\n    \"message\": \"Refund amount cannot exceed available refund amount of {amount}.\"\n}",
                            "name": ""
                        }
                    ]
                },
                {
                    "name": "Get Refund",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/v1\/refunds\/:id",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/v1\/refunds\/:id",
                            "variable": [
                                {
                                    "id": "id",
                                    "key": "id",
                                    "value": "laudantium",
                                    "description": "The ID of the refund."
                                },
                                {
                                    "id": "ulid",
                                    "key": "ulid",
                                    "value": "01H8X9V8X9Y8Z9A8B8C8D8E8F8",
                                    "description": "ULID of the refund."
                                }
                            ]
                        },
                        "method": "GET",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": null,
                        "description": "Returns the details of a specific refund including gateway records."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\n    \"status\": \"success\",\n    \"data\": {\n        \"id\": \"01H8X9V8X9Y8Z9A8B8C8D8E8F8\",\n        \"payment_id\": \"01H8X9V8X9Y8Z9A8B8C8D8E8F8\",\n        \"amount\": 50.00,\n        \"status\": \"completed\",\n        \"reason\": \"Customer requested refund\",\n        \"payment\": {...}\n    }\n}",
                            "name": ""
                        },
                        {
                            "header": [],
                            "code": 404,
                            "body": "{\n    \"status\": \"error\",\n    \"message\": \"Refund not found.\"\n}",
                            "name": ""
                        }
                    ]
                }
            ]
        }
    ],
    "auth": {
        "type": "bearer",
        "bearer": [
            {
                "key": "key",
                "type": "string"
            }
        ]
    }
}