API v1 Reference

If you have any questions regarding the API, you can ask in the #dev channel in our Discord Server

API v1 is deprecated.


The v1 API is no longer actively developed or maintained due to poor implementation. Existing integrations will continue to work, but we cannot guarantee longterm availability. Please migrate to v2 as soon as you can.

login POST

Login and start a session with the server. If the user does not have 2FA enabled the TOTP code is not needed.

Endpoint: https://mypayindia.com/api/v1/login

Request body:

{
    "username": "username",
    "password": "password",
    "totp_code": "000000"
}


Response: 200 OK

{
    "success": true,
    "message": "Logged in!"
}

Errors

Invalid credentials: 401 Unauthorized

{
    "success": false,
    "message": "Invalid credentials"
}

2FA code was not provided: 202 Accepted

{
    "success": false,
    "message": "Please provide your authenticator code."
}

2FA code was incorrect: 401 Unauthorized

{
    "success": false,
    "message": "Invalid authenticator code."
}

Missing required fields: 400 Bad Request

{
    "success": false,
    "message": "Username or password is missing"
}

info GET

Get information about the logged in account.

Endpoint: https://mypayindia.com/api/v1/info


Response: 200 OK

{
    "success": true,
    "username": "username",
    "first_name": "first_name",
    "last_name": "last_name",
    "email": "[email protected]",
    "date_of_birth": "1970-01-01",
    "created": "1970-01-01 00:00:00",
    "balance": "123456.78",
    "2fa_ready": false
}

Errors

Not logged in: 401 Unauthorized

{
    "success": false,
    "message": "Unauthorized"
}

leaderboard GET

Get global leaderboard

Endpoint: https://mypayindia.com/api/v1/leaderboard


Response: 200 OK

{
  "success": true,
  "data": [
    {
      "username": "username",
      "balance": "123456.78",
      "created": "1970-01-01 00:00:00"
    },
    ...
  ]
}

transaction_history GET

Get transaction history for logged in account.

Endpoint: https://mypayindia.com/api/v1/transaction_history


Response: 200 OK

{
  "success": true,
  "data": [
    {
      "id": 123,
      "transaction_id": "TXN-1234567890-09af",
      "sender_id": 9,
      "target_id": 41,
      "amount": "123.45",
      "created": "1970-01-01 00:00:00",
      "status": "status",
      "sender_name": "sender_username",
      "target_name": "recipient_username"
    },
    ...
  ]
}

Errors

Not logged in: 401 Unauthorized

{
    "success": false,
    "message": "Unauthorized"
}

transaction POST

Get information about a transaction.

Endpoint: https://mypayindia.com/api/v1/transaction

Request body:

{
    "id": 123
}

// Or:

{
    "transaction_id": "TXN-1234567890-09af"
}

Note: id and transaction_id are not interchangeable and are not allowed to be used together in the same request.


Response: 200 OK

{
    "success": true,
    "id": 123,
    "transaction_id": "TXN-1234567890-09af",
    "sender_id": 9,
    "target_id": 41,
    "amount": "123.45",
    "created": "1970-01-01 00:00:00",
    "status": "status",
    "sender_name": "sender_username",
    "target_name": "recipient_username",
    "note": "My Note India"
}

Errors

Not logged in: 401 Unauthorized

{
    "success": false,
    "message": "Unauthorized"
}

Transaction id not provided: 400 Bad Request

{
    "success": false,
    "message": "Missing id"
}

transfer POST

Transfer money to recipient.

Endpoint: https://mypayindia.com/api/v1/transfer

Request body:

{
    "amount": "123.45",
    "recipient": "johnpayment",
    "note": "My Note India (note is optional)"
}

Recipient can be an integer (user ID) or string (username).


Response: 200 OK

{
    "success": true,
    "transaction_id": 123,
    "status": "status",
    "sender_id": 9,
    "recipient_id": 41,
    "amount": "123.45",
    "new_balance": "123345.99"
}

Errors

Not logged in: 401 Unauthorized

{
    "success": false,
    "message": "Unauthorized"
}

Amount not provided: 400 Bad Request

{
    "success": false,
    "message": "Missing amount"
}

Recipient not provided: 400 Bad Request

{
    "success": false,
    "message": "Missing recipient"
}

Create a payment link to share money with anyone who has a MyPayIndia account.

Endpoint: https://mypayindia.com/api/v1/create_payment_link

Request body:

{
    "amount": 123.45,
    "note": "My Note India"
}

Note: The note field is optional


Response: 200 OK

{
    "success": true,
    "id": 123,
    "token": "0123456789abcdef",
    "amount": 123.45,
    "note": "My Note India",
    "new_balance": 123345.67,
    "link_url": "URL_HERE"
}

Errors

Not logged in: 401 Unauthorized

{
    "success": false,
    "message": "Unauthorized"
}

Amount not provided: 400 Bad Request

{
    "success": false,
    "message": "Missing amount"
}

Insufficient balance: 200 OK

{
    "success": false,
    "message": "Insufficient balance. You need X.XX INR but only have Y.YY INR."
}

Get information about a payment link by its token. If the user is logged in, also returns their balance and whether they can accept the link.

Endpoint: https://mypayindia.com/api/v1/get_payment_link?token=TOKEN


Response: 200 OK

