EstateHub

Administrator Payment Management API

Base URL: http://localhost:8000/api/v1
Prefix: /admins
Auth: Bearer token with admin role
Headers: Content-Type: application/json


1. List Payments

Returns a paginated list of reservation, remaining, bank-transfer, and cash payments.

GET/admins/payments/

Auth: Required

Headers

HTTP
Authorization: Bearer {{access_token}}

Success Example

JSON
{
  "success": true,
  "message": "Payments retrieved successfully.",
  "data": {
    "payments": {
      "count": 1,
      "next": null,
      "previous": null,
      "results": [
        {
          "id": "05bf6841-b2e4-4fc5-b034-c60271451170",
          "payment_for": "property_purchase",
          "amount": "250000.00",
          "currency": "USD",
          "method": "bank_transfer",
          "status": "submitted",
          "transaction_id": "BFT-PURCHASE-001",
          "payment_proof_url": "https://example.com/proofs/purchase-001.jpg",
          "receipt_number": null,
          "review_note": "",
          "failure_reason": "",
          "payer": {
            "id": "eb1b80f0-d827-4f67-a841-c267925ad0c1",
            "full_name": "James Wilson",
            "email": "james@example.com",
            "phone": "+15125550103"
          },
          "payee": {
            "id": "66952d6b-e32b-458a-942f-fc240bcaee00",
            "full_name": "Property Seller",
            "email": "seller@example.com",
            "phone": "+15125550104"
          },
          "verified_by": null,
          "verified_at": null,
          "paid_at": null,
          "transaction": {
            "type": "purchase",
            "id": "9a76cc16-a995-47e5-853e-a59643464ddb",
            "status": "payment_pending",
            "customer_id": "eb1b80f0-d827-4f67-a841-c267925ad0c1",
            "property": {
              "id": "51040fcb-b837-4220-b43b-c414f9502bd5",
              "title": "South Congress Apartment"
            }
          },
          "created_at": "2026-09-15T10:30:00Z",
          "updated_at": "2026-09-15T10:30:00Z"
        }
      ]
    }
  }
}

Notes

  • Supports pagination through page and page_size.

  • The maximum page size is 50.

  • Supported filters:

    • type — purchase or lease

    • status

    • method

    • payment_for

    • search

    • from — Start date in YYYY-MM-DD format

    • to — End date in YYYY-MM-DD format

  • search searches the payment transaction ID.

  • from and to filter by the payment creation date and are inclusive.

  • to cannot be earlier than from.

  • Filters can be combined.

  • Example: /admins/payments/?status=submitted&method=bank_transfer.

  • Current-month example: /admins/payments/?from=2026-09-01&to=2026-09-30.

  • Combined example: /admins/payments/?type=purchase&status=submitted&from=2026-09-01&to=2026-09-30.

  • Supported payment_for values include:

    • purchase_reservation

    • rental_reservation

    • property_purchase

    • rent

  • Common payment statuses include submitted, verified, and failed.


2. Get Payment Details

Returns a payment with its payer, payee, verification, transaction, and property information.

GET/admins/payments/{payment_id}/

Auth: Required

Headers

HTTP
Authorization: Bearer {{access_token}}

Success Example

