ce-storefront 0.3.3 → 0.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -37
- package/docs/sdks/{cestorefrontpayments → cestorefrontorderspayments}/README.md +1 -1
- package/docs/sdks/customers/README.md +236 -0
- package/docs/sdks/{paymentsapijuspay → juspay}/README.md +12 -12
- package/docs/sdks/orders/README.md +80 -1
- package/docs/sdks/payments/README.md +242 -2
- package/docs/sdks/products/README.md +1 -1
- package/esm/funcs/catalogProductsGet.d.ts +1 -1
- package/esm/funcs/catalogProductsGet.js +1 -1
- package/esm/funcs/{customersAPIGetCustomersId.d.ts → customersGetCustomersId.d.ts} +2 -2
- package/esm/funcs/customersGetCustomersId.d.ts.map +1 -0
- package/esm/funcs/{customersAPIGetCustomersId.js → customersGetCustomersId.js} +2 -2
- package/esm/funcs/customersGetCustomersId.js.map +1 -0
- package/esm/funcs/{customersAPIPostCustomers.d.ts → customersPostCustomers.d.ts} +2 -2
- package/esm/funcs/customersPostCustomers.d.ts.map +1 -0
- package/esm/funcs/{customersAPIPostCustomers.js → customersPostCustomers.js} +2 -2
- package/esm/funcs/customersPostCustomers.js.map +1 -0
- package/esm/funcs/{customersAPIPutCustomersId.d.ts → customersPutCustomersId.d.ts} +2 -2
- package/esm/funcs/customersPutCustomersId.d.ts.map +1 -0
- package/esm/funcs/{customersAPIPutCustomersId.js → customersPutCustomersId.js} +2 -2
- package/esm/funcs/{customersAPIPostCustomers.js.map → customersPutCustomersId.js.map} +1 -1
- package/esm/funcs/{paymentsAPIJuspayGetPaymentsJuspayCustomer.d.ts → juspayGetPaymentsJuspayCustomer.d.ts} +2 -2
- package/esm/funcs/juspayGetPaymentsJuspayCustomer.d.ts.map +1 -0
- package/esm/funcs/{paymentsAPIJuspayGetPaymentsJuspayCustomer.js → juspayGetPaymentsJuspayCustomer.js} +2 -2
- package/esm/funcs/juspayGetPaymentsJuspayCustomer.js.map +1 -0
- package/esm/funcs/{paymentsAPIJuspayPostPaymentsJuspayCreateCustomer.d.ts → juspayPostPaymentsJuspayCreateCustomer.d.ts} +2 -2
- package/esm/funcs/juspayPostPaymentsJuspayCreateCustomer.d.ts.map +1 -0
- package/esm/funcs/{paymentsAPIJuspayPostPaymentsJuspayCreateCustomer.js → juspayPostPaymentsJuspayCreateCustomer.js} +2 -2
- package/esm/funcs/juspayPostPaymentsJuspayCreateCustomer.js.map +1 -0
- package/esm/funcs/{paymentsAPIJuspayPostPaymentsJuspayCreateOrder.d.ts → juspayPostPaymentsJuspayCreateOrder.d.ts} +2 -2
- package/esm/funcs/juspayPostPaymentsJuspayCreateOrder.d.ts.map +1 -0
- package/esm/funcs/{paymentsAPIJuspayPostPaymentsJuspayCreateOrder.js → juspayPostPaymentsJuspayCreateOrder.js} +2 -2
- package/esm/funcs/juspayPostPaymentsJuspayCreateOrder.js.map +1 -0
- package/esm/funcs/{ordersAPIGetOrdersIdPaymentStatus.d.ts → ordersGetOrdersIdPaymentStatus.d.ts} +2 -2
- package/esm/funcs/ordersGetOrdersIdPaymentStatus.d.ts.map +1 -0
- package/esm/funcs/{ordersAPIGetOrdersIdPaymentStatus.js → ordersGetOrdersIdPaymentStatus.js} +2 -2
- package/esm/funcs/ordersGetOrdersIdPaymentStatus.js.map +1 -0
- package/esm/funcs/paymentsGetMethods.d.ts +1 -1
- package/esm/funcs/paymentsGetMethods.d.ts.map +1 -1
- package/esm/funcs/paymentsGetMethods.js +3 -3
- package/esm/funcs/paymentsGetMethods.js.map +1 -1
- package/esm/funcs/{paymentsAPIGetPaymentsCards.d.ts → paymentsGetPaymentsCards.d.ts} +2 -2
- package/esm/funcs/paymentsGetPaymentsCards.d.ts.map +1 -0
- package/esm/funcs/{paymentsAPIGetPaymentsCards.js → paymentsGetPaymentsCards.js} +2 -2
- package/esm/funcs/paymentsGetPaymentsCards.js.map +1 -0
- package/esm/funcs/{paymentsAPIGetPaymentsVerifyVpa.d.ts → paymentsGetPaymentsVerifyVpa.d.ts} +2 -2
- package/esm/funcs/paymentsGetPaymentsVerifyVpa.d.ts.map +1 -0
- package/esm/funcs/{paymentsAPIGetPaymentsVerifyVpa.js → paymentsGetPaymentsVerifyVpa.js} +2 -2
- package/esm/funcs/paymentsGetPaymentsVerifyVpa.js.map +1 -0
- package/esm/funcs/{paymentsAPIPostPaymentsCards.d.ts → paymentsPostPaymentsCards.d.ts} +2 -2
- package/esm/funcs/paymentsPostPaymentsCards.d.ts.map +1 -0
- package/esm/funcs/{paymentsAPIPostPaymentsCards.js → paymentsPostPaymentsCards.js} +2 -2
- package/esm/funcs/paymentsPostPaymentsCards.js.map +1 -0
- package/esm/lib/config.d.ts +3 -3
- package/esm/lib/config.js +3 -3
- package/esm/lib/config.js.map +1 -1
- package/esm/models/components/anonymoususer.d.ts +87 -0
- package/esm/models/components/anonymoususer.d.ts.map +1 -0
- package/esm/models/components/anonymoususer.js +78 -0
- package/esm/models/components/anonymoususer.js.map +1 -0
- package/esm/models/components/cart.d.ts +1 -1
- package/esm/models/components/cart.d.ts.map +1 -1
- package/esm/models/components/cart.js +1 -1
- package/esm/models/components/cart.js.map +1 -1
- package/esm/models/components/createcustomer.d.ts +1 -1
- package/esm/models/components/createcustomer.d.ts.map +1 -1
- package/esm/models/components/createcustomer.js +1 -1
- package/esm/models/components/createcustomer.js.map +1 -1
- package/esm/models/components/{customeraddressinput.d.ts → customeraddress.d.ts} +33 -33
- package/esm/models/components/customeraddress.d.ts.map +1 -0
- package/esm/models/components/{customeraddressinput.js → customeraddress.js} +37 -37
- package/esm/models/components/customeraddress.js.map +1 -0
- package/esm/models/components/freegoodspromotion.d.ts +2 -2
- package/esm/models/components/freegoodspromotion.d.ts.map +1 -1
- package/esm/models/components/freegoodspromotion.js +2 -2
- package/esm/models/components/freegoodspromotion.js.map +1 -1
- package/esm/models/components/index.d.ts +3 -3
- package/esm/models/components/index.d.ts.map +1 -1
- package/esm/models/components/index.js +3 -3
- package/esm/models/components/index.js.map +1 -1
- package/esm/models/components/orderdetail.d.ts +1 -1
- package/esm/models/components/orderdetail.d.ts.map +1 -1
- package/esm/models/components/orderdetail.js +1 -1
- package/esm/models/components/orderdetail.js.map +1 -1
- package/esm/models/components/{productlist.d.ts → product.d.ts} +14 -16
- package/esm/models/components/product.d.ts.map +1 -0
- package/esm/models/components/{productlist.js → product.js} +16 -20
- package/esm/models/components/product.js.map +1 -0
- package/esm/models/components/productdetail.d.ts +4 -4
- package/esm/models/components/productdetail.d.ts.map +1 -1
- package/esm/models/components/productdetail.js +4 -4
- package/esm/models/components/productdetail.js.map +1 -1
- package/esm/models/components/productlistresponse.d.ts +3 -3
- package/esm/models/components/productlistresponse.d.ts.map +1 -1
- package/esm/models/components/productlistresponse.js +3 -3
- package/esm/models/components/productlistresponse.js.map +1 -1
- package/esm/models/components/productpromotion.d.ts +11 -5
- package/esm/models/components/productpromotion.d.ts.map +1 -1
- package/esm/models/operations/getpaymentmethods.d.ts +143 -0
- package/esm/models/operations/getpaymentmethods.d.ts.map +1 -0
- package/esm/models/operations/{getpaymentspaymentmethods.js → getpaymentmethods.js} +42 -44
- package/esm/models/operations/getpaymentmethods.js.map +1 -0
- package/esm/models/operations/getsimilar.d.ts +2 -27
- package/esm/models/operations/getsimilar.d.ts.map +1 -1
- package/esm/models/operations/getsimilar.js +2 -27
- package/esm/models/operations/getsimilar.js.map +1 -1
- package/esm/models/operations/index.d.ts +1 -2
- package/esm/models/operations/index.d.ts.map +1 -1
- package/esm/models/operations/index.js +1 -2
- package/esm/models/operations/index.js.map +1 -1
- package/esm/models/operations/postauthanonymous.d.ts +2 -2
- package/esm/models/operations/postauthanonymous.d.ts.map +1 -1
- package/esm/models/operations/postauthanonymous.js +2 -2
- package/esm/models/operations/postauthanonymous.js.map +1 -1
- package/esm/models/operations/postcartitemid.d.ts +15 -15
- package/esm/models/operations/postcartitemid.d.ts.map +1 -1
- package/esm/models/operations/postcartitemid.js +15 -15
- package/esm/models/operations/postcartitemid.js.map +1 -1
- package/esm/sdk/{cestorefrontpayments.d.ts → cestorefrontorderspayments.d.ts} +2 -2
- package/esm/sdk/cestorefrontorderspayments.d.ts.map +1 -0
- package/esm/sdk/{cestorefrontpayments.js → cestorefrontorderspayments.js} +2 -2
- package/esm/sdk/cestorefrontorderspayments.js.map +1 -0
- package/esm/sdk/customers.d.ts +24 -1
- package/esm/sdk/customers.d.ts.map +1 -1
- package/esm/sdk/customers.js +31 -0
- package/esm/sdk/customers.js.map +1 -1
- package/esm/sdk/{paymentsapijuspay.d.ts → juspay.d.ts} +2 -2
- package/esm/sdk/juspay.d.ts.map +1 -0
- package/esm/sdk/{paymentsapijuspay.js → juspay.js} +8 -8
- package/esm/sdk/juspay.js.map +1 -0
- package/esm/sdk/orders.d.ts +9 -2
- package/esm/sdk/orders.d.ts.map +1 -1
- package/esm/sdk/orders.js +12 -2
- package/esm/sdk/orders.js.map +1 -1
- package/esm/sdk/payments.d.ts +23 -1
- package/esm/sdk/payments.d.ts.map +1 -1
- package/esm/sdk/payments.js +31 -0
- package/esm/sdk/payments.js.map +1 -1
- package/esm/sdk/products.d.ts +1 -1
- package/esm/sdk/products.js +1 -1
- package/esm/sdk/sdk.d.ts +3 -12
- package/esm/sdk/sdk.d.ts.map +1 -1
- package/esm/sdk/sdk.js +3 -15
- package/esm/sdk/sdk.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/catalogProductsGet.ts +1 -1
- package/src/funcs/{customersAPIGetCustomersId.ts → customersGetCustomersId.ts} +1 -1
- package/src/funcs/{customersAPIPostCustomers.ts → customersPostCustomers.ts} +1 -1
- package/src/funcs/{customersAPIPutCustomersId.ts → customersPutCustomersId.ts} +1 -1
- package/src/funcs/{paymentsAPIJuspayGetPaymentsJuspayCustomer.ts → juspayGetPaymentsJuspayCustomer.ts} +1 -1
- package/src/funcs/{paymentsAPIJuspayPostPaymentsJuspayCreateCustomer.ts → juspayPostPaymentsJuspayCreateCustomer.ts} +1 -1
- package/src/funcs/{paymentsAPIJuspayPostPaymentsJuspayCreateOrder.ts → juspayPostPaymentsJuspayCreateOrder.ts} +1 -1
- package/src/funcs/{ordersAPIGetOrdersIdPaymentStatus.ts → ordersGetOrdersIdPaymentStatus.ts} +1 -1
- package/src/funcs/paymentsGetMethods.ts +6 -7
- package/src/funcs/{paymentsAPIGetPaymentsCards.ts → paymentsGetPaymentsCards.ts} +1 -1
- package/src/funcs/{paymentsAPIGetPaymentsVerifyVpa.ts → paymentsGetPaymentsVerifyVpa.ts} +1 -1
- package/src/funcs/{paymentsAPIPostPaymentsCards.ts → paymentsPostPaymentsCards.ts} +1 -1
- package/src/lib/config.ts +3 -3
- package/src/models/components/anonymoususer.ts +167 -0
- package/src/models/components/cart.ts +1 -1
- package/src/models/components/createcustomer.ts +1 -1
- package/src/models/components/freegoodspromotion.ts +4 -4
- package/src/models/components/index.ts +3 -3
- package/src/models/components/orderdetail.ts +1 -1
- package/src/models/components/{productlist.ts → product.ts} +73 -78
- package/src/models/components/productdetail.ts +8 -8
- package/src/models/components/productlistresponse.ts +9 -9
- package/src/models/operations/{getpaymentspaymentmethods.ts → getpaymentmethods.ts} +68 -77
- package/src/models/operations/getsimilar.ts +4 -62
- package/src/models/operations/index.ts +1 -2
- package/src/models/operations/postauthanonymous.ts +4 -4
- package/src/models/operations/postcartitemid.ts +27 -25
- package/src/sdk/{cestorefrontpayments.ts → cestorefrontorderspayments.ts} +1 -1
- package/src/sdk/customers.ts +58 -1
- package/src/sdk/{paymentsapijuspay.ts → juspay.ts} +7 -7
- package/src/sdk/orders.ts +22 -4
- package/src/sdk/payments.ts +57 -2
- package/src/sdk/products.ts +1 -1
- package/src/sdk/sdk.ts +4 -22
- package/docs/sdks/customersapi/README.md +0 -321
- package/docs/sdks/ordersapi/README.md +0 -86
- package/docs/sdks/paymentsapi/README.md +0 -247
- package/esm/funcs/customersAPIGetCustomersId.d.ts.map +0 -1
- package/esm/funcs/customersAPIGetCustomersId.js.map +0 -1
- package/esm/funcs/customersAPIGetRecommendedProducts.d.ts +0 -16
- package/esm/funcs/customersAPIGetRecommendedProducts.d.ts.map +0 -1
- package/esm/funcs/customersAPIGetRecommendedProducts.js +0 -80
- package/esm/funcs/customersAPIGetRecommendedProducts.js.map +0 -1
- package/esm/funcs/customersAPIPostCustomers.d.ts.map +0 -1
- package/esm/funcs/customersAPIPutCustomersId.d.ts.map +0 -1
- package/esm/funcs/customersAPIPutCustomersId.js.map +0 -1
- package/esm/funcs/ordersAPIGetOrdersIdPaymentStatus.d.ts.map +0 -1
- package/esm/funcs/ordersAPIGetOrdersIdPaymentStatus.js.map +0 -1
- package/esm/funcs/paymentsAPIGetPaymentsCards.d.ts.map +0 -1
- package/esm/funcs/paymentsAPIGetPaymentsCards.js.map +0 -1
- package/esm/funcs/paymentsAPIGetPaymentsVerifyVpa.d.ts.map +0 -1
- package/esm/funcs/paymentsAPIGetPaymentsVerifyVpa.js.map +0 -1
- package/esm/funcs/paymentsAPIJuspayGetPaymentsJuspayCustomer.d.ts.map +0 -1
- package/esm/funcs/paymentsAPIJuspayGetPaymentsJuspayCustomer.js.map +0 -1
- package/esm/funcs/paymentsAPIJuspayPostPaymentsJuspayCreateCustomer.d.ts.map +0 -1
- package/esm/funcs/paymentsAPIJuspayPostPaymentsJuspayCreateCustomer.js.map +0 -1
- package/esm/funcs/paymentsAPIJuspayPostPaymentsJuspayCreateOrder.d.ts.map +0 -1
- package/esm/funcs/paymentsAPIJuspayPostPaymentsJuspayCreateOrder.js.map +0 -1
- package/esm/funcs/paymentsAPIPostPaymentsCards.d.ts.map +0 -1
- package/esm/funcs/paymentsAPIPostPaymentsCards.js.map +0 -1
- package/esm/models/components/customeraddressinput.d.ts.map +0 -1
- package/esm/models/components/customeraddressinput.js.map +0 -1
- package/esm/models/components/productlist.d.ts.map +0 -1
- package/esm/models/components/productlist.js.map +0 -1
- package/esm/models/components/recommendedproduct.d.ts +0 -155
- package/esm/models/components/recommendedproduct.d.ts.map +0 -1
- package/esm/models/components/recommendedproduct.js +0 -193
- package/esm/models/components/recommendedproduct.js.map +0 -1
- package/esm/models/operations/getpaymentspaymentmethods.d.ts +0 -143
- package/esm/models/operations/getpaymentspaymentmethods.d.ts.map +0 -1
- package/esm/models/operations/getpaymentspaymentmethods.js.map +0 -1
- package/esm/models/operations/getrecommendedproducts.d.ts +0 -90
- package/esm/models/operations/getrecommendedproducts.d.ts.map +0 -1
- package/esm/models/operations/getrecommendedproducts.js +0 -87
- package/esm/models/operations/getrecommendedproducts.js.map +0 -1
- package/esm/sdk/cestorefrontpayments.d.ts.map +0 -1
- package/esm/sdk/cestorefrontpayments.js.map +0 -1
- package/esm/sdk/customersapi.d.ts +0 -34
- package/esm/sdk/customersapi.d.ts.map +0 -1
- package/esm/sdk/customersapi.js +0 -48
- package/esm/sdk/customersapi.js.map +0 -1
- package/esm/sdk/ordersapi.d.ts +0 -12
- package/esm/sdk/ordersapi.d.ts.map +0 -1
- package/esm/sdk/ordersapi.js +0 -18
- package/esm/sdk/ordersapi.js.map +0 -1
- package/esm/sdk/paymentsapi.d.ts +0 -27
- package/esm/sdk/paymentsapi.d.ts.map +0 -1
- package/esm/sdk/paymentsapi.js +0 -39
- package/esm/sdk/paymentsapi.js.map +0 -1
- package/esm/sdk/paymentsapijuspay.d.ts.map +0 -1
- package/esm/sdk/paymentsapijuspay.js.map +0 -1
- package/src/funcs/customersAPIGetRecommendedProducts.ts +0 -144
- package/src/models/components/recommendedproduct.ts +0 -385
- package/src/models/operations/getrecommendedproducts.ts +0 -206
- package/src/sdk/customersapi.ts +0 -82
- package/src/sdk/ordersapi.ts +0 -27
- package/src/sdk/paymentsapi.ts +0 -64
- package/src/models/components/{customeraddressinput.ts → customeraddress.ts} +60 -60
package/src/sdk/customers.ts
CHANGED
|
@@ -2,7 +2,13 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { customersGetCustomersId } from "../funcs/customersGetCustomersId.js";
|
|
6
|
+
import { customersPostCustomers } from "../funcs/customersPostCustomers.js";
|
|
7
|
+
import { customersPutCustomersId } from "../funcs/customersPutCustomersId.js";
|
|
8
|
+
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
9
|
+
import * as components from "../models/components/index.js";
|
|
10
|
+
import * as operations from "../models/operations/index.js";
|
|
11
|
+
import { unwrapAsync } from "../types/fp.js";
|
|
6
12
|
import { Addresses } from "./addresses.js";
|
|
7
13
|
import { Loyalty } from "./loyalty.js";
|
|
8
14
|
import { Reviews } from "./reviews.js";
|
|
@@ -22,4 +28,55 @@ export class Customers extends ClientSDK {
|
|
|
22
28
|
get reviews(): Reviews {
|
|
23
29
|
return (this._reviews ??= new Reviews(this._options));
|
|
24
30
|
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Create customer
|
|
34
|
+
*
|
|
35
|
+
* @remarks
|
|
36
|
+
* Create customer
|
|
37
|
+
*/
|
|
38
|
+
async postCustomers(
|
|
39
|
+
request: components.CreateCustomer,
|
|
40
|
+
options?: RequestOptions,
|
|
41
|
+
): Promise<operations.PostCustomersResponseBody> {
|
|
42
|
+
return unwrapAsync(customersPostCustomers(
|
|
43
|
+
this,
|
|
44
|
+
request,
|
|
45
|
+
options,
|
|
46
|
+
));
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Retrieve customer detail
|
|
51
|
+
*
|
|
52
|
+
* @remarks
|
|
53
|
+
* Retrieve customer detail.
|
|
54
|
+
*/
|
|
55
|
+
async getCustomersId(
|
|
56
|
+
request: operations.GetCustomersIdRequest,
|
|
57
|
+
options?: RequestOptions,
|
|
58
|
+
): Promise<operations.GetCustomersIdResponseBody> {
|
|
59
|
+
return unwrapAsync(customersGetCustomersId(
|
|
60
|
+
this,
|
|
61
|
+
request,
|
|
62
|
+
options,
|
|
63
|
+
));
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Update customer detail
|
|
68
|
+
*
|
|
69
|
+
* @remarks
|
|
70
|
+
* Update customer detail
|
|
71
|
+
*/
|
|
72
|
+
async putCustomersId(
|
|
73
|
+
request: operations.PutCustomersIdRequest,
|
|
74
|
+
options?: RequestOptions,
|
|
75
|
+
): Promise<operations.PutCustomersIdResponseBody> {
|
|
76
|
+
return unwrapAsync(customersPutCustomersId(
|
|
77
|
+
this,
|
|
78
|
+
request,
|
|
79
|
+
options,
|
|
80
|
+
));
|
|
81
|
+
}
|
|
25
82
|
}
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { juspayGetPaymentsJuspayCustomer } from "../funcs/juspayGetPaymentsJuspayCustomer.js";
|
|
6
|
+
import { juspayPostPaymentsJuspayCreateCustomer } from "../funcs/juspayPostPaymentsJuspayCreateCustomer.js";
|
|
7
|
+
import { juspayPostPaymentsJuspayCreateOrder } from "../funcs/juspayPostPaymentsJuspayCreateOrder.js";
|
|
8
8
|
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
9
9
|
import * as components from "../models/components/index.js";
|
|
10
10
|
import * as operations from "../models/operations/index.js";
|
|
11
11
|
import { unwrapAsync } from "../types/fp.js";
|
|
12
12
|
|
|
13
|
-
export class
|
|
13
|
+
export class Juspay extends ClientSDK {
|
|
14
14
|
/**
|
|
15
15
|
* Create order in juspay
|
|
16
16
|
*
|
|
@@ -22,7 +22,7 @@ export class PaymentsAPIJuspay extends ClientSDK {
|
|
|
22
22
|
request: components.JuspayCreateOrderPayload,
|
|
23
23
|
options?: RequestOptions,
|
|
24
24
|
): Promise<operations.PostPaymentsJuspayCreateOrderResponseBody> {
|
|
25
|
-
return unwrapAsync(
|
|
25
|
+
return unwrapAsync(juspayPostPaymentsJuspayCreateOrder(
|
|
26
26
|
this,
|
|
27
27
|
request,
|
|
28
28
|
options,
|
|
@@ -39,7 +39,7 @@ export class PaymentsAPIJuspay extends ClientSDK {
|
|
|
39
39
|
request: components.JuspayCreateCustomerPayload,
|
|
40
40
|
options?: RequestOptions,
|
|
41
41
|
): Promise<operations.PostPaymentsJuspayCreateCustomerResponseBody> {
|
|
42
|
-
return unwrapAsync(
|
|
42
|
+
return unwrapAsync(juspayPostPaymentsJuspayCreateCustomer(
|
|
43
43
|
this,
|
|
44
44
|
request,
|
|
45
45
|
options,
|
|
@@ -56,7 +56,7 @@ export class PaymentsAPIJuspay extends ClientSDK {
|
|
|
56
56
|
request: operations.GetPaymentsJuspayCustomerRequest,
|
|
57
57
|
options?: RequestOptions,
|
|
58
58
|
): Promise<operations.GetPaymentsJuspayCustomerResponseBody> {
|
|
59
|
-
return unwrapAsync(
|
|
59
|
+
return unwrapAsync(juspayGetPaymentsJuspayCustomer(
|
|
60
60
|
this,
|
|
61
61
|
request,
|
|
62
62
|
options,
|
package/src/sdk/orders.ts
CHANGED
|
@@ -5,12 +5,13 @@
|
|
|
5
5
|
import { ordersCancel } from "../funcs/ordersCancel.js";
|
|
6
6
|
import { ordersCreate } from "../funcs/ordersCreate.js";
|
|
7
7
|
import { ordersGet } from "../funcs/ordersGet.js";
|
|
8
|
+
import { ordersGetOrdersIdPaymentStatus } from "../funcs/ordersGetOrdersIdPaymentStatus.js";
|
|
8
9
|
import { ordersList } from "../funcs/ordersList.js";
|
|
9
10
|
import { ordersRetryPayment } from "../funcs/ordersRetryPayment.js";
|
|
10
11
|
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
11
12
|
import * as operations from "../models/operations/index.js";
|
|
12
13
|
import { unwrapAsync } from "../types/fp.js";
|
|
13
|
-
import {
|
|
14
|
+
import { CeStorefrontOrdersPayments } from "./cestorefrontorderspayments.js";
|
|
14
15
|
import { Refunds } from "./refunds.js";
|
|
15
16
|
import { Shipments } from "./shipments.js";
|
|
16
17
|
|
|
@@ -25,9 +26,9 @@ export class Orders extends ClientSDK {
|
|
|
25
26
|
return (this._refunds ??= new Refunds(this._options));
|
|
26
27
|
}
|
|
27
28
|
|
|
28
|
-
private _payments?:
|
|
29
|
-
get payments():
|
|
30
|
-
return (this._payments ??= new
|
|
29
|
+
private _payments?: CeStorefrontOrdersPayments;
|
|
30
|
+
get payments(): CeStorefrontOrdersPayments {
|
|
31
|
+
return (this._payments ??= new CeStorefrontOrdersPayments(this._options));
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
/**
|
|
@@ -114,4 +115,21 @@ export class Orders extends ClientSDK {
|
|
|
114
115
|
options,
|
|
115
116
|
));
|
|
116
117
|
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Retrieve payment status
|
|
121
|
+
*
|
|
122
|
+
* @remarks
|
|
123
|
+
* Retrieve payment status of a paricular order.
|
|
124
|
+
*/
|
|
125
|
+
async getOrdersIdPaymentStatus(
|
|
126
|
+
request: operations.GetOrdersIdPaymentStatusRequest,
|
|
127
|
+
options?: RequestOptions,
|
|
128
|
+
): Promise<operations.GetOrdersIdPaymentStatusResponseBody> {
|
|
129
|
+
return unwrapAsync(ordersGetOrdersIdPaymentStatus(
|
|
130
|
+
this,
|
|
131
|
+
request,
|
|
132
|
+
options,
|
|
133
|
+
));
|
|
134
|
+
}
|
|
117
135
|
}
|
package/src/sdk/payments.ts
CHANGED
|
@@ -4,6 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
import { paymentsGenerateHash } from "../funcs/paymentsGenerateHash.js";
|
|
6
6
|
import { paymentsGetMethods } from "../funcs/paymentsGetMethods.js";
|
|
7
|
+
import { paymentsGetPaymentsCards } from "../funcs/paymentsGetPaymentsCards.js";
|
|
8
|
+
import { paymentsGetPaymentsVerifyVpa } from "../funcs/paymentsGetPaymentsVerifyVpa.js";
|
|
9
|
+
import { paymentsPostPaymentsCards } from "../funcs/paymentsPostPaymentsCards.js";
|
|
7
10
|
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
8
11
|
import * as operations from "../models/operations/index.js";
|
|
9
12
|
import { unwrapAsync } from "../types/fp.js";
|
|
@@ -33,13 +36,65 @@ export class Payments extends ClientSDK {
|
|
|
33
36
|
* List all payment methods
|
|
34
37
|
*/
|
|
35
38
|
async getMethods(
|
|
36
|
-
request: operations.
|
|
39
|
+
request: operations.GetPaymentMethodsRequest,
|
|
37
40
|
options?: RequestOptions,
|
|
38
|
-
): Promise<operations.
|
|
41
|
+
): Promise<operations.GetPaymentMethodsResponseBody> {
|
|
39
42
|
return unwrapAsync(paymentsGetMethods(
|
|
40
43
|
this,
|
|
41
44
|
request,
|
|
42
45
|
options,
|
|
43
46
|
));
|
|
44
47
|
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* List all saved cards
|
|
51
|
+
*
|
|
52
|
+
* @remarks
|
|
53
|
+
* List all saved cards.
|
|
54
|
+
*/
|
|
55
|
+
async getPaymentsCards(
|
|
56
|
+
request: operations.GetPaymentsCardsRequest,
|
|
57
|
+
options?: RequestOptions,
|
|
58
|
+
): Promise<operations.GetPaymentsCardsResponseBody> {
|
|
59
|
+
return unwrapAsync(paymentsGetPaymentsCards(
|
|
60
|
+
this,
|
|
61
|
+
request,
|
|
62
|
+
options,
|
|
63
|
+
));
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Add card
|
|
68
|
+
*
|
|
69
|
+
* @remarks
|
|
70
|
+
* Add a new card
|
|
71
|
+
*/
|
|
72
|
+
async postPaymentsCards(
|
|
73
|
+
request: operations.PostPaymentsCardsRequestBody,
|
|
74
|
+
options?: RequestOptions,
|
|
75
|
+
): Promise<operations.PostPaymentsCardsResponseBody> {
|
|
76
|
+
return unwrapAsync(paymentsPostPaymentsCards(
|
|
77
|
+
this,
|
|
78
|
+
request,
|
|
79
|
+
options,
|
|
80
|
+
));
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Verify VPA
|
|
85
|
+
*
|
|
86
|
+
* @remarks
|
|
87
|
+
* The Virtual Payment Address or VPA is a unique ID given to an individual using the Unified Payment Interface (UPI) service to send or receive money. In the case of UPI collect VPA is the mandatory param and merchants are always advised to check if the VPA is valid or not.
|
|
88
|
+
* Validating the VPA will help in reducing the failure rate due to incorrect vpa.
|
|
89
|
+
*/
|
|
90
|
+
async getPaymentsVerifyVpa(
|
|
91
|
+
request: operations.GetPaymentsVerifyVpaRequest,
|
|
92
|
+
options?: RequestOptions,
|
|
93
|
+
): Promise<operations.GetPaymentsVerifyVpaResponseBody> {
|
|
94
|
+
return unwrapAsync(paymentsGetPaymentsVerifyVpa(
|
|
95
|
+
this,
|
|
96
|
+
request,
|
|
97
|
+
options,
|
|
98
|
+
));
|
|
99
|
+
}
|
|
45
100
|
}
|
package/src/sdk/products.ts
CHANGED
|
@@ -42,7 +42,7 @@ export class Products extends ClientSDK {
|
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
/**
|
|
45
|
-
* Retrieve a product
|
|
45
|
+
* Retrieve a product detail
|
|
46
46
|
*
|
|
47
47
|
* @remarks
|
|
48
48
|
* Retrieves the details of an existing product. Supply the unique product ID from either a product creation request or the product list, and Commerce Engine will return the corresponding product information.
|
package/src/sdk/sdk.ts
CHANGED
|
@@ -10,13 +10,10 @@ import { Carts } from "./carts.js";
|
|
|
10
10
|
import { Catalog } from "./catalog.js";
|
|
11
11
|
import { Checkout } from "./checkout.js";
|
|
12
12
|
import { Customers } from "./customers.js";
|
|
13
|
-
import {
|
|
13
|
+
import { Juspay } from "./juspay.js";
|
|
14
14
|
import { Offers } from "./offers.js";
|
|
15
15
|
import { Orders } from "./orders.js";
|
|
16
|
-
import { OrdersAPI } from "./ordersapi.js";
|
|
17
16
|
import { Payments } from "./payments.js";
|
|
18
|
-
import { PaymentsAPI } from "./paymentsapi.js";
|
|
19
|
-
import { PaymentsAPIJuspay } from "./paymentsapijuspay.js";
|
|
20
17
|
import { Shipping } from "./shipping.js";
|
|
21
18
|
import { User } from "./user.js";
|
|
22
19
|
import { Utils } from "./utils.js";
|
|
@@ -28,11 +25,6 @@ export class CeStorefront extends ClientSDK {
|
|
|
28
25
|
return (this._catalog ??= new Catalog(this._options));
|
|
29
26
|
}
|
|
30
27
|
|
|
31
|
-
private _customersAPI?: CustomersAPI;
|
|
32
|
-
get customersAPI(): CustomersAPI {
|
|
33
|
-
return (this._customersAPI ??= new CustomersAPI(this._options));
|
|
34
|
-
}
|
|
35
|
-
|
|
36
28
|
private _carts?: Carts;
|
|
37
29
|
get carts(): Carts {
|
|
38
30
|
return (this._carts ??= new Carts(this._options));
|
|
@@ -63,11 +55,6 @@ export class CeStorefront extends ClientSDK {
|
|
|
63
55
|
return (this._orders ??= new Orders(this._options));
|
|
64
56
|
}
|
|
65
57
|
|
|
66
|
-
private _ordersAPI?: OrdersAPI;
|
|
67
|
-
get ordersAPI(): OrdersAPI {
|
|
68
|
-
return (this._ordersAPI ??= new OrdersAPI(this._options));
|
|
69
|
-
}
|
|
70
|
-
|
|
71
58
|
private _shipping?: Shipping;
|
|
72
59
|
get shipping(): Shipping {
|
|
73
60
|
return (this._shipping ??= new Shipping(this._options));
|
|
@@ -88,14 +75,9 @@ export class CeStorefront extends ClientSDK {
|
|
|
88
75
|
return (this._payments ??= new Payments(this._options));
|
|
89
76
|
}
|
|
90
77
|
|
|
91
|
-
private
|
|
92
|
-
get
|
|
93
|
-
return (this.
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
private _paymentsAPIJuspay?: PaymentsAPIJuspay;
|
|
97
|
-
get paymentsAPIJuspay(): PaymentsAPIJuspay {
|
|
98
|
-
return (this._paymentsAPIJuspay ??= new PaymentsAPIJuspay(this._options));
|
|
78
|
+
private _juspay?: Juspay;
|
|
79
|
+
get juspay(): Juspay {
|
|
80
|
+
return (this._juspay ??= new Juspay(this._options));
|
|
99
81
|
}
|
|
100
82
|
|
|
101
83
|
private _utils?: Utils;
|
|
@@ -1,321 +0,0 @@
|
|
|
1
|
-
# CustomersAPI
|
|
2
|
-
(*customersAPI*)
|
|
3
|
-
|
|
4
|
-
## Overview
|
|
5
|
-
|
|
6
|
-
Customers API
|
|
7
|
-
|
|
8
|
-
### Available Operations
|
|
9
|
-
|
|
10
|
-
* [getRecommendedProducts](#getrecommendedproducts) - List all recommended products
|
|
11
|
-
* [postCustomers](#postcustomers) - Create customer
|
|
12
|
-
* [getCustomersId](#getcustomersid) - Retrieve customer detail
|
|
13
|
-
* [putCustomersId](#putcustomersid) - Update customer detail
|
|
14
|
-
|
|
15
|
-
## getRecommendedProducts
|
|
16
|
-
|
|
17
|
-
Retrieves a list of recommended products for a specified user based on their browsing history, past purchases, and indicated preferences. The recommended products are returned sorted by relevance, providing a personalized shopping experience for each user.
|
|
18
|
-
|
|
19
|
-
### Example Usage
|
|
20
|
-
|
|
21
|
-
```typescript
|
|
22
|
-
import { CeStorefront } from "ce-storefront";
|
|
23
|
-
|
|
24
|
-
const ceStorefront = new CeStorefront({
|
|
25
|
-
authorization: "<YOUR_BEARER_TOKEN_HERE>",
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
async function run() {
|
|
29
|
-
const result = await ceStorefront.customersAPI.getRecommendedProducts({
|
|
30
|
-
id: "<id>",
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
// Handle the result
|
|
34
|
-
console.log(result);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
run();
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
### Standalone function
|
|
41
|
-
|
|
42
|
-
The standalone function version of this method:
|
|
43
|
-
|
|
44
|
-
```typescript
|
|
45
|
-
import { CeStorefrontCore } from "ce-storefront/core.js";
|
|
46
|
-
import { customersAPIGetRecommendedProducts } from "ce-storefront/funcs/customersAPIGetRecommendedProducts.js";
|
|
47
|
-
|
|
48
|
-
// Use `CeStorefrontCore` for best tree-shaking performance.
|
|
49
|
-
// You can create one instance of it to use across an application.
|
|
50
|
-
const ceStorefront = new CeStorefrontCore({
|
|
51
|
-
authorization: "<YOUR_BEARER_TOKEN_HERE>",
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
async function run() {
|
|
55
|
-
const res = await customersAPIGetRecommendedProducts(ceStorefront, {
|
|
56
|
-
id: "<id>",
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
if (!res.ok) {
|
|
60
|
-
throw res.error;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
const { value: result } = res;
|
|
64
|
-
|
|
65
|
-
// Handle the result
|
|
66
|
-
console.log(result);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
run();
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
### Parameters
|
|
73
|
-
|
|
74
|
-
| Parameter | Type | Required | Description |
|
|
75
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
76
|
-
| `request` | [operations.GetRecommendedProductsRequest](../../models/operations/getrecommendedproductsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
77
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
78
|
-
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
79
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
80
|
-
|
|
81
|
-
### Response
|
|
82
|
-
|
|
83
|
-
**Promise\<[operations.GetRecommendedProductsResponseBody](../../models/operations/getrecommendedproductsresponsebody.md)\>**
|
|
84
|
-
|
|
85
|
-
### Errors
|
|
86
|
-
|
|
87
|
-
| Error Type | Status Code | Content Type |
|
|
88
|
-
| ------------------- | ------------------- | ------------------- |
|
|
89
|
-
| errors.Unauthorized | 401 | application/json |
|
|
90
|
-
| errors.NotFound | 404 | application/json |
|
|
91
|
-
| errors.CeError | 4XX, 5XX | \*/\* |
|
|
92
|
-
|
|
93
|
-
## postCustomers
|
|
94
|
-
|
|
95
|
-
Create customer
|
|
96
|
-
|
|
97
|
-
### Example Usage
|
|
98
|
-
|
|
99
|
-
```typescript
|
|
100
|
-
import { CeStorefront } from "ce-storefront";
|
|
101
|
-
|
|
102
|
-
const ceStorefront = new CeStorefront({
|
|
103
|
-
authorization: "<YOUR_BEARER_TOKEN_HERE>",
|
|
104
|
-
});
|
|
105
|
-
|
|
106
|
-
async function run() {
|
|
107
|
-
const result = await ceStorefront.customersAPI.postCustomers({});
|
|
108
|
-
|
|
109
|
-
// Handle the result
|
|
110
|
-
console.log(result);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
run();
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
### Standalone function
|
|
117
|
-
|
|
118
|
-
The standalone function version of this method:
|
|
119
|
-
|
|
120
|
-
```typescript
|
|
121
|
-
import { CeStorefrontCore } from "ce-storefront/core.js";
|
|
122
|
-
import { customersAPIPostCustomers } from "ce-storefront/funcs/customersAPIPostCustomers.js";
|
|
123
|
-
|
|
124
|
-
// Use `CeStorefrontCore` for best tree-shaking performance.
|
|
125
|
-
// You can create one instance of it to use across an application.
|
|
126
|
-
const ceStorefront = new CeStorefrontCore({
|
|
127
|
-
authorization: "<YOUR_BEARER_TOKEN_HERE>",
|
|
128
|
-
});
|
|
129
|
-
|
|
130
|
-
async function run() {
|
|
131
|
-
const res = await customersAPIPostCustomers(ceStorefront, {});
|
|
132
|
-
|
|
133
|
-
if (!res.ok) {
|
|
134
|
-
throw res.error;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
const { value: result } = res;
|
|
138
|
-
|
|
139
|
-
// Handle the result
|
|
140
|
-
console.log(result);
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
run();
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
### Parameters
|
|
147
|
-
|
|
148
|
-
| Parameter | Type | Required | Description |
|
|
149
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
150
|
-
| `request` | [components.CreateCustomer](../../models/components/createcustomer.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
151
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
152
|
-
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
153
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
154
|
-
|
|
155
|
-
### Response
|
|
156
|
-
|
|
157
|
-
**Promise\<[operations.PostCustomersResponseBody](../../models/operations/postcustomersresponsebody.md)\>**
|
|
158
|
-
|
|
159
|
-
### Errors
|
|
160
|
-
|
|
161
|
-
| Error Type | Status Code | Content Type |
|
|
162
|
-
| ------------------- | ------------------- | ------------------- |
|
|
163
|
-
| errors.BadRequest | 400 | application/json |
|
|
164
|
-
| errors.Unauthorized | 401 | application/json |
|
|
165
|
-
| errors.CeError | 4XX, 5XX | \*/\* |
|
|
166
|
-
|
|
167
|
-
## getCustomersId
|
|
168
|
-
|
|
169
|
-
Retrieve customer detail.
|
|
170
|
-
|
|
171
|
-
### Example Usage
|
|
172
|
-
|
|
173
|
-
```typescript
|
|
174
|
-
import { CeStorefront } from "ce-storefront";
|
|
175
|
-
|
|
176
|
-
const ceStorefront = new CeStorefront({
|
|
177
|
-
authorization: "<YOUR_BEARER_TOKEN_HERE>",
|
|
178
|
-
});
|
|
179
|
-
|
|
180
|
-
async function run() {
|
|
181
|
-
const result = await ceStorefront.customersAPI.getCustomersId({
|
|
182
|
-
id: "<id>",
|
|
183
|
-
});
|
|
184
|
-
|
|
185
|
-
// Handle the result
|
|
186
|
-
console.log(result);
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
run();
|
|
190
|
-
```
|
|
191
|
-
|
|
192
|
-
### Standalone function
|
|
193
|
-
|
|
194
|
-
The standalone function version of this method:
|
|
195
|
-
|
|
196
|
-
```typescript
|
|
197
|
-
import { CeStorefrontCore } from "ce-storefront/core.js";
|
|
198
|
-
import { customersAPIGetCustomersId } from "ce-storefront/funcs/customersAPIGetCustomersId.js";
|
|
199
|
-
|
|
200
|
-
// Use `CeStorefrontCore` for best tree-shaking performance.
|
|
201
|
-
// You can create one instance of it to use across an application.
|
|
202
|
-
const ceStorefront = new CeStorefrontCore({
|
|
203
|
-
authorization: "<YOUR_BEARER_TOKEN_HERE>",
|
|
204
|
-
});
|
|
205
|
-
|
|
206
|
-
async function run() {
|
|
207
|
-
const res = await customersAPIGetCustomersId(ceStorefront, {
|
|
208
|
-
id: "<id>",
|
|
209
|
-
});
|
|
210
|
-
|
|
211
|
-
if (!res.ok) {
|
|
212
|
-
throw res.error;
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
const { value: result } = res;
|
|
216
|
-
|
|
217
|
-
// Handle the result
|
|
218
|
-
console.log(result);
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
run();
|
|
222
|
-
```
|
|
223
|
-
|
|
224
|
-
### Parameters
|
|
225
|
-
|
|
226
|
-
| Parameter | Type | Required | Description |
|
|
227
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
228
|
-
| `request` | [operations.GetCustomersIdRequest](../../models/operations/getcustomersidrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
229
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
230
|
-
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
231
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
232
|
-
|
|
233
|
-
### Response
|
|
234
|
-
|
|
235
|
-
**Promise\<[operations.GetCustomersIdResponseBody](../../models/operations/getcustomersidresponsebody.md)\>**
|
|
236
|
-
|
|
237
|
-
### Errors
|
|
238
|
-
|
|
239
|
-
| Error Type | Status Code | Content Type |
|
|
240
|
-
| -------------- | -------------- | -------------- |
|
|
241
|
-
| errors.CeError | 4XX, 5XX | \*/\* |
|
|
242
|
-
|
|
243
|
-
## putCustomersId
|
|
244
|
-
|
|
245
|
-
Update customer detail
|
|
246
|
-
|
|
247
|
-
### Example Usage
|
|
248
|
-
|
|
249
|
-
```typescript
|
|
250
|
-
import { CeStorefront } from "ce-storefront";
|
|
251
|
-
|
|
252
|
-
const ceStorefront = new CeStorefront({
|
|
253
|
-
authorization: "<YOUR_BEARER_TOKEN_HERE>",
|
|
254
|
-
});
|
|
255
|
-
|
|
256
|
-
async function run() {
|
|
257
|
-
const result = await ceStorefront.customersAPI.putCustomersId({
|
|
258
|
-
id: "<id>",
|
|
259
|
-
updateCustomer: {},
|
|
260
|
-
});
|
|
261
|
-
|
|
262
|
-
// Handle the result
|
|
263
|
-
console.log(result);
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
run();
|
|
267
|
-
```
|
|
268
|
-
|
|
269
|
-
### Standalone function
|
|
270
|
-
|
|
271
|
-
The standalone function version of this method:
|
|
272
|
-
|
|
273
|
-
```typescript
|
|
274
|
-
import { CeStorefrontCore } from "ce-storefront/core.js";
|
|
275
|
-
import { customersAPIPutCustomersId } from "ce-storefront/funcs/customersAPIPutCustomersId.js";
|
|
276
|
-
|
|
277
|
-
// Use `CeStorefrontCore` for best tree-shaking performance.
|
|
278
|
-
// You can create one instance of it to use across an application.
|
|
279
|
-
const ceStorefront = new CeStorefrontCore({
|
|
280
|
-
authorization: "<YOUR_BEARER_TOKEN_HERE>",
|
|
281
|
-
});
|
|
282
|
-
|
|
283
|
-
async function run() {
|
|
284
|
-
const res = await customersAPIPutCustomersId(ceStorefront, {
|
|
285
|
-
id: "<id>",
|
|
286
|
-
updateCustomer: {},
|
|
287
|
-
});
|
|
288
|
-
|
|
289
|
-
if (!res.ok) {
|
|
290
|
-
throw res.error;
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
const { value: result } = res;
|
|
294
|
-
|
|
295
|
-
// Handle the result
|
|
296
|
-
console.log(result);
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
run();
|
|
300
|
-
```
|
|
301
|
-
|
|
302
|
-
### Parameters
|
|
303
|
-
|
|
304
|
-
| Parameter | Type | Required | Description |
|
|
305
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
306
|
-
| `request` | [operations.PutCustomersIdRequest](../../models/operations/putcustomersidrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
307
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
308
|
-
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
309
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
310
|
-
|
|
311
|
-
### Response
|
|
312
|
-
|
|
313
|
-
**Promise\<[operations.PutCustomersIdResponseBody](../../models/operations/putcustomersidresponsebody.md)\>**
|
|
314
|
-
|
|
315
|
-
### Errors
|
|
316
|
-
|
|
317
|
-
| Error Type | Status Code | Content Type |
|
|
318
|
-
| ------------------- | ------------------- | ------------------- |
|
|
319
|
-
| errors.BadRequest | 400 | application/json |
|
|
320
|
-
| errors.Unauthorized | 401 | application/json |
|
|
321
|
-
| errors.CeError | 4XX, 5XX | \*/\* |
|