Lean Technologies Customer API
The Customer API from Lean Technologies — 3 operation(s) for customer.
The Customer API from Lean Technologies — 3 operation(s) for customer.
openapi: 3.1.0
info:
title: Consents Account On File Account Controls (New) Account Controls (New) Customer API
version: v0.2.3
servers:
- url: https://sandbox.leantech.me
description: Sandbox
- url: https://api2.leantech.me
description: Production
security:
- bearerAuth: []
tags:
- name: Customer
paths:
/customers/v1/:
get:
summary: List Customers
deprecated: false
description: Fetch a list of all customers created
operationId: getCustomers
tags:
- Customer
parameters:
- name: page_number
in: query
description: ''
required: true
example: 0
schema:
type: integer
- name: page_size
in: query
description: ''
required: true
example: 50
schema:
type: integer
responses:
'200':
description: ''
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/Customer'
page:
$ref: '#/components/schemas/Pagination'
required:
- data
- page
example:
data:
- customer_id: 49e8d23e-9b17-4ffe-a2ab-4c5fc1c02431
app_user_id: '001'
- customer_id: 090e2390-bd5a-47d8-97a6-6d4dd1af35f0
app_user_id: '002'
- customer_id: 8eeec6bd-332a-40ec-8de3-a5d064d107d6
app_user_id: '003'
page:
number: 0
size: 50
total_elements: 3
total_pages: 1
headers: {}
security:
- bearer: []
post:
summary: Create Customer
deprecated: false
description: Create a customer object on Lean given the app_user_id which is the identifier (or a hash of the identifier) you use to refer to a user in your own database. The customer object in Lean should map one to one with the user object in your database.
operationId: createCustomer
tags:
- Customer
parameters: []
requestBody:
content:
application/json:
schema:
type: object
properties:
app_user_id:
type: string
description: A unique value from your database, can be the corresponding User ID in your system, or any other string.
minLength: 1
maxLength: 255
government_identifiers:
type: array
description: "A government‑issued identifier for the debtor (the account holder making the payment). \nThis is **required by the UAE Open Finance specification** to uniquely identify the customer in any long lived consent authorization journey."
items:
allOf:
- $ref: '#/components/schemas/GovernmentIdentifierRequest'
required:
- app_user_id
examples:
- app_user_id: my_first_customer
government_identifier:
- type: EMIRATES_ID
value: 784-1232-1232-1232
responses:
'200':
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/Customer'
example:
customer_id: 49e8d23e-9b17-4ffe-a2ab-4c5fc1c02431
app_user_id: '001'
headers: {}
security:
- bearer: []
/customers/v1/{customer_id}/:
get:
summary: Get Customer by ID
deprecated: false
description: Fetch a Customer object by the customer_id associated
operationId: getCustomerById
tags:
- Customer
parameters:
- name: customer_id
in: path
description: ''
required: true
schema:
type: string
responses:
'200':
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/Customer'
example:
customer_id: 49e8d23e-9b17-4ffe-a2ab-4c5fc1c02431
app_user_id: '001'
headers: {}
security:
- bearer: []
put:
summary: Update Customer
deprecated: false
description: 'This endpoint allows you to update the government identifiers associated with an existing customer.
Government identifiers are required by the UAE Open Finance specification to uniquely identify the customer and must reflect the latest, valid information for the account holder.'
operationId: updateCustomer
tags:
- Customer
parameters:
- name: customer_id
in: path
description: ''
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
type: object
properties:
government_identifiers:
type: array
description: "A government‑issued identifier for the debtor (the account holder making the payment). \nThis is **required by the UAE Open Finance specification** to uniquely identify the customer."
items:
allOf:
- $ref: '#/components/schemas/GovernmentIdentifierRequest'
required:
- government_identifiers
examples:
- government_identifier:
- type: EMIRATES_ID
value: 784-1232-1232-1232
responses:
'200':
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/Customer'
example:
customer_id: 49e8d23e-9b17-4ffe-a2ab-4c5fc1c02431
app_user_id: '001'
headers: {}
/customers/v1/app-user-id/{app_user_id}:
get:
summary: Get Customer by app_user_id
deprecated: false
description: Fetch a Customer object by the associated `app_user_id` value
operationId: getCustomerByUserId
tags:
- Customer
parameters:
- name: app_user_id
in: path
description: ''
required: true
schema:
type: string
responses:
'200':
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/Customer'
example:
customer_id: 34c11087-b6bc-429b-9a91-725941b1a547
app_user_id: '001'
headers: {}
security:
- bearer: []
components:
schemas:
Customer:
type: object
properties:
customer_id:
type: string
format: uuid
description: Customer ID
app_user_id:
type: string
government_identifiers:
type: array
description: "A government‑issued identifier for the debtor (the account holder making the payment). \nThis is **required by the UAE Open Finance specification** to uniquely identify the customer."
items:
allOf:
- $ref: '#/components/schemas/GovernmentIdentifierRequest'
required:
- customer_id
- app_user_id
Pagination:
type: object
properties:
number:
type: integer
description: The current page being returned by the API
size:
type: integer
description: The page size requested
total_elements:
type: integer
description: The total number of elements in all pages
total_pages:
type: integer
description: The total number of pages retrievable
required:
- number
- size
- total_elements
- total_pages
GovernmentIdentifierRequest:
type: object
required:
- type
- value
properties:
value:
type: string
description: The identifier value
minLength: 1
pattern: ^(?!\s*$).+
type:
type: string
description: The type of Government ID
enum:
- EMIRATES_ID
- TRADE_LICENSE_NUMBER
securitySchemes:
bearerAuth:
type: http
scheme: bearer