BokaMera.API.Host

<back to all web services

CreateCustomer

Requires Authentication
Required role:bookingsupplier-administrator-write
The following routes are available for this service:
POST/customersCreate a new customerCreates a new customer, if an admin user is making the request, the user will be associated with the admin user's company.
CreateCustomer Parameters:
NameParameterData TypeRequiredDescription
CompanyIdqueryGuid?NoEnter the company and id for the customer, if blank company id and you are an admin, your company id will be used.
FirstnamebodystringYes
LastnamebodystringYes
PhonebodystringYes
EmailbodystringNo
CustomFieldsbodyList<AddCustomField>NoIf Custom Fields are added to the customer, here you will send the id and the value for each custom field to be updated
AccessKeysbodyList<AddUserAccessKey>NoList of Access Keys
InvoiceAddressbodyInvoiceAddressNoCustomer invoice adress
AddCustomField Parameters:
NameParameterData TypeRequiredDescription
IdformintNo
ValueformstringNo
AddUserAccessKey Parameters:
NameParameterData TypeRequiredDescription
IdformGuid?No
CompanyIdformGuid?No
AccessKeyTypeIdformintNo
ValueformstringNo
CustomerIdformGuid?No
DescriptionformstringNo
InvoiceAddress Parameters:
NameParameterData TypeRequiredDescription
CorporateIdentityNumberformstringNo
InvoiceAddress1formstringNo
InvoiceAddress2formstringNo
InvoiceCityformstringNo
InvoicePostalCodeformstringNo
InvoiceCountryCodeformstringNo
UpdateCustomerResponse Parameters:
NameParameterData TypeRequiredDescription
FacebookUserNameformstringNo
UserIdformGuid?No
CompanyIdformGuid?No
CreatedDateformDateTime?No
DeletedAccessKeysformList<UserAccessKeys>No
CreatedOrUpdatedAccessKeysformList<UserAccessKeys>No
CustomerQueryResponse Parameters:
NameParameterData TypeRequiredDescription
IdformGuidNo
FirstnameformstringNo
LastnameformstringNo
EmailformstringNo
PhoneformstringNo
ImageUrlformstringNo
CustomFieldsformList<CustomFieldConfigData>No
CustomFieldValuesformList<CustomFieldDataResponse>No
CommentsformList<CustomerCommentsResponse>No
AccessKeysformList<UserAccessKeys>No
UpdatedformDateTimeNo
CreatedformDateTimeNo
ResponseStatusformObjectNo
SubscribedToNewsletterformboolNo
InvoiceAddressformInvoiceAddressNo
CustomFieldConfigData Parameters:
NameParameterData TypeRequiredDescription
IdformintNoCustom field id
NameformstringNoConfiguration name. Example: 'Number of persons'.
DescriptionformstringNoCustom field description. Example: 'For how many persons is this booking?'
Widthformint?NoField width. Example: 20 for 20px
DataTypeformstringNoData field of custom field. Valid values are: TextBox, ... Example: 'TextBox'
DefaultValueformstringNoDefault value of the field. Example: '3'
IsMandatoryformboolNoDetermines if the field is required to have a value or not
MandatoryErrorMessageformstringNoError message shown to the user if the field data is required but not entered
MaxLengthformintNoMax lenght of the field
MultipleLineTextformboolNoIf the field should have multiple lines
RegExformstringNoRegular expression used for validation of the field
RegExErrorMessageformstringNoError message shown if the regular expression validation failed
ValuesformList<CustomFieldValueResponse>NoThe values to select from if Datatype is DropDown for this custom field
CustomFieldValueResponse Parameters:
NameParameterData TypeRequiredDescription
ValueformstringNo
CustomFieldDataResponse Parameters:
NameParameterData TypeRequiredDescription
IdformintNo
ColumnformstringNo
NameformstringNo
DescriptionformstringNo
ValueformstringNo
DataTypeformstringNoData field of custom field. Valid values are: TextBox, ... Example: 'TextBox'
CustomerCommentsResponse Parameters:
NameParameterData TypeRequiredDescription
IdformintNo
CustomerIdformGuidNo
CommentsformstringNo
UpdatedformDateTimeNo
CreatedformDateTimeNo
ImageUrlformUriNo
UserAccessKeys Parameters:
NameParameterData TypeRequiredDescription
CompanyIdformGuidYes
AccessKeyTypeIdformintYes
ValueformstringYes
CustomerIdformGuidYes
DescriptionformstringNo
IdformGuidYes

To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other

HTTP + OTHER

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /customers HTTP/1.1 
Host: api.bokamera.se 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"CompanyId":"00000000-0000-0000-0000-000000000000","Firstname":"String","Lastname":"String","Phone":"String","Email":"String","CustomFields":[{"Id":0,"Value":"String"}],"AccessKeys":[{"Id":"00000000-0000-0000-0000-000000000000","CompanyId":"00000000-0000-0000-0000-000000000000","AccessKeyTypeId":0,"Value":"String","CustomerId":"00000000-0000-0000-0000-000000000000","Description":"String"}],"InvoiceAddress":{"CorporateIdentityNumber":"String","InvoiceAddress1":"String","InvoiceAddress2":"String","InvoiceCity":"String","InvoicePostalCode":"String","InvoiceCountryCode":"String"}}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"FacebookUserName":"String","UserId":"00000000-0000-0000-0000-000000000000","CompanyId":"00000000-0000-0000-0000-000000000000","CreatedDate":"0001-01-01T00:00:00","DeletedAccessKeys":[{"AccessKeyTypeId":0,"Value":"String","Description":"String"}],"CreatedOrUpdatedAccessKeys":[{"AccessKeyTypeId":0,"Value":"String","Description":"String"}],"Firstname":"String","Lastname":"String","Email":"String","Phone":"String","ImageUrl":"String","CustomFields":[{"Id":0,"Name":"String","Description":"String","Width":0,"DataType":"String","DefaultValue":"String","IsMandatory":false,"MandatoryErrorMessage":"String","MaxLength":0,"MultipleLineText":false,"RegEx":"String","RegExErrorMessage":"String","Values":[{"Value":"String"}]}],"CustomFieldValues":[{"Id":0,"Column":"String","Name":"String","Description":"String","Value":"String","DataType":"String"}],"Comments":[{"Id":0,"Comments":"String"}],"AccessKeys":[{"AccessKeyTypeId":0,"Value":"String","Description":"String"}],"ResponseStatus":{},"SubscribedToNewsletter":false,"InvoiceAddress":{"CorporateIdentityNumber":"String","InvoiceAddress1":"String","InvoiceAddress2":"String","InvoiceCity":"String","InvoicePostalCode":"String","InvoiceCountryCode":"String"}}