Customers

Create A Customer

curl-request
$ curl 'http://localhost:8080/customers' -i -X POST -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{
  "identifier" : "idOne",
  "type" : "PERSON",
  "givenName" : "Kima",
  "middleName" : "Bessem",
  "surname" : "Ray",
  "dateOfBirth" : {
    "year" : 2000,
    "month" : 6,
    "day" : 6
  },
  "member" : true,
  "accountBeneficiary" : "Spouse",
  "referenceCustomer" : "mate",
  "assignedOffice" : "Oweh ViB",
  "assignedEmployee" : "Che Godwin",
  "address" : {
    "street" : "Hospital",
    "city" : "Muyuka",
    "region" : "SWR",
    "postalCode" : "8050",
    "countryCode" : "CM",
    "country" : "Cameroon"
  },
  "contactDetails" : [ {
    "type" : "MOBILE",
    "group" : "PRIVATE",
    "value" : "677777777",
    "preferenceLevel" : 1,
    "validated" : false
  }, {
    "type" : "PHONE",
    "group" : "BUSINESS",
    "value" : "233363640",
    "preferenceLevel" : 2,
    "validated" : false
  } ],
  "currentState" : "PENDING",
  "applicationDate" : "2017-07-19",
  "lastModifiedBy" : "Nakuve",
  "lastModifiedOn" : "2018-01-04"
}'
http-request
POST /customers HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: localhost:8080
Content-Length: 948

{
  "identifier" : "idOne",
  "type" : "PERSON",
  "givenName" : "Kima",
  "middleName" : "Bessem",
  "surname" : "Ray",
  "dateOfBirth" : {
    "year" : 2000,
    "month" : 6,
    "day" : 6
  },
  "member" : true,
  "accountBeneficiary" : "Spouse",
  "referenceCustomer" : "mate",
  "assignedOffice" : "Oweh ViB",
  "assignedEmployee" : "Che Godwin",
  "address" : {
    "street" : "Hospital",
    "city" : "Muyuka",
    "region" : "SWR",
    "postalCode" : "8050",
    "countryCode" : "CM",
    "country" : "Cameroon"
  },
  "contactDetails" : [ {
    "type" : "MOBILE",
    "group" : "PRIVATE",
    "value" : "677777777",
    "preferenceLevel" : 1,
    "validated" : false
  }, {
    "type" : "PHONE",
    "group" : "BUSINESS",
    "value" : "233363640",
    "preferenceLevel" : 2,
    "validated" : false
  } ],
  "currentState" : "PENDING",
  "applicationDate" : "2017-07-19",
  "lastModifiedBy" : "Nakuve",
  "lastModifiedOn" : "2018-01-04"
}
httpie-request
$ echo '{
  "identifier" : "idOne",
  "type" : "PERSON",
  "givenName" : "Kima",
  "middleName" : "Bessem",
  "surname" : "Ray",
  "dateOfBirth" : {
    "year" : 2000,
    "month" : 6,
    "day" : 6
  },
  "member" : true,
  "accountBeneficiary" : "Spouse",
  "referenceCustomer" : "mate",
  "assignedOffice" : "Oweh ViB",
  "assignedEmployee" : "Che Godwin",
  "address" : {
    "street" : "Hospital",
    "city" : "Muyuka",
    "region" : "SWR",
    "postalCode" : "8050",
    "countryCode" : "CM",
    "country" : "Cameroon"
  },
  "contactDetails" : [ {
    "type" : "MOBILE",
    "group" : "PRIVATE",
    "value" : "677777777",
    "preferenceLevel" : 1,
    "validated" : false
  }, {
    "type" : "PHONE",
    "group" : "BUSINESS",
    "value" : "233363640",
    "preferenceLevel" : 2,
    "validated" : false
  } ],
  "currentState" : "PENDING",
  "applicationDate" : "2017-07-19",
  "lastModifiedBy" : "Nakuve",
  "lastModifiedOn" : "2018-01-04"
}' | http POST 'http://localhost:8080/customers' 'Content-Type:application/json' 'Accept:application/json'
Table 1. create-customer-request-fields
Path Type Description

identifier

String

The customer’s identifier

type

String

The type of legal entity

enum Type {
PERSON,
BUSINESS
}

givenName

String

The customer’s given name

middleName

String

The customer’s middle name

surname

String

The customer’s surname

dateOfBirth

DateOfBirth

The customer’s date of birth

DateOfBirth {
Integer year,
Integer month,
Integer day,
}

member

Boolean

Is customer a member of the MFI ?

assignedOffice

String

The customer’s assigned office

assignedEmployee

String

The customer’s assigned employee

address

Address

The customer’s physical address

Address {
String street,
String city,
String region,
String postalCode,
String countryCode,
String country }

contactDetails

List<ContactDetail>

The customer’s contact details

ContactDetail {
enum Type {
EMAIL,
PHONE,
MOBILE
} type,
enum Group {
BUSINESS,
PRIVATE
} group,
String value
}

currentState

State

The customer’s current state

enum State {
PENDING,
ACTIVE,
LOCKED,
CLOSED
}

accountBeneficiary

String

account beneficiary

applicationDate

String

date customer applied for account

lastModifiedBy

