riverty logo

Docs

Searching In Customer With Given Filter Value

Returns a list of customers. The customers are returned sorted by customer number as default.

Path

POST /v1/clients/{clientId}/customers/search

Request Parameters

clientId
required
integer
The ID of the client.
page
integer
The page number of results. Default: _1_
perPage
integer
The maximum number of results to retrieve per page. Default: _100_
sort
string
The field name for sorting. Default: _customerNumber_\ Available values: - clientId - customerNumber - name - ssn - organizationNumber
order
string
The pagination order. Default: _desc_\ Available values: - asc - desc

Request Body

application/json

searchValue
string
Specifies the keyword to search.
searchColumn
string
Specifies the column name to search.\ Available values: - clientId - customerNumber - name - ssn - organizationNumber

Responses

Successful RequestSuccessful Request, Customer Not Found

Request Example

    
        {
 "searchValue": "customer-person-1",
 "searchColumn": "customerNumber"
}
    

Response Example

    
        {
 "items": [
  {
   "_links": [
    {
     "href": "https://api.horizonafs.io/customer/v1/client/1234/customers/customer-person-1",
     "rel": "_self",
     "method": "GET"
    },
    {
     "href": "https://api.horizonafs.io/customer/v1/client/1234/customers/customer-person-1",
     "rel": "check_customer",
     "method": "HEAD"
    },
    {
     "href": "https://api.horizonafs.io/customer/v1/client/1234/customers/customer-person-1",
     "rel": "update_customer",
     "method": "PUT"
    },
    {
     "href": "https://api.horizonafs.io/customer/v1/client/1234/customers/search?page={Page}&perPage={PerPage}&sort={byFieldName}&order={ASC/DESC}",
     "rel": "search_customer_by_field",
     "method": "POST"
    }
   ],
   "customerNumber": "customer-person-1",
   "type": "Person",
   "person": {
    "firstName": "Tom",
    "lastName": "Customer"
   },
   "phoneNumber": "+4712345678",
   "email": "tom.customer@mail.com",
   "paymentMeans": {
    "paymentId": "291069002072200000004"
   },
   "address": {
    "addressLine": "Person Street 1",
    "postalCode": "0002",
    "postalPlace": "PRSN",
    "countryCode": "NO"
   }
  },
  {
   "_links": [
    {
     "href": "https://api.horizonafs.io/customer/v1/client/1234/customers/customer-company-1",
     "rel": "_self",
     "method": "GET"
    },
    {
     "href": "https://api.horizonafs.io/customer/v1/client/1234/customers/customer-company-1",
     "rel": "check_customer",
     "method": "HEAD"
    },
    {
     "href": "https://api.horizonafs.io/customer/v1/client/1234/customers/customer-company-1",
     "rel": "update_customer",
     "method": "PUT"
    },
    {
     "href": "https://api.horizonafs.io/customer/v1/client/1234/customers/search?page={Page}&perPage={PerPage}&sort={byFieldName}&order={ASC/DESC}",
     "rel": "search_customer_by_field",
     "method": "POST"
    }
   ],
   "customerNumber": "customer-company-1",
   "type": "Company",
   "company": {
    "name": "Company AS",
    "organizationNumber": "111222333"
   },
   "phoneNumber": "+4788833322",
   "email": "company.name@mail.com",
   "paymentMeans": {
    "paymentId": "291069002072200000008"
   },
   "address": {
    "addressLine": "Company Street 1",
    "postalCode": "0001",
    "postalPlace": "CMPY",
    "countryCode": "NO"
   }
  }
 ],
 "total": 2
}