You are reading the documentation for v7.x and earlier, which is no longer the latest version. Switch to v8.x
createCustomer
Creates an account for a customer by assisted service agent.
This method sends a POST request to the autoComplete endpoint of the Alokai Middleware. In turn, it exchanges data with the createCustomer endpoint exposed by the SAP OCC API Customer Controller.
Signature
export declare function createCustomer<Res extends User = User>(
props: CreateCustomerProps,
options?: MethodOptions
): Promise<Res>;Parameters
| Name | Required | Type | Description |
|---|---|---|---|
props | Required | CreateCustomerProps | Parameter object which can be used with this method. Refer to its type definition to learn about possible properties. |
options | Optional | MethodOptions | Options that can be passed to additionally configure the request or customize the logic in a plugin. |
Returns
Returns a created customer.
Referenced Types
- User
CreateCustomerProps- MethodOptions
Examples
Requesting autocomplete information on customers based on the customer query
const user = await sdk.commerce.createCustomer({
customerRegistrationForm: {
firstName: "Brande",
lastName: "Smith",
emailAddress: "brande.smith@sap.com",
},
})
// User contains object with customer data