persons

persons

Retrieve information about a person

An ID must be used when requesting a persons information.

Request

HTTP GET to /persons/id

Parameters

See Common parameters and responses

Name

Value

Description

Data type

memberuntil

2015-12-24

When the membership expires

Date

kid

000000400000006

The persons KID-number

String

Example:

APIURL/persons/1.xml?apikey=338934897438

Response

<person> <id>1</id> <businessunit> <id>2</id> <name>Test facility</name> </businessunit> <organization> <id>12</id> <name>Acme</name> </organization> <cardnumber>123434556</cardnumber> <customernumber>10000</customernumber> <firstname>John</firstname> <lastname>Doe</lastname> <shippingcareof>Jane Doe</shippingcareof> <shippingstreet>10 Main street</shippingstreet> <shippingpostal>12345</shippingpostal> <shippingcity>Springfield</shippingcity> <shippingcountry>SE</shippingcountry> <billingcareof/> <billingstreet/> <billingpostal/> <billingcity/> <billingcountry/> <email>john@doe.com</email> <sex>male</sex> <kid>000000400000006</kid> <personnumber/> <birthdate/> <homephone>012-123 456</homephone> <mobilephone></mobilephone> <workphone></workphone> <memberuntil>2015-12-24</memberuntil> <allowsmsreminders>true</allowsmsreminders> <allowsms>true</allowsms> <allowmail>true</allowmail> <allowemail>true</allowemail> <lastupdate>2012-08-13 13:31:32.0</lastupdate> <suspended>false</suspended> <suspendedreason></suspendedreason> <staffmember>false</staffmember> <discount></discount> <pricelist> <id>1</id> <name>Bonuskund</name> </pricelist> <photodocumentid>180</photodocumentid> <customertype>2</customertype> <customertypeend>2016-10-31</customertypeend> <owndefinedfields> <owndefinedfield> <id>137</id> <caption>Cars</caption> <name>field_cars</name> <sortindex>1</sortindex> <type>MultipleSelectionsList</type> <value/> <mulitvalues> <value> <id>480</id> <text>Volvo</text> </value> <value> <id>482</id> <text>BMW</text> </value> </mulitvalues> </owndefinedfield> <owndefinedfield> <id>134</id> <caption>Middle name</caption> <name>field_middlename</name> <sortindex>5</sortindex> <type>String</type> <value>Henrik</value> </owndefinedfield> </owndefinedfields> <wellnessloginurl></wellnessloginurl> <persongroups> <persongroup> <id>1</id> <name>VIP</name> </persongroup> <persongroup> <id>6</id> <name>Student</name> </persongroup> </persongroups> <internalnote>Some internal note</internalnote> <nationality>NO</nationality> <missingswedishssn>true</missingswedishssn> <temporary>2012-08-13 13:31:32.0</temporary> <employmentnumber></employmentnumber> <employmentstart></employmentstart> <employmentend></employmentend> <businessunits></businessunits> <role></role> </person>

See Common parameters and responses

Verify a person

Request

HTTP GET to /persons

Example:

APIURL/persons.xml?apikey=338934897438

Response

The same as the above but the logged on person is returned in a list instead.

<persons> <person> ... </person> </persons>

If either the username or password are wrong an HTTP 401 - Unauthorized is returned.

Create person

Creates a new person

Request

HTTP POST to /persons

Parameters

See Common parameters and responses
The following fields are required in order to create a person:

firstname

lastname

email

password

businessunitid

Example

Example:

POST:APIURL/persons.xml apikey=338934897438 firstname=Tessan lastname=Testsson businessunitid=1 password=test12 email=john@doe.com

Response

<person> ... </person>

Change/Update a persons information

Changes a persons information.

Request

HTTP PUT to /persons/id

Parameters

See Common parameters and respones

businessunitid

May not be changed via the API

Example

APIURL/persons/1.xml?apikey=338934897438&firstname=John&sex=male

Svar

<person> ... </person>

Common parameters

Name

Value

Description

Data type

organizationid

organizationid=1

The organization the person is connected to. Set this to 0 to remove organization connection.

ID

businessunitid

businessunitid=1

The business unit/facility the person is connected to

ID

firstname

firstname=Anders

The persons first name

String

lastname

lastname=Svensson

The persons last name

String

cardnumber

cardnumber=13243424

The persons cardnumber

String

shippingcareof

shippingcareof=Per Persson

The persons care of address - c/o - May be set as an own field from version 25.525
Older versions from 25.495 can set it via the shipping street, for example shippingstreet=c/o Simpson<new row>10 Main Street

String

shippingstreet

shippingstreet=Testgatan 14

