---
# System prepended metadata

title: Pathao Pro Api Doc

---

# Pathao Pro Api Doc


PRD link
https://docs.google.com/document/d/1VKN4Z2W7LgSLfeagVfEoOXmQtb-1smlnlZLM25NcOEQ

Base Url: /api/v1/app

### Create Invoice
* API: /subscriptions/:subscriptionId/invoice
* Method: POST
* Request Body: n/a
* note:
* Response:
    ```
    {
        "success": true,
        "message": "Invoice created successfully",
        "data": {
            invoiceId: ""
        }
    }
    ```
    ```
    {
        "success": false,
        "message": "Invalid Subsciption ID"
    }
    ```

### User
* API: /api/v1/users/:userId
* Method: GET
* Query Param:
* Request Body: n/a
* note:
* Response:
    ```
    {
        "success": true,
        "message": "...",
        "data": {
                "user_id": "1",
                "name": "",
                "phone_no": "",
                "email": "",
                "image_url": "",
                "status": "",
                "subscription_ids": [
                    "subs_id_1",
                    "subs_id_2",
                ],
                "invoice_ids": [
                    "inv_id_1",
                    "inv_id_2",
                ],
        }
    }
    ```
    ```
    {
        "success": false,
        "message": "invalid id"
    }
    ```

### Subscribed Packages
* API: /api/v1/users/:userId/subscriptions
* Method: GET
* Query Param:
    * subscription_ids: []
* Request Body: n/a
* note:
* Response:
    ```
    {
        "success": true,
        "message": "...",
        "data": [
            {
                subscription_id: "",
                package_id: "",
                created_at: "",
                expired_at: "",
                package_info: JSON,
                subscribed_members: [
                    {
                        user_id: "",
                        name: "",
                        image_url: "",
                        status: ""
                    }
                ],
            }
            
        ]
    }
    ```
    ```
    {
        "success": false,
        "message": "invalid id"
    }
    ```
    
### Subscribed Package Details
* API: /api/v1/subscriptions/:subscription_id
* Method: GET
* Query Param:
* Request Body: n/a
* note:
* Response:
    ```
    {
        "success": true,
        "message": "...",
        "data": [
            {
                subscription_id: "",
                package_id: "",
                created_at: "",
                expired_at: "",
                package_info: JSON,
                subscribed_members: [
                    {
                        user_id: "",
                        name: "",
                        image_url: "",
                        status: ""
                    }
                ],
                usage: {},
                invoice: {}
            }
            
        ]
    }
    ```
    ```
    {
        "success": false,
        "message": "invalid id"
    }
    ```

### Invite Members
* API: /api/v1/user/:userId/membership
* Method: POST
* Query Param: n/a
* Request Body: Required.
    ```
    {
        "package_id": "1"
        "phone_numbers": [
            "01xxxxxxxxx",
            "01xxxxxxxxx",
        ]
    }
    ```
* Response:
    ```
    {
        "success": true,
        "message": "..."
    }
    ```

### Remove Members
* API: /api/v1/user/:userId/membership
* Method: DELETE
* Query Param: n/a
* Request Body: Required.
    ```
    {
        "package_id": "1"
        "phone_numbers": [
            "01xxxxxxxxx",
        ]
    }
    ```
* Response:
    ```
    {
        "success": true,
        "message": "..."
    }
    ```
    
### Invoices
* API: /api/v1/invoices
* Method: GET
* Query Param:
    * user_id: String
* Request Body: n/a
* note:
* Response:
    ```
    {
        "success": true,
        "message": "...",
        "data": [
            {
                invoice_id: "",
                amount: "",
                discounted_amount: "",
                phone_no: "",
                otp: "",
                transaction_id: JSON,
                currency: "",
                user_id: "",
                subscription_id: "",
                created_at: "",
                updated_at: "",
                payment_status: "",
                payment_info: JSON
            }
            
        ]
    }
    ```
    ```
    {
        "success": false,
        "message": "invalid id"
    }
    ```