Check out the Wallet API overview to understand how Okra uses wallets to handle payments for the services and products that you use, and how you can manage your wallets.

Get wallet

post /wallet/get

or null

Request

null

Response

ExamplesSchema

A successful response of the get wallet operation.

[
  {
    "status": "success",
    "message": "Wallet successfully retrieved!",
    "data": {
      "wallet": {
        "_id": "14550e9c2264c151c9cfc1e4",
        "auto_topup": {
          "status": true,
          "payment_method": "xxxxxxxxxxxxxxxxxxxxxxxx",
          "topup_amount": 101,
          "available_balance_threshold": 100,
          "currency": "USD",
          "amount": 101
        },
        "notifications": {
          "available_balance": {
            "status": true,
            "min": 900,
            "schedule": "hourly",
            "emails": [
              "test+user1@okra.ng",
              "test+user2@okra.ng"
            ]
          }
        },
        "created_at": "2023-05-05T14:12:00.807Z",
        "credits": 1.35364000000007,
        "last_updated": "2023-05-10T09:32:13.861Z",
        "payment_wallet": 1590999,
        "current_project": "1ff62b99aea7a57a5c3baa01",
        "current_project_name": "My Project"
      }
    }
  }
]

An example response of a successful get wallet operation.

List wallets

post /wallet/list

page

int

i32

Page determines the page that the API returns in the response. For example, if you set page to 1 in your request, the API will return the first page of results in the response.

limit

int

i32

Limit sets the number of results that the API returns in a single page. If you do not specify a value for limit, the API will limit the response to 10 results per page.

project

string

The unique ID of an Okra project.

id

string

The unique ID of an Okra wallet.

term

string

A search term that filters for project name.

Request

{
  "term": "My project",
  "page": 1,
  "limit": 10
}

Response

ExamplesSchema

A successful response of the list wallets operation.

[
  {
    "summary": "Wallets returned successfully",
    "description": "An example response of a successful list wallets operation.",
    "value": [
      {
        "status": "success",
        "message": "Wallet(s) successfully retrieved!",
        "data": {
          "wallets": [
            {
              "id": "13cfa4261521184c8cf428c3",
              "current_project": "131f47360d4cdca777a7e671",
              "current_project_name": "My Project",
              "company": {
                "_id": "131f4736b5dba8be3595cdbb",
                "name": "BUGA MOTORS GLOBAL INVESTMENT LIMITED"
              },
              "auto_topup": {
                "status": true,
                "payment_method": "xxxxxxxxxxxxxxxxxxxxxxxx",
                "topup_amount": 101,
                "available_balance_threshold": 100,
                "currency": "USD",
                "amount": 101
              },
              "notifications": {
                "available_balance": {
                  "status": true,
                  "min": 900,
                  "schedule": "hourly",
                  "emails": [
                    "test+user1@okra.ng",
                    "test+user2@okra.ng"
                  ]
                }
              },
              "credits": 1000,
              "payment_wallet": 0
            }
          ],
          "total": null,
          "pagination": {
            "totalDocs": null
          }
        }
      }
    ]
  }
]

An example response of a successful get wallet operation.

Check wallet balance

post /wallet/balance/check

project

string

The unique ID of an Okra project.

id

string

The unique ID of an Okra wallet.

Request

{
  "project": "1dadfa049f45083b5e14d75a"
}

Response

ExamplesSchema

A successful response of the check wallet balance operation.

[
  {
    "status": "success",
    "message": "Balance successfully fetched!",
    "data": {
      "balance": [
        {
          "auto_topup": {
            "status": true,
            "payment_method": "xxxxxxxxxxxxxxxxxxxxxxxx",
            "topup_amount": 101,
            "available_balance_threshold": 100,
            "currency": "USD",
            "amount": 101
          },
          "notifications": {
            "available_balance": {
              "status": true,
              "min": 900,
              "schedule": "hourly",
              "emails": [
                "test+user1@okra.ng",
                "test+user2@okra.ng"
              ]
            }
          },
          "credits": 1000,
          "payment_wallet": 0,
          "current_project": "1dadfa049f45083b5e14d75a",
          "current_project_name": "My Project",
          "last_updated": "2023-03-13T00:32:51.252Z"
        }
      ]
    }
  }
]

An example response of a successful check wallet balance operation.

Was this page helpful?