Shipping street

String

shippingpostal

shippingpostal=12345

Shipping zip code

String

shippingcity

shippingcity=Teststa

Shipping city

String

shippingcountry

shippingcountry=SE

Shipping country

 

billingcareof

shippingcountry=Oskar Ohlson

Billing care off address

 

billingstreet

billingstreet=Testgatan 14

Billing street

String

billingpostal

billingpostal=12345

Billing zip code

String

billingcity

billingcity=Teststa

Billing city

String

billingcountry

billingcountry=SE

Billing country

 

email

email=anders.testsson@test.com

E-mail

E-mail

password

password=****

Password, at least 6 characters

Password

personnumber

personnumber=900101-111X

Personal ID number

Personal ID number

sex

sex=female

Sex

female / male

homephone

homephone=013-12345

Home phone

Telephone number

birthdate

birthdate=1980-11-19

Birthday

Date

workphone

workphone=08-54321

Work phone

Telephone number

mobilephone

mobilephone=073-12345

Mobile phone

Telephone number

allowsmsreminders

allowsmsreminders=true

Permit SMS reminders for bookings

Boolean

allowsms

allowsms=true

Permit sms

Boolean

allowmail

allowmail=true

Permit letters

Boolean

allowemail

allowemail=true

Permit e-mails

Boolean

suspended

suspended=false

The person is suspended from both bookings and entering the facility. Please note that the field does not manage suspensions due to noshows or late invoices.

Boolean

suspendedreason

suspendedreason=Skadegörelse

Explanation of suspenion

String

staffmember

staffmember=false

If this person is part of the staff

 

discount

discount=1250

An across the board rebate for the person. A rebate of 12,5% is entered as 1250. Please note that other prices may be used due to other combinations of price lists and rebates set on for example an organization. If price lists are used the final price will be a rebated price list price.

Integer

pricelist

pricelist=1

Price list used for the person. These are listed by an ID in the BRP klient under Products - Settings - Price lists

Integer

customertype

customertype=1

The customertype. See table below

ID(1,2,3)

customertypeend

customertypeend=2016-10-31

End date for customertype

 

acceptedbookingterms

acceptedbookingterms=true

The person has accepted the booking terms. This field is only active if the setting "Use booking terms" is active. Stored in the system as time. Updating to true sets the current time in the field.

Boolean

acceptedregistrationtermsdate

acceptedregistrationtermsdate=2018-01-01

The date when the person accepted the registration terms.

Date

acceptedregistrationtermstime

acceptedregistrationtermstime=13:45

The time when the person accepted the registration terms.

Time

persongroups

persongroups=1,5,92

Comma separated list of groups to which the person belongs

String

internalnote

internalnote=Note

Internal note that is displayed when a personcard is opened in BRP. The value sent in replaces the previous internal note.

 

nationality

nationality=NO

Nationality (alpha-2 format). Note: It is not possible to set nationality to swedish. This field is used in BRP when missing swedish SSN is "true" (see below).

 

missingswedishssn

missingswedishssn=false

Missing swedish SSN. When true it is possible to set nationality in BRP. This is used for Närvarostöd

 

employmentnumber

employmentnumber=abc1234

Shows the employe enumber if the person is part of the staff.

 

employmentstart

employmentstart=2017-02-03

The date when the person became part of the staff.

 

employmentend

employmentend=2018-05-06

The date when the person finished the employment .

 

businessunits

businessunits=1,14,15

Shows which businessunits person is working at if part of staff

 

role

role=3

Sets the role of this person, used for staff to give different permissions and rights.

 

temporary

temporary=true

Will mark the person as temporary. A scheduled task, InactiveInternetPersonRemover, will if active remove all persons which is marked as temporary and does not have any orders connected. If any order is connected to the person, the temporary flag will be cleared. Can only be set through Create action.

Boolean

Set customertype and customertypeend on person

ID

Customertype

Allowed to set customertypeend

Mandatory parameters

1

Ordinary

No

-

2

Student

Yes (Default value: 31 mars or 30 october, depending whichever comes first.

-

3

Pensioner

Yes

-

4

Youth

No

personnumber or birthdate must be provided

 

Manually defined fields

In the BRP system a user can define their own set of fields. See manually defined fields

Example for a field with the paramater name field_middlename of type string.

APIURL/persons/1.xml?apikey=338934897438&field_middlename=Nicklas

Validating the field

Type

Example

Data type

Text

Henrik

String

Integer

23

Integer

Date

1980-11-19

Date

List

345

ID

Yes / No

true

Boolean

Multiple choice

35,34,33

ID-list

Textarea

Main street

String