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.

post

Get wallet

Responses

Request examples

null

Response examples

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",
        "current_project": "1ff62b99aea7a57a5c3baa01",
        "current_project_name": "My Project"
      }
    }
  }
]

An example response of a successful get wallet operation.

post

List wallets

pageint

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.

Format
int32
limitint

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.

Format
int32
projectstring

The unique ID of an Okra project.

idstring

The unique ID of an Okra wallet.

termstring

A search term that filters for project name.

Responses

Request examples

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

Response examples

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
            }
          ],
          "total": null,
          "pagination": {
            "totalDocs": null
          }
        }
      }
    ]
  }
]

An example response of a successful get wallet operation.

post

Check wallet balance

projectstring

The unique ID of an Okra project.

idstring

The unique ID of an Okra wallet.

Responses

Request examples

{
  "project": "1dadfa049f45083b5e14d75a"
}

Response examples

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,
          "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?