1.0.62 • Published 1 day ago

oneentry v1.0.62

Weekly downloads
-
License
ISC
Repository
-
Last release
1 day ago

OneEntry SDK

OneEntry Headless CMS SDK is an SDK that provides an easy way to interact with the OneEntry Headless CMS API.

Official Site

Visit the official OneEntry website at https://oneentry.cloud to learn more about the OneEntry Headless CMS.

Sign Up

To get started with OneEntry, sign up for an account at https://account.oneentry.cloud/authentication/register.

Installation

To install the OneEntry Headless CMS SDK in your project, run the following command:

npm install oneentry

Usage

To use the OneEntry Headless CMS SDK in your project, import the defineOneEntry function:

import { defineOneEntry } from 'oneentry'

const {
        Admins,
        AttributesSets,
        Blocks,
        Forms,
        FormData,
        FileUploading,
        GeneralTypes,
        Locales,
        Markers,
        Menus,
        Pages,
        Products,
        ProductStatuses,
        System,
        Templates,
        TemplatePreviews
} = defineOneEntry('your-url');

Or

const api = defineOneEntry('your-url');

The second parameter of the function takes a configuration object with the keys "token", "langCode" and "multipleResponse". Set the token key if your project secure "Security API Token"

Set the "langCode" to set the default language. By specifying this parameter once, you don't have to pass the langCode to the methods ONEENTRY API. If you have not passed the default language, it will be set "en_US" Some methods use more than one request to the CMS so that the data you receive is complete and easy to work with. Pass the value "false" for this parameter to save traffic and decide for yourself what data you need. The default value "true"

If you chose token protection to ensure connection security, just pass your token to the function as an optional parameter.

You can get a token as follows 1) Log in to your personal account 2) Go to the "Projects" tab and select a project 3) Go to the "Access" tab 4) Set the switch to "Security API Token" 5) Log in to the project, go to the settings section and open the token tab 6) Get and copy the token of your project

You can also connect a tls certificate to protect your project. In this case, do not pass the "token" at all. When using the certificate, set up a proxy in your project. Pass an empty string as an url parameter. Learn more about security

const api = defineOneEntry('your-url', {token: 'my-token', langCode:'my-langCode'})

Now you can use the following links to jump to specific entries:

Admins

const { Admins } = defineOneEntry('your-url');

Admins.getAdminsInfo(langCode, offset, limit)

const value = await Admins.getAdminsInfo('en_US', 0, 30)

This method retrieves all user objects of type admin from the API. It returns a Promise that resolves to an array of AdminEntity objects.

Example return:

[
  {
    "id": 1764,
    "identifier": "admin1",
    "attributeSetId": 7,
    "isSync": false,
    "attributeValues": {
      "marker": {
        "value": "",
        "type": "string"
      }
    },
    "position": 192
  }
]

id: number object identifier example: 1764

identifier: string textual identifier for the record field example: admin1 default: admin1

attributeSetId: number Attribute set identifier example: 7

isSync boolean Page indexing flag (true or false) example: false

attributeValues: Record<string, string> Array of attribute values from the index (presented as a pair of user attribute identifier: attribute value) example: OrderedMap { "en_US": OrderedMap { "marker": OrderedMap { "value": "", "type": "string" } } }

position: number Position number (for sorting) example: 192


AttributesSets

const { AttributesSets } = defineOneEntry('your-url');

AttributesSets.getAttributesByMarker(marker, langCode)

const value = await AttributesSets.getAttributesByMarker('my-marker', 'en_US')

This method return all attributes with data from the attribute sets.

Example return:

[
  {
    "type": "list",
    "marker": "list1",
    "position": 192,
    "validators": {
      "requiredValidator": {
        "strict": true
      },
      "defaultValueValidator": {
        "fieldDefaultValue": 11
      }
    },
    "localizeInfos": {
      "title": "My attribute"
    },
    "listTitles": [
      {
        "title": "red",
        "value": 1,
        "position": 1,
        "extendedValue": null,
        "extendedValueType": null
      },
      {
        "title": "yellow",
        "value": 2,
        "position": 2,
        "extendedValue": null,
        "extendedValueType": null
      }
    ]
  }
]

type: string attribute type example: list

marker: string textual identifier of the attribute (marker) Enum: string, text, textWithHeader, integer, real, float, dateTime, date, time, file, image, groupOfImages, radioButton, list, button example: list1

position: number position number for sorting example: 192

validators: Record<string, any> set of validators for validation example: OrderedMap { "requiredValidator": OrderedMap { "strict": true }, "defaultValueValidator": OrderedMap { "fieldDefaultValue": 11 } }

localizeInfos: Record<string, any> localization data for the set (name) example: OrderedMap { "title": "My attribute" }

listTitles Record<string, any> array of values (with extended data) for list and radioButton attributes example: List OrderedMap { "title": "red", "value": 1, "position": 1, "extendedValue": null, "extendedValueType": null }, OrderedMap { "title": "yellow", "value": 2, "position": 2, "extendedValue": null, "extendedValueType": null }

AttributesSets.getSingleAttributeByMarkerSet(attributeMarker, setMarker, langCode)

const value = await AttributesSets.getSingleAttributeByMarkerSet('list1', 'list1', 'en_US')

This method return a single attribute with data from the attribute sets.

Example return:

{
  "type": "list",
  "marker": "list1",
  "position": 192,
  "validators": {
    "requiredValidator": {
      "strict": true
    },
    "defaultValueValidator": {
      "fieldDefaultValue": 11
    }
  },
  "localizeInfos": {
    "title": "My attribute"
  },
  "listTitles": [
    {
      "title": "red",
      "value": 1,
      "position": 1,
      "extendedValue": null,
      "extendedValueType": null
    },
    {
      "title": "yellow",
      "value": 2,
      "position": 2,
      "extendedValue": null,
      "extendedValueType": null
    }
  ]
}

type: string attribute type example: list

marker: string textual identifier of the attribute (marker) Enum: string, text, textWithHeader, integer, real, float, dateTime, date, time, file, image, groupOfImages, radioButton, list, button example: list1

position: number position number for sorting example: 192

validators: Record<string, any> set of validators for validation example: OrderedMap { "requiredValidator": OrderedMap { "strict": true }, "defaultValueValidator": OrderedMap { "fieldDefaultValue": 11 } }

localizeInfos: Record<string, any> localization data for the set (name) example: OrderedMap { "title": "My attribute" }

listTitles Record<string, any> array of values (with extended data) for list and radioButton attributes example: List OrderedMap { "title": "red", "value": 1, "position": 1, "extendedValue": null, "extendedValueType": null }, OrderedMap { "title": "yellow", "value": 2, "position": 2, "extendedValue": null, "extendedValueType": null }