String

employee who last modified account

lastModifiedOn

String

last time account was modified

referenceCustomer

String

fellow customer to refer to

http-response
HTTP/1.1 202 Accepted

Find A Customer

curl-request
$ curl 'http://localhost:8080/customers/eniruth' -i -H 'Content-Type: application/json' -H 'Accept: */*'
http-request
GET /customers/eniruth HTTP/1.1
Content-Type: application/json
Accept: */*
Host: localhost:8080
httpie-request
$ http GET 'http://localhost:8080/customers/eniruth' 'Content-Type:application/json' 'Accept:*/*'
http-response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 892

{
  "identifier" : "eniruth",
  "type" : "PERSON",
  "givenName" : "Eni",
  "middleName" : "Ruth",
  "surname" : "Tah",
  "dateOfBirth" : {
    "year" : 1997,
    "month" : 6,
    "day" : 5
  },
  "member" : true,
  "accountBeneficiary" : "Hubby",
  "referenceCustomer" : "friend",
  "assignedOffice" : "Bali ViB",
  "assignedEmployee" : "Shu Dion",
  "address" : {
    "street" : "Che St",
    "city" : "Bali",
    "region" : "WC",
    "postalCode" : "8050",
    "countryCode" : "CM",
    "country" : "Cameroon"
  },
  "contactDetails" : [ {
    "type" : "MOBILE",
    "group" : "PRIVATE",
    "value" : "675673477",
    "preferenceLevel" : 1,
    "validated" : false
  } ],
  "currentState" : "PENDING",
  "applicationDate" : "2018-01-04",
  "customValues" : [ ],
  "createdBy" : "maatkare",
  "createdOn" : "2018-06-11T03:17:26.646Z",
  "lastModifiedBy" : null,
  "lastModifiedOn" : null
}
Table 2. find-a-customer-response-fields
Path Type Description

identifier

String

The customer’s identifier

type

String

The type of legal entity

enum Type {
PERSON,
BUSINESS
}

givenName

String

The customer’s given name

middleName

String

The customer’s middle name

surname

String

The customer’s surName

dateOfBirth

DateOfBirth

The customer’s date of birth

DateOfBirth {
Integer year,
Integer month,
Integer day,
}

member

Boolean

Is customer a member of the MFI ?

assignedOffice

String

The customer’s assigned office

assignedEmployee

String

The customer’s assigned employee

address

Address

The customer’s physical address

Address {
String street,
String city,
String region,
String postalCode,
String countryCode,
String country }

contactDetails

List<ContactDetail>

The customer’s contact details

ContactDetail {
enum Type {
EMAIL,
PHONE,
MOBILE
} type,
enum Group {
BUSINESS,
PRIVATE
} group,
String value
}

currentState

State

The customer’s current state

enum State {
PENDING,
ACTIVE,
LOCKED,
CLOSED
}

accountBeneficiary

String

(Optional) The customer beneficiary

referenceCustomer

String

(Optional) The customer’s reference

applicationDate

String

(Optional) The date customer applied for account

customValues

List<Value>

Some custom values

createdBy

String

User who created account

createdOn

String

Date and time when account was created

lastModifiedBy

String

(Optional) Employee who last modified account

lastModifiedOn

String

(Optional) Date and time account was last modified

List Customers

curl-request
$ curl 'http://localhost:8080/customers' -i -H 'Content-Type: application/json' -H 'Accept: */*'
http-request
GET /customers HTTP/1.1
Content-Type: application/json
Accept: */*
Host: localhost:8080
httpie-request
$ http GET 'http://localhost:8080/customers' 'Content-Type:application/json' 'Accept:*/*'
http-response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 1402

{
  "customers" : [ {
    "identifier" : "bencho",
    "type" : "PERSON",
    "givenName" : "Bencho",
    "middleName" : "Etah",
    "surname" : "Obi",
    "dateOfBirth" : {
      "year" : 2000,
      "month" : 6,
      "day" : 6
    },
    "member" : true,
    "accountBeneficiary" : "Spouse",
    "referenceCustomer" : "mate",
    "assignedOffice" : "Kah ViB",
    "assignedEmployee" : "Ebot Tabi",
    "address" : null,
    "contactDetails" : null,
    "currentState" : "PENDING",
    "applicationDate" : "2017-04-10",
    "customValues" : null,
    "createdBy" : "maatkare",
    "createdOn" : "2018-06-11T03:19:40.833Z",
    "lastModifiedBy" : null,
    "lastModifiedOn" : null
  }, {
    "identifier" : "meni",
    "type" : "PERSON",
    "givenName" : "Meni",
    "middleName" : "Richmond",
    "surname" : "Akom",
    "dateOfBirth" : {
      "year" : 1997,
      "month" : 6,
      "day" : 5
    },
    "member" : true,
    "accountBeneficiary" : "Spouse",
    "referenceCustomer" : "friend",
    "assignedOffice" : "Buea ViB",
    "assignedEmployee" : "Itoh Mih",
    "address" : null,
    "contactDetails" : null,
    "currentState" : "PENDING",
    "applicationDate" : "2018-02-18",
    "customValues" : null,
    "createdBy" : "maatkare",
    "createdOn" : "2018-06-11T03:19:40.732Z",
    "lastModifiedBy" : null,
    "lastModifiedOn" : null
  } ],
  "totalPages" : 1,
  "totalElements" : 2
}
Table 3. list-customers-response-fields
Path Type Description

