oneentry 1.0.59 → 1.0.61
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 +745 -13
- package/dist/formsData/formsDataApi.d.ts +10 -11
- package/dist/formsData/formsDataApi.js +13 -11
- package/dist/formsData/formsDataInterfaces.d.ts +4 -16
- package/dist/index.d.ts +4 -0
- package/dist/index.js +6 -0
- package/dist/orders/ordersApi.d.ts +46 -0
- package/dist/orders/ordersApi.js +59 -0
- package/dist/orders/ordersInterfaces.d.ts +108 -0
- package/dist/orders/ordersInterfaces.js +2 -0
- package/dist/pages/pagesInterfaces.d.ts +1 -1
- package/dist/payments/paymentsApi.d.ts +80 -0
- package/dist/payments/paymentsApi.js +108 -0
- package/dist/payments/paymentsInterfaces.d.ts +124 -0
- package/dist/payments/paymentsInterfaces.js +2 -0
- package/dist/products/productsApi.d.ts +18 -30
- package/dist/products/productsApi.js +18 -30
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -41,13 +41,13 @@ const {
|
|
|
41
41
|
System,
|
|
42
42
|
Templates,
|
|
43
43
|
TemplatePreviews
|
|
44
|
-
} = defineOneEntry('your-url')
|
|
44
|
+
} = defineOneEntry('your-url');
|
|
45
45
|
```
|
|
46
46
|
|
|
47
47
|
Or
|
|
48
48
|
|
|
49
49
|
```js
|
|
50
|
-
const api = defineOneEntry('your-url')
|
|
50
|
+
const api = defineOneEntry('your-url');
|
|
51
51
|
```
|
|
52
52
|
|
|
53
53
|
The second parameter of the function takes a configuration object with the keys "token", "langCode" and "multipleResponse".
|
|
@@ -84,7 +84,9 @@ Now you can use the following links to jump to specific entries:
|
|
|
84
84
|
- [Locales](#locales)
|
|
85
85
|
- [Markers](#markers)
|
|
86
86
|
- [Menus](#menus)
|
|
87
|
+
- [Orders](#orders)
|
|
87
88
|
- [Pages](#pages)
|
|
89
|
+
- [Payments](#payments)
|
|
88
90
|
- [Products](#products)
|
|
89
91
|
- [ProductStatuses](#productstatuses)
|
|
90
92
|
- [System](#system)
|
|
@@ -96,7 +98,7 @@ Now you can use the following links to jump to specific entries:
|
|
|
96
98
|
|
|
97
99
|
|
|
98
100
|
```js
|
|
99
|
-
const { Admins } = defineOneEntry('your-url')
|
|
101
|
+
const { Admins } = defineOneEntry('your-url');
|
|
100
102
|
```
|
|
101
103
|
|
|
102
104
|
### Admins.getAdminsInfo(langCode, offset, limit)
|
|
@@ -623,7 +625,9 @@ Example return:
|
|
|
623
625
|
|
|
624
626
|
## <h2 id="fileuploading"> FileUploading </h2>
|
|
625
627
|
|
|
628
|
+
```js
|
|
626
629
|
const { FileUploading } = defineOneEntry('your-url');
|
|
630
|
+
```
|
|
627
631
|
|
|
628
632
|
### FileUploading.upload(data, fileQuery)
|
|
629
633
|
|
|
@@ -707,7 +711,9 @@ Example return:
|
|
|
707
711
|
## <h2 id="forms"> Forms </h2>
|
|
708
712
|
|
|
709
713
|
|
|
714
|
+
```js
|
|
710
715
|
const { Forms } = defineOneEntry('your-url');
|
|
716
|
+
```
|
|
711
717
|
|
|
712
718
|
### Forms.getAllForms(langCode, offset, limit)
|
|
713
719
|
|
|
@@ -915,15 +921,27 @@ example: List [ OrderedMap { "type": "list", "marker": "l1", "position": 2, "lis
|
|
|
915
921
|
|
|
916
922
|
## <h2 id="formdata"> FormData </h2>
|
|
917
923
|
|
|
924
|
+
```js
|
|
918
925
|
const { FormData } = defineOneEntry('your-url');
|
|
926
|
+
```
|
|
919
927
|
|
|
920
|
-
### FormData.postFormsData(data)
|
|
928
|
+
### FormData.postFormsData(data, langCode)
|
|
921
929
|
|
|
922
930
|
```js
|
|
923
|
-
const
|
|
931
|
+
const body = {
|
|
932
|
+
formIdentifier: 'test',
|
|
933
|
+
formData: {
|
|
934
|
+
marker: 'test',
|
|
935
|
+
value: 'Test',
|
|
936
|
+
},
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
const value = await FormData.postFormsData(body)
|
|
924
940
|
```
|
|
925
941
|
|
|
926
|
-
> This method retrieves all form data objects from the API. It returns a Promise that resolves to an array of objects of type
|
|
942
|
+
> This method retrieves all form data objects from the API. It returns a Promise that resolves to an array of objects of type CreateFormData. The method will add the default language to the request body. If you want to change the language, just pass it with the second argument
|
|
943
|
+
|
|
944
|
+
|
|
927
945
|
|
|
928
946
|
Example return:
|
|
929
947
|
|
|
@@ -1061,7 +1079,9 @@ example: test-form <br>
|
|
|
1061
1079
|
|
|
1062
1080
|
## <h2 id="generaltypes"> GeneralTypes </h2>
|
|
1063
1081
|
|
|
1082
|
+
```js
|
|
1064
1083
|
const { GeneralTypes } = defineOneEntry('your-url');
|
|
1084
|
+
```
|
|
1065
1085
|
|
|
1066
1086
|
### GeneralTypes.getAllTypes()
|
|
1067
1087
|
|
|
@@ -1101,7 +1121,7 @@ Enum:
|
|
|
1101
1121
|
## <h2 id="locales"> Locales </h2>
|
|
1102
1122
|
|
|
1103
1123
|
```js
|
|
1104
|
-
const { Locales } = defineOneEntry('your-url')
|
|
1124
|
+
const { Locales } = defineOneEntry('your-url');
|
|
1105
1125
|
```
|
|
1106
1126
|
|
|
1107
1127
|
### Locales.getLocales()
|
|
@@ -1172,7 +1192,7 @@ description:position number
|
|
|
1172
1192
|
|
|
1173
1193
|
|
|
1174
1194
|
```js
|
|
1175
|
-
const { Markers } = defineOneEntry('your-url')
|
|
1195
|
+
const { Markers } = defineOneEntry('your-url');
|
|
1176
1196
|
```
|
|
1177
1197
|
|
|
1178
1198
|
### Markers.getMarkers(offset, limit)
|
|
@@ -1401,11 +1421,206 @@ example: List [ OrderedMap { "id": 11, "pageUrl": "122", "localizeInfos": Ordere
|
|
|
1401
1421
|
|
|
1402
1422
|
---
|
|
1403
1423
|
|
|
1424
|
+
|
|
1425
|
+
|
|
1426
|
+
## <h2 id="orders"> Orders </h2>
|
|
1427
|
+
|
|
1428
|
+
```js
|
|
1429
|
+
const { Orders } = defineOneEntry('your-url');
|
|
1430
|
+
```
|
|
1431
|
+
|
|
1432
|
+
### Orders.getOrderByMarker(marker, langCode)
|
|
1433
|
+
|
|
1434
|
+
```js
|
|
1435
|
+
const value = await Pages.getOrderByMarker('my-order', 'en_US')
|
|
1436
|
+
```
|
|
1437
|
+
|
|
1438
|
+
> This method retrieves one order storage object by marker.
|
|
1439
|
+
|
|
1440
|
+
Example return:
|
|
1441
|
+
```json
|
|
1442
|
+
{
|
|
1443
|
+
"id": 1764,
|
|
1444
|
+
"localizeInfos": {
|
|
1445
|
+
"title": "Order 1"
|
|
1446
|
+
},
|
|
1447
|
+
"identifier": "catalog",
|
|
1448
|
+
"generalTypeId": 4,
|
|
1449
|
+
"formIdentifier": "catalog-form",
|
|
1450
|
+
"paymentAccountIdentifiers": [
|
|
1451
|
+
{
|
|
1452
|
+
"identifier": "p1"
|
|
1453
|
+
}
|
|
1454
|
+
]
|
|
1455
|
+
}
|
|
1456
|
+
```
|
|
1457
|
+
<details>
|
|
1458
|
+
<summary>Schema</summary>
|
|
1459
|
+
|
|
1460
|
+
**id:** number <br>
|
|
1461
|
+
*object identifier* <br>
|
|
1462
|
+
example: 1764 <br>
|
|
1463
|
+
|
|
1464
|
+
**localizeInfos:** Record<string, any> <br>
|
|
1465
|
+
*json description of the main page data object taking into account the language "en_US" (for example)* <br>
|
|
1466
|
+
example: OrderedMap { "en_US": OrderedMap { "title": "Catalog", "plainContent": "Content for catalog", "htmlContent": "<b>Content for catalog</b>", "menuTitle": "Catalog" } } <br>
|
|
1467
|
+
|
|
1468
|
+
**identifier** string <br>
|
|
1469
|
+
*textual identifier for the record field* <br>
|
|
1470
|
+
example: catalog <br>
|
|
1471
|
+
|
|
1472
|
+
**generalTypeId** number <br>
|
|
1473
|
+
*type identifier* <br>
|
|
1474
|
+
example: 4 <br>
|
|
1475
|
+
|
|
1476
|
+
**formIdentifier** string <br>
|
|
1477
|
+
*textual identifier for the form used by the order storage* <br>
|
|
1478
|
+
example: catalog-form <br>
|
|
1479
|
+
|
|
1480
|
+
**paymentAccountIdentifiers** Array<{identifier:string} <br>
|
|
1481
|
+
*array of textual identifiers of payment accounts used by the order storage* <br>
|
|
1482
|
+
example: [{ "identifier": "p1" }] <br>
|
|
1483
|
+
|
|
1484
|
+
</details>
|
|
1485
|
+
|
|
1486
|
+
|
|
1487
|
+
### Orders.createOrder(marker, data, langCode)
|
|
1488
|
+
|
|
1489
|
+
```js
|
|
1490
|
+
const body = {
|
|
1491
|
+
"formIdentifier": "order_form",
|
|
1492
|
+
"paymentAccountIdentifier": "stripe",
|
|
1493
|
+
"currency": "USD",
|
|
1494
|
+
"formData": {
|
|
1495
|
+
"en_US": [
|
|
1496
|
+
{
|
|
1497
|
+
"marker": "name_order",
|
|
1498
|
+
"value": "Alex"
|
|
1499
|
+
},
|
|
1500
|
+
{
|
|
1501
|
+
"marker": "phone_order",
|
|
1502
|
+
"value": "+19999999999"
|
|
1503
|
+
},
|
|
1504
|
+
{
|
|
1505
|
+
"marker": "email_order",
|
|
1506
|
+
"value": "example@oneentry.cloud"
|
|
1507
|
+
}
|
|
1508
|
+
]
|
|
1509
|
+
},
|
|
1510
|
+
"products": [
|
|
1511
|
+
{
|
|
1512
|
+
"productId": 444,
|
|
1513
|
+
"quantity": 1,
|
|
1514
|
+
"price": "0.1"
|
|
1515
|
+
},
|
|
1516
|
+
{
|
|
1517
|
+
"productId": 446,
|
|
1518
|
+
"quantity": 3,
|
|
1519
|
+
"price": "123"
|
|
1520
|
+
}
|
|
1521
|
+
]
|
|
1522
|
+
}
|
|
1523
|
+
|
|
1524
|
+
const value = await Pages.createOrder('my-order', body)
|
|
1525
|
+
```
|
|
1526
|
+
|
|
1527
|
+
> This method retrieves one order storage object by marker. The method will add the default language to the request body. If you want to change the language, just pass it with the second argument
|
|
1528
|
+
|
|
1529
|
+
Example return:
|
|
1530
|
+
```json
|
|
1531
|
+
{
|
|
1532
|
+
"id": 17,
|
|
1533
|
+
"statusIdentifier": "inprogress",
|
|
1534
|
+
"formIdentifier": "order-form",
|
|
1535
|
+
"paymentIdentifier": "payment-1",
|
|
1536
|
+
"formData": [
|
|
1537
|
+
{
|
|
1538
|
+
"marker": "name_1",
|
|
1539
|
+
"value": "Name"
|
|
1540
|
+
}
|
|
1541
|
+
],
|
|
1542
|
+
"products": [
|
|
1543
|
+
{
|
|
1544
|
+
"id": 1,
|
|
1545
|
+
"title": "Floorwood Maxima Laminate, 9811 Oak Mistral",
|
|
1546
|
+
"sku": null,
|
|
1547
|
+
"price": "1.00",
|
|
1548
|
+
"quantity": 10,
|
|
1549
|
+
"previewImage": [
|
|
1550
|
+
{
|
|
1551
|
+
"filename": "files/project/page/36/image/20240322_77c83b02-4c82-4bea-80eb-3763c469b00e.jpg",
|
|
1552
|
+
"downloadLink": "http://my-site.com/files/project/page/36/image/20240322_77c83b02-4c82-4bea-80eb-3763c469b00e.jpg",
|
|
1553
|
+
"size": 296391,
|
|
1554
|
+
"previewLink": ""
|
|
1555
|
+
}
|
|
1556
|
+
]
|
|
1557
|
+
}
|
|
1558
|
+
],
|
|
1559
|
+
"totalSum": "12.00",
|
|
1560
|
+
"currency": "USD",
|
|
1561
|
+
"createdDate": "2023-01-01 12:12",
|
|
1562
|
+
"paymentAccountIdentifier": "payment-1",
|
|
1563
|
+
"paymentAccountLocalizeInfos": {
|
|
1564
|
+
"title": "Account 1"
|
|
1565
|
+
}
|
|
1566
|
+
}
|
|
1567
|
+
```
|
|
1568
|
+
<details>
|
|
1569
|
+
<summary>Schema</summary>
|
|
1570
|
+
|
|
1571
|
+
**statusIdentifier:** string <br>
|
|
1572
|
+
*text identifier of the order status* <br>
|
|
1573
|
+
example: inprogress <br>
|
|
1574
|
+
|
|
1575
|
+
**formIdentifier:** string <br>
|
|
1576
|
+
*text identifier of the form status* <br>
|
|
1577
|
+
example: order-form <br>
|
|
1578
|
+
|
|
1579
|
+
**paymentIdentifier** string <br>
|
|
1580
|
+
*text identifier of the order payment* <br>
|
|
1581
|
+
example: payment-1 <br>
|
|
1582
|
+
|
|
1583
|
+
**formData** FormDataType <br>
|
|
1584
|
+
*data submitted by the form linked to the order store* <br>
|
|
1585
|
+
example: [{ "marker": "name_1", "value": "Name" } ] <br>
|
|
1586
|
+
|
|
1587
|
+
**products** Record<string, string | any>[] <br>
|
|
1588
|
+
*array of products added to order* <br>
|
|
1589
|
+
|
|
1590
|
+
**totalSum** string <br>
|
|
1591
|
+
*total order amount* <br>
|
|
1592
|
+
example: 12.00 <br>
|
|
1593
|
+
|
|
1594
|
+
**currency** string <br>
|
|
1595
|
+
*currency used to pay for the order* <br>
|
|
1596
|
+
example: USD <br>
|
|
1597
|
+
|
|
1598
|
+
**createdDate** string <br>
|
|
1599
|
+
*date when the order was created* <br>
|
|
1600
|
+
example: 2023-01-01 12:12 <br>
|
|
1601
|
+
|
|
1602
|
+
**price** number <br>
|
|
1603
|
+
*price of the product per unit (at the time of ordering)* <br>
|
|
1604
|
+
example: 20.00 <br>
|
|
1605
|
+
|
|
1606
|
+
**paymentAccountIdentifier** string <br>
|
|
1607
|
+
*textual identifier for the order payment* <br>
|
|
1608
|
+
example: payment-1 <br>
|
|
1609
|
+
|
|
1610
|
+
**paymentAccountLocalizeInfos** CommonLocalizeInfos <br>
|
|
1611
|
+
*payment account name considering localization* <br>
|
|
1612
|
+
example: { "title": "Account 1" } <br>
|
|
1613
|
+
</details>
|
|
1614
|
+
|
|
1615
|
+
---
|
|
1616
|
+
|
|
1617
|
+
|
|
1618
|
+
|
|
1404
1619
|
## <h2 id="pages"> Pages </h2>
|
|
1405
1620
|
|
|
1406
1621
|
|
|
1407
1622
|
```js
|
|
1408
|
-
const { Pages } = defineOneEntry('your-url')
|
|
1623
|
+
const { Pages } = defineOneEntry('your-url');
|
|
1409
1624
|
```
|
|
1410
1625
|
|
|
1411
1626
|
### Pages.getRootPages(langCode)
|
|
@@ -2364,11 +2579,528 @@ Example return:
|
|
|
2364
2579
|
---
|
|
2365
2580
|
|
|
2366
2581
|
|
|
2582
|
+
## <h2 id="payments"> Payments </h2>
|
|
2583
|
+
|
|
2584
|
+
```js
|
|
2585
|
+
const { Payments } = defineOneEntry('your-url');
|
|
2586
|
+
```
|
|
2587
|
+
|
|
2588
|
+
### Payments.getSessions(limit, offset)
|
|
2589
|
+
|
|
2590
|
+
```js
|
|
2591
|
+
const value = await Payments.getSessions(30, 0)
|
|
2592
|
+
```
|
|
2593
|
+
|
|
2594
|
+
> This method get list of a payment session. It returns a Promise that resolves to a payment session object.
|
|
2595
|
+
|
|
2596
|
+
Example return:
|
|
2597
|
+
|
|
2598
|
+
```json
|
|
2599
|
+
[
|
|
2600
|
+
{
|
|
2601
|
+
"id": 1764,
|
|
2602
|
+
"updatedDate": "2024-04-10T16:39:04.297Z",
|
|
2603
|
+
"version": 10,
|
|
2604
|
+
"identifier": "catalog",
|
|
2605
|
+
"type": "session",
|
|
2606
|
+
"lineItems": [
|
|
2607
|
+
{
|
|
2608
|
+
"quantity": 1,
|
|
2609
|
+
"amount": 5,
|
|
2610
|
+
"currency": "USD",
|
|
2611
|
+
"name": "T-shirt",
|
|
2612
|
+
"description": "White T-shirt"
|
|
2613
|
+
}
|
|
2614
|
+
],
|
|
2615
|
+
"orderId": 1,
|
|
2616
|
+
"paymentAccountId": 1,
|
|
2617
|
+
"status": "completed",
|
|
2618
|
+
"sessionId": "9BE88048TU058770M",
|
|
2619
|
+
"paymentUrl": "https://www.sandbox.paypal.com/checkoutnow?token=9BE88048TU058770M",
|
|
2620
|
+
"successUrl": "https://example.com/success",
|
|
2621
|
+
"cancelUrl": "https://example.com/cancel",
|
|
2622
|
+
"intent": {
|
|
2623
|
+
"amount": 1,
|
|
2624
|
+
"currency": "usd"
|
|
2625
|
+
},
|
|
2626
|
+
"intentId": 1,
|
|
2627
|
+
"clientSecret": "pi_3Oyz2kQWzXG1R23w144qG7o4_secret_OeScuCwTpHmyOM1atbm7pWJw2"
|
|
2628
|
+
}
|
|
2629
|
+
]
|
|
2630
|
+
```
|
|
2631
|
+
<details>
|
|
2632
|
+
<summary>Schema</summary>
|
|
2633
|
+
|
|
2634
|
+
**id:** number <br>
|
|
2635
|
+
*object identifier* <br>
|
|
2636
|
+
example: 1764 <br>
|
|
2637
|
+
|
|
2638
|
+
**updatedDate:** string <br>
|
|
2639
|
+
*object modification date* <br>
|
|
2640
|
+
|
|
2641
|
+
**version:** number <br>
|
|
2642
|
+
*object modification version number* <br>
|
|
2643
|
+
example: 10 <br>
|
|
2644
|
+
|
|
2645
|
+
**identifier:** string <br>
|
|
2646
|
+
*text identifier for the record field* <br>
|
|
2647
|
+
example: catalog <br>
|
|
2648
|
+
|
|
2649
|
+
**type:** string <br>
|
|
2650
|
+
*type may be 'session' or 'intent'* <br>
|
|
2651
|
+
example: session <br>
|
|
2652
|
+
|
|
2653
|
+
**lineItems:** array <br>
|
|
2654
|
+
*list of items* <br>
|
|
2655
|
+
|
|
2656
|
+
**orderId:** number <br>
|
|
2657
|
+
*order identifier* <br>
|
|
2658
|
+
example: 1 <br>
|
|
2659
|
+
|
|
2660
|
+
**paymentAccountId:** number <br>
|
|
2661
|
+
*payment account object identifier* <br>
|
|
2662
|
+
example: 1 <br>
|
|
2663
|
+
|
|
2664
|
+
**status:** string <br>
|
|
2665
|
+
*payment status* <br>
|
|
2666
|
+
example: completed <br>
|
|
2667
|
+
|
|
2668
|
+
**sessionId:** string <br>
|
|
2669
|
+
*Payment ID from an external provider* <br>
|
|
2670
|
+
example: 9BE88048TU058770M <br>
|
|
2671
|
+
|
|
2672
|
+
**paymentUrl:** string <br>
|
|
2673
|
+
*payment link* <br>
|
|
2674
|
+
example: https://www.sandbox.paypal.com/checkoutnow?token=9BE88048TU058770M <br>
|
|
2675
|
+
|
|
2676
|
+
**successUrl:** string <br>
|
|
2677
|
+
*redirect link after successful payment* <br>
|
|
2678
|
+
example: https://example.com/success <br>
|
|
2679
|
+
|
|
2680
|
+
**cancelUrl** string <br>
|
|
2681
|
+
*redirect link after payment cancellation* <br>
|
|
2682
|
+
example: https://example.com/cancel <br>
|
|
2683
|
+
|
|
2684
|
+
**intent** string <br>
|
|
2685
|
+
example: { "amount": 1, "currency": "usd" } <br>
|
|
2686
|
+
|
|
2687
|
+
**intentId** number <br>
|
|
2688
|
+
*intent object identifier* <br>
|
|
2689
|
+
example: 1 <br>
|
|
2690
|
+
|
|
2691
|
+
**clientSecret** string <br>
|
|
2692
|
+
*client secret key* <br>
|
|
2693
|
+
example: pi_3Oyz2kQWzXG1R23w144qG7o4_secret_OeScuCwTpHmyOM1atbm7pWJw2 <br>
|
|
2694
|
+
|
|
2695
|
+
</details>
|
|
2696
|
+
|
|
2697
|
+
|
|
2698
|
+
### Payments.getSessionById(id)
|
|
2699
|
+
|
|
2700
|
+
```js
|
|
2701
|
+
const value = await Payments.getSessionById(1764)
|
|
2702
|
+
```
|
|
2703
|
+
|
|
2704
|
+
> This method get a single payment session object by its identifier. It returns a Promise that resolves to a payment session object.
|
|
2705
|
+
|
|
2706
|
+
Example return:
|
|
2707
|
+
|
|
2708
|
+
```json
|
|
2709
|
+
{
|
|
2710
|
+
"id": 1764,
|
|
2711
|
+
"updatedDate": "2024-04-10T16:39:04.297Z",
|
|
2712
|
+
"version": 10,
|
|
2713
|
+
"identifier": "catalog",
|
|
2714
|
+
"type": "session",
|
|
2715
|
+
"lineItems": [
|
|
2716
|
+
{
|
|
2717
|
+
"quantity": 1,
|
|
2718
|
+
"amount": 5,
|
|
2719
|
+
"currency": "USD",
|
|
2720
|
+
"name": "T-shirt",
|
|
2721
|
+
"description": "White T-shirt"
|
|
2722
|
+
}
|
|
2723
|
+
],
|
|
2724
|
+
"orderId": 1,
|
|
2725
|
+
"paymentAccountId": 1,
|
|
2726
|
+
"status": "completed",
|
|
2727
|
+
"sessionId": "9BE88048TU058770M",
|
|
2728
|
+
"paymentUrl": "https://www.sandbox.paypal.com/checkoutnow?token=9BE88048TU058770M",
|
|
2729
|
+
"successUrl": "https://example.com/success",
|
|
2730
|
+
"cancelUrl": "https://example.com/cancel",
|
|
2731
|
+
"intent": {
|
|
2732
|
+
"amount": 1,
|
|
2733
|
+
"currency": "usd"
|
|
2734
|
+
},
|
|
2735
|
+
"intentId": 1,
|
|
2736
|
+
"clientSecret": "pi_3Oyz2kQWzXG1R23w144qG7o4_secret_OeScuCwTpHmyOM1atbm7pWJw2"
|
|
2737
|
+
}
|
|
2738
|
+
```
|
|
2739
|
+
<details>
|
|
2740
|
+
<summary>Schema</summary>
|
|
2741
|
+
|
|
2742
|
+
**id:** number <br>
|
|
2743
|
+
*object identifier* <br>
|
|
2744
|
+
example: 1764 <br>
|
|
2745
|
+
|
|
2746
|
+
**updatedDate:** string <br>
|
|
2747
|
+
*object modification date* <br>
|
|
2748
|
+
|
|
2749
|
+
**version:** number <br>
|
|
2750
|
+
*object modification version number* <br>
|
|
2751
|
+
example: 10 <br>
|
|
2752
|
+
|
|
2753
|
+
**identifier:** string <br>
|
|
2754
|
+
*text identifier for the record field* <br>
|
|
2755
|
+
example: catalog <br>
|
|
2756
|
+
|
|
2757
|
+
**type:** string <br>
|
|
2758
|
+
*type may be 'session' or 'intent'* <br>
|
|
2759
|
+
example: session <br>
|
|
2760
|
+
|
|
2761
|
+
**lineItems:** array <br>
|
|
2762
|
+
*list of items* <br>
|
|
2763
|
+
|
|
2764
|
+
**orderId:** number <br>
|
|
2765
|
+
*order identifier* <br>
|
|
2766
|
+
example: 1 <br>
|
|
2767
|
+
|
|
2768
|
+
**paymentAccountId:** number <br>
|
|
2769
|
+
*payment account object identifier* <br>
|
|
2770
|
+
example: 1 <br>
|
|
2771
|
+
|
|
2772
|
+
**status:** string <br>
|
|
2773
|
+
*payment status* <br>
|
|
2774
|
+
example: completed <br>
|
|
2775
|
+
|
|
2776
|
+
**sessionId:** string <br>
|
|
2777
|
+
*Payment ID from an external provider* <br>
|
|
2778
|
+
example: 9BE88048TU058770M <br>
|
|
2779
|
+
|
|
2780
|
+
**paymentUrl:** string <br>
|
|
2781
|
+
*payment link* <br>
|
|
2782
|
+
example: https://www.sandbox.paypal.com/checkoutnow?token=9BE88048TU058770M <br>
|
|
2783
|
+
|
|
2784
|
+
**successUrl:** string <br>
|
|
2785
|
+
*redirect link after successful payment* <br>
|
|
2786
|
+
example: https://example.com/success <br>
|
|
2787
|
+
|
|
2788
|
+
**cancelUrl** string <br>
|
|
2789
|
+
*redirect link after payment cancellation* <br>
|
|
2790
|
+
example: https://example.com/cancel <br>
|
|
2791
|
+
|
|
2792
|
+
**intent** string <br>
|
|
2793
|
+
example: { "amount": 1, "currency": "usd" } <br>
|
|
2794
|
+
|
|
2795
|
+
**intentId** number <br>
|
|
2796
|
+
*intent object identifier* <br>
|
|
2797
|
+
example: 1 <br>
|
|
2798
|
+
|
|
2799
|
+
**clientSecret** string <br>
|
|
2800
|
+
*client secret key* <br>
|
|
2801
|
+
example: pi_3Oyz2kQWzXG1R23w144qG7o4_secret_OeScuCwTpHmyOM1atbm7pWJw2 <br>
|
|
2802
|
+
|
|
2803
|
+
</details>
|
|
2804
|
+
|
|
2805
|
+
|
|
2806
|
+
### Payments.createSession(body)
|
|
2807
|
+
|
|
2808
|
+
```js
|
|
2809
|
+
const body = {
|
|
2810
|
+
"lineItems": [
|
|
2811
|
+
{
|
|
2812
|
+
"quantity": 1,
|
|
2813
|
+
"amount": 5,
|
|
2814
|
+
"currency": "USD",
|
|
2815
|
+
"name": "T-Shirt",
|
|
2816
|
+
"description": "White T-Shirt"
|
|
2817
|
+
}
|
|
2818
|
+
],
|
|
2819
|
+
"orderId": 22
|
|
2820
|
+
}
|
|
2821
|
+
|
|
2822
|
+
const value = await Payments.createSession(body)
|
|
2823
|
+
```
|
|
2824
|
+
|
|
2825
|
+
> This method creation of a payment session. It returns a Promise that resolves to a payment session object.
|
|
2826
|
+
|
|
2827
|
+
Example return:
|
|
2828
|
+
|
|
2829
|
+
```json
|
|
2830
|
+
{
|
|
2831
|
+
"id": 1764,
|
|
2832
|
+
"updatedDate": "2024-04-10T16:39:04.297Z",
|
|
2833
|
+
"version": 10,
|
|
2834
|
+
"identifier": "catalog",
|
|
2835
|
+
"type": "session",
|
|
2836
|
+
"lineItems": [
|
|
2837
|
+
{
|
|
2838
|
+
"quantity": 1,
|
|
2839
|
+
"amount": 5,
|
|
2840
|
+
"currency": "USD",
|
|
2841
|
+
"name": "T-shirt",
|
|
2842
|
+
"description": "White T-shirt"
|
|
2843
|
+
}
|
|
2844
|
+
],
|
|
2845
|
+
"orderId": 1,
|
|
2846
|
+
"paymentAccountId": 1,
|
|
2847
|
+
"status": "completed",
|
|
2848
|
+
"sessionId": "9BE88048TU058770M",
|
|
2849
|
+
"paymentUrl": "https://www.sandbox.paypal.com/checkoutnow?token=9BE88048TU058770M",
|
|
2850
|
+
"successUrl": "https://example.com/success",
|
|
2851
|
+
"cancelUrl": "https://example.com/cancel",
|
|
2852
|
+
"intent": {
|
|
2853
|
+
"amount": 1,
|
|
2854
|
+
"currency": "usd"
|
|
2855
|
+
},
|
|
2856
|
+
"intentId": 1,
|
|
2857
|
+
"clientSecret": "pi_3Oyz2kQWzXG1R23w144qG7o4_secret_OeScuCwTpHmyOM1atbm7pWJw2"
|
|
2858
|
+
}
|
|
2859
|
+
```
|
|
2860
|
+
<details>
|
|
2861
|
+
<summary>Schema</summary>
|
|
2862
|
+
|
|
2863
|
+
**id:** number <br>
|
|
2864
|
+
*object identifier* <br>
|
|
2865
|
+
example: 1764 <br>
|
|
2866
|
+
|
|
2867
|
+
**updatedDate:** string <br>
|
|
2868
|
+
*object modification date* <br>
|
|
2869
|
+
|
|
2870
|
+
**version:** number <br>
|
|
2871
|
+
*object modification version number* <br>
|
|
2872
|
+
example: 10 <br>
|
|
2873
|
+
|
|
2874
|
+
**identifier:** string <br>
|
|
2875
|
+
*text identifier for the record field* <br>
|
|
2876
|
+
example: catalog <br>
|
|
2877
|
+
|
|
2878
|
+
**type:** string <br>
|
|
2879
|
+
*type may be 'session' or 'intent'* <br>
|
|
2880
|
+
example: session <br>
|
|
2881
|
+
|
|
2882
|
+
**lineItems:** array <br>
|
|
2883
|
+
*list of items* <br>
|
|
2884
|
+
|
|
2885
|
+
**orderId:** number <br>
|
|
2886
|
+
*order identifier* <br>
|
|
2887
|
+
example: 1 <br>
|
|
2888
|
+
|
|
2889
|
+
**paymentAccountId:** number <br>
|
|
2890
|
+
*payment account object identifier* <br>
|
|
2891
|
+
example: 1 <br>
|
|
2892
|
+
|
|
2893
|
+
**status:** string <br>
|
|
2894
|
+
*payment status* <br>
|
|
2895
|
+
example: completed <br>
|
|
2896
|
+
|
|
2897
|
+
**sessionId:** string <br>
|
|
2898
|
+
*Payment ID from an external provider* <br>
|
|
2899
|
+
example: 9BE88048TU058770M <br>
|
|
2900
|
+
|
|
2901
|
+
**paymentUrl:** string <br>
|
|
2902
|
+
*payment link* <br>
|
|
2903
|
+
example: https://www.sandbox.paypal.com/checkoutnow?token=9BE88048TU058770M <br>
|
|
2904
|
+
|
|
2905
|
+
**successUrl:** string <br>
|
|
2906
|
+
*redirect link after successful payment* <br>
|
|
2907
|
+
example: https://example.com/success <br>
|
|
2908
|
+
|
|
2909
|
+
**cancelUrl** string <br>
|
|
2910
|
+
*redirect link after payment cancellation* <br>
|
|
2911
|
+
example: https://example.com/cancel <br>
|
|
2912
|
+
|
|
2913
|
+
**intent** string <br>
|
|
2914
|
+
example: { "amount": 1, "currency": "usd" } <br>
|
|
2915
|
+
|
|
2916
|
+
**intentId** number <br>
|
|
2917
|
+
*intent object identifier* <br>
|
|
2918
|
+
example: 1 <br>
|
|
2919
|
+
|
|
2920
|
+
**clientSecret** string <br>
|
|
2921
|
+
*client secret key* <br>
|
|
2922
|
+
example: pi_3Oyz2kQWzXG1R23w144qG7o4_secret_OeScuCwTpHmyOM1atbm7pWJw2 <br>
|
|
2923
|
+
|
|
2924
|
+
</details>
|
|
2925
|
+
|
|
2926
|
+
|
|
2927
|
+
### Payments.getConnected()
|
|
2928
|
+
|
|
2929
|
+
```js
|
|
2930
|
+
const value = await Payments.getConnected()
|
|
2931
|
+
```
|
|
2932
|
+
|
|
2933
|
+
> This method get payment settings. It returns a Promise that resolves to a payment connection object.
|
|
2934
|
+
|
|
2935
|
+
Example return:
|
|
2936
|
+
|
|
2937
|
+
```json
|
|
2938
|
+
{
|
|
2939
|
+
"stripeAccountId": "acct_1OtRiIHTHOaLRCAa",
|
|
2940
|
+
"stripePublishableKey": "pk_51OOvk2HPDnVW5KWJwZfiYAlTLAytYqYYKYjGkxm6PqDD4BATCwuRDGgVYXNCqnvwrewgtDVaGyju5VfClW3GrxxT005KnY7MS3",
|
|
2941
|
+
"paypalAccountId": "4Q0BANTF5BE7N"
|
|
2942
|
+
}
|
|
2943
|
+
```
|
|
2944
|
+
<details>
|
|
2945
|
+
<summary>Schema</summary>
|
|
2946
|
+
|
|
2947
|
+
**stripeAccountId:** string <br>
|
|
2948
|
+
*Identifier of connected Stripe account* <br>
|
|
2949
|
+
example: acct_1OtRiIHTHOaLRCAa <br>
|
|
2950
|
+
|
|
2951
|
+
**stripePublishableKey:** string <br>
|
|
2952
|
+
*Stripe Connect public key* <br>
|
|
2953
|
+
example: pk_51OOvk2HPDnVW5KWJwZfiYAlTLAytYqYYKYjGkxm6PqDD4BATCwuRDGgVYXNCqnvwrewgtDVaGyju5VfClW3GrxxT005KnY7MS3 <br>
|
|
2954
|
+
|
|
2955
|
+
**paypalAccountId:** string <br>
|
|
2956
|
+
*Identifier of connected Paypal account* <br>
|
|
2957
|
+
example: 4Q0BANTF5BE7N <br>
|
|
2958
|
+
|
|
2959
|
+
</details>
|
|
2960
|
+
|
|
2961
|
+
|
|
2962
|
+
### Payments.getAccounts()
|
|
2963
|
+
|
|
2964
|
+
```js
|
|
2965
|
+
const value = await Payments.getAccounts()
|
|
2966
|
+
```
|
|
2967
|
+
|
|
2968
|
+
> This method get payment account as an array. It returns a Promise that resolves to a payment account object.
|
|
2969
|
+
|
|
2970
|
+
Example return:
|
|
2971
|
+
|
|
2972
|
+
```json
|
|
2973
|
+
[
|
|
2974
|
+
{
|
|
2975
|
+
"id": 1764,
|
|
2976
|
+
"updatedDate": "2024-04-10T17:02:20.707Z",
|
|
2977
|
+
"version": 10,
|
|
2978
|
+
"identifier": "catalog",
|
|
2979
|
+
"localizeInfos": {
|
|
2980
|
+
"title": "Stripe"
|
|
2981
|
+
},
|
|
2982
|
+
"type": "stripe",
|
|
2983
|
+
"isVisible": true
|
|
2984
|
+
}
|
|
2985
|
+
]
|
|
2986
|
+
```
|
|
2987
|
+
<details>
|
|
2988
|
+
<summary>Schema</summary>
|
|
2989
|
+
|
|
2990
|
+
**id:** number <br>
|
|
2991
|
+
*object identifier* <br>
|
|
2992
|
+
example: 1764 <br>
|
|
2993
|
+
|
|
2994
|
+
**updatedDate:** string <br>
|
|
2995
|
+
*object modification date* <br>
|
|
2996
|
+
|
|
2997
|
+
**version:** number <br>
|
|
2998
|
+
*object modification version number* <br>
|
|
2999
|
+
example: 10 <br>
|
|
3000
|
+
|
|
3001
|
+
**identifier:** string <br>
|
|
3002
|
+
*text identifier for the recording field* <br>
|
|
3003
|
+
example: catalog <br>
|
|
3004
|
+
|
|
3005
|
+
**localizeInfos:** Record<string, any> <br>
|
|
3006
|
+
*json description of the main page data object taking into account the language "en_US" (for example)* <br>
|
|
3007
|
+
example: OrderedMap { "title": "Catalog", "plainContent": "Content for catalog", "htmlContent": "<b>Content for catalog</b>", "menuTitle": "Catalog" } <br>
|
|
3008
|
+
|
|
3009
|
+
**type:** string <br>
|
|
3010
|
+
*type may be 'stripe', 'paypal' or 'custom'* <br>
|
|
3011
|
+
example: stripe <br>
|
|
3012
|
+
|
|
3013
|
+
**isVisible:** boolean <br>
|
|
3014
|
+
*visibility indicator of the payment account* <br>
|
|
3015
|
+
example: true <br>
|
|
3016
|
+
|
|
3017
|
+
</details>
|
|
3018
|
+
|
|
3019
|
+
|
|
3020
|
+
### Payments.getAccountById()
|
|
3021
|
+
|
|
3022
|
+
```js
|
|
3023
|
+
const value = await Payments.getAccountById(1764)
|
|
3024
|
+
```
|
|
3025
|
+
|
|
3026
|
+
> This method get a single payment account object by its identifier. It returns a Promise that resolves to a payment account object.
|
|
3027
|
+
|
|
3028
|
+
Example return:
|
|
3029
|
+
|
|
3030
|
+
```json
|
|
3031
|
+
{
|
|
3032
|
+
"id": 1764,
|
|
3033
|
+
"updatedDate": "2024-04-10T17:12:20.233Z",
|
|
3034
|
+
"version": 10,
|
|
3035
|
+
"identifier": "catalog",
|
|
3036
|
+
"localizeInfos": {
|
|
3037
|
+
"en_US": {
|
|
3038
|
+
"title": "Stripe"
|
|
3039
|
+
}
|
|
3040
|
+
},
|
|
3041
|
+
"type": "stripe",
|
|
3042
|
+
"isVisible": true
|
|
3043
|
+
}
|
|
3044
|
+
```
|
|
3045
|
+
<details>
|
|
3046
|
+
<summary>Schema</summary>
|
|
3047
|
+
|
|
3048
|
+
**id:** number <br>
|
|
3049
|
+
*object identifier* <br>
|
|
3050
|
+
example: 1764 <br>
|
|
3051
|
+
|
|
3052
|
+
**updatedDate:** string <br>
|
|
3053
|
+
*object modification date* <br>
|
|
3054
|
+
|
|
3055
|
+
**version:** number <br>
|
|
3056
|
+
*object modification version number* <br>
|
|
3057
|
+
example: 10 <br>
|
|
3058
|
+
|
|
3059
|
+
**identifier:** string <br>
|
|
3060
|
+
*text identifier for the recording field* <br>
|
|
3061
|
+
example: catalog <br>
|
|
3062
|
+
|
|
3063
|
+
**localizeInfos:** Record<string, any> <br>
|
|
3064
|
+
*json description of the main page data object taking into account the language "en_US" (for example)* <br>
|
|
3065
|
+
example: OrderedMap { "title": "Catalog", "plainContent": "Content for catalog", "htmlContent": "<b>Content for catalog</b>", "menuTitle": "Catalog" } <br>
|
|
3066
|
+
|
|
3067
|
+
**type:** string <br>
|
|
3068
|
+
*type may be 'stripe', 'paypal' or 'custom'* <br>
|
|
3069
|
+
example: stripe <br>
|
|
3070
|
+
|
|
3071
|
+
**isVisible:** boolean <br>
|
|
3072
|
+
*visibility indicator of the payment account* <br>
|
|
3073
|
+
example: true <br>
|
|
3074
|
+
|
|
3075
|
+
</details>
|
|
3076
|
+
|
|
3077
|
+
|
|
3078
|
+
### Payments.webhookStripe()
|
|
3079
|
+
|
|
3080
|
+
```js
|
|
3081
|
+
const value = await Payments.webhookStripe()
|
|
3082
|
+
```
|
|
3083
|
+
|
|
3084
|
+
> This method use webhook for Stripe. Returns true (in case of successful execution) or false (in case of unsuccessful execution).
|
|
3085
|
+
|
|
3086
|
+
|
|
3087
|
+
|
|
3088
|
+
### Payments.webhookStripe()
|
|
3089
|
+
|
|
3090
|
+
```js
|
|
3091
|
+
const value = await Payments.webhookPaypal()
|
|
3092
|
+
```
|
|
3093
|
+
|
|
3094
|
+
> This method use webhook for Paypal. Returns true (in case of successful execution) or false (in case of unsuccessful execution).
|
|
3095
|
+
|
|
3096
|
+
---
|
|
3097
|
+
|
|
3098
|
+
|
|
2367
3099
|
## <h2 id="products"> Products </h2>
|
|
2368
3100
|
|
|
2369
3101
|
|
|
2370
3102
|
```js
|
|
2371
|
-
const { Products } = defineOneEntry('your-url')
|
|
3103
|
+
const { Products } = defineOneEntry('your-url');
|
|
2372
3104
|
```
|
|
2373
3105
|
|
|
2374
3106
|
>This module accepts a set of user parameters called userQuery. If the parameters are not passed to the method, the default value will be applied.
|
|
@@ -3459,7 +4191,7 @@ true
|
|
|
3459
4191
|
|
|
3460
4192
|
|
|
3461
4193
|
```js
|
|
3462
|
-
const { System } = defineOneEntry('your-url')
|
|
4194
|
+
const { System } = defineOneEntry('your-url');
|
|
3463
4195
|
```
|
|
3464
4196
|
|
|
3465
4197
|
### System.test404()
|
|
@@ -3483,7 +4215,7 @@ const value = await System.test500()
|
|
|
3483
4215
|
|
|
3484
4216
|
|
|
3485
4217
|
```js
|
|
3486
|
-
const { Templates } = defineOneEntry('your-url')
|
|
4218
|
+
const { Templates } = defineOneEntry('your-url');
|
|
3487
4219
|
```
|
|
3488
4220
|
|
|
3489
4221
|
### Templates.getAllTemplates()
|
|
@@ -3645,7 +4377,7 @@ general type name <br>
|
|
|
3645
4377
|
|
|
3646
4378
|
|
|
3647
4379
|
```js
|
|
3648
|
-
const { TemplatePreviews } = defineOneEntry('your-url')
|
|
4380
|
+
const { TemplatePreviews } = defineOneEntry('your-url');
|
|
3649
4381
|
```
|
|
3650
4382
|
|
|
3651
4383
|
### TemplatePreviews.getTemplatePreviews()
|