Blocks

const { Blocks } = defineOneEntry('your-url');

Blocks.getBlocks(langCode, offset, limit)

const value = await Blocks.getBlocks('en_US', 0, 30)

This method return array of all blocks object.

Example return:

[
  {
    "id": 4,
    "localizeInfos": {
      "title": "Name"
    },
    "version": 0,
    "position": 3,
    "identifier": "product",
    "type": "forProductBlock",
    "templateIdentifier": null,
    "isVisible": true,
    "attributeValues": {
      "attr": {
        "type": "string",
        "value": "",
        "position": 0,
        "isProductPreview": false
      }
    },
    "countElementsPerRow": 3,
    "products": [
      {
        "id": 446,
        "localizeInfos": {
          "title": "new product 3"
        },
        "relatedIds": [1, 2],
        "statusId": null,
        "attributeSetId": 11,
        "position": 3,
        "templateIdentifier": null,
        "shortDescTemplateIdentifier": null,
        "price": 543,
        "sku": "ggg",
        "isSync": true,
        "attributeValues": {
          "sku": {
            "type": "string",
            "value": "ggg",
            "position": 0,
            "isProductPreview": false
          },
          "images": {
            "type": "groupOfImages",
            "value": {},
            "position": 3,
            "isProductPreview": false
          }
        },
        "isVisible": true
      }
    ]
  }
]

id: number object identifier example: 1764

attributeSetId: number identifier for the used attribute set example: 7

localizeInfos: CommonLocalizeInfos block name with localization example: OrderedMap { "en_US": OrderedMap { "title": "My block" } }

customSettings: BlockCustomSettings custom settings for different block types example: OrderedMap { "sliderDelay": 0, "sliderDelayType": "", "productQuantity": 4, "productSortType": "By_ID", "productSortOrder": "Descending", "productCountElementsPerRow": 10, "similarProductRules": List OrderedMap { "property": "Descending", "includes": "", "keywords": "", "strict": "" } }

version: number object version number example: 10

identifier: string textual identifier for the field record example: catalog default: marker

position: number position number (for sorting) example: 192

attributeValues: Record<string, string> array of attribute values from the index (presented as a pair of custom attribute identifier: attribute value) example: OrderedMap { "en_US": OrderedMap { "marker": OrderedMap { "value": "", "type": "string" } } }

type: string block type example: forNewsPage

templateIdentifier: string template marker used by the block (can be null) Enum: forCatalogProducts, forBasketPage, forErrorPage, forCatalogPages, forProductPreview, forProductPage, forSimilarProductBlock, forStatisticProductBlock, forProductBlock, forForm, forFormField, forNewsPage, forNewsBlock, forNewsPreview, forOneNewsPage, forUsualPage, forTextBlock, forSlider, service example: null

Blocks.getBlockByMarker(marker, langCode)

const value = await Blocks.getBlockByMarker('my-marker', 'en_US')

This method return one blocks object by marker.

Example return:

{
  "id": 1,
  "localizeInfos": {
    "title": "Block"
  },
  "version": 0,
  "position": 1,
  "identifier": "block",
  "type": "forTextBlock",
  "templateIdentifier": null,
  "isVisible": true,
  "attributeValues": {}
}

id: number object identifier example: 1764

attributeSetId: number identifier for the used attribute set example: 7

localizeInfos: CommonLocalizeInfos block name with localization example: OrderedMap { "en_US": OrderedMap { "title": "My block" } }

customSettings: BlockCustomSettings custom settings for different block types example: OrderedMap { "sliderDelay": 0, "sliderDelayType": "", "productQuantity": 4, "productSortType": "By_ID", "productSortOrder": "Descending", "productCountElementsPerRow": 10, "similarProductRules": List OrderedMap { "property": "Descending", "includes": "", "keywords": "", "strict": "" } }

version: number object version number example: 10

identifier: string textual identifier for the field record example: catalog default: marker

position: number position number (for sorting) example: 192

attributeValues: Record<string, string> array of attribute values from the index (presented as a pair of custom attribute identifier: attribute value) example: OrderedMap { "en_US": OrderedMap { "marker": OrderedMap { "value": "", "type": "string" } } }

type: string block type example: forNewsPage

templateIdentifier: string template marker used by the block (can be null) Enum: forCatalogProducts, forBasketPage, forErrorPage, forCatalogPages, forProductPreview, forProductPage, forSimilarProductBlock, forStatisticProductBlock, forProductBlock, forForm, forFormField, forNewsPage, forNewsBlock, forNewsPreview, forOneNewsPage, forUsualPage, forTextBlock, forSlider, service example: null

Blocks.getSimilarProducts(marker, langCode, offset, limit)

const value = await Blocks.getSimilarProducts('my-marker', 'en_US')

This method return array of similar products from block by block marker.

Example return:

[
  {
    "id": 2,
    "localizeInfos": {
      "title": "Box"
    },
    "relatedIds": [],
    "statusId": 2,
    "attributeSetId": 5,
    "position": 1,
    "templateIdentifier": null,
    "shortDescTemplateIdentifier": null,
    "price": 150,
    "sku": null,
    "isSync": true,
    "attributeValues": {
      "price": {
        "type": "integer",
        "value": "150",
        "position": 1,
        "isProductPreview": false
      },
      "product-name": {
        "type": "string",
        "value": "Box text",
        "position": 0,
        "isProductPreview": false
      }
    },
    "isVisible": true
  }
]

Blocks.getProductsByBlockMarker(marker, langCode, offset, limit)

const value = await Blocks.getProductsByBlockMarker('my-marker', 'en_US')

This method return array of products from block by block marker.

Example return:

[
  {
    "id": 446,
    "localizeInfos": {
      "title": "new product 3"
    },
    "relatedIds": [1, 2],
    "statusId": null,
    "position": 3,
    "templateIdentifier": null,
    "shortDescTemplateIdentifier": null,
    "price": 543,
    "sku": "ggg",
    "isSync": true,
    "attributeValues": {
      "sku": {
        "type": "string",
        "value": "ggg",
        "position": 0,
        "isProductPreview": false
      },
      "images": {
        "type": "groupOfImages",
        "value": {},
        "position": 3,
        "isProductPreview": false
      }
    },
    "isVisible": true
  }
]

FileUploading

const { FileUploading } = defineOneEntry('your-url');

FileUploading.upload(data, fileQuery)

const query = {
        type:"page",
        entity:"editor",
        id:3787,
        width:0,
        height:0,
        compress:true,
    }

const value = await FileUploading.upload(data, query)

This method uploads a file to a cloud file storage. Pass to the date the value obtained from input type "file". Data is file object (or array), learn more - File Object

Example return:

[
  {
    "filename": "string",
    "downloadLink": "string",
    "size": 0
  }
]

