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

kid000000400000006The 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

organizationidorganizationid=1The 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

cardnumbercardnumber=13243424The persons cardnumberString
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

shippingcountryshippingcountry=SEShipping country
billingcareofshippingcountry=Oskar OhlsonBilling care off address

billingstreet

billingstreet=Testgatan 14

Billing street

String

billingpostal

billingpostal=12345

Billing zip code

String

billingcity

billingcity=Teststa

Billing city

String

billingcountrybillingcountry=SEBilling 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

BirthdayDate

workphone

workphone=08-54321

Work phone

Telephone number

mobilephone

mobilephone=073-12345

Mobile phone

Telephone number

allowsmsremindersallowsmsreminders=truePermit SMS reminders for bookingsBoolean
allowsmsallowsms=truePermit smsBoolean
allowmailallowmail=truePermit lettersBoolean
allowemailallowemail=truePermit e-mailsBoolean
suspendedsuspended=falseThe 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
suspendedreasonsuspendedreason=SkadegörelseExplanation of suspenionString
staffmemberstaffmember=falseIf this person is part of the staff

discount

discount=1250An 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
pricelistpricelist=1Price list used for the person. These are listed by an ID in the BRP klient under Products - Settings - Price listsInteger
customertypecustomertype=1The customertype. See table belowID(1,2,3)
customertypeendcustomertypeend=2016-10-31End date for customertype
acceptedbookingtermsacceptedbookingterms=trueThe 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
acceptedregistrationtermsdateacceptedregistrationtermsdate=2018-01-01The date when the person accepted the registration terms.Date
acceptedregistrationtermstimeacceptedregistrationtermstime=13:45The time when the person accepted the registration terms.Time
persongroupspersongroups=1,5,92Comma separated list of groups to which the person belongsString
internalnoteinternalnote=NoteInternal note that is displayed when a personcard is opened in BRP. The value sent in replaces the previous internal note.
nationalitynationality=NONationality (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).
missingswedishssnmissingswedishssn=falseMissing swedish SSN. When true it is possible to set nationality in BRP. This is used for Närvarostöd
employmentnumberemploymentnumber=abc1234Shows the employe enumber if the person is part of the staff.
employmentstartemploymentstart=2017-02-03The date when the person became part of the staff.
employmentendemploymentend=2018-05-06The date when the person finished the employment .
businessunitsbusinessunits=1,14,15Shows which businessunits person is working at if part of staff
rolerole=3Sets the role of this person, used for staff to give different permissions and rights.
temporarytemporary=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

IDCustomertypeAllowed to set customertypeendMandatory parameters
1OrdinaryNo-
2StudentYes (Default value: 31 mars or 30 october, depending whichever comes first.-
3PensionerYes-
4YouthNopersonnumber 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 streetString