JSON
{
  "success": true,
  "message": "",
  "data": {
    "payment": {
      "id": "05bf6841-b2e4-4fc5-b034-c60271451170",
      "payment_for": "property_purchase",
      "amount": "250000.00",
      "currency": "USD",
      "method": "bank_transfer",
      "status": "submitted",
      "transaction_id": "BFT-PURCHASE-001",
      "payment_proof_url": "https://example.com/proofs/purchase-001.jpg",
      "receipt_number": null,
      "review_note": "",
      "failure_reason": "",
      "payer": {
        "id": "eb1b80f0-d827-4f67-a841-c267925ad0c1",
        "full_name": "James Wilson",
        "email": "james@example.com",
        "phone": "+15125550103"
      },
      "payee": {
        "id": "66952d6b-e32b-458a-942f-fc240bcaee00",
        "full_name": "Property Seller",
        "email": "seller@example.com",
        "phone": "+15125550104"
      },
      "verified_by": null,
      "verified_at": null,
      "paid_at": null,
      "transaction": {
        "type": "purchase",
        "id": "9a76cc16-a995-47e5-853e-a59643464ddb",
        "status": "payment_pending",
        "customer_id": "eb1b80f0-d827-4f67-a841-c267925ad0c1",
        "property": {
          "id": "51040fcb-b837-4220-b43b-c414f9502bd5",
          "title": "South Congress Apartment"
        }
      },
      "created_at": "2026-09-15T10:30:00Z",
      "updated_at": "2026-09-15T10:30:00Z"
    }
  }
}

Notes

  • Returns HTTP 404 Not Found when the payment does not exist.

  • transaction.type is either purchase or lease.

  • transaction.id is the purchase ID or rental-application ID.


3. Verify Bank-Transfer Payment

Verifies a submitted bank-transfer payment and updates the related transaction.

POST/admins/payments/{payment_id}/verify/

Auth: Required

Headers

HTTP
Authorization: Bearer {{access_token}}
Content-Type: application/json

Request Body

JSON
{
  "note": "Payment confirmed against the bank statement."
}

Success Example

JSON
{
  "success": true,
  "message": "Payment verified successfully.",
  "data": {
    "payment": {
      "id": "05bf6841-b2e4-4fc5-b034-c60271451170",
      "payment_for": "property_purchase",
      "amount": "250000.00",
      "currency": "USD",
      "method": "bank_transfer",
      "status": "verified",
      "transaction_id": "BFT-PURCHASE-001",
      "payment_proof_url": "https://example.com/proofs/purchase-001.jpg",
      "receipt_number": null,
      "review_note": "Payment confirmed against the bank statement.",
      "failure_reason": "",
      "payer": {
        "id": "eb1b80f0-d827-4f67-a841-c267925ad0c1",
        "full_name": "James Wilson",
        "email": "james@example.com",
        "phone": "+15125550103"
      },
      "payee": {
        "id": "66952d6b-e32b-458a-942f-fc240bcaee00",
        "full_name": "Property Seller",
        "email": "seller@example.com",
        "phone": "+15125550104"
      },
      "verified_by": {
        "id": "07ddda70-fd16-4c6a-a975-d0e984719c83",
        "full_name": "EstateHub Admin",
        "email": "admin@estatehub.com",
        "phone": "+15125550105"
      },
      "verified_at": "2026-09-15T11:00:00Z",
      "paid_at": null,
      "transaction": {
        "type": "purchase",
        "id": "9a76cc16-a995-47e5-853e-a59643464ddb",
        "status": "payment_pending",
        "customer_id": "eb1b80f0-d827-4f67-a841-c267925ad0c1",
        "property": {
          "id": "51040fcb-b837-4220-b43b-c414f9502bd5",
          "title": "South Congress Apartment"
        }
      },
      "created_at": "2026-09-15T10:30:00Z",
      "updated_at": "2026-09-15T11:00:00Z"
    }
  }
}

Notes

  • note is optional.

  • Only a payment with method: bank_transfer and status: submitted can be verified.

  • A payment cannot be verified more than once.

  • Verification records the authenticated admin and verification time.

  • The customer receives a notification.

  • An audit log is created.

  • Verifying a purchase reservation:

    • Changes the purchase to reserved.

    • Changes the property to reserved.

  • Verifying a lease reservation:

    • Changes the rental application to reserved.

    • Changes the property to reserved.

  • Verifying a purchase remaining payment:

    • Keeps the purchase payment_pending while a balance remains.

    • Changes the purchase and property to transfer_pending when fully paid.

  • Verifying a lease remaining payment records the payment as verified while the rental application remains reserved.

  • Returns HTTP 400 Bad Request when the payment cannot be verified.

  • Returns HTTP 404 Not Found when the payment does not exist.