filename: string filename with relative path

downloadLink: string link for downloading the file

size number size of the file in bytes

FileUploading.delete(filename, fileQuery)

const query = {
        type:"page",
        entity:"editor",
        id:3787
    }


const value = await FileUploading.delete("file.png", query)

This void method delete a file from the cloud file storage.

FileUploading.getFile(id, type, entity, filename)

const value = await FileUploading.getFile(123, 'page', 'editor', 'file.png')

This method return file object by parameters.

Example return:

{
  "file": "string"
}

Forms

const { Forms } = defineOneEntry('your-url');

Forms.getAllForms(langCode, offset, limit)

const value = await Forms.getAllForms('en_US', 0, 30)

This method retrieves all form objects from the API. It returns a Promise that resolves to an array of FormEntity objects.

Example return:

[
  {
    "id": 1764,
    "attributeSetId": 0,
    "processingType": "email",
    "localizeInfos": {
      "title": "My Form",
      "titleForSite": "",
      "successMessage": "",
      "unsuccessMessage": "",
      "urlAddress": "",
      "database": "0",
      "script": "0"
    },
    "processingData": "Unknown Type: ProcessingData",
    "version": 10,
    "identifier": "catalog",
    "position": 192,
    "attributes": [
      {
        "type": "list",
        "marker": "l1",
        "position": 2,
        "listTitles": [
          {
            "title": "red",
            "value": 1,
            "position": 1,
            "extendedValue": null,
            "extendedValueType": null
          },
          {
            "title": "yellow",
            "value": 2,
            "position": 2,
            "extendedValue": null,
            "extendedValueType": null
          }
        ],
        "validators": {},
        "localizeInfos": {
          "title": "l1"
        }
      }
    ]
  }
]

id: number object identifier example: 1764

attributeSetId: number identifier of the attribute set used

processingType: string form processing type example: email

localizeInfos: FormLocalizeInfos form name with localization Enum: db, email, script example: OrderedMap { "en_US": OrderedMap { "title": "My Form", "titleForSite": "", "successMessage": "", "unsuccessMessage": "", "urlAddress": "", "database": "0", "script": "0" } }

processingData: ProcessingData form data

version: number object version number example: 10

identifier: string textual identifier for the record field example: catalog default: marker

position: number position number (for sorting) example: 192

attributes: array of attribute values from the used attribute set for displaying the form (taking into account the specified language) example: List [ OrderedMap { "type": "list", "marker": "l1", "position": 2, "listTitles": List OrderedMap { "title": "red", "value": 1, "position": 1, "extendedValue": null, "extendedValueType": null }, OrderedMap { "title": "yellow", "value": 2, "position": 2, "extendedValue": null, "extendedValueType": null } , "validators": OrderedMap {}, "localizeInfos": OrderedMap { "title": "l1" } } ]

Forms.getFormByMarker(marker, langCode)

const value = await Forms.getFormByMarker('My form', 'en_US')

This method retrieves a single form object based on its textual identifier (marker) from the API. It returns a Promise that resolves to a FormEntity object.

Example return:

{
  "id": 1764,
  "attributeSetId": 0,
  "processingType": "email",
  "localizeInfos": {
    "title": "My Form",
    "titleForSite": "",
    "successMessage": "",
    "unsuccessMessage": "",
    "urlAddress": "",
    "database": "0",
    "script": "0"
  },
  "processingData": "Unknown Type: ProcessingData",
  "version": 10,
  "identifier": "catalog",
  "position": 192,
  "attributes": [
    {
      "type": "list",
      "marker": "l1",
      "position": 2,
      "listTitles": [
        {
          "title": "red",
          "value": 1,
          "position": 1,
          "extendedValue": null,
          "extendedValueType": null
        },
        {
          "title": "yellow",
          "value": 2,
          "position": 2,
          "extendedValue": null,
          "extendedValueType": null
        }
      ],
      "validators": {},
      "localizeInfos": {
        "title": "l1"
      }
    }
  ]
}

id: number object identifier example: 1764

attributeSetId: number identifier of the attribute set used

processingType: string form processing type example: email

localizeInfos: FormLocalizeInfos form name with localization Enum: db, email, script example: OrderedMap { "en_US": OrderedMap { "title": "My Form", "titleForSite": "", "successMessage": "", "unsuccessMessage": "", "urlAddress": "", "database": "0", "script": "0" } }

processingData: ProcessingData form data

version: number object version number example: 10

identifier: string textual identifier for the record field example: catalog default: marker

position: number position number (for sorting) example: 192

attributes: array of attribute values from the used attribute set for displaying the form (taking into account the specified language) example: List [ OrderedMap { "type": "list", "marker": "l1", "position": 2, "listTitles": List OrderedMap { "title": "red", "value": 1, "position": 1, "extendedValue": null, "extendedValueType": null }, OrderedMap { "title": "yellow", "value": 2, "position": 2, "extendedValue": null, "extendedValueType": null } , "validators": OrderedMap {}, "localizeInfos": OrderedMap { "title": "l1" } } ]


FormData

const { FormData } = defineOneEntry('your-url');

FormData.postFormsData(data, langCode)

const body = {
    formIdentifier: 'test',
    formData: {
        marker: 'test',
        value: 'Test',
    },
}

const value = await FormData.postFormsData(body)

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

Example return:

{
  "id": 1764,
  "formIdentifier": "my-form",
  "time": "2023-02-12 10:56",
  "formData": {
    "marker": "name_1",
    "value": "Name"
  }
}

id: number object identifier example: 1764

formIdentifier: string Text identifier of the form object (marker) example: my-form

time: Date Date and time of form modification example: 2023-02-12 10:56

formData: FormDataLangType Data submitted by the form example: OrderedMap { "en_US": List OrderedMap { "marker": "naimenovanie_1", "value": "Name" } }

FormData.getFormsData(langCode, offset, limit)

const value = await FormData.getFormsData('en_US', 0, 30)

This method creates form data objects by sending a request to the API. It accepts an array of objects of type IFormsPost as the request body to provide the necessary form data. It returns a Promise that resolves to the created CreateFormDataDto objects.

Example return:

{
  "id": 1764,
  "formIdentifier": "my-form",
  "time": "2023-02-12 10:56",
  "formData": {
    "marker": "name_1",
    "value": "Name"
  },
  "attributeSetIdentifier": "test-form"
}

id: number object identifier example: 1764

formIdentifier: string Text identifier of the form object (marker) example: my-form

time: Date Date and time of form modification example: 2023-02-12 10:56

formData: FormDataLangType Data submitted by the form example: OrderedMap { "en_US": List OrderedMap { "marker": "naimenovanie_1", "value": "Name" } }

attributeSetIdentifier: string text identifier (marker) of the used attribute set example: test-form