customers

List<Customer>

The List of Customers

totalPages

Integer

Number of pages

totalElements

Long

Number of customers in page

customers[].identifier

String

First customer’s identifier

customers[].type

Type

The type of first customer

enum Type {
PERSON,
BUSINESS
}

customers[].givenName

String

first customer’s given name

customers[].middleName

String

first customer’s middle name

customers[].surname

String

first customer’s surName

customers[].dateOfBirth

DateOfBirth

first customer’s date of birth

DateOfBirth {
Integer year,
Integer month,
Integer day,
}

customers[].member

Boolean

Is customer a member of the MFI ?

customers[].assignedOffice

String

first customer’s assigned office

customers[].assignedEmployee

String

first customer’s assigned employee

customers[].address

Address

first customer’s physical address

Address {
String street,
String city,
String region,
String postalCode,
String countryCode,
String country }

customers[].contactDetails

List<ContactDetail>

first customer’s contact details

ContactDetail {
enum Type {
EMAIL,
PHONE,
MOBILE
} type,
enum Group {
BUSINESS,
PRIVATE
} group,
String value
}

customers[].currentState

State

first customer’s current state

enum State {
PENDING,
ACTIVE,
LOCKED,
CLOSED
}

customers[].accountBeneficiary

String

first customer’s beneficiary

customers[].referenceCustomer

String

first customer’s reference

customers[].applicationDate

String

The date first customer applied for account

customers[].customValues

List<Value>

first customer’s custom values

customers[].createdBy

String

employee who created first customer’s account

customers[].createdOn

String

Date and time when first customer’s account was created

customers[].lastModifiedBy

String

Employee who last modified first customer’s account

customers[].lastModifiedOn

String

Date and time first customer’s account was last modified

customers[1].identifier

String

Second customer’s identifier

customers[1].type

Type

The type of the second customer

enum Type {
PERSON,
BUSINESS
}

customers[1].givenName

String

The second customer’s given name

customers[1].middleName

String

The second customer’s middle name

customers[1].surname

String

The second customer’s surName

customers[1].dateOfBirth

DateOfBirth

The second customer’s date of birth

DateOfBirth {
Integer year,
Integer month,
Integer day,
}

customers[1].member

Boolean

Is second customer a member of the MFI ?

customers[1].assignedOffice

String

The second customer’s assigned office

customers[1].assignedEmployee

String

The second customer’s assigned employee

customers[1].address

Address

second customer’s physical address

Address {
String street,
String city,
String region,
String postalCode,
String countryCode,
String country }

customers[1].contactDetails

List<ContactDetail>

second customer’s contact details

ContactDetail {
enum Type {
EMAIL,
PHONE,
MOBILE
} type,
enum Group {
BUSINESS,
PRIVATE
} group,
String value
}

customers[1].currentState

State

The second customer’s current state

enum State {
PENDING,
ACTIVE,
LOCKED,
CLOSED
}

customers[1].accountBeneficiary

String

The second customer’s beneficiary

customers[1].referenceCustomer

String

The second customer’s reference

customers[1].applicationDate

String

The date second customer applied for account

customers[1].customValues

List<Value>

Second customer’s custom values

customers[1].createdBy

String

User who created second customer’s account

customers[1].createdOn

String

Date and time when second customer’s account was created

customers[1].lastModifiedBy

String

Employee who last modified second customer’s account

customers[1].lastModifiedOn

String

Date and time second customer’s account was last modified

Update A Customer

curl-request
$ curl 'http://localhost:8080/customers/tifuh' -i -X PUT -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{
  "identifier" : "tifuh",
  "type" : "PERSON",
  "givenName" : "Tifuh",
  "middleName" : "Ndah",
  "surname" : "Sih",
  "dateOfBirth" : {
    "year" : 1990,
    "month" : 4,
    "day" : 3
  },
  "member" : true,
  "accountBeneficiary" : "Wife",
  "referenceCustomer" : "sister",
  "assignedOffice" : "Nkwen",
  "assignedEmployee" : "Chi Tih",
  "address" : {
    "street" : "Sonac",
    "city" : "Bamenda",
    "region" : "NWR",
    "postalCode" : "8050",
    "countryCode" : "CM",
    "country" : "Cameroon"
  },
  "contactDetails" : [ {
    "type" : "MOBILE",
    "group" : "PRIVATE",
    "value" : "677665544",
    "preferenceLevel" : 1,
    "validated" : false
  } ],
  "currentState" : "PENDING",
  "applicationDate" : "2017-09-06",
  "customValues" : [ ],
  "createdBy" : "maatkare",
  "createdOn" : "2018-06-15T11:34:51.553Z",
  "lastModifiedBy" : "maatkare",
  "lastModifiedOn" : "2018-06-15T11:34:51.702Z"
}'
http-request
PUT /customers/tifuh HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: localhost:8080
Content-Length: 918