4. Reject Bank-Transfer Payment

Rejects a submitted bank-transfer payment with a required reason.

POST/admins/payments/{payment_id}/reject/

Auth: Required

Headers

HTTP
Authorization: Bearer {{access_token}}
Content-Type: application/json

Request Body

JSON
{
  "reason": "The transaction could not be confirmed in the bank statement."
}

Success Example

JSON
{
  "success": true,
  "message": "Payment rejected successfully.",
  "data": {
    "payment": {
      "id": "05bf6841-b2e4-4fc5-b034-c60271451170",
      "payment_for": "property_purchase",
      "amount": "250000.00",
      "currency": "USD",
      "method": "bank_transfer",
      "status": "failed",
      "transaction_id": "BFT-PURCHASE-001",
      "payment_proof_url": "https://example.com/proofs/purchase-001.jpg",
      "receipt_number": null,
      "review_note": "",
      "failure_reason": "The transaction could not be confirmed in the bank statement.",
      "payer": {
        "id": "eb1b80f0-d827-4f67-a841-c267925ad0c1",
        "full_name": "James Wilson",
        "email": "james@example.com",
        "phone": "+15125550103"
      },
      "payee": {
        "id": "66952d6b-e32b-458a-942f-fc240bcaee00",
        "full_name": "Property Seller",
        "email": "seller@example.com",
        "phone": "+15125550104"
      },
      "verified_by": {
        "id": "07ddda70-fd16-4c6a-a975-d0e984719c83",
        "full_name": "EstateHub Admin",
        "email": "admin@estatehub.com",
        "phone": "+15125550105"
      },
      "verified_at": "2026-09-15T11:10:00Z",
      "paid_at": null,
      "transaction": {
        "type": "purchase",
        "id": "9a76cc16-a995-47e5-853e-a59643464ddb",
        "status": "payment_pending",
        "customer_id": "eb1b80f0-d827-4f67-a841-c267925ad0c1",
        "property": {
          "id": "51040fcb-b837-4220-b43b-c414f9502bd5",
          "title": "South Congress Apartment"
        }
      },
      "created_at": "2026-09-15T10:30:00Z",
      "updated_at": "2026-09-15T11:10:00Z"
    }
  }
}

Notes

  • reason is required.

  • Only a submitted bank-transfer payment can be rejected.

  • A rejected payment changes to failed.

  • The authenticated admin and review time are recorded.

  • The customer receives the rejection reason in a notification.

  • An audit log is created.

  • Rejecting a purchase reservation cancels the purchase request.

  • Rejecting a lease reservation rejects the rental application.

  • Rejecting a remaining payment keeps the related purchase or rental application active.

  • The customer may submit another remaining payment after rejection.

  • Returns HTTP 400 Bad Request when the payment cannot be rejected.

  • Returns HTTP 404 Not Found when the payment does not exist.


5. Record Manual Cash Payment

Records cash physically received by an admin. The payment is created directly as verified.

POST/admins/manual-payments/

Auth: Required

Headers

HTTP
Authorization: Bearer {{access_token}}
Content-Type: application/json

Request Body

Purchase reservation:

JSON
{
  "payment_for": "purchase_reservation",
  "property_id": "51040fcb-b837-4220-b43b-c414f9502bd5",
  "customer_id": "eb1b80f0-d827-4f67-a841-c267925ad0c1",
  "note": "Cash received at the EstateHub South Congress office."
}

Lease reservation:

JSON
{
  "payment_for": "rental_reservation",
  "property_id": "51040fcb-b837-4220-b43b-c414f9502bd5",
  "customer_id": "eb1b80f0-d827-4f67-a841-c267925ad0c1",
  "preferred_move_in_date": "2026-10-01",
  "preferred_duration_months": 12,
  "message": "Customer requested a 12-month lease.",
  "note": "Cash received at the EstateHub South Congress office."
}