FormData.getFormsDataByMarker(marker, langCode, offset, limit)

const value = await FormData.getFormsDataByMarker('my-marker', 'en_US', 0, 30)

This method retrieves a specific form data object by its marker from the API. It accepts a marker parameter as the marker of the form data. It returns a Promise that resolves to an array of objects of type FormDataEntity.

Example return:

{
  "id": 1764,
  "formIdentifier": "my-form",
  "time": "2023-02-12 10:56",
  "formData": {
     "marker": "name_1",
     "value": "Name"
  },
  "attributeSetIdentifier": "test-form"
}

id: number object identifier example: 1764

formIdentifier: string Text identifier of the form object (marker) example: my-form

time: Date Date and time of form modification example: 2023-02-12 10:56

formData: FormDataLangType Data submitted by the form example: OrderedMap { "en_US": List OrderedMap { "marker": "naimenovanie_1", "value": "Name" } }

attributeSetIdentifier: string text identifier (marker) of the used attribute set example: test-form


GeneralTypes

const { GeneralTypes } = defineOneEntry('your-url');

GeneralTypes.getAllTypes()

const value = await GeneralTypes.getAllTypes()

This method retrieves all objects of type GeneralTypeEntity from the API. It returns a Promise that resolves to an array of GeneralTypeEntity objects.

Example return:

[
  {
    "id": 1,
    "type": "forNewsPage"
  }
]

id: number object identifier example: 1764

type: string type value example: forNewsPage Enum: forCatalogProducts, forBasketPage, forErrorPage, forCatalogPages, forProductPreview, forProductPage, forSimilarProductBlock, forStatisticProductBlock, forProductBlock, forForm, forFormField, forNewsPage, forNewsBlock, forNewsPreview, forOneNewsPage, forUsualPage, forTextBlock, forSlider, service

Locales

const { Locales } = defineOneEntry('your-url');

Locales.getLocales()

const value = await Locales.getLocales()

This method retrieves all active language localization objects from the API. It returns a Promise that resolves to an array of LocaleEntity objects.

Example return:

[
    {
      "id": 1764,
      "shortCode": "en",
      "code": "en_US",
      "name": "Bengali",
      "nativeName": "বাংলা",
      "isActive": false,
      "image": "🇦🇨",
      "position": 1
    }
]

id: number object identifier example: 1764

shortCode: string language code (short) example: en

code: string language code with country code example: en_US

name string Language name (in English) example: Bengali

nativeName string Language name (in native language) example: বাংলা

isActive: boolean Flag of usage example: false

image: string Graphic image of the language (under development) example: 🇦🇨

position: { description:position number }

Markers

const { Markers } = defineOneEntry('your-url');

Markers.getMarkers(offset, limit)

const value = await Markers.getMarkers(0, 30)

This method return an array of all objects MarkerEntity.

Example return:

[
  {
    "id": 17,
    "updatedDate": "2023-12-18T08:53:37.422Z",
    "version": 10,
    "identifier": "catalog",
    "name": "string",
    "marker": "string",
    "localizeInfos": {
      "title": "My marker"
    }
  }
]

id: number object identifier example: 1764

updatedDate: string($date-time) object modification date

version: number version number of the object change example: 10

identifier?: string textual identifier for a record field example: catalog

name?: string name

marker?: string textual identifier

localizeInfos: CommonLocalizeInfos localized marker name example: OrderedMap { "en_US": OrderedMap { "title": "My marker" } }

Markers.getMarkerById(id)

const value = await Markers.getMarkerById(1)

This method return one object of MarkerEntity by id.

Example return:

{
  "id": 17,
  "updatedDate": "2023-12-18T08:55:22.581Z",
  "version": 10,
  "identifier": "catalog",
  "name": "string",
  "marker": "string",
  "localizeInfos": {
    "title": "My marker"
  }
}

id: number object identifier example: 1764

updatedDate: string($date-time) object modification date

version: number version number of the object change example: 10

identifier?: string textual identifier for a record field example: catalog

name?: string name

marker?: string textual identifier

localizeInfos: CommonLocalizeInfos localized marker name example: OrderedMap { "en_US": OrderedMap { "title": "My marker" } }

Markers.getMarkerByMarker(marker)

const value = await Markers.getMarkerByMarker('my-marker')

This method return one object of MarkerEntity by marker.

Example return:

{
  "id": 17,
  "updatedDate": "2023-12-18T08:59:42.006Z",
  "version": 10,
  "identifier": "catalog",
  "name": "string",
  "marker": "string",
  "localizeInfos": {
    "title": "My marker"
  }
}

id: number object identifier example: 1764

updatedDate: string($date-time) object modification date

version: number version number of the object change example: 10

identifier?: string textual identifier for a record field example: catalog

name?: string name

marker?: string textual identifier

localizeInfos: CommonLocalizeInfos localized marker name example: OrderedMap { "en_US": OrderedMap { "title": "My marker" } }


Menus

const { Menus } = defineOneEntry('your-url')

Menus.getMenusByMarker(marker)

const value = await Menus.getMenusByMarker('my-marker')

This method retrieves a single menu object based on its marker (marker) from the API. It returns a Promise that resolves to a single menu object as a ContentMenuDto object with included pages.

Example return:

{
  "id": 1764,
  "identifier": "catalog",
  "localizeInfos": {
    "title": "Main Menu"
  },
  "pages": [
    {
      "id": 11,
      "pageUrl": "122",
      "localizeInfos": {
        "title": "12",
        "content": "",
        "menuTitle": "12"
      },
      "position": 0,
      "parentId": null
    }
  ]
}

id: number object identifier example: 1764

identifier: string textual identifier for a record field example: catalog

localizeInfos Record<string, any> json object description of the menu item with the language "en_US" (for example) example: OrderedMap { "en_US": OrderedMap { "title": "Main Menu" } }

pages: data of the pages included in the menu example: List OrderedMap { "id": 11, "pageUrl": "122", "localizeInfos": OrderedMap { "en_US": OrderedMap { "title": "12", "plainContent": "Content for catalog", "htmlContent": "Content for catalog", "menuTitle": "12" } }, "position": 0, "parentId": null }


Orders

const { Orders } = defineOneEntry('your-url');

Orders.getOrderByMarker(marker, langCode)

const value = await Pages.getOrderByMarker('my-order', 'en_US')

This method retrieves one order storage object by marker.

Example return:

{
  "id": 1764,
  "localizeInfos": {
    "title": "Order 1"
  },
  "identifier": "catalog",
  "generalTypeId": 4,
  "formIdentifier": "catalog-form",
  "paymentAccountIdentifiers": [
    {
      "identifier": "p1"
    }
  ]
}

id: number object identifier example: 1764

