Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.
The following example shows a request.
POST https://graph.microsoft.com/v1.0/solutions/bookingBusinesses/Contosolunchdelivery@contoso.onmicrosoft.com/customers
Content-type: application/json
{
"@odata.type": "#microsoft.graph.bookingCustomer",
"displayName": "Joni Sherman",
"emailAddress": "jonis@relecloud.com",
"addresses": [
{
"postOfficeBox":"",
"street":"4567 Main Street",
"city":"Buffalo",
"state":"NY",
"countryOrRegion":"USA",
"postalCode":"98052",
"type":"home"
},
{
"postOfficeBox":"",
"street":"4570 Main Street",
"city":"Buffalo",
"state":"NY",
"countryOrRegion":"USA",
"postalCode":"98054",
"type":"business"
}
],
"phones": [
{
"number": "206-555-0100",
"type": "home"
},
{
"number": "206-555-0200",
"type": "business"
}
]
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new BookingCustomer
{
OdataType = "#microsoft.graph.bookingCustomer",
DisplayName = "Joni Sherman",
EmailAddress = "jonis@relecloud.com",
Addresses = new List<PhysicalAddress>
{
new PhysicalAddress
{
Street = "4567 Main Street",
City = "Buffalo",
State = "NY",
CountryOrRegion = "USA",
PostalCode = "98052",
AdditionalData = new Dictionary<string, object>
{
{
"postOfficeBox" , ""
},
{
"type" , "home"
},
},
},
new PhysicalAddress
{
Street = "4570 Main Street",
City = "Buffalo",
State = "NY",
CountryOrRegion = "USA",
PostalCode = "98054",
AdditionalData = new Dictionary<string, object>
{
{
"postOfficeBox" , ""
},
{
"type" , "business"
},
},
},
},
Phones = new List<Phone>
{
new Phone
{
Number = "206-555-0100",
Type = PhoneType.Home,
},
new Phone
{
Number = "206-555-0200",
Type = PhoneType.Business,
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Solutions.BookingBusinesses["{bookingBusiness-id}"].Customers.PostAsync(requestBody);
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
// THE CLI IS IN PREVIEW. NON-PRODUCTION USE ONLY
mgc solutions booking-businesses customers create --booking-business-id {bookingBusiness-id} --body '{\
"@odata.type": "#microsoft.graph.bookingCustomer",\
"displayName": "Joni Sherman",\
"emailAddress": "jonis@relecloud.com",\
"addresses": [\
{\
"postOfficeBox":"",\
"street":"4567 Main Street",\
"city":"Buffalo",\
"state":"NY",\
"countryOrRegion":"USA",\
"postalCode":"98052",\
"type":"home"\
},\
{\
"postOfficeBox":"",\
"street":"4570 Main Street",\
"city":"Buffalo",\
"state":"NY",\
"countryOrRegion":"USA",\
"postalCode":"98054",\
"type":"business"\
}\
],\
"phones": [\
{\
"number": "206-555-0100",\
"type": "home"\
},\
{\
"number": "206-555-0200",\
"type": "business"\
}\
]\
}\
'
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
//other-imports
)
graphClient := msgraphsdk.NewGraphServiceClientWithCredentials(cred, scopes)
requestBody := graphmodels.NewBookingCustomerBase()
displayName := "Joni Sherman"
requestBody.SetDisplayName(&displayName)
emailAddress := "jonis@relecloud.com"
requestBody.SetEmailAddress(&emailAddress)
physicalAddress := graphmodels.NewPhysicalAddress()
street := "4567 Main Street"
physicalAddress.SetStreet(&street)
city := "Buffalo"
physicalAddress.SetCity(&city)
state := "NY"
physicalAddress.SetState(&state)
countryOrRegion := "USA"
physicalAddress.SetCountryOrRegion(&countryOrRegion)
postalCode := "98052"
physicalAddress.SetPostalCode(&postalCode)
additionalData := map[string]interface{}{
"postOfficeBox" : "",
"type" : "home",
}
physicalAddress.SetAdditionalData(additionalData)
physicalAddress1 := graphmodels.NewPhysicalAddress()
street := "4570 Main Street"
physicalAddress1.SetStreet(&street)
city := "Buffalo"
physicalAddress1.SetCity(&city)
state := "NY"
physicalAddress1.SetState(&state)
countryOrRegion := "USA"
physicalAddress1.SetCountryOrRegion(&countryOrRegion)
postalCode := "98054"
physicalAddress1.SetPostalCode(&postalCode)
additionalData := map[string]interface{}{
"postOfficeBox" : "",
"type" : "business",
}
physicalAddress1.SetAdditionalData(additionalData)
addresses := []graphmodels.PhysicalAddressable {
physicalAddress,
physicalAddress1,
}
requestBody.SetAddresses(addresses)
phone := graphmodels.NewPhone()
number := "206-555-0100"
phone.SetNumber(&number)
type := graphmodels.HOME_PHONETYPE
phone.SetType(&type)
phone1 := graphmodels.NewPhone()
number := "206-555-0200"
phone1.SetNumber(&number)
type := graphmodels.BUSINESS_PHONETYPE
phone1.SetType(&type)
phones := []graphmodels.Phoneable {
phone,
phone1,
}
requestBody.SetPhones(phones)
customers, err := graphClient.Solutions().BookingBusinesses().ByBookingBusinessId("bookingBusiness-id").Customers().Post(context.Background(), requestBody, nil)
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
const options = {
authProvider,
};
const client = Client.init(options);
const bookingCustomerBase = {
'@odata.type': '#microsoft.graph.bookingCustomer',
displayName: 'Joni Sherman',
emailAddress: 'jonis@relecloud.com',
addresses: [
{
postOfficeBox: '',
street: '4567 Main Street',
city: 'Buffalo',
state: 'NY',
countryOrRegion: 'USA',
postalCode: '98052',
type: 'home'
},
{
postOfficeBox: '',
street: '4570 Main Street',
city: 'Buffalo',
state: 'NY',
countryOrRegion: 'USA',
postalCode: '98054',
type: 'business'
}
],
phones: [
{
number: '206-555-0100',
type: 'home'
},
{
number: '206-555-0200',
type: 'business'
}
]
};
await client.api('/solutions/bookingBusinesses/Contosolunchdelivery@contoso.onmicrosoft.com/customers')
.post(bookingCustomerBase);
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
<?php
// THIS SNIPPET IS A PREVIEW VERSION OF THE SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new BookingCustomer();
$requestBody->setOdataType('#microsoft.graph.bookingCustomer');
$requestBody->setDisplayName('Joni Sherman');
$requestBody->setEmailAddress('jonis@relecloud.com');
$addressesPhysicalAddress1 = new PhysicalAddress();
$addressesPhysicalAddress1->setStreet('4567 Main Street');
$addressesPhysicalAddress1->setCity('Buffalo');
$addressesPhysicalAddress1->setState('NY');
$addressesPhysicalAddress1->setCountryOrRegion('USA');
$addressesPhysicalAddress1->setPostalCode('98052');
$additionalData = [
'postOfficeBox' => '',
'type' => 'home',
];
$addressesPhysicalAddress1->setAdditionalData($additionalData);
$addressesArray []= $addressesPhysicalAddress1;
$addressesPhysicalAddress2 = new PhysicalAddress();
$addressesPhysicalAddress2->setStreet('4570 Main Street');
$addressesPhysicalAddress2->setCity('Buffalo');
$addressesPhysicalAddress2->setState('NY');
$addressesPhysicalAddress2->setCountryOrRegion('USA');
$addressesPhysicalAddress2->setPostalCode('98054');
$additionalData = [
'postOfficeBox' => '',
'type' => 'business',
];
$addressesPhysicalAddress2->setAdditionalData($additionalData);
$addressesArray []= $addressesPhysicalAddress2;
$requestBody->setAddresses($addressesArray);
$phonesPhone1 = new Phone();
$phonesPhone1->setNumber('206-555-0100');
$phonesPhone1->setType(new PhoneType('home'));
$phonesArray []= $phonesPhone1;
$phonesPhone2 = new Phone();
$phonesPhone2->setNumber('206-555-0200');
$phonesPhone2->setType(new PhoneType('business'));
$phonesArray []= $phonesPhone2;
$requestBody->setPhones($phonesArray);
$result = $graphServiceClient->solutions()->bookingBusinesses()->byBookingBusinessId('bookingBusiness-id')->customers()->post($requestBody)->wait();
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
Import-Module Microsoft.Graph.Bookings
$params = @{
"@odata.type" = "#microsoft.graph.bookingCustomer"
displayName = "Joni Sherman"
emailAddress = "jonis@relecloud.com"
addresses = @(
)
phones = @(
)
}
New-MgBookingBusinessCustomer -BookingBusinessId $bookingBusinessId -BodyParameter $params
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
# THE PYTHON SDK IS IN PREVIEW. FOR NON-PRODUCTION USE ONLY
graph_client = GraphServiceClient(credentials, scopes)
request_body = BookingCustomer(
odata_type = "#microsoft.graph.bookingCustomer",
display_name = "Joni Sherman",
email_address = "jonis@relecloud.com",
addresses = [
PhysicalAddress(
street = "4567 Main Street",
city = "Buffalo",
state = "NY",
country_or_region = "USA",
postal_code = "98052",
additional_data = {
"post_office_box" : "",
"type" : "home",
}
),
PhysicalAddress(
street = "4570 Main Street",
city = "Buffalo",
state = "NY",
country_or_region = "USA",
postal_code = "98054",
additional_data = {
"post_office_box" : "",
"type" : "business",
}
),
],
phones = [
Phone(
number = "206-555-0100",
type = PhoneType.Home,
),
Phone(
number = "206-555-0200",
type = PhoneType.Business,
),
],
)
result = await graph_client.solutions.booking_businesses.by_booking_business_id('bookingBusiness-id').customers.post(request_body)
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
The following example shows the response.