Alokai

createOrder

Initiates partial payments by creating a wrapper for them.

It communicates with the createOrder endpoint of the Vue Storefront API Middleware. In turn, it calls the POST /orders Adyen endpoint directly and returns received response.

Signature

export declare function createOrder(
	props: CreateOrderParams,
	options?: MethodOptions
): Promise<import("@adyen/api-library/lib/src/typings/checkout/createOrderResponse").CreateOrderResponse>;

Parameters

NameRequiredTypeDescription
propsRequiredCreateOrderParamsParameter 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 Promise<CreateOrderResponse>

Referenced Types

Examples

Retrieves the balance remaining on a shopper's gift card. For full context, check the Alokai's documentation.

import { sdk } from '~/sdk.config.ts';

// ... Inside adyenConfiguration.giftcard property passed in object to the mountPaymentElement SDK method call
async onOrderRequest(resolve, reject, data) {
 sdk.adyen
   .createOrder({
     ...data,
     paymentId: getPaymentMethodsResponse.payment.id,
   })
   .then(resolve)
   .catch(reject);
}

On this page