Alokai
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

NameRequiredTypeDescription
propsRequiredPropsParameter object which can be used with this method. Refer to its type definition to learn about possible properties.
optionsOptionalMethodOptionsOptions 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

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);

On this page