OhentPay
API Reference

Balances

Balance operations

Fetch balances

This endpoint allows you to fetch balances on the currencies you hold

GET
/balances
AuthorizationBearer <token>

In: header

Query Parameters

currency?string

Filter by currency code

Response Body

curl -X GET "https://api.ohentpay.com/balances?currency=GBP"
[
  {
    "id": "88fe6e8a-bd3b-11e9-821e-4180c1a9232a",
    "name": "Main",
    "currency": "GBP",
    "balance": 10000,
    "default_currency": "GBP",
    "default_currency_balance": 10000,
    "addresses": [
      {
        "details": {
          "account_name": "John Doe",
          "sort_code": "000000",
          "account_number": "12345678"
        },
        "type": "local",
        "supported_channels": [
          "FP",
          "BACS",
          "CHAPS"
        ],
        "active": true
      }
    ],
    "created": "2019-09-02T13:16:47+01:00"
  }
]

Create a new balance

POST
/balances
AuthorizationBearer <token>

In: header

name?string
currency?string

Response Body

curl -X POST "https://api.ohentpay.com/balances" \
  -H "Content-Type: application/json" \
  -d '{}'
{
  "id": "88fe6e8a-bd3b-11e9-821e-4180c1a9232a",
  "name": "Main",
  "currency": "GBP",
  "balance": 10000,
  "default_currency": "GBP",
  "default_currency_balance": 10000,
  "addresses": [
    {
      "details": {
        "account_name": "John Doe",
        "sort_code": "000000",
        "account_number": "12345678"
      },
      "type": "local",
      "supported_channels": [
        "FP",
        "BACS",
        "CHAPS"
      ],
      "active": true
    }
  ],
  "created": "2019-09-02T13:16:47+01:00"
}
{
  "request": "error",
  "code": 400,
  "message": "Invalid request"
}

Fetch single balance

GET
/balances/{id}
AuthorizationBearer <token>

In: header

Path Parameters

idstring

Balance ID

Formatuuid

Response Body

curl -X GET "https://api.ohentpay.com/balances/88fe6e8a-bd3b-11e9-821e-4180c1a9232a"
{
  "id": "88fe6e8a-bd3b-11e9-821e-4180c1a9232a",
  "name": "Main",
  "currency": "GBP",
  "balance": 10000,
  "default_currency": "GBP",
  "default_currency_balance": 10000,
  "addresses": [
    {
      "details": {
        "account_name": "John Doe",
        "sort_code": "000000",
        "account_number": "12345678"
      },
      "type": "local",
      "supported_channels": [
        "FP",
        "BACS",
        "CHAPS"
      ],
      "active": true
    }
  ],
  "created": "2019-09-02T13:16:47+01:00"
}
Empty

Update balance name

PATCH
/balances/{id}
AuthorizationBearer <token>

In: header

Path Parameters

idstring

Balance ID

Formatuuid
name?string
Rangevalue <= 50

Response Body

curl -X PATCH "https://api.ohentpay.com/balances/88fe6e8a-bd3b-11e9-821e-4180c1a9232a" \
  -H "Content-Type: application/json" \
  -d '{}'
{
  "id": "88fe6e8a-bd3b-11e9-821e-4180c1a9232a",
  "name": "Main",
  "currency": "GBP",
  "balance": 10000,
  "default_currency": "GBP",
  "default_currency_balance": 10000,
  "addresses": [
    {
      "details": {
        "account_name": "John Doe",
        "sort_code": "000000",
        "account_number": "12345678"
      },
      "type": "local",
      "supported_channels": [
        "FP",
        "BACS",
        "CHAPS"
      ],
      "active": true
    }
  ],
  "created": "2019-09-02T13:16:47+01:00"
}
{
  "request": "error",
  "code": 400,
  "message": "Invalid request"
}