OhentPay
API Reference

Recipients

Recipients operations

Fetch recipients list

GET
/recipients
AuthorizationBearer <token>

In: header

Response Body

curl -X GET "https://api.ohentpay.com/recipients"
[
  {
    "id": "88fe6e8a-cd7b-11e9-821e-4180c1a9232a",
    "country": "GB",
    "default_reference": "Invoice",
    "alias": "John's Savings",
    "type": "personal",
    "created": "2019-09-02T13:16:47+01:00",
    "bank_account": {
      "account_name": "John Doe",
      "sort_code": "040004",
      "account_number": "12345678",
      "bank_name": "Monzo Bank Limited",
      "currency": "GBP"
    }
  }
]

Create a new recipient

POST
/recipients
AuthorizationBearer <token>

In: header

Data from bank account fields. Required fields can be found on the /bankfields endpoint

country?string
currency?string

Supported currencies for each country can be found in the /countries endpoint

alias?string

Optional alias to identify the recipient

Rangevalue <= 150
type?string

Type of recipient

Value in"personal" | "business"
account_name?string
sort_code?string
account_number?string

Response Body

curl -X POST "https://api.ohentpay.com/recipients" \
  -H "Content-Type: application/json" \
  -d '{}'
{
  "id": "88fe6e8a-cd7b-11e9-821e-4180c1a9232a",
  "country": "GB",
  "default_reference": "Invoice",
  "alias": "John's Savings",
  "type": "personal",
  "created": "2019-09-02T13:16:47+01:00",
  "bank_account": {
    "account_name": "John Doe",
    "sort_code": "040004",
    "account_number": "12345678",
    "bank_name": "Monzo Bank Limited",
    "currency": "GBP"
  }
}
{
  "request": "error",
  "code": 400,
  "message": "Invalid request"
}

Fetch single recipient

GET
/recipients/{id}
AuthorizationBearer <token>

In: header

Path Parameters

idstring

Recipient ID

Formatuuid

Response Body

curl -X GET "https://api.ohentpay.com/recipients/88fe6e8a-cd7b-11e9-821e-4180c1a9232a"
{
  "id": "88fe6e8a-cd7b-11e9-821e-4180c1a9232a",
  "country": "GB",
  "default_reference": "Invoice",
  "alias": "John's Savings",
  "type": "personal",
  "created": "2019-09-02T13:16:47+01:00",
  "bank_account": {
    "account_name": "John Doe",
    "sort_code": "040004",
    "account_number": "12345678",
    "bank_name": "Monzo Bank Limited",
    "currency": "GBP"
  }
}
Empty

Update recipient alias

PATCH
/recipients/{id}
AuthorizationBearer <token>

In: header

Path Parameters

idstring

Recipient ID

Formatuuid
alias?string
Rangevalue <= 150

Response Body

curl -X PATCH "https://api.ohentpay.com/recipients/88fe6e8a-bd3b-11e9-821e-4180c1a9232a" \
  -H "Content-Type: application/json" \
  -d '{}'
{
  "id": "88fe6e8a-cd7b-11e9-821e-4180c1a9232a",
  "country": "GB",
  "default_reference": "Invoice",
  "alias": "John's Savings",
  "type": "personal",
  "created": "2019-09-02T13:16:47+01:00",
  "bank_account": {
    "account_name": "John Doe",
    "sort_code": "040004",
    "account_number": "12345678",
    "bank_name": "Monzo Bank Limited",
    "currency": "GBP"
  }
}
{
  "request": "error",
  "code": 400,
  "message": "Invalid request"
}

Delete a recipient

DELETE
/recipients/{id}
AuthorizationBearer <token>

In: header

Path Parameters

idstring

Recipient ID

Formatuuid

Response Body

curl -X DELETE "https://api.ohentpay.com/recipients/88fe6e8a-cd7b-11e9-821e-4180c1a9232a"
{
  "result": "ok"
}

Validate recipient bank account details

POST
/recipients/validate
AuthorizationBearer <token>

In: header

You can validate bank account details of a new recipient with this endpoint before saving it.

With some bank accounts, like Nigeria, we can resolve the bank account details and return the actual account name held by the bank. This will enable you to confirm the account name is actually that of the person you intend to make payment to.

Note that we validate bank account details automatically when you try to create a new recipient so you don't really have to call this API unless you intend to use the account name resolving feature

Data from bank account fields. Required fields can be found on the /bankfields endpoint

country?string
currency?string
bank_id?string
account_number?string

Response Body

curl -X POST "https://api.ohentpay.com/recipients/validate" \
  -H "Content-Type: application/json" \
  -d '{}'
{
  "bank_name": "Access Bank",
  "bank_id": "1",
  "account_name": "John Doe",
  "account_number": "1234567890",
  "currency": "NGN"
}
{
  "request": "error",
  "code": 400,
  "message": "Invalid request"
}