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.
CustomFieldsbodyList<AddCustomField>YesIf 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>YesList of Access Keys
InvoiceAddressbodyInvoiceAddressToHandleYesCustomer invoice adress
CustomerBase Parameters:
NameParameterData TypeRequiredDescription
CustomerIdformGuid?No
FirstnameformstringYes
LastnameformstringYes
EmailformstringYes
PhoneformstringYes
SubscribedToNewsletterformboolNo
AddCustomField Parameters:
NameParameterData TypeRequiredDescription
IdformintNo
ValueformstringYes
AddUserAccessKey Parameters:
NameParameterData TypeRequiredDescription
IdformGuid?NoSpecify 'Id' to update an existing access key, leave empty to create a new one
CompanyIdformGuid?NoThe company ID associated with this access key
AccessKeyTypeIdformintNoThe type of access key to create
ValueformstringYesThe actual key value or token
CustomerIdformGuid?NoThe customer ID this access key is associated with
DescriptionformstringYesA description or note about this access key
InvoiceAddressToHandle Parameters:
NameParameterData TypeRequiredDescription
CorporateIdentityNumberformstringYes
InvoiceAddress1formstringYes
InvoiceAddress2formstringYes
InvoiceCityformstringYes
InvoicePostalCodeformstringYes
InvoiceCountryCodeformstringYes
UpdateCustomerResponse Parameters:
NameParameterData TypeRequiredDescription
FacebookUserNameformstringYes
UserIdformGuid?No
CompanyIdformGuid?No
CreatedDateformDateTime?No
DeletedAccessKeysformList<UserAccessKeys>Yes
CreatedOrUpdatedAccessKeysformList<UserAccessKeys>Yes
CustomerQueryResponse Parameters:
NameParameterData TypeRequiredDescription
IdformGuidNo
FirstnameformstringYes
LastnameformstringYes
EmailformstringYes
PhoneformstringYes
ImageUrlformstringYes
CustomFieldsformList<CustomFieldConfigData>Yes
CustomFieldValuesformList<CustomFieldDataResponse>Yes
CommentsformList<CustomerCommentsResponse>Yes
AccessKeysformList<UserAccessKeys>Yes
UpdatedformDateTimeNo
CreatedformDateTimeNo
ResponseStatusformObjectYes
SubscribedToNewsletterformboolNo
InvoiceAddressformInvoiceAddressResponseYes
CustomFieldConfigData Parameters:
NameParameterData TypeRequiredDescription
IdformintNoCustom field id
NameformstringYesConfiguration name. Example: 'Number of persons'.
DescriptionformstringYesCustom field description. Example: 'For how many persons is this booking?'
Widthformint?NoField width. Example: 20 for 20px
DataTypeformstringYesData field of custom field. Valid values are: TextBox, ... Example: 'TextBox'
DefaultValueformstringYesDefault value of the field. Example: '3'
IsMandatoryformboolNoDetermines if the field is required to have a value or not
MandatoryErrorMessageformstringYesError 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
RegExformstringYesRegular expression used for validation of the field
RegExErrorMessageformstringYesError message shown if the regular expression validation failed
ValuesformList<CustomFieldValueResponse>YesThe values to select from if Datatype is DropDown for this custom field
CustomFieldValueResponse Parameters:
NameParameterData TypeRequiredDescription
ValueformstringYes
CustomFieldDataResponse Parameters:
NameParameterData TypeRequiredDescription
IdformintNo
ColumnformstringYes
NameformstringYes
DescriptionformstringYes
ValueformstringYes
DataTypeformstringYesData field of custom field. Valid values are: TextBox, ... Example: 'TextBox'
CustomerCommentsResponse Parameters:
NameParameterData TypeRequiredDescription
IdformintNo
CustomerIdformGuidNo
CommentsformstringYes
UpdatedformDateTimeNo
CreatedformDateTimeNo
ImageUrlformUriYes
UserAccessKeys Parameters:
NameParameterData TypeRequiredDescription
CompanyIdformGuidYes
AccessKeyTypeIdformintYes
ValueformstringYes
CustomerIdformGuidYes
DescriptionformstringNo
IdformGuidYes
InvoiceAddressResponse Parameters:
NameParameterData TypeRequiredDescription
InvoiceAddressIdformGuidNo
UserIdformGuid?No
CorporateIdentityNumberformstringYes
InvoiceAddress1formstringYes
InvoiceAddress2formstringYes
InvoiceCityformstringYes
InvoicePostalCodeformstringYes
InvoiceCountryCodeformstringYes

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: testapi.bokamera.se 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"CompanyId":"00000000-0000-0000-0000-000000000000","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"},"CustomerId":"00000000-0000-0000-0000-000000000000","Firstname":"String","Lastname":"String","Email":"String","Phone":"String","SubscribedToNewsletter":false}
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":{"UserId":"00000000-0000-0000-0000-000000000000","CorporateIdentityNumber":"String","InvoiceAddress1":"String","InvoiceAddress2":"String","InvoiceCity":"String","InvoicePostalCode":"String","InvoiceCountryCode":"String"}}