{
  "identifier" : "tifuh",
  "type" : "PERSON",
  "givenName" : "Tifuh",
  "middleName" : "Ndah",
  "surname" : "Sih",
  "dateOfBirth" : {
    "year" : 1990,
    "month" : 4,
    "day" : 3
  },
  "member" : true,
  "accountBeneficiary" : "Wife",
  "referenceCustomer" : "sister",
  "assignedOffice" : "Nkwen",
  "assignedEmployee" : "Chi Tih",
  "address" : {
    "street" : "Sonac",
    "city" : "Bamenda",
    "region" : "NWR",
    "postalCode" : "8050",
    "countryCode" : "CM",
    "country" : "Cameroon"
  },
  "contactDetails" : [ {
    "type" : "MOBILE",
    "group" : "PRIVATE",
    "value" : "677665544",
    "preferenceLevel" : 1,
    "validated" : false
  } ],
  "currentState" : "PENDING",
  "applicationDate" : "2017-09-06",
  "customValues" : [ ],
  "createdBy" : "maatkare",
  "createdOn" : "2018-06-15T11:34:51.553Z",
  "lastModifiedBy" : "maatkare",
  "lastModifiedOn" : "2018-06-15T11:34:51.702Z"
}
httpie-request
$ echo '{
  "identifier" : "tifuh",
  "type" : "PERSON",
  "givenName" : "Tifuh",
  "middleName" : "Ndah",
  "surname" : "Sih",
  "dateOfBirth" : {
    "year" : 1990,
    "month" : 4,
    "day" : 3
  },
  "member" : true,
  "accountBeneficiary" : "Wife",
  "referenceCustomer" : "sister",
  "assignedOffice" : "Nkwen",
  "assignedEmployee" : "Chi Tih",
  "address" : {
    "street" : "Sonac",
    "city" : "Bamenda",
    "region" : "NWR",
    "postalCode" : "8050",
    "countryCode" : "CM",
    "country" : "Cameroon"
  },
  "contactDetails" : [ {
    "type" : "MOBILE",
    "group" : "PRIVATE",
    "value" : "677665544",
    "preferenceLevel" : 1,
    "validated" : false
  } ],
  "currentState" : "PENDING",
  "applicationDate" : "2017-09-06",
  "customValues" : [ ],
  "createdBy" : "maatkare",
  "createdOn" : "2018-06-15T11:34:51.553Z",
  "lastModifiedBy" : "maatkare",
  "lastModifiedOn" : "2018-06-15T11:34:51.702Z"
}' | http PUT 'http://localhost:8080/customers/tifuh' 'Content-Type:application/json' 'Accept:application/json'
Table 4. update-customer-request-fields
Path Type Description

identifier

String

The customer’s identifier

type

String

The type of legal entity

enum Type {
PERSON,
BUSINESS
}

givenName

String

The customer’s given name

middleName

String

The customer’s middle name

surname

String

The customer’s surname

dateOfBirth

DateOfBirth

The customer’s date of birth

DateOfBirth {
Integer year,
Integer month,
Integer day,
}

member

Boolean

Is customer a member of the MFI ?

assignedOffice

String

The customer’s assigned office

assignedEmployee

String

The customer’s assigned employee

address

Address

The customer’s physical address

Address {
String street,
String city,
String region,
String postalCode,
String countryCode,
String country }

contactDetails

List<ContactDetail>

The customer’s contact details

ContactDetail {
enum Type {
EMAIL,
PHONE,
MOBILE
} type,
enum Group {
BUSINESS,
PRIVATE
} group,
String value
}

currentState

State

The customer’s current state

enum State {
PENDING,
ACTIVE,
LOCKED,
CLOSED
}

accountBeneficiary

String

account beneficiary

applicationDate

String

date customer applied for account

customValues

List<Value>

Second customer’s custom values

createdBy

String

User who created second customer’s account

createdOn

String

Date and time when second customer’s account was created

lastModifiedBy

String

employee who last modified account

lastModifiedOn

String

last time account was modified

referenceCustomer

String

fellow customer to refer to

http-response
HTTP/1.1 202 Accepted

Activate A Client

curl-request
$ curl 'http://localhost:8080/customers/bihade/commands' -i -X POST -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{
  "action" : "ACTIVATE",
  "comment" : "Client Activated"
}'
http-request
POST /customers/bihade/commands HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: localhost:8080
Content-Length: 61

{
  "action" : "ACTIVATE",
  "comment" : "Client Activated"
}
httpie-request
$ echo '{
  "action" : "ACTIVATE",
  "comment" : "Client Activated"
}' | http POST 'http://localhost:8080/customers/bihade/commands' 'Content-Type:application/json' 'Accept:application/json'
Table 5. activate-client-request-fields
Path Type Description

action

String

Action ACTIVATE
enum Action {
ACTIVATE,
LOCK,
UNLOCK,
CLOSE,
REOPEN
}

comment

String

Activate comment

http-response
HTTP/1.1 202 Accepted

Lock A Client

curl-request
$ curl 'http://localhost:8080/customers/bahtende/commands' -i -X POST -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{
  "action" : "LOCK",
  "comment" : "Locked Client"
}'
http-request
POST /customers/bahtende/commands HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: localhost:8080
Content-Length: 54

