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
| Name | Required | Type | Description |
|---|---|---|---|
props | Required | CreateOrderParams | 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 Promise<CreateOrderResponse>
Referenced Types
- CreateOrderParams
- MethodOptions
CreateOrderResponse
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);
}