OgaPay Docs

API Documentation

Developer API reference for integrating with OgaPay.

API Documentation

Base URL: https://ogapay-production.up.railway.app/api/v1

Authentication

Most endpoints require a Bearer token in the Authorization header.

Authorization: Bearer <your-access-token>

Register

POST /auth/register

{
  "firstName": "John",
  "lastName": "Doe",
  "email": "john@example.com",
  "password": "SecurePass123",
  "username": "johndoe",
  "role": "WORKER"
}

Login

POST /auth/login

{
  "email": "john@example.com",
  "password": "SecurePass123"
}

Refresh Token

POST /auth/refresh

Tasks

List Tasks (Public)

GET /tasks

Query parameters: category, status, page, limit, search, currency, minReward, maxReward, sortBy, sortOrder

Get Task

GET /tasks/:id

Create Task (Poster)

POST /tasks

{
  "title": "Rate 10 logo designs",
  "description": "Rate 10 logo designs on a scale of 1-5",
  "category": "SURVEY",
  "reward": 100,
  "currency": "NGN",
  "maxWorkers": 5,
  "instructions": "Open each link, rate it, paste your ratings"
}

Apply to Task (Worker)

POST /tasks/:id/apply

Submit Proof (Worker)

POST /tasks/:id/submit

{
  "workerNotes": "I completed the task",
  "proof": "https://example.com/proof",
  "attachments": ["https://imgkit.com/file1.jpg"]
}

Review Submission (Poster)

PATCH /tasks/submissions/:submissionId/review

{
  "status": "APPROVED",
  "posterNotes": "Great work!",
  "rating": 5
}

Wallet

Get Balance

GET /wallet/balance

Withdraw

POST /wallet/withdraw

{
  "amount": 5000,
  "currency": "NGN",
  "bankAccountId": "uuid"
}

Transaction History

GET /wallet/transactions

Users

Get Profile

GET /users/:id

Update Profile

PATCH /users/me

Save Wallet

POST /users/wallet

Save Bank Account

POST /users/bank

Leaderboard

GET /leaderboard?period=all&type=earners

Notifications

List

GET /notifications

Mark Read

PATCH /notifications/:id/read

Error Responses

All endpoints return errors in this format:

{
  "success": false,
  "message": "Error description",
  "errors": [
    { "field": "email", "message": "Invalid email format" }
  ]
}

HTTP Status Codes

CodeMeaning
200Success
201Created
400Bad request / Validation failed
401Unauthorized
403Forbidden
404Not found
429Too many requests
500Internal server error

Rate Limits

Endpoint TypeLimitWindow
Auth endpoints20 requests15 minutes
General API200 requests15 minutes