{
  "action" : "LOCK",
  "comment" : "Locked Client"
}
httpie-request
$ echo '{
  "action" : "LOCK",
  "comment" : "Locked Client"
}' | http POST 'http://localhost:8080/customers/bahtende/commands' 'Content-Type:application/json' 'Accept:application/json'
Table 6. lock-client-request-fields
Path Type Description

action

String

Action LOCK
enum Action {
ACTIVATE,
LOCK,
UNLOCK,
CLOSE,
REOPEN
}

comment

String

Lock comment

http-response
HTTP/1.1 202 Accepted

Unlock A Client

curl-request
$ curl 'http://localhost:8080/customers/pobum/commands' -i -X POST -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{
  "action" : "UNLOCK",
  "comment" : "Client Unlocked"
}'
http-request
POST /customers/pobum/commands HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: localhost:8080
Content-Length: 58

{
  "action" : "UNLOCK",
  "comment" : "Client Unlocked"
}
httpie-request
$ echo '{
  "action" : "UNLOCK",
  "comment" : "Client Unlocked"
}' | http POST 'http://localhost:8080/customers/pobum/commands' 'Content-Type:application/json' 'Accept:application/json'
Table 7. unlock-client-request-fields
Path Type Description

action

String

Action UNLOCK
enum Action {
ACTIVATE,
LOCK,
UNLOCK,
CLOSE,
REOPEN
}

comment

String

Unlock comment

http-response
HTTP/1.1 202 Accepted

Close A Client

curl-request
$ curl 'http://localhost:8080/customers/epolle/commands' -i -X POST -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{
  "action" : "CLOSE",
  "comment" : "Client Closed"
}'
http-request
POST /customers/epolle/commands HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: localhost:8080
Content-Length: 55

{
  "action" : "CLOSE",
  "comment" : "Client Closed"
}
httpie-request
$ echo '{
  "action" : "CLOSE",
  "comment" : "Client Closed"
}' | http POST 'http://localhost:8080/customers/epolle/commands' 'Content-Type:application/json' 'Accept:application/json'
Table 8. close-client-request-fields
Path Type Description

action

String

Action CLOSE
enum Action {
ACTIVATE,
LOCK,
UNLOCK,
CLOSE,
REOPEN
}

comment

String

Close comment

http-response
HTTP/1.1 202 Accepted

Reopen A Client

curl-request
$ curl 'http://localhost:8080/customers/eyolle/commands' -i -X POST -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{
  "action" : "REOPEN",
  "comment" : "Reopened Client"
}'
http-request
POST /customers/eyolle/commands HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: localhost:8080
Content-Length: 58

{
  "action" : "REOPEN",
  "comment" : "Reopened Client"
}
httpie-request
$ echo '{
  "action" : "REOPEN",
  "comment" : "Reopened Client"
}' | http POST 'http://localhost:8080/customers/eyolle/commands' 'Content-Type:application/json' 'Accept:application/json'
Table 9. reopen-client-request-fields
Path Type Description

action

String

Action REOPEN
enum Action {
ACTIVATE,
LOCK,
UNLOCK,
CLOSE,
REOPEN
}

comment

String

Reopen comment

http-response
HTTP/1.1 202 Accepted

List Client Commands

curl-request
$ curl 'http://localhost:8080/customers/kumba/commands' -i -H 'Content-Type: application/json' -H 'Accept: */*'
http-request
GET /customers/kumba/commands HTTP/1.1
Content-Type: application/json
Accept: */*
Host: localhost:8080
httpie-request
$ http GET 'http://localhost:8080/customers/kumba/commands' 'Content-Type:application/json' 'Accept:*/*'
http-response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 125

[ {
  "action" : "ACTIVATE",
  "comment" : "Test",
  "createdOn" : "2018-06-11T03:33:08.077Z",
  "createdBy" : "maatkare"
} ]
Table 10. list-client-commands-response-fields
Path Type Description

[].action

String

A List of commands

[].comment

String

A comment

[].createdOn

String

Date and time customer was created

[].createdBy

String

Employee who created customer

Update Customer’s Address

curl-request
$ curl 'http://localhost:8080/customers/likumba/address' -i -X PUT -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{
  "street" : "Ombe Rd",
  "city" : "Mutengene",
  "region" : "SWR",
  "postalCode" : "8050",
  "countryCode" : "CM",
  "country" : "Cameroon"
}'
http-request
PUT /customers/likumba/address HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: localhost:8080
Content-Length: 145

{
  "street" : "Ombe Rd",
  "city" : "Mutengene",
  "region" : "SWR",
  "postalCode" : "8050",
  "countryCode" : "CM",
  "country" : "Cameroon"
}
httpie-request
$ echo '{
  "street" : "Ombe Rd",
  "city" : "Mutengene",
  "region" : "SWR",
  "postalCode" : "8050",
  "countryCode" : "CM",
  "country" : "Cameroon"
}' | http PUT 'http://localhost:8080/customers/likumba/address' 'Content-Type:application/json' 'Accept:application/json'
Table 11. update-customer-request-fields
Path Type Description

street

String

street

city

String

city

region

String

region

postalCode

String

postal code

countryCode

String

country code

country

String

country