localizeInfos: Record<string, any> json description of the main page data object taking into account the language "en_US" (for example) example: OrderedMap { "en_US": OrderedMap { "title": "Catalog", "plainContent": "Content for catalog", "htmlContent": "Content for catalog", "menuTitle": "Catalog" } }

identifier string textual identifier for the record field example: catalog

generalTypeId number type identifier example: 4

formIdentifier string textual identifier for the form used by the order storage example: catalog-form

paymentAccountIdentifiers Array<{identifier:string} array of textual identifiers of payment accounts used by the order storage example: { "identifier": "p1" }

Orders.createOrder(marker, data, langCode)

 const body = {
    "formIdentifier": "order_form",
    "paymentAccountIdentifier": "stripe",
    "currency": "USD",
    "formData": {
        "en_US": [
            {
                "marker": "name_order",
                "value": "Alex"
            },
            {
                "marker": "phone_order",
                "value": "+19999999999"
            },
            {
                "marker": "email_order",
                "value": "example@oneentry.cloud"
            }
        ]
    },
    "products": [
        {
            "productId": 444,
            "quantity": 1,
            "price": "0.1"
        },
        {
            "productId": 446,
            "quantity": 3,
            "price": "123"
        }
    ]
}

const value = await Pages.createOrder('my-order', body)

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

Example return:

{
  "id": 17,
  "statusIdentifier": "inprogress",
  "formIdentifier": "order-form",
  "paymentIdentifier": "payment-1",
  "formData": [
    {
      "marker": "name_1",
      "value": "Name"
    }
  ],
  "products": [
    {
      "id": 1,
      "title": "Floorwood Maxima Laminate, 9811 Oak Mistral",
      "sku": null,
      "price": "1.00",
      "quantity": 10,
      "previewImage": [
        {
          "filename": "files/project/page/36/image/20240322_77c83b02-4c82-4bea-80eb-3763c469b00e.jpg",
          "downloadLink": "http://my-site.com/files/project/page/36/image/20240322_77c83b02-4c82-4bea-80eb-3763c469b00e.jpg",
          "size": 296391,
          "previewLink": ""
        }
      ]
    }
  ],
  "totalSum": "12.00",
  "currency": "USD",
  "createdDate": "2023-01-01 12:12",
  "paymentAccountIdentifier": "payment-1",
  "paymentAccountLocalizeInfos": {
    "title": "Account 1"
  }
}

statusIdentifier: string text identifier of the order status example: inprogress

formIdentifier: string text identifier of the form status example: order-form

paymentIdentifier string text identifier of the order payment example: payment-1

formData FormDataType data submitted by the form linked to the order store example: { "marker": "name_1", "value": "Name" }

products Record<string, string | any>[] array of products added to order

totalSum string total order amount example: 12.00

currency string currency used to pay for the order example: USD

createdDate string date when the order was created example: 2023-01-01 12:12

price number price of the product per unit (at the time of ordering) example: 20.00

paymentAccountIdentifier string textual identifier for the order payment example: payment-1

paymentAccountLocalizeInfos CommonLocalizeInfos payment account name considering localization example: { "title": "Account 1" }


Pages

const { Pages } = defineOneEntry('your-url');

Pages.getRootPages(langCode)

const value = await Pages.getRootPages('en_US')

This method retrieves all top-level page objects from the API. It returns a Promise that resolves to an array of ContentIndexedPageDto objects or an empty array [] if there is no data. Get required language parameter.

Example return:

[
  {
      "id": 1764,
      "parentId": null,
      "config": {
        "rowsPerPage": 1,
        "productsPerRow": 1
      },
      "pageUrl": "string",
      "depth": 3,
      "localizeInfos": {
        "title": "Catalog",
        "content": "Content for catalog",
        "menuTitle": "Catalog"
      },
      "isVisible": true,
      "products": 0,
      "attributeSetId": 7,
      "isSync": false,
      "templateIdentifier": "my-template",
      "attributeValues": {
        "marker": {
          "value": "",
          "type": "string"
        }
      },
      "position": 192,
      "type": "forNewsPage",
      "childrenCount": 0
  }
]

id: number object identifier example: 1764

parentId number parent page identifier, if null, it is a top-level page example: null

config Record<string, number> output settings for catalog pages example: OrderedMap { "rowsPerPage": 1, "productsPerRow": 1 }

pageUrl string unique page URL

depth number page nesting depth relative to parentId example: 3

localizeInfos: Record<string, any> json description of the main page data object taking into account the language "en_US" (for example) example: OrderedMap { "en_US": OrderedMap { "title": "Catalog", "plainContent": "Content for catalog", "htmlContent": "Content for catalog", "menuTitle": "Catalog" } }

isVisible: boolean Page visibility flag example: true

products number Number of products linked to the page example: 0

attributeSetId: number attribute set identifier example: 7

forms Array of FormEntity object identifier values linked to the page (optional)

blocks Array of BlockEntity object identifier values linked to the page (optional)

isSync: boolean indicator of page indexing (true or false) example: false

templateIdentifier: string Custom identifier of the linked template example: my-template

attributeValues: Record<string, string> Array of attribute values from the index (presented as a pair of custom attribute identifier: attribute value) example: OrderedMap { "en_US": OrderedMap { "marker": OrderedMap { "value": "", "type": "string" } } }

position: number position number for sorting (optional) example: 192

type: string Page type example: forNewsPage Enum: forCatalogProducts, forBasketPage, forErrorPage, forCatalogPages, forProductPreview, forProductPage, forSimilarProductBlock, forStatisticProductBlock, forProductBlock, forForm, forFormField, forNewsPage, forNewsBlock, forNewsPreview, forOneNewsPage, forUsualPage, forTextBlock, forSlider, service

childrenCount: number number of nested pages example: 0

Pages.getCatalogPages(langCode, limit, offset)

const value = await Pages.getCatalogPages('en_US', 0, 30)

This method retrieves all page objects with product information as an array from the API. It accepts two optional parameters limit and offset for pagination and language code parameter. It returns a Promise that resolves to an array of ContentIndexedPageDto objects or an empty array [] if there is no data.

Example return:

[
  {
      "id": 1764,
      "parentId": null,
      "config": {
        "rowsPerPage": 1,
        "productsPerRow": 1
      },
      "pageUrl": "string",
      "depth": 3,
      "localizeInfos": {
        "title": "Catalog",
        "content": "Content for catalog",
        "menuTitle": "Catalog"
      },
      "isVisible": true,
      "products": 0,
      "attributeSetId": 7,
      "isSync": false,
      "templateIdentifier": "my-template",
      "attributeValues": {
        "marker": {
          "value": "",
          "type": "string"
        }
      },
      "position": 192,
      "type": "forNewsPage",
      "childrenCount": 0
  }
]