{
    "success": true,
    "amount": 123.45,
    "author_username": "sender_username",
    "author_name": "Sender Name",
    "note": "My Note India",
    "created": "1970-01-01 00:00:00",
    "current_user_balance": 500.00,
    "can_accept": true
}

Errors

Missing token: 400 Bad Request

{
    "success": false,
    "error": "missing_token",
    "message": "Missing token parameter"
}

Not logged in: 401 Unauthorized

{
    "success": false,
    "message": "Unauthorized"
}

Payment link not found: 404 Not Found

{
    "success": false,
    "error": "not_found",
    "message": "Payment link not found."
}

Payment link already claimed: 410 Gone

{
    "success": false,
    "error": "already_claimed",
    "message": "This payment link has already been claimed."
}

Payment link cancelled: 410 Gone

{
    "success": false,
    "error": "cancelled",
    "message": "This payment link has been cancelled by the sender."
}

List payment links for logged in account

Endpoint: https://mypayindia.com/api/v1/list_payment_links


Response: 200 OK

{
  "success": true,
  "data": [
    "links": [
        {
        "id": 123,
        "token": "0123456789abcdef",
        "amount": 123,
        "note": "Hi",
        "created": "1970-01-01 00:00:00",
        "status": "status"
        },
        ...
    ]
  ]
}

Errors

Not logged in: 401 Unauthorized

{
    "success": false,
    "message": "Unauthorized"
}

Claim a payment link

Endpoint: https://mypayindia.com/api/v1/claim_payment_link?token=TOKEN


Response: 200 OK

{
    "success": true,
    "data": {
        "transaction_id": "TXN-0123456789-abcd",
        "amount": 123,
        "new_balance": 12345,
        "from_user": "defaultuser0"
    }
}

Errors

Missing token: 400 Bad Request

{
    "success": false,
    "error": "missing_token",
    "message": "Missing token parameter"
}

Not logged in: 401 Unauthorized

{
    "success": false,
    "message": "Unauthorized"
}

Cancel a payment link

Endpoint: https://mypayindia.com/api/v1/cancel_payment_link?token=TOKEN


Response: 200 OK

{
    "success": true,
    "data": {
        "amount": 123,
        "refunded_to": "mypayindia"
    }
}

Errors

Missing token: 400 Bad Request

{
    "success": false,
    "error": "missing_token",
    "message": "Missing token parameter"
}

Not logged in: 401 Unauthorized

{
    "success": false,
    "message": "Unauthorized"
}

team GET

Get an array of team members with their name, role, profile picture, join date, and socials.

Endpoint: https://mypayindia.com/api/v1/team


Response: 200 OK

{
    "success": true,
    "data": [
        {
            "name": "John Doe",
            "role": "Chief Executive Officer",
            "image": "https://mypayindia.com/siteassets/images/team/john.webp",
            "since": "January 1st, 2025",
            "socials": {
                "Website": "https://johndoe.com",
                "Twitter": "https://twitter.com/johndoe"
            }
        },
        {
            "name": "Jane Doe",
            "role": "Managing Director",
            "image": "jane.webp",
            "since": "January 15th, 2025",
            "socials": {
                "GitHub": "https://github.com/janedoe"
            }
        }
    ]
}

Errors

Internal server error: 500 Internal Server Error

{
    "success": false,
    "message": "Error retrieving team members"
}

restrictions GET

Get restrictions for the logged in account.

Endpoint: https://mypayindia.com/api/v1/restrictions


Response: 200 OK

{
  "success": true,
  "restrictions": {
    "frozen": {
      "active": true,
      "value": "whatever, can be and usually IS null",
      "expires_at": "2026-04-17 00:58:00"
    },
    ...
  }
}

Errors

Not logged in: 401 Unauthorized

{
    "success": false,
    "message": "Unauthorized"
}

sessions/get GET

Get session list for the logged in account.

Endpoint: https://mypayindia.com/api/v1/sessions/get


Response: 200 OK

{
  "success": true,
  "data": [
    {
        "id": "0123456789abcdef",
        "device_info": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/146.0.0.0 Safari/537.36",
        "ip": "1.50.100.200",
        "created_at": "1970-01-01 00:00:00",
        "last_active": "1970-01-01 00:00:00",
        "invalidated": false,
        "invalidated_at": "1970-01-01 00:00:00 (or null)",
        "current": true
    },
    ...
  ]
}

Errors

Not logged in: 401 Unauthorized

{
    "success": false,
    "message": "Unauthorized"
}

sessions/invalidate POST

Invalidate a session of the logged in account.

Endpoint: https://mypayindia.com/api/v1/sessions/invalidate

Request body:

{
    "session_id" : "0123456789abcdef"
}


Response: 200 OK

{
    "success": true,
    "data": []
}

Errors

Not logged in: 401 Unauthorized

{
    "success": false,
    "message": "Unauthorized"
}

Missing session ID: 400 Bad Request

{
    "success": false,
    "message": "Missing session_id"
}

permissions GET

Get the role and permissions (if admin) for the logged in account.

Endpoint: https://mypayindia.com/api/v1/permissions


Response: 200 OK

{
    "success": true,
    "data": {
        "role": "admin",
        "permissions": ["admin.users.*", "admin.transactions.*"]
    }
}

Errors

Not logged in: 401 Unauthorized

{
    "success": false,
    "message": "Unauthorized"
}