http-response
HTTP/1.1 202 Accepted

Update Customer’s Details

curl-request
$ curl 'http://localhost:8080/customers/kome/contact' -i -X PUT -H 'Content-Type: application/json' -H 'Accept: application/json' -d '[ {
  "type" : "MOBILE",
  "group" : "PRIVATE",
  "value" : "666737666",
  "preferenceLevel" : 2,
  "validated" : false
}, {
  "type" : "MOBILE",
  "group" : "PRIVATE",
  "value" : "677757564",
  "preferenceLevel" : 1,
  "validated" : true
} ]'
http-request
PUT /customers/kome/contact HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: localhost:8080
Content-Length: 243

[ {
  "type" : "MOBILE",
  "group" : "PRIVATE",
  "value" : "666737666",
  "preferenceLevel" : 2,
  "validated" : false
}, {
  "type" : "MOBILE",
  "group" : "PRIVATE",
  "value" : "677757564",
  "preferenceLevel" : 1,
  "validated" : true
} ]
httpie-request
$ echo '[ {
  "type" : "MOBILE",
  "group" : "PRIVATE",
  "value" : "666737666",
  "preferenceLevel" : 2,
  "validated" : false
}, {
  "type" : "MOBILE",
  "group" : "PRIVATE",
  "value" : "677757564",
  "preferenceLevel" : 1,
  "validated" : true
} ]' | http PUT 'http://localhost:8080/customers/kome/contact' 'Content-Type:application/json' 'Accept:application/json'
Table 12. update-customer-details-request-fields
Path Type Description

[].type

Type

The type of the first contact

enum Type {
PERSON,
BUSINESS
}

[].group

Group

The group of the first contact

enum Type {
BUSINESS,
PRIVATE
}

[].value

String

first contact’s value

[].preferenceLevel

Number

Preference Level

[].validated

Boolean

Is first contact validated ?

[1].type

Type

The type of the second contact

enum Type {
PERSON,
BUSINESS
}

[1].group

Group

The Group of the second contact

enum Type {
BUSINESS,
PRIVATE
}

[1].value

String

second contact’s value

[1].preferenceLevel

Number

Preference Level

[1].validated

Boolean

Is second contact validated ?

http-response
HTTP/1.1 202 Accepted

Upload Customer’s Portrait

curl-request
$ curl 'http://localhost:8080/customers/ojong/portrait' -i -X POST -H 'Content-Type: multipart/form-data' -F 'portrait=@portrait.png;type=image/png'
httpie-request
$ http --form POST 'http://localhost:8080/customers/ojong/portrait' \
  'portrait'@'portrait.png'
http-request
POST /customers/ojong/portrait HTTP/1.1
Content-Type: multipart/form-data; boundary=6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Host: localhost:8080

--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Content-Disposition: form-data; name=portrait
Content-Type: image/png

i don't care
--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm--
http-response
HTTP/1.1 202 Accepted

Replace Customer’s Portrait

curl-request
$ curl 'http://localhost:8080/customers/osong/portrait' -i -X POST -H 'Content-Type: multipart/form-data' -F 'portrait=@test.png;type=image/png'
httpie-request
$ http --form POST 'http://localhost:8080/customers/osong/portrait' \
  'portrait'@'test.png'
http-request
POST /customers/osong/portrait HTTP/1.1
Content-Type: multipart/form-data; boundary=6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Host: localhost:8080

--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Content-Disposition: form-data; name=portrait
Content-Type: image/png

i care
--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm--
http-response
HTTP/1.1 202 Accepted

Delete Customer’s Portrait

curl-request
$ curl 'http://localhost:8080/customers/shey/portrait' -i -X DELETE -H 'Accept: */*' -H 'Content-Type: application/json'
http-request
DELETE /customers/shey/portrait HTTP/1.1
Accept: */*
Content-Type: application/json
Host: localhost:8080
httpie-request
$ http DELETE 'http://localhost:8080/customers/shey/portrait' 'Accept:*/*' 'Content-Type:application/json'
http-response
HTTP/1.1 202 Accepted

Identification Cards

Create Identification Card

curl-request
$ curl 'http://localhost:8080/customers/ejiks/identifications' -i -X POST -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{
  "type" : "National",
  "number" : "SC10A1234567",
  "expirationDate" : {
    "year" : 2029,
    "month" : 10,
    "day" : 10
  },
  "issuer" : "National Security",
  "createdBy" : "Ndop Ndop",
  "createdOn" : "2018/10/10",
  "lastModifiedBy" : "Cho Toh",
  "lastModifiedOn" : "2018-06-11"
}'
http-request
POST /customers/ejiks/identifications HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: localhost:8080
Content-Length: 294

{
  "type" : "National",
  "number" : "SC10A1234567",
  "expirationDate" : {
    "year" : 2029,
    "month" : 10,
    "day" : 10
  },
  "issuer" : "National Security",
  "createdBy" : "Ndop Ndop",
  "createdOn" : "2018/10/10",
  "lastModifiedBy" : "Cho Toh",
  "lastModifiedOn" : "2018-06-11"
}
httpie-request
$ echo '{
  "type" : "National",
  "number" : "SC10A1234567",
  "expirationDate" : {
    "year" : 2029,
    "month" : 10,
    "day" : 10
  },
  "issuer" : "National Security",
  "createdBy" : "Ndop Ndop",
  "createdOn" : "2018/10/10",
  "lastModifiedBy" : "Cho Toh",
  "lastModifiedOn" : "2018-06-11"
}' | http POST 'http://localhost:8080/customers/ejiks/identifications' 'Content-Type:application/json' 'Accept:application/json'
Table 13. create-id-card-request-fields
Path Type Description

