本文整理匯總了TypeScript中shopify-prime.Orders.create方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript Orders.create方法的具體用法?TypeScript Orders.create怎麽用?TypeScript Orders.create使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類shopify-prime.Orders
的用法示例。
在下文中一共展示了Orders.create方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: function
handler: async function (req, res, next) {
const model: Requests.CreateOrder = req.validatedBody;
const service = new Orders(req.user.shopify_domain, req.user.shopify_access_token);
const order = await service.create({
billing_address: {
address1: model.street,
city: model.city,
province: model.state,
zip: model.zip,
name: model.name,
country_code: "US",
default: true,
},
line_items: [
{
name: model.line_item,
title: model.line_item,
quantity: model.quantity,
price: 5,
},
],
financial_status: "authorized",
email: model.email,
});
res.json(order);
return next();
}