Purchase remaining payment:

JSON
{
  "payment_for": "property_purchase",
  "purchase_id": "9a76cc16-a995-47e5-853e-a59643464ddb",
  "amount": "250000.00",
  "note": "Cash received at the EstateHub South Congress office."
}

Lease remaining payment:

JSON
{
  "payment_for": "rent",
  "rental_application_id": "923089a0-69e0-4377-a107-2d0289831203",
  "amount": "2000.00",
  "note": "Cash received at the EstateHub South Congress office."
}

Success Example

JSON
{
  "success": true,
  "message": "Cash payment recorded successfully.",
  "data": {
    "payment": {
      "id": "a1664257-3a5e-4f41-a93d-4e9774d898ca",
      "payment_for": "property_purchase",
      "amount": "250000.00",
      "currency": "USD",
      "method": "cash",
      "status": "verified",
      "transaction_id": "",
      "payment_proof_url": "",
      "receipt_number": "CASH-20260915-A1B2C3D4E5",
      "review_note": "Cash received at the EstateHub South Congress office.",
      "failure_reason": "",
      "payer": {
        "id": "eb1b80f0-d827-4f67-a841-c267925ad0c1",
        "full_name": "James Wilson",
        "email": "james@example.com",
        "phone": "+15125550103"
      },
      "payee": {
        "id": "66952d6b-e32b-458a-942f-fc240bcaee00",
        "full_name": "Property Seller",
        "email": "seller@example.com",
        "phone": "+15125550104"
      },
      "verified_by": {
        "id": "07ddda70-fd16-4c6a-a975-d0e984719c83",
        "full_name": "EstateHub Admin",
        "email": "admin@estatehub.com",
        "phone": "+15125550105"
      },
      "verified_at": "2026-09-15T12:00:00Z",
      "paid_at": "2026-09-15T12:00:00Z",
      "transaction": {
        "type": "purchase",
        "id": "9a76cc16-a995-47e5-853e-a59643464ddb",
        "status": "payment_pending",
        "customer_id": "eb1b80f0-d827-4f67-a841-c267925ad0c1",
        "property": {
          "id": "51040fcb-b837-4220-b43b-c414f9502bd5",
          "title": "South Congress Apartment"
        }
      },
      "created_at": "2026-09-15T12:00:00Z",
      "updated_at": "2026-09-15T12:00:00Z"
    }
  }
}

Notes

  • This endpoint is used only when an admin physically receives cash.

  • The customer does not submit a separate payment request.

  • Supported payment_for values are:

    • purchase_reservation

    • rental_reservation

    • property_purchase

    • rent

  • Cash payments are created with method: cash and status: verified.

  • A unique cash receipt number is generated automatically.

  • verified_by, verified_at, and paid_at are recorded automatically.

  • An audit log is created.

  • The customer receives a notification.

  • For purchase reservations, property_id and customer_id are required.

  • For lease reservations, the following fields are required:

    • property_id

    • customer_id

    • preferred_move_in_date

    • preferred_duration_months

  • Reservation amounts are calculated by the backend from the purchase or rental reservation settings: percentage or fixed amount, with a default of 2%.

  • Admins cannot manually provide a reservation amount.

  • For purchase remaining payments, purchase_id and amount are required.

  • For lease remaining payments, rental_application_id and amount are required.

  • A remaining cash payment cannot exceed the outstanding balance.

  • Manual remaining payments require a verified reservation.

  • A manual payment is rejected when another payment is awaiting verification.

  • A successful request returns HTTP 201 Created.


Common Success Format

JSON
{
  "success": true,
  "message": "Operation completed successfully.",
  "data": {}
}

Common Error Format

JSON
{
  "success": false,
  "message": "Validation failed.",
  "errors": {
    "field_name": [
      "Error description."
    ]
  }
}