Skip to main content

Customer Management Schemas

API endpoints for managing bank customers within the Peere Network.

Endpoints

MethodEndpointDescription
GET/v1/bank/customerGet specific customer details
GET/v1/bank/customersList customers with filters
POST/v1/bank/customersCreate customers in batch
PATCH/v1/bank/customerUpdate customer information

GET /v1/bank/customer

Retrieve details for a specific customer in your bank.

Query Parameters

ParameterTypeRequiredDescription
idstringNoCustomer ID (one of id, email, or phrase required)
emailstringNoCustomer email address
phrasestringNoCustomer phrase

Response Schema

{
  "statusCode": 200,
  "success": true,
  "message": "Customer retrieved successfully",
  "data": {
    "id": "string",
    "accountName": "string",
    "gender": "male | female | other",
    "displayPicture": "string",
    "bankId": "string",
    "phrase": "string",
    "country": "string"
  }
}

GET /v1/bank/customers

List customers in your bank with optional filters and pagination.

Query Parameters

ParameterTypeRequiredDescription
idsstring[]NoFilter by customer IDs
phrasesstring[]NoFilter by customer phrases
sortBystringNoField to sort by
limitnumberNoNumber of results to return
pagenumberNoPage number for pagination

Response Schema

[
  {
    "id": "string",
    "accountName": "string",
    "gender": "male | female | other",
    "displayPicture": "string",
    "bankId": "string",
    "phrase": "string",
    "country": "string"
  }
]

POST /v1/bank/customers

Create multiple customers in batch for your bank.

Request Body

{
  "customers": [
    {
      "clientRef": "string",
      "firstname": "string",
      "lastname": "string",
      "middlename": "string",
      "accountName": "string",
      "email": "string",
      "country": "string",
      "address": "string",
      "gender": "male | female | other",
      "phone": "string",
      "accountNumber": "string",
      "reference": "string"
    }
  ]
}

Request Schema

FieldTypeRequiredDescription
customersarrayYesArray of customer objects
customers[].clientRefstringYesClient reference identifier
customers[].firstnamestringYesCustomer first name
customers[].lastnamestringYesCustomer last name
customers[].middlenamestringNoCustomer middle name
customers[].accountNamestringYesFull account name
customers[].emailstringYesCustomer email address
customers[].countrystringYesCountry code (ISO 3166-1 alpha-2)
customers[].addressstringNoCustomer address
customers[].genderstringNoCustomer gender
customers[].phonestringNoCustomer phone number
customers[].accountNumberstringYesBank account number
customers[].referencestringYesInternal reference

Response Schema

{
  "success": true,
  "message": "Batch processed, customers will reflect shortly",
  "statusCode": 201,
  "data": {
    "batchId": "string",
    "status": "PROCESSING",
    "summary": {
      "total": 10,
      "successful": 10,
      "failed": 0,
      "duplicates": 0,
      "invalidData": 0
    },
    "failures": [],
    "failuresInline": true,
    "inlineFailureLimit": 50,
    "data": {
      "createdCount": 10,
      "customerIds": ["string"]
    }
  }
}

PATCH /v1/bank/customer

Update information for an existing customer.

Request Body

{
  "id": "string",
  "update": {
    "firstname": "string",
    "middlename": "string",
    "lastname": "string",
    "accountName": "string",
    "address": "string",
    "phone": "string",
    "displayPicture": "string"
  }
}

Request Schema

FieldTypeRequiredDescription
idstringYesCustomer identifier
updateobjectYesFields to update
update.firstnamestringNoUpdated first name
update.middlenamestringNoUpdated middle name
update.lastnamestringNoUpdated last name
update.accountNamestringNoUpdated account name
update.addressstringNoUpdated address
update.phonestringNoUpdated phone number
update.displayPicturestringNoUpdated profile picture URL

Response Schema

{
  "statusCode": 200,
  "success": true,
  "message": "Customer updated successfully",
  "data": {
    "id": "string",
    "email": "string",
    "phone": "string"
  }
}

Customer Schema (Sensitive Fields Hidden)

When retrieving customer information as a bank, sensitive fields are filtered based on context:

Standard Fields (Always Visible)

FieldTypeDescription
idstringCustomer identifier
accountNamestringFull customer name
genderstringCustomer gender
displayPicturestringProfile picture URL
bankIdstringBank identifier
phrasestringCustomer unique phrase
countrystringCountry code

Extended Fields (Non-Sensitive Context)

FieldTypeDescription
statestringState/region
emailstringEmail address
phonestringPhone number
addressstringPhysical address
createdAtstringAccount creation date

Batch Processing Error Codes

Error CodeDescription
DUPLICATE_IN_BATCHDuplicate customer found within the same batch
INVALID_DATAMissing or invalid required fields
EXISTING_CUSTOMERCustomer already exists in the system
VALIDATION_ERRORData format or constraint violations

Error Responses

400 Bad Request

{
  "statusCode": 400,
  "success": false,
  "message": "Invalid customer data"
}

404 Not Found

{
  "statusCode": 404,
  "success": false,
  "message": "Customer not found"
}

409 Conflict

{
  "statusCode": 409,
  "success": false,
  "message": "Customer with this email already exists"
}