Okra API endpoints for Payments

Verify Payment

post /pay/verify

This endpoint allows you verify the status of a payment initiated

HTTP bearer bearer

payment_id

string

The ID of the payment you want to verify

Request

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

Response

Examples Schema

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": ""
    }
  }
}

status

string

message

string

data

object (data)

Example
{ "payment_status": { "_id": "", "amount": 100, "currency": "NGN", "customer": "", "error": {}, "link": { "_id": "", "url": "", "surl": "", "short_url": "" }, "status": "", "response_status": "" } }

payment_status

object (payment_status)

Example
{ "_id": "", "amount": 100, "currency": "NGN", "customer": "", "error": {}, "link": { "_id": "", "url": "", "surl": "", "short_url": "" }, "status": "", "response_status": "" }

_id

string

Okra's unique identifier used to reference the current owner.

amount

int

i32

Amount transfered in kobo if currency is NGN.

error

string

An error code unique to the error received.

currency

string

The currency of the transfer. Defaults to NGN

customer

string

The ID for the customer whose payment was made to

link

object (link)

Example
{ "_id": "", "url": "", "surl": "", "short_url": "" }

_id

string

Okra's unique identifier used to reference the payment link

url

string

The payment url.

surl

string

The payment short url.

short_url

string

The payment short url.

status

string

Filter payment by status ('failed', 'success', 'pending')

Content-Security-Policy

string

Content Type
text/plain
Example
"default-src 'self';base-uri 'self';block-all-mixed-content;font-src 'self' https: data:;frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests"

X-DNS-Prefetch-Control

string

Content Type
text/plain
Example
"off"

Expect-CT

string

Content Type
text/plain
Example
"max-age=0"

X-Frame-Options

string

Content Type
text/plain
Example
"SAMEORIGIN"

Strict-Transport-Security

string

Content Type
text/plain
Example
"max-age=15552000; includeSubDomains"

X-Download-Options

string

Content Type
text/plain
Example
"noopen"

X-Content-Type-Options

string

Content Type
text/plain
Example
"nosniff"

X-Permitted-Cross-Domain-Policies

string

Content Type
text/plain
Example
"none"

Referrer-Policy

string

Content Type
text/plain
Example
"no-referrer"

X-XSS-Protection

string

Content Type
text/plain
Example
"0"

Access-Control-Allow-Methods

string

Content Type
text/plain
Example
"GET, POST, OPTIONS, PUT, PATCH, DELETE"

Access-Control-Allow-Headers

string

Content Type
text/plain
Example
"X-Requested-With,content-type,authorization"

Access-Control-Allow-Credentials

string

Content Type
text/plain
Example
"true"

Content-Length

string

Content Type
text/plain
Example
"398"

ETag

string

Content Type
text/plain
Example
"W/\"18e-fiAT1GhwEg1xIPdBFd3bq+apiRg\""

Date

string

Content Type
text/plain
Example
"Fri, 29 Jan 2021 14:25:39 GMT"

Connection

string

Content Type
text/plain
Example
"keep-alive"

Keep-Alive

string

Content Type
text/plain
Example
"timeout=5"

Get all Payments

post /pay/list

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

HTTP bearer bearer

payment_id

string

The ID of the payment you want to verify

Request

{
  "payment_id": "// payment_id"
}

Response

Examples Schema

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": ""
    }
  }
}

status

string

message

string

data

object (data)

Example
{ "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": "" } }

payment

object (payment)

Example
{ "_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": "" }

_id

string

Okra's unique identifier used to reference the current owner.

record

string

The record ID of the payment.

__v

int

i32

The document version of the payment

amount

int

i32

Amount to transfer in kobo if currency is NGN.

created_at

string

Timestamp in ISO 8601 format (YYYY-MM-DDTHH:mm:ssZ) indicating the first time that the payment was created.

credit_account

string

The account to be credited.

currency

string

The currency of the transfer. Defaults to NGN

customer

string

The ID for the customer whose payment was made to

debit_account

string

The account to be debited.

email

string or null

Customer's email address

env

string

The application environment where process was carried out.

error

object (error)

An error code unique to the error received.

last_updated

string

Timestamp in ISO 8601 format (YYYY-MM-DDTHH:mm:ssZ) indicating the last time that the payment was updated.

link

object (link)

Example
{ "_id": "", "url": "", "surl": "", "short_url": "" }

_id

string

Okra's unique identifier used to reference the payment link

url

string

The payment url.

surl

string

The payment short url.

short_url

string

The payment short url.

meta

string or null

Stringified JSON object of custom data.

ref

string

Unique payment reference. Only -, ., = and alphanumeric characters allowed.

source

string

Where should we transfer from? Only balance for now

status

string

Filter payment by status ('failed', 'success', 'pending')

current_project

string

projects

array[string]

string

response_status

string

Content-Security-Policy

string

Content Type
text/plain
Example
"default-src 'self';base-uri 'self';block-all-mixed-content;font-src 'self' https: data:;frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests"

X-DNS-Prefetch-Control

string