type

String

Type of identity card

number

String

Identity card number

expirationDate

ExpirationDate

expiry date of card

class ExpirationDate {
Integer year,
Integer month,
Integer day,
}

issuer

String

Issuer of identity Card

createdBy

String

employee who created card

createdOn

String

date when card was created

lastModifiedBy

String

employee who last modified card

lastModifiedOn

String

last time card was modified

http-response
HTTP/1.1 202 Accepted

Update Identification Card

curl-request
$ curl 'http://localhost:8080/customers/zIRg8pb5/identifications/4OTnXX8Hg3sRPHDblHYftemgMOdB9n2p' -i -X PUT -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{
  "type" : "University",
  "number" : "4OTnXX8Hg3sRPHDblHYftemgMOdB9n2p",
  "expirationDate" : {
    "year" : 2020,
    "month" : 1,
    "day" : 1
  },
  "issuer" : "UBuea"
}'
http-request
PUT /customers/zIRg8pb5/identifications/4OTnXX8Hg3sRPHDblHYftemgMOdB9n2p HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: localhost:8080
Content-Length: 176

{
  "type" : "University",
  "number" : "4OTnXX8Hg3sRPHDblHYftemgMOdB9n2p",
  "expirationDate" : {
    "year" : 2020,
    "month" : 1,
    "day" : 1
  },
  "issuer" : "UBuea"
}
httpie-request
$ echo '{
  "type" : "University",
  "number" : "4OTnXX8Hg3sRPHDblHYftemgMOdB9n2p",
  "expirationDate" : {
    "year" : 2020,
    "month" : 1,
    "day" : 1
  },
  "issuer" : "UBuea"
}' | http PUT 'http://localhost:8080/customers/zIRg8pb5/identifications/4OTnXX8Hg3sRPHDblHYftemgMOdB9n2p' 'Content-Type:application/json' 'Accept:application/json'
Table 14. update-id-card-request-fields
Path Type Description

type

String

Type of Identity card

number

String

Identity card number

expirationDate

ExpirationDate

expiry date of card

class ExpirationDate {
Integer year,
Integer month,
Integer day,
}

issuer

String

Issuer of identity Card

http-response
HTTP/1.1 202 Accepted

Fetch Identification Cards

curl-request
$ curl 'http://localhost:8080/customers/ektcOHJc/identifications' -i -H 'Content-Type: application/json' -H 'Accept: */*'
httpie-request
$ http GET 'http://localhost:8080/customers/ektcOHJc/identifications' 'Content-Type:application/json' 'Accept:*/*'
http-request
GET /customers/ektcOHJc/identifications HTTP/1.1
Content-Type: application/json
Accept: */*
Host: localhost:8080
http-response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 557

[ {
  "type" : "National",
  "number" : "07235388",
  "expirationDate" : {
    "year" : 2028,
    "month" : 5,
    "day" : 23
  },
  "issuer" : "NDNS",
  "createdBy" : "maatkare",
  "createdOn" : "2018-06-11T03:47:42.063Z",
  "lastModifiedBy" : null,
  "lastModifiedOn" : null
}, {
  "type" : "University",
  "number" : "SC10A123",
  "expirationDate" : {
    "year" : 2019,
    "month" : 10,
    "day" : 7
  },
  "issuer" : "UB",
  "createdBy" : "maatkare",
  "createdOn" : "2018-06-11T03:47:42.15Z",
  "lastModifiedBy" : null,
  "lastModifiedOn" : null
} ]
Table 15. fetch-id-cards-response-fields
Path Type Description

[].type

String

type of first card

[].number

String

Number on first card

[].expirationDate

ExpirationDate

expiry date of first card

class ExpirationDate {
Integer year,
Integer month,
Integer day,
}

[].issuer

String

issuer of first card

[].createdBy

String

creator of first card

[].createdOn

String

date of creation of first card

[].lastModifiedBy

String

employee who last modified first card

[].lastModifiedOn

String

date when first card was lastly modified

[1].type

String

type of second card

[1].number

String

Number of second card

[1].expirationDate

ExpirationDate

expiry date of second card

class ExpirationDate {
Integer year,
Integer month,
Integer day,
}

[1].issuer

String

issuer of second card

[1].createdBy

String

creator of second card

[1].createdOn

String

date of creation of second card

[1].lastModifiedBy

String

employee who last modified second card

[1].lastModifiedOn

String

date when second cards was lastly modified

Delete Identification Card

curl-request
$ curl 'http://localhost:8080/customers/ekolle/identifications/FET12345' -i -X DELETE -H 'Content-Type: application/json' -H 'Accept: */*'
http-request
DELETE /customers/ekolle/identifications/FET12345 HTTP/1.1
Content-Type: application/json
Accept: */*
Host: localhost:8080
httpie-request
$ http DELETE 'http://localhost:8080/customers/ekolle/identifications/FET12345' 'Content-Type:application/json' 'Accept:*/*'
http-response
HTTP/1.1 202 Accepted

