You are reading the documentation for v7.x and earlier, which is no longer the latest version. Switch to v8.x
createRegistrationRequest
Creates a registration request for a B2B user.
This method sends a POST request to the createRegistrationRequest endpoint of the Alokai Middleware. In turn, it exchanges data with the createRegistrationRequest endpoint exposed by the SAP OCC API B2b Users Controller.
This method will work only if B2B User extension is enabled.
Signature
export declare function createRegistrationRequest<Props extends CreateRegistrationRequestProps = CreateRegistrationRequestProps>(
props: Props,
options?: MethodOptions
): Promise<void>;Parameters
| Name | Required | Type | Description |
|---|---|---|---|
props | Required | Props | 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 representation of an Order.
Referenced Types
CreateRegistrationRequestProps- MethodOptions
Examples
Cancelling an order from a cart.
import { sdk } from '~/sdk';
const b2bUserData: createRegistrationRequestProps = {
orgUserRegistrationData: {
titleCode: "mr",
firstName: "john",
lastName: "doe",
email: "john+doe@integration-test.com",
message:
"Please create a new account for me. Department: Ground support; Position: Chief safeguard; Report to: Steve Jackson.",
},
sapCommerceCloudCaptchaToken: "token", // optional recaptcha token, when the captchaCheckEnabled = true for the store
};
await sdk.commerce.createRegistrationRequest(b2bUserData);