Content Type
text/plain
Example
"off"

Expect-CT

string

Content Type
text/plain
Example
"max-age=0"

X-Frame-Options

string

Content Type
text/plain
Example
"SAMEORIGIN"

Strict-Transport-Security

string

Content Type
text/plain
Example
"max-age=15552000; includeSubDomains"

X-Download-Options

string

Content Type
text/plain
Example
"noopen"

X-Content-Type-Options

string

Content Type
text/plain
Example
"nosniff"

X-Permitted-Cross-Domain-Policies

string

Content Type
text/plain
Example
"none"

Referrer-Policy

string

Content Type
text/plain
Example
"no-referrer"

X-XSS-Protection

string

Content Type
text/plain
Example
"0"

Access-Control-Allow-Methods

string

Content Type
text/plain
Example
"GET, POST, OPTIONS, PUT, PATCH, DELETE"

Access-Control-Allow-Headers

string

Content Type
text/plain
Example
"X-Requested-With,content-type,authorization"

Access-Control-Allow-Credentials

string

Content Type
text/plain
Example
"true"

Content-Length

string

Content Type
text/plain
Example
"768"

ETag

string

Content Type
text/plain
Example
"W/\"300-NGgMqFko2RjWgyOPjxkN+xulTCE\""

Date

string

Content Type
text/plain
Example
"Tue, 23 Mar 2021 14:53:43 GMT"

Connection

string

Content Type
text/plain
Example
"keep-alive"

Keep-Alive

string

Content Type
text/plain
Example
"timeout=5"

Get Payments by id

post /pay/get/id

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

HTTP bearer bearer

payment_id

string

The ID of the payment you want to verify

Request

{
  "payment_id": "// payment_id"
}

Response

Examples Schema

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": ""
    }
  }
}

status

string

message

string

data

object (data)

Example
{ "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": "" } }

payment

object (payment)

Example
{ "_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": "" }

_id

string

Okra's unique identifier used to reference the current owner.

record

string

The record ID of the payment.

__v

int

i32

The document version of the payment

amount

int

i32

Amount to transfer in kobo if currency is NGN.

created_at

string

Timestamp in ISO 8601 format (YYYY-MM-DDTHH:mm:ssZ) indicating the first time that the payment was created.

credit_account

string

The account to be credited.

currency

string

The currency of the transfer. Defaults to NGN

customer

string

The ID for the customer whose payment was made to

debit_account

string

The account to be debited.

email

string or null

Customer's email address

env

string

The application environment where process was carried out.

error

object (error)

An error code unique to the error received.

last_updated

string

Timestamp in ISO 8601 format (YYYY-MM-DDTHH:mm:ssZ) indicating the last time that the payment was updated.

link

object (link)

Example
{ "_id": "", "url": "", "surl": "", "short_url": "" }

_id

string

Okra's unique identifier used to reference the payment link

url

string

The payment url.

surl

string

The payment short url.

short_url

string

The payment short url.

meta

string or null

Stringified JSON object of custom data.

ref

string

Unique payment reference. Only -, ., = and alphanumeric characters allowed.

source

string

Where should we transfer from? Only balance for now

status

string

Filter payment by status ('failed', 'success', 'pending')

current_project

string

projects

array[string]

string

response_status

string

Content-Security-Policy

string

Content Type
text/plain
Example
"default-src 'self';base-uri 'self';block-all-mixed-content;font-src 'self' https: data:;frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests"

X-DNS-Prefetch-Control

string

Content Type
text/plain
Example
"off"

Expect-CT

string

Content Type
text/plain
Example
"max-age=0"

X-Frame-Options

string

Content Type
text/plain
Example
"SAMEORIGIN"

Strict-Transport-Security

string

Content Type
text/plain
Example
"max-age=15552000; includeSubDomains"

X-Download-Options

string

Content Type
text/plain
Example
"noopen"

X-Content-Type-Options

string

Content Type
text/plain
Example
"nosniff"

X-Permitted-Cross-Domain-Policies

string

Content Type
text/plain
Example
"none"

Referrer-Policy

string

Content Type
text/plain
Example
"no-referrer"

X-XSS-Protection

string

Content Type
text/plain
Example
"0"

Access-Control-Allow-Methods

string

Content Type
text/plain
Example
"GET, POST, OPTIONS, PUT, PATCH, DELETE"

Access-Control-Allow-Headers

string

Content Type
text/plain
Example
"X-Requested-With,content-type,authorization"

Access-Control-Allow-Credentials

string

Content Type
text/plain
Example
"true"

Content-Length

string

Content Type
text/plain
Example
"768"

ETag

string

Content Type
text/plain
Example
"W/\"300-NGgMqFko2RjWgyOPjxkN+xulTCE\""

Date

string

Content Type
text/plain
Example
"Tue, 23 Mar 2021 14:51:36 GMT"

Connection

string

Content Type
text/plain
Example
"keep-alive"

Keep-Alive

string

Content Type
text/plain
Example
"timeout=5"

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

Examples Schema

Empty response

No schema

Was this page helpful?