Delete Identification Card With Scan

curl-request
$ curl 'http://localhost:8080/customers/ana/identifications/FET20Z234/scans/myScan' -i -X DELETE -H 'Accept: */*' -H 'Content-Type: application/json'
http-request
DELETE /customers/ana/identifications/FET20Z234/scans/myScan HTTP/1.1
Accept: */*
Content-Type: application/json
Host: localhost:8080
httpie-request
$ http DELETE 'http://localhost:8080/customers/ana/identifications/FET20Z234/scans/myScan' 'Accept:*/*' 'Content-Type:application/json'
http-response
HTTP/1.1 202 Accepted

Fetch Identification Card Scans

curl-request
$ curl 'http://localhost:8080/customers/ato'oh/identifications/CT13B0987/scans' -i -H 'Content-Type: application/json' -H 'Accept: */*' -d '[ {
  "identifier" : "ScanOne",
  "description" : "First Scan"
}, {
  "identifier" : "ScanTwo",
  "description" : "Second Scan"
}, {
  "identifier" : "ScanThree",
  "description" : "Three Scan"
} ]'
http-request
GET /customers/ato'oh/identifications/CT13B0987/scans HTTP/1.1
Content-Type: application/json
Accept: */*
Host: localhost:8080
Content-Length: 197

[ {
  "identifier" : "ScanOne",
  "description" : "First Scan"
}, {
  "identifier" : "ScanTwo",
  "description" : "Second Scan"
}, {
  "identifier" : "ScanThree",
  "description" : "Three Scan"
} ]
httpie-request
$ echo '[ {
  "identifier" : "ScanOne",
  "description" : "First Scan"
}, {
  "identifier" : "ScanTwo",
  "description" : "Second Scan"
}, {
  "identifier" : "ScanThree",
  "description" : "Three Scan"
} ]' | http GET 'http://localhost:8080/customers/ato'oh/identifications/CT13B0987/scans' 'Content-Type:application/json' 'Accept:*/*'
http-response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 197

[ {
  "identifier" : "ScanOne",
  "description" : "First Scan"
}, {
  "identifier" : "ScanTwo",
  "description" : "Second Scan"
}, {
  "identifier" : "ScanThree",
  "description" : "Three Scan"
} ]
Table 16. response-fields
Path Type Description

[].identifier

String

First scan’s identifier

[].description

String

First scan’s description

[1].identifier

String

Second scan’s identifier

[1].description

String

Second scan’s description

[2].identifier

String

Third scan’s identifier

[2].description

String

Third scan’s description

Find Identification Card Scan

curl-request
$ curl 'http://localhost:8080/customers/checko/identifications/SM23A4321/scans/soughtOut' -i -H 'Content-Type: application/json' -H 'Accept: */*' -d '{
  "identifier" : "soughtOut",
  "description" : "Found Scan"
}'
http-request
GET /customers/checko/identifications/SM23A4321/scans/soughtOut HTTP/1.1
Content-Type: application/json
Accept: */*
Host: localhost:8080
Content-Length: 64

{
  "identifier" : "soughtOut",
  "description" : "Found Scan"
}
httpie-request
$ echo '{
  "identifier" : "soughtOut",
  "description" : "Found Scan"
}' | http GET 'http://localhost:8080/customers/checko/identifications/SM23A4321/scans/soughtOut' 'Content-Type:application/json' 'Accept:*/*'
http-response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 64

{
  "identifier" : "soughtOut",
  "description" : "Found Scan"
}
Table 17. response-fields
Path Type Description

identifier

String

scan’s identifier

description

String

scan’s description

Find Identification Card Scan With Image

curl-request
$ curl 'http://localhost:8080/customers/akong/identifications/SC18C0999/scans/scanIdentity/image' -i -H 'Content-Type: application/json' -H 'Accept: */*' -d 'iCareAboutImage'
http-request
GET /customers/akong/identifications/SC18C0999/scans/scanIdentity/image HTTP/1.1
Content-Type: application/json
Accept: */*
Host: localhost:8080
Content-Length: 15

iCareAboutImage
httpie-request
$ echo 'iCareAboutImage' | http GET 'http://localhost:8080/customers/akong/identifications/SC18C0999/scans/scanIdentity/image' 'Content-Type:application/json' 'Accept:*/*'
http-response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 15

iCareAboutImage

Delete Identification Card Scan

curl-request
$ curl 'http://localhost:8080/customers/wabah/identifications/SC012A001/scans/justScan' -i -X DELETE -H 'Accept: */*' -H 'Content-Type: application/json'
http-request
DELETE /customers/wabah/identifications/SC012A001/scans/justScan HTTP/1.1
Accept: */*
Content-Type: application/json
Host: localhost:8080
httpie-request
$ http DELETE 'http://localhost:8080/customers/wabah/identifications/SC012A001/scans/justScan' 'Accept:*/*' 'Content-Type:application/json'
http-response
HTTP/1.1 202 Accepted