| Required role: | bookingsupplier-administrator-write |
| POST | /customers | Create a new customer | Creates a new customer, if an admin user is making the request, the user will be associated with the admin user's company. |
|---|
| Name | Parameter | Data Type | Required | Description |
|---|---|---|---|---|
| CompanyId | query | Guid? | No | Enter the company and id for the customer, if blank company id and you are an admin, your company id will be used. |
| CustomFields | body | List<AddCustomField> | Yes | If Custom Fields are added to the customer, here you will send the id and the value for each custom field to be updated |
| AccessKeys | body | List<AddUserAccessKey> | Yes | List of Access Keys |
| InvoiceAddress | body | InvoiceAddressToHandle | Yes | Customer invoice adress |
| Name | Parameter | Data Type | Required | Description |
|---|---|---|---|---|
| CustomerId | form | Guid? | No | |
| Firstname | form | string | Yes | |
| Lastname | form | string | Yes | |
| form | string | Yes | ||
| Phone | form | string | Yes | |
| SubscribedToNewsletter | form | bool | No |
| Name | Parameter | Data Type | Required | Description |
|---|---|---|---|---|
| Id | form | int | No | |
| Value | form | string | Yes |
| Name | Parameter | Data Type | Required | Description |
|---|---|---|---|---|
| Id | form | Guid? | No | Specify 'Id' to update an existing access key, leave empty to create a new one |
| CompanyId | form | Guid? | No | The company ID associated with this access key |
| AccessKeyTypeId | form | int | No | The type of access key to create |
| Value | form | string | Yes | The actual key value or token |
| CustomerId | form | Guid? | No | The customer ID this access key is associated with |
| Description | form | string | Yes | A description or note about this access key |
| Name | Parameter | Data Type | Required | Description |
|---|---|---|---|---|
| CorporateIdentityNumber | form | string | Yes | |
| InvoiceAddress1 | form | string | Yes | |
| InvoiceAddress2 | form | string | Yes | |
| InvoiceCity | form | string | Yes | |
| InvoicePostalCode | form | string | Yes | |
| InvoiceCountryCode | form | string | Yes |
| Name | Parameter | Data Type | Required | Description |
|---|---|---|---|---|
| FacebookUserName | form | string | Yes | |
| UserId | form | Guid? | No | |
| CompanyId | form | Guid? | No | |
| CreatedDate | form | DateTime? | No | |
| DeletedAccessKeys | form | List<UserAccessKeys> | Yes | |
| CreatedOrUpdatedAccessKeys | form | List<UserAccessKeys> | Yes |
| Name | Parameter | Data Type | Required | Description |
|---|---|---|---|---|
| Id | form | Guid | No | |
| Firstname | form | string | Yes | |
| Lastname | form | string | Yes | |
| form | string | Yes | ||
| Phone | form | string | Yes | |
| ImageUrl | form | string | Yes | |
| CustomFields | form | List<CustomFieldConfigData> | Yes | |
| CustomFieldValues | form | List<CustomFieldDataResponse> | Yes | |
| Comments | form | List<CustomerCommentsResponse> | Yes | |
| AccessKeys | form | List<UserAccessKeys> | Yes | |
| Updated | form | DateTime | No | |
| Created | form | DateTime | No | |
| ResponseStatus | form | Object | Yes | |
| SubscribedToNewsletter | form | bool | No | |
| InvoiceAddress | form | InvoiceAddressResponse | Yes |
| Name | Parameter | Data Type | Required | Description |
|---|---|---|---|---|
| Id | form | int | No | Custom field id |
| Name | form | string | Yes | Configuration name. Example: 'Number of persons'. |
| Description | form | string | Yes | Custom field description. Example: 'For how many persons is this booking?' |
| Width | form | int? | No | Field width. Example: 20 for 20px |
| DataType | form | string | Yes | Data field of custom field. Valid values are: TextBox, ... Example: 'TextBox' |
| DefaultValue | form | string | Yes | Default value of the field. Example: '3' |
| IsMandatory | form | bool | No | Determines if the field is required to have a value or not |
| MandatoryErrorMessage | form | string | Yes | Error message shown to the user if the field data is required but not entered |
| MaxLength | form | int | No | Max lenght of the field |
| MultipleLineText | form | bool | No | If the field should have multiple lines |
| RegEx | form | string | Yes | Regular expression used for validation of the field |
| RegExErrorMessage | form | string | Yes | Error message shown if the regular expression validation failed |
| Values | form | List<CustomFieldValueResponse> | Yes | The values to select from if Datatype is DropDown for this custom field |
| Name | Parameter | Data Type | Required | Description |
|---|---|---|---|---|
| Value | form | string | Yes |
| Name | Parameter | Data Type | Required | Description |
|---|---|---|---|---|
| Id | form | int | No | |
| Column | form | string | Yes | |
| Name | form | string | Yes | |
| Description | form | string | Yes | |
| Value | form | string | Yes | |
| DataType | form | string | Yes | Data field of custom field. Valid values are: TextBox, ... Example: 'TextBox' |
| Name | Parameter | Data Type | Required | Description |
|---|---|---|---|---|
| Id | form | int | No | |
| CustomerId | form | Guid | No | |
| Comments | form | string | Yes | |
| Updated | form | DateTime | No | |
| Created | form | DateTime | No | |
| ImageUrl | form | Uri | Yes |
| Name | Parameter | Data Type | Required | Description |
|---|---|---|---|---|
| CompanyId | form | Guid | Yes | |
| AccessKeyTypeId | form | int | Yes | |
| Value | form | string | Yes | |
| CustomerId | form | Guid | Yes | |
| Description | form | string | No | |
| Id | form | Guid | Yes |
| Name | Parameter | Data Type | Required | Description |
|---|---|---|---|---|
| InvoiceAddressId | form | Guid | No | |
| UserId | form | Guid? | No | |
| CorporateIdentityNumber | form | string | Yes | |
| InvoiceAddress1 | form | string | Yes | |
| InvoiceAddress2 | form | string | Yes | |
| InvoiceCity | form | string | Yes | |
| InvoicePostalCode | form | string | Yes | |
| InvoiceCountryCode | form | string | Yes |
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
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: application/xml
Content-Type: application/xml
Content-Length: length
<CreateCustomer xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos">
<CustomerId xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos.Commons">00000000-0000-0000-0000-000000000000</CustomerId>
<Email xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos.Commons">String</Email>
<Firstname xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos.Commons">String</Firstname>
<Lastname xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos.Commons">String</Lastname>
<Phone xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos.Commons">String</Phone>
<SubscribedToNewsletter xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos.Commons">false</SubscribedToNewsletter>
<AccessKeys>
<AddUserAccessKey>
<AccessKeyTypeId>0</AccessKeyTypeId>
<CompanyId>00000000-0000-0000-0000-000000000000</CompanyId>
<CustomerId>00000000-0000-0000-0000-000000000000</CustomerId>
<Description>String</Description>
<Id>00000000-0000-0000-0000-000000000000</Id>
<Value>String</Value>
</AddUserAccessKey>
</AccessKeys>
<CompanyId>00000000-0000-0000-0000-000000000000</CompanyId>
<CustomFields>
<AddCustomField>
<Id>0</Id>
<Value>String</Value>
</AddCustomField>
</CustomFields>
<InvoiceAddress>
<CorporateIdentityNumber>String</CorporateIdentityNumber>
<InvoiceAddress1>String</InvoiceAddress1>
<InvoiceAddress2>String</InvoiceAddress2>
<InvoiceCity>String</InvoiceCity>
<InvoiceCountryCode>String</InvoiceCountryCode>
<InvoicePostalCode>String</InvoicePostalCode>
</InvoiceAddress>
</CreateCustomer>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<UpdateCustomerResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos">
<AccessKeys xmlns:d2p1="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Db">
<d2p1:UserAccessKeys>
<d2p1:AccessKeyTypeId>0</d2p1:AccessKeyTypeId>
<d2p1:CompanyId>00000000-0000-0000-0000-000000000000</d2p1:CompanyId>
<d2p1:CustomerId>00000000-0000-0000-0000-000000000000</d2p1:CustomerId>
<d2p1:Description>String</d2p1:Description>
<d2p1:Id>00000000-0000-0000-0000-000000000000</d2p1:Id>
<d2p1:Value>String</d2p1:Value>
</d2p1:UserAccessKeys>
</AccessKeys>
<Comments>
<CustomerCommentsResponse>
<Comments>String</Comments>
<Created>0001-01-01T00:00:00</Created>
<CustomerId>00000000-0000-0000-0000-000000000000</CustomerId>
<Id>0</Id>
<ImageUrl i:nil="true" />
<Updated>0001-01-01T00:00:00</Updated>
</CustomerCommentsResponse>
</Comments>
<Created>0001-01-01T00:00:00</Created>
<CustomFieldValues>
<CustomFieldDataResponse>
<Column>String</Column>
<DataType>String</DataType>
<Description>String</Description>
<Id>0</Id>
<Name>String</Name>
<Value>String</Value>
</CustomFieldDataResponse>
</CustomFieldValues>
<CustomFields>
<CustomFieldConfigData>
<DataType>String</DataType>
<DefaultValue>String</DefaultValue>
<Description>String</Description>
<Id>0</Id>
<IsMandatory>false</IsMandatory>
<MandatoryErrorMessage>String</MandatoryErrorMessage>
<MaxLength>0</MaxLength>
<MultipleLineText>false</MultipleLineText>
<Name>String</Name>
<RegEx>String</RegEx>
<RegExErrorMessage>String</RegExErrorMessage>
<Values>
<CustomFieldValueResponse>
<Value>String</Value>
</CustomFieldValueResponse>
</Values>
<Width>0</Width>
</CustomFieldConfigData>
</CustomFields>
<Email>String</Email>
<Firstname>String</Firstname>
<Id>00000000-0000-0000-0000-000000000000</Id>
<ImageUrl>String</ImageUrl>
<InvoiceAddress>
<CorporateIdentityNumber>String</CorporateIdentityNumber>
<InvoiceAddress1>String</InvoiceAddress1>
<InvoiceAddress2>String</InvoiceAddress2>
<InvoiceAddressId>00000000-0000-0000-0000-000000000000</InvoiceAddressId>
<InvoiceCity>String</InvoiceCity>
<InvoiceCountryCode>String</InvoiceCountryCode>
<InvoicePostalCode>String</InvoicePostalCode>
<UserId>00000000-0000-0000-0000-000000000000</UserId>
</InvoiceAddress>
<Lastname>String</Lastname>
<Phone>String</Phone>
<ResponseStatus />
<SubscribedToNewsletter>false</SubscribedToNewsletter>
<Updated>0001-01-01T00:00:00</Updated>
<CompanyId>00000000-0000-0000-0000-000000000000</CompanyId>
<CreatedDate>0001-01-01T00:00:00</CreatedDate>
<CreatedOrUpdatedAccessKeys xmlns:d2p1="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Db">
<d2p1:UserAccessKeys>
<d2p1:AccessKeyTypeId>0</d2p1:AccessKeyTypeId>
<d2p1:CompanyId>00000000-0000-0000-0000-000000000000</d2p1:CompanyId>
<d2p1:CustomerId>00000000-0000-0000-0000-000000000000</d2p1:CustomerId>
<d2p1:Description>String</d2p1:Description>
<d2p1:Id>00000000-0000-0000-0000-000000000000</d2p1:Id>
<d2p1:Value>String</d2p1:Value>
</d2p1:UserAccessKeys>
</CreatedOrUpdatedAccessKeys>
<DeletedAccessKeys xmlns:d2p1="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Db">
<d2p1:UserAccessKeys>
<d2p1:AccessKeyTypeId>0</d2p1:AccessKeyTypeId>
<d2p1:CompanyId>00000000-0000-0000-0000-000000000000</d2p1:CompanyId>
<d2p1:CustomerId>00000000-0000-0000-0000-000000000000</d2p1:CustomerId>
<d2p1:Description>String</d2p1:Description>
<d2p1:Id>00000000-0000-0000-0000-000000000000</d2p1:Id>
<d2p1:Value>String</d2p1:Value>
</d2p1:UserAccessKeys>
</DeletedAccessKeys>
<FacebookUserName>String</FacebookUserName>
<UserId>00000000-0000-0000-0000-000000000000</UserId>
</UpdateCustomerResponse>