Okra API endpoints for Payments

post /pay/link/create

This endpoint allows you create a payment link.

amount

int

required

The amount of money to transfer. When the currency is NGN, this amount is transferred in kobo.

Example
50000

name

string

required

The name of payment link.

Example
"A payment link"

currency

string

required

The currency used in the transfer. Defaults to NGN.

Example
"NGN"

note

string

A description for the payment link.

Example
"For groceries."

countries

string

The account’s country.

Enum
  • NG
Example
"NG"

account

string

The beneficiary account ID. If you do not specify a value for account in your request, the Okra API defaults to the account ID that is linked to your business.

Example
"{account ID}"

type

string

required

The type of payment you want to charge. Check out the Payments guide for more details.

Enum
  • one-time
Example
"NG"

filter

object (filter)

Filter for banks that you would like to show to your users on the bank selection screen. To filter for banks, list bank slugs in an array of strings in your filter object. Use the List banks API endpoint to retrieve bank slugs for institutions that Okra supports.

Example
{ "filter": { "banks": [ "first-bank-of-nigeria", "guaranty-trust-bank", "kuda-bank", "zenith-bank" ] } }

Request

{
  "amount": 50000,
  "name": "A payment link",
  "currency": "NGN",
  "note": "For groceries.",
  "countries": "NG",
  "account": "{account ID}",
  "type": "NG",
  "filter": {
    "filter": {
      "banks": [
        "first-bank-of-nigeria",
        "guaranty-trust-bank",
        "kuda-bank",
        "zenith-bank"
      ]
    }
  }
}

Response

ExamplesSchema

Created

{
  "status": "success",
  "message": "Payment link successfully created!",
  "data": {
    "preselect_bank": {
      "bank": null,
      "type": null,
      "platform": null,
      "login": null
    },
    "schedule": {
      "startDate": null,
      "endDate": null
    },
    "whatsapp": {
      "enabled": false,
      "users": [],
      "message_templates": [],
      "qr": []
    },
    "filter": {
      "banks": [
        "first-bank-of-nigeria",
        "guaranty-trust-bank",
        "kuda-bank",
        "zenith-bank"
      ]
    },
    "amount": 40000,
    "currency": "NGN",
    "type": "one-time",
    "debitLater": false,
    "countries": [
      "NG"
    ],
    "unique_views": [],
    "institutions": [],
    "qr": null,
    "displayQR": false,
    "billable_products": [
      "auth",
      "identity",
      "balance",
      "payment"
    ],
    "data": false,
    "archived": false,
    "corporate": null,
    "projects": [],
    "_id": "15086eb9e6ccab3fe5147b6e",
    "note": "Payment description",
    "count": 0,
    "created_by": "1f2922b59afab10984102e52",
    "support_email": null,
    "url": "{URL of the Payment link}",
    "meta": {
      "transaction_id": 1000000001012
    },
    "surl": "{URL of the Payment link}",
    "short_url": "eTKuRWMqn",
    "owner": {
      "_id": "1d9288ea182d3d000cb7c486",
      "name": "Okra Tech Inc.",
      "app_name": "Okra, Inc"
    },
    "garnish": false,
    "success_url": "continue-url",
    "callback_url": "{The callback URL.}",
    "redirect_url": "{The redirect URL.}",
    "name": "Cool Payment Link",
    "clientName": "Cool Inc.",
    "env": "production-sandbox",
    "logo": null,
    "color": "#6734eb",
    "account": "15086eb9e6ccab3fe5147b6d",
    "receipt_merchant": null,
    "current_project": "1050d01a9306f087a64462cf",
    "created_at": "2023-09-18T15:37:29.578Z",
    "last_updated": "2023-09-18T15:37:29.578Z",
    "__v": 0,
    "shared": null
  }
}

Verify Payment

post /pay/verify

This endpoint allows you verify the status of a payment initiated

payment_id

string

The ID of the payment you want to verify

Request

{
  "payment_id": "// The payment_id"
}

Response

ExamplesSchema

OK

{
  "status": "success",
  "message": "Payment Status suceccefully retrieved!",
  "data": {
    "payment_status": {
      "_id": "",
      "amount": 100,
      "currency": "NGN",
      "customer": "",
      "error": {},
      "link": {
        "_id": "",
        "url": "",
        "surl": "",
        "short_url": ""
      },
      "status": "",
      "response_status": ""
    }
  }
}

Get all Payments

post /pay/list

This endpoint allows you retrieve all the payment transactions in your Okra account.

payment_id

string

The ID of the payment you want to verify

Request

{
  "payment_id": "// payment_id"
}

Response

ExamplesSchema

OK

{
  "status": "",
  "message": "",
  "data": {
    "payment": {
      "_id": "",
      "record": "",
      "__v": 0,
      "amount": 100,
      "created_at": "",
      "credit_account": "",
      "currency": "NGN",
      "customer": "",
      "debit_account": "",
      "env": "",
      "error": {},
      "last_updated": "",
      "link": {
        "_id": "",
        "url": "",
        "surl": "",
        "short_url": ""
      },
      "ref": "",
      "source": "",
      "status": "",
      "current_project": "",
      "projects": [
        ""
      ],
      "response_status": ""
    }
  }
}

Get Payments by id

post /pay/get/id

This endpoint allows you retrieve a specific the payment transactions in your Okra account.

payment_id

string

The ID of the payment you want to verify

Request

{
  "payment_id": "// payment_id"
}

Response

ExamplesSchema

OK

{
  "status": "",
  "message": "",
  "data": {
    "payment": {
      "_id": "",
      "record": "",
      "__v": 0,
      "amount": 100,
      "created_at": "",
      "credit_account": "",
      "currency": "NGN",
      "customer": "",
      "debit_account": "",
      "env": "",
      "error": {},
      "last_updated": "",
      "link": {
        "_id": "",
        "url": "",
        "surl": "",
        "short_url": ""
      },
      "ref": "",
      "source": "",
      "status": "",
      "current_project": "",
      "projects": [
        ""
      ],
      "response_status": ""
    }
  }
}

Get payments by options

post /pay/verifyByOptions

This endpoint allows you verify the payments via the metadata or options.

options

string

required

Verify the payment by passing options

Example
"\"reference\": \"xxxxx\""

page

int

i32

A page number within the paginated result set.

Example
1

limit

int

i32

This limits the number of records returned based on a limit value

Example
1

Response

ExamplesSchema

Empty response

Was this page helpful?