id: number object identifier example: 1764

parentId number parent page identifier, if null, it is a top-level page example: null

config Record<string, number> output settings for catalog pages example: OrderedMap { "rowsPerPage": 1, "productsPerRow": 1 }

pageUrl string unique page URL

depth number page nesting depth relative to parentId example: 3

localizeInfos: Record<string, any> json description of the main page data object taking into account the language "en_US" (for example) example: OrderedMap { "en_US": OrderedMap { "title": "Catalog", "plainContent": "Content for catalog", "htmlContent": "Content for catalog", "menuTitle": "Catalog" } }

isVisible: boolean Page visibility flag example: true

products number Number of products linked to the page example: 0

attributeSetId: number attribute set identifier example: 7

forms Array of FormEntity object identifier values linked to the page (optional)

blocks Array of BlockEntity object identifier values linked to the page (optional)

isSync: boolean indicator of page indexing (true or false) example: false

templateIdentifier: string Custom identifier of the linked template example: my-template

attributeValues: Record<string, string> Array of attribute values from the index (presented as a pair of custom attribute identifier: attribute value) example: OrderedMap { "en_US": OrderedMap { "marker": OrderedMap { "value": "", "type": "string" } } }

position: number position number for sorting (optional) example: 192

type: string Page type example: forNewsPage Enum: forCatalogProducts, forBasketPage, forErrorPage, forCatalogPages, forProductPreview, forProductPage, forSimilarProductBlock, forStatisticProductBlock, forProductBlock, forForm, forFormField, forNewsPage, forNewsBlock, forNewsPreview, forOneNewsPage, forUsualPage, forTextBlock, forSlider, service

childrenCount: number number of nested pages example: 0

Pages.getPages(langCode)

const value = await Pages.getPages('en_US')

This method retrieves all created pages as an array from the API. It returns a Promise that resolves to an array of ContentIndexedPageDto objects or an empty array [] if there is no data. Get required language parameter.

Example return:

[
  {
      "id": 1764,
      "parentId": null,
      "config": {
        "rowsPerPage": 1,
        "productsPerRow": 1
      },
      "pageUrl": "string",
      "depth": 3,
      "localizeInfos": {
        "title": "Catalog",
        "content": "Content for catalog",
        "menuTitle": "Catalog"
      },
      "isVisible": true,
      "products": 0,
      "attributeSetId": 7,
      "isSync": false,
      "templateIdentifier": "my-template",
      "attributeValues": {
        "marker": {
          "value": "",
          "type": "string"
        }
      },
      "position": 192,
      "type": "forNewsPage",
      "childrenCount": 0
  }
]

id: number object identifier example: 1764

parentId number parent page identifier, if null, it is a top-level page example: null

config Record<string, number> output settings for catalog pages example: OrderedMap { "rowsPerPage": 1, "productsPerRow": 1 }

pageUrl string unique page URL

depth number page nesting depth relative to parentId example: 3

localizeInfos: Record<string, any> json description of the main page data object taking into account the language "en_US" (for example) example: OrderedMap { "en_US": OrderedMap { "title": "Catalog", "plainContent": "Content for catalog", "htmlContent": "Content for catalog", "menuTitle": "Catalog" } }

isVisible: boolean Page visibility flag example: true

products number Number of products linked to the page example: 0

attributeSetId: number attribute set identifier example: 7

forms Array of FormEntity object identifier values linked to the page (optional)

blocks Array of BlockEntity object identifier values linked to the page (optional)

isSync: boolean indicator of page indexing (true or false) example: false

templateIdentifier: string Custom identifier of the linked template example: my-template

attributeValues: Record<string, string> Array of attribute values from the index (presented as a pair of custom attribute identifier: attribute value) example: OrderedMap { "en_US": OrderedMap { "marker": OrderedMap { "value": "", "type": "string" } } }

position: number position number for sorting (optional) example: 192

type: string Page type example: forNewsPage Enum: forCatalogProducts, forBasketPage, forErrorPage, forCatalogPages, forProductPreview, forProductPage, forSimilarProductBlock, forStatisticProductBlock, forProductBlock, forForm, forFormField, forNewsPage, forNewsBlock, forNewsPreview, forOneNewsPage, forUsualPage, forTextBlock, forSlider, service

childrenCount: number number of nested pages example: 0

Pages.getPageById(id, langCode)

const value = await Pages.getPageById(1, 'en_US')

This method retrieves a single page object based on its identifier (id) from the API. It returns a Promise that resolves to the page object, with the specific DTO depending on the type of page being returned. Get required language parameter.

Example return:

{
  "id": 1764,
  "parentId": null,
  "pageUrl": "string",
  "depth": 3,
  "localizeInfos": {
    "title": "Catalog",
    "content": "Content for catalog",
    "menuTitle": "Catalog"
  },
  "isVisible": true,
  "position": 192,
  "type": "forNewsPage",
  "templateIdentifier": "my-template",
  "attributeSetId": 7,
  "attributeValues": {
    "marker": "description",
    "type": "string",
    "value": ""
  },
  "isSync": false,
  "products": 0
}

id: number object identifier example: 1764

parentId number parent page identifier, if null, it is a top-level page example: null

pageUrl string unique page URL

depth number page nesting depth relative to parentId example: 3

localizeInfos: Record<string, any> json description of the main page data object taking into account the language "en_US" (for example) example: OrderedMap { "en_US": OrderedMap { "title": "Catalog", "plainContent": "Content for catalog", "htmlContent": "Content for catalog", "menuTitle": "Catalog" } }

isVisible: boolean Page visibility flag example: true

position: number position number (for sorting) example: 192

type string page type: example: forNewsPage Enum: forCatalogProducts, forBasketPage, forErrorPage, forCatalogPages, forProductPreview, forProductPage, forSimilarProductBlock, forStatisticProductBlock, forProductBlock, forForm, forFormField, forNewsPage, forNewsBlock, forNewsPreview, forOneNewsPage, forUsualPage, forTextBlock, forSlider, service

templateIdentifier: string custom identifier of the associated template example: my-template

attributeSetId: number attribute set identifier example: 7

forms Array of FormEntity object identifier values linked to the page (optional)

blocks Array of BlockEntity object identifier values linked to the page (optional)

isSync: boolean indicator of page indexing (true or false) example: false

products number number of products associated with the page example: 0

Pages.getPageByUrl(url, langCode)

const value = await Pages.getPageByUrl('shop', 'en_US')

This method retrieves a single page object based on its URL (url) from the API. It returns a Promise that resolves to the page object, with the specific DTO depending on the type of page being returned. Get required language parameter.

Example return:

{
  "id": 1764,
  "parentId": null,
  "pageUrl": "string",
  "depth": 3,
  "localizeInfos": {
    "title": "Catalog",
    "content": "Content for catalog",
    "menuTitle": "Catalog"
  },
  "isVisible": true,
  "position": 192,
  "type": "forNewsPage",
  "templateIdentifier": "my-template",
  "attributeSetId": 7,
  "attributeValues": {
    "marker": "description",
    "type": "string",
    "value": ""
  },
  "isSync": false,
  "products": 0
}

id: number object identifier example: 1764

parentId number parent page identifier, if null, it is a top-level page example: null

pageUrl string unique page URL

depth number page nesting depth relative to parentId example: 3

localizeInfos: Record<string, any> json description of the main page data object taking into account the language "en_US" (for example) example: OrderedMap { "en_US": OrderedMap { "title": "Catalog", "plainContent": "Content for catalog", "htmlContent": "Content for catalog", "menuTitle": "Catalog" } }

isVisible: boolean Page visibility flag example: true

position: number position number (for sorting) example: 192

type string page type: example: forNewsPage Enum: forCatalogProducts, forBasketPage, forErrorPage, forCatalogPages, forProductPreview, forProductPage, forSimilarProductBlock, forStatisticProductBlock, forProductBlock, forForm, forFormField, forNewsPage, forNewsBlock, forNewsPreview, forOneNewsPage, forUsualPage, forTextBlock, forSlider, service

templateIdentifier: string custom identifier of the associated template example: my-template

attributeSetId: number attribute set identifier example: 7

forms Array of FormEntity object identifier values linked to the page (optional)

blocks Array of BlockEntity object identifier values linked to the page (optional)

isSync: boolean indicator of page indexing (true or false) example: false

products number number of products associated with the page example: 0

Pages.getChildPagesByParentUrl(url, langCode)

const value = await Pages.getChildPagesByParentUrl('shop', 'en_US')

Getting child pages with information about products in the form of an array. Returns all created pages as an array of AdminIndexedPageDto objects or an empty array [] (if there is no data) for the selected parent.

Example return:

[
  {
    "id": 1764,
    "parentId": null,
    "config": {
      "rowsPerPage": 1,
      "productsPerRow": 1
    },
    "pageUrl": "string",
    "depth": 3,
    "localizeInfos": {
      "title": "Catalog",
      "plainContent": "Content for catalog",
      "htmlContent": "<b>Content for catalog</b>",
      "menuTitle": "Catalog"
    },
    "isVisible": true,
    "products": 0,
    "attributeSetId": 7,
    "forms": [
      null
    ],
    "blocks": [
      null
    ],
    "isSync": false,
    "templateIdentifier": "my-template",
    "attributeValues": {
      "marker": {
        "value": "",
        "type": "string"
      }
    },
    "position": 192,
    "type": "forNewsPage",
    "childrenCount": 0
  }
]

id: number object identifier example: 1764

parentId number parent page identifier, if null, it is a top-level page example: null

config Record<string, number> output settings for catalog pages example: OrderedMap { "rowsPerPage": 1, "productsPerRow": 1 }

pageUrl string unique page URL

depth number page nesting depth relative to parentId example: 3

localizeInfos: Record<string, any> json description of the main page data object taking into account the language "en_US" (for example) example: OrderedMap { "en_US": OrderedMap { "title": "Catalog", "plainContent": "Content for catalog", "htmlContent": "Content for catalog", "menuTitle": "Catalog" } }

isVisible: boolean Page visibility flag example: true

products number Number of products linked to the page example: 0

attributeSetId: number attribute set identifier example: 7

forms Array of FormEntity object identifier values linked to the page (optional)

blocks Array of BlockEntity object identifier values linked to the page (optional)

isSync: boolean indicator of page indexing (true or false) example: false

templateIdentifier: string Custom identifier of the linked template example: my-template

attributeValues: Record<string, string> Array of attribute values from the index (presented as a pair of custom attribute identifier: attribute value) example: OrderedMap { "en_US": OrderedMap { "marker": OrderedMap { "value": "", "type": "string" } } }

position: number position number for sorting (optional) example: 192

type: string Page type example: forNewsPage Enum: forCatalogProducts, forBasketPage, forErrorPage, forCatalogPages, forProductPreview, forProductPage, forSimilarProductBlock, forStatisticProductBlock, forProductBlock, forForm, forFormField, forNewsPage, forNewsBlock, forNewsPreview, forOneNewsPage, forUsualPage, forTextBlock, forSlider, service

childrenCount: number number of nested pages example: 0

Pages.getBlocksByPageUrl(url, langCode)

const value = await Pages.getFormsByPageUrl('shop', 'en_US')

Get PositionBlock objects for a related form by url. Returns an array of PositionBlock objects.

Example return:

[
  {
    "id": 1764,
    "version": 10,
    "identifier": "catalog",
    "attributeSetId": 0,
    "localizeInfos": {
      "title": "My block"
    },
    "customSettings": {
      "sliderDelay": 0,
      "sliderDelayType": "",
      "productQuantity": 4,
      "productSortType": "By_ID",
      "productSortOrder": "Descending",
      "productCountElementsPerRow": 10,
      "similarProductRules": [
        {
          "property": "Descending",
          "includes": "",
          "keywords": "",
          "strict": ""
        }
      ]
    },
    "position": 0,
    "isSync": false,
    "attributeValues": {
      "marker": {
        "value": "",
        "type": "string"
      }
    },
    "type": "forNewsPage",
    "templateIdentifier": null
  }
]

id: number object identifier example: 1764

version number object version number example: 10

identifier: string text identifier for the record field example: catalog

attributeSetId: number attribute set identifier example: 7

localizeInfos: Record<string, any> json description of the main page data object taking into account the language "en_US" (for example) example: OrderedMap { "en_US": OrderedMap { "title": "Catalog", "plainContent": "Content for catalog", "htmlContent": "Content for catalog", "menuTitle": "Catalog" } }

customSettings: BlockCustomSettings custom settings for different types of blocks example: OrderedMap { "sliderDelay": 0, "sliderDelayType": "", "productQuantity": 4, "productSortType": "By_ID", "productSortOrder": "Descending", "productCountElementsPerRow": 10, "similarProductRules": List OrderedMap { "property": "Descending", "includes": "", "keywords": "", "strict": "" } }

isSync: boolean indicator of page indexing (true or false) example: false

attributeValues: Record<string, string> Array of attribute values from the index (presented as a pair of custom attribute identifier: attribute value) example: OrderedMap { "en_US": OrderedMap { "marker": OrderedMap { "value": "", "type": "string" } } }

position: number position number for sorting (optional) example: 192

type: string Page type example: forNewsPage Enum: forCatalogProducts, forBasketPage, forErrorPage, forCatalogPages, forProductPreview, forProductPage, forSimilarProductBlock, forStatisticProductBlock, forProductBlock, forForm, forFormField, forNewsPage, forNewsBlock, forNewsPreview, forOneNewsPage, forUsualPage, forTextBlock, forSlider, service

templateIdentifier: string marker of the template used by the block (can be null) example: null

Pages.getFormsByPageUrl(url, langCode)

const value = await Pages.getFormsByPageUrl('shop', 'en_US')

Get PositionForm objects for a related form by url. Returns an array of PositionForm objects.

Example return:

[
  {
    "id": 1764,
    "version": 10,
    "identifier": "catalog",
    "attributeSetId": 0,
    "processingType": "email",
    "localizeInfos": {
      "title": "My form",
      "titleForSite": "",
      "successMessage": "",
      "unsuccessMessage": "",
      "urlAddress": "",
      "database": "0",
      "script": "0"
    },
    "processingData": {},
    "position": 0,
    "attributes": [
      {
        "type": "list",
        "marker": "l1",
        "position": 2,
        "listTitles": [
          {
            "title": "red",
            "value": 1,
            "position": 1,
            "extendedValue": null,
            "extendedValueType": null
          },
          {
            "title": "yellow",
            "value": 2,
            "position": 2,
            "extendedValue": null,
            "extendedValueType": null
          }
        ],
        "validators": {},
        "localizeInfos": {
          "title": "l1"
        }
      }
    ]
  }
]

id: number object identifier example: 1764

version number object version number example: 10

identifier: string text identifier for the record field example: catalog

attributeSetId: number attribute set identifier example: 7

processingType: string form processing type example: email Enum: db, email, script

localizeInfos: Record<string, any> json description of the main page data object taking into account the language "en_US" (for example) example: OrderedMap { "en_US": OrderedMap { "title": "Catalog", "plainContent": "Content for catalog", "htmlContent": "Content for catalog", "menuTitle": "Catalog" } }

processingData: form data

attributes: Record<string, string> array of attribute values from the used attribute set for displaying the form (taking into account the specified language) example: List [ OrderedMap { "type": "list", "marker": "l1", "position": 2, "listTitles": List OrderedMap { "title": "red", "value": 1, "position": 1, "extendedValue": null, "extendedValueType": null }, OrderedMap { "title": "yellow", "value": 2, "position": 2, "extendedValue": null, "extendedValueType": null } , "validators": OrderedMap {}, "localizeInfos": OrderedMap { "title": "l1" } } ]

position: number position number for sorting (optional) example: 192

Pages.getConfigPageByUrl(url)

const value = await Pages.getConfigPageByUrl('shop')

This method retrieves the settings for a specific page based on its URL (url). It returns a Promise that resolves to a ConfigPageDto object with page display settings.

Example return:

{
  "rowsPerPage": 10,
  "productsPerRow": 10
}

rowsPerPage: number Number of rows per page example: 10

productsPerRow number Number of products per row example: 10

Pages.searchPage(name, langCode)

const value = await Pages.searchPage('cup', 'en_US')

This method performs a quick search for page objects based on a text query (name). It returns a Promise that resolves to a ContentIndexedPageDto objects or an empty array []. Get required language parameter.

Example return:

[
  {
      "id": 1764,
      "parentId": null,
      "pageUrl": "string",
      "depth": 3,
      "localizeInfos": {
        "title": "Catalog",
        "content": "Content for catalog",
        "menuTitle": "Catalog"
      },
      "isVisible": true,
      "position": 192,
      "type": "forNewsPage",
      "templateIdentifier": "my-template",
      "attributeSetId": 7,
      "attributeValues": {
        "marker": "description",
        "type": "string",
        "value": ""
      },
      "isSync": false,
      "products": 0
    }
]

Payments

const { Payments } = defineOneEntry('your-url');

Payments.getSessions(limit, offset)

const value = await Payments.getSessions(30, 0)

This method get list of a payment session. It returns a Promise that resolves to a payment session object.

Example return:

[
  {
    "id": 1764,
    "updatedDate": "2024-04-10T16:39:04.297Z",
    "version": 10,
    "identifier": "catalog",
    "type": "session",
    "lineItems": [
      {
        "quantity": 1,
        "amount": 5,
        "currency": "USD",
        "name": "T-shirt",
        "description": "White T-shirt"
      }
    ],
    "orderId": 1,
    "paymentAccountId": 1,
    "status": "completed",
    "sessionId": "9BE88048TU058770M",
    "paymentUrl": "https://www.sandbox.paypal.com/checkoutnow?token=9BE88048TU058770M",
    "successUrl": "https://example.com/success",
    "cancelUrl": "https://example.com/cancel",
    "intent": {
      "amount": 1,
      "currency": "usd"
    },
    "intentId": 1,
    "clientSecret": "pi_3Oyz2kQWzXG1R23w144qG7o4_secret_OeScuCwTpHmyOM1atbm7pWJw2"
  }
]

id: number object identifier example: 1764

updatedDate: string object modification date

version: number object modification version number example: 10

identifier: string text identifier for the record field example: catalog

type: string type may be 'session' or 'intent' example: session

**lineIt

1.0.62

1 day ago

1.0.61

13 days ago

1.0.60

29 days ago

1.0.59

1 month ago

1.0.58

1 month ago

1.0.57

2 months ago

1.0.56

2 months ago

1.0.55

3 months ago

1.0.54

3 months ago

1.0.53

3 months ago

1.0.52

3 months ago

1.0.51

3 months ago

1.0.50

4 months ago

1.0.49

4 months ago

1.0.48

4 months ago

1.0.47

4 months ago

1.0.46

4 months ago

1.0.45

4 months ago

1.0.44

4 months ago

1.0.40

5 months ago

1.0.42

5 months ago

1.0.41

5 months ago

1.0.39

5 months ago

1.0.38

5 months ago

1.0.36

5 months ago

1.0.35

5 months ago

1.0.34

5 months ago

1.0.33

5 months ago

1.0.32

5 months ago

1.0.31

5 months ago

1.0.30

5 months ago

1.0.29

5 months ago

1.0.28

5 months ago

1.0.27

5 months ago

1.0.26

6 months ago

1.0.25

6 months ago

1.0.24

6 months ago

1.0.23

6 months ago

1.0.22

6 months ago

1.0.21

6 months ago

1.0.20

6 months ago

1.0.19

6 months ago

1.0.18

6 months ago

1.0.17

6 months ago

1.0.16

6 months ago

1.0.15

7 months ago

1.0.14

7 months ago

1.0.13

7 months ago

1.0.12

7 months ago

1.0.10

7 months ago

1.0.9

7 months ago

1.0.7

7 months ago

1.0.8

7 months ago

1.0.0

8 months ago