maas-schemas

customer Schema

http://maasglobal.com/core/customer.json

MaaS customer schema

Abstract Extensible Status Identifiable Custom Properties Additional Properties Defined In
Can be instantiated No Develop No Forbidden Forbidden core/customer.json

Schema Hierarchy

customer Example

{
  "identityId": "eu-west-1:4828507e-683f-41bf-9d87-689808fbf958",
  "id": 1234,
  "favoriteLocations": [],
  "phone": "+358407654321",
  "email": "bob.customer@example.com",
  "honorifics": "mr",
  "sex": "male",
  "firstName": "Bob",
  "lastName": "Customer",
  "created": 1553687004207,
  "modified": 1553688004207,
  "paymentMethod": {
    "type": "unknown",
    "valid": false
  },
  "subscriptionInstance": {
    "id": 10,
    "name": "Whim to Go",
    "plan": {
      "id": "fi-whim-payg_v2"
    },
    "addons": {
      "0": "eur-whim-rollover-100_v1",
      "1": "fi-whim-car"
    },
    "region": {
      "id": "fi-helsinki",
      "name": "Helsinki Region",
      "active": true,
      "hidden": false,
      "created": "2019-03-27T14:00:00.12345+00:00",
      "zipCode": "00100",
      "currency": "EUR",
      "location": {
        "lat": 60.1699,
        "lon": 24.9384
      },
      "geometryId": 2,
      "countryCode": "FI",
      "countryDefault": true
    },
    "coupons": [],
    "topUpId": "fi-whim-top-up",
    "wmpGrant": 0,
    "pointCost": 0.01,
    "description": "Pay for each trip as you go"
  },
  "balances": {
    "WMP": {
      "currency": "WMP",
      "amount": 1234,
      "type": "charge"
    },
    "cx-test-token_v2": {
      "currency": "TOKEN",
      "tokenId": "cx-test-token_v2",
      "amount": 1,
      "type": "charge"
    }
  },
  "referral": {
    "code": "XXXX-XXXX-XXXX-XXXX"
  },
  "regionId": "fi-helsinki",
  "region": {
    "id": "fi-helsinki",
    "name": "Helsinki Region",
    "countryCode": "FI",
    "countryDefault": true,
    "zipCode": "00100",
    "location": {
      "lat": 60.1699,
      "lon": 24.9384
    },
    "active": true,
    "hidden": false,
    "geometryId": 2,
    "created": 1553687004207,
    "modified": 0,
    "currency": "EUR"
  }
}

customer Properties

Property Type Required Nullable Defined by
address string Optional No customer (this schema)
appInstanceId string Optional No customer (this schema)
authToken string Optional No customer (this schema)
balances object Optional No customer (this schema)
city string Optional No customer (this schema)
clientId enum Optional No customer (this schema)
country string Optional No customer (this schema)
dob complex Optional No customer (this schema)
documents personal-document Optional No customer (this schema)
email string Optional No customer (this schema)
firstName string Optional No customer (this schema)
firstNameLocalized string Optional No customer (this schema)
honorifics string Optional No customer (this schema)
identityId complex Optional No customer (this schema)
lastName string Optional No customer (this schema)
lastNameLocalized string Optional No customer (this schema)
locale string Optional No customer (this schema)
opaqueId string Optional No customer (this schema)
phone string Optional No customer (this schema)
referral object Optional No customer (this schema)
sex string Optional No customer (this schema)
ssid complex Optional No customer (this schema)
state string Optional No customer (this schema)
subscriberType string Optional No customer (this schema)
zipCode string Optional No customer (this schema)

address

Street address (and optional number), http://www.bitboost.com/ref/international-address-formats.html

address

address Type

string

appInstanceId

An id specific to a user device

appInstanceId

appInstanceId Type

string

authToken

Authentication Token

authToken

authToken Type

string

balances

balances

balances Type

object with following properties:

Property Type Required
WMP object Required

WMP

WMP

WMP Type

object with following properties:

Property Type Required
amount integer Required
currency   Required

amount

amount

amount Type

integer

currency

currency

The value of this property must be equal to:

"WMP"

city

Alphabetic city name

city

city Type

string

clientId

An id indicating the source of the client

clientId

The value of this property must be equal to one of the known values below.

clientId Known Values

Value Description
whim  
wechat  

country

ISO 3166-1 alpha-2 country code, see https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2

country

country Type

string

All instances must conform to this regular expression (test examples here):

^[A-Z]{2,2}$

dob

The customer’s date of birth or boolean indicating if the value is already in DB

dob

dob Type

Any following options needs to be fulfilled.

Option 1

boolean

Option 2

documents

documents

documents Type

Array type: personal-document

All items must be of the type:

email

Rough validation of a valid e-mail address

email

email Type

string

^.+@.+\..+$

email Example

"joe.customer@example.com"

firstName

First name of the customer (e.g. John)

firstName

firstName Type

string

firstNameLocalized

Localized first name of the customer (e.g. John)

firstNameLocalized

firstNameLocalized Type

string

honorifics

honorifics

honorifics Type

string

identityId

identityId

identityId Type

Any following options needs to be fulfilled.

Option 1

string

All instances must conform to this regular expression

^[aepus]{2}-[\w]{4}-\d:[a-f\d]{8}(-[a-f\d]{4}){3}-[a-f\d]{12}$

Option 2

string

All instances must conform to this regular expression

^[A-Fa-f0-9]{8}(-[A-Fa-f0-9]{4}){3}-[A-Fa-f0-9]{12}$

identityId Examples

"eu-west-1:4828507e-683f-41bf-9d87-689808fbf958"
"4828507e-683f-41bf-9d87-689808fbf958"

lastName

Last name of the customer (e.g. Doe)

lastName

lastName Type

string

lastNameLocalized

Localized last name of the customer (e.g. Doe)

lastNameLocalized

lastNameLocalized Type

string

locale

locale

locale Type

string

All instances must conform to this regular expression (test examples here):

^[a-z]{2,3}(?:-[a-zA-Z]{4})?(?:-[A-Z]{2,3})?$

opaqueId

Typically the hash of the identityId

opaqueId

opaqueId Type

string

All instances must conform to this regular expression (test examples here):

^[0-9abcdefABCDEF]+$

phone

ITU-T E.164 phone number

phone

phone Type

string

All instances must conform to this regular expression

^\+(?:\d){6,14}\d$

phone Example

"+358401234567"

referral

referral

referral Type

object with following properties:

Property Type Required
code string Optional

code

code

code Type

string

sex

sex

sex Type

string

ssid

Social Security ID

ssid

ssid Type

Any following options needs to be fulfilled.

Option 1

boolean

Option 2

state

Alphabetic state name

state

state Type

string

subscriberType

Subscriber Type

subscriberType

subscriberType Type

string

zipCode

Numeric zip code, see https://en.wikipedia.org/wiki/Postal_code

zipCode

zipCode Type

string