Skip to main content

The admin-api node

The admin-api node gives direct access to the internal OneEntry API. Use it to read and modify orders, pages, products, users, collections, and payment sessions from an integration stream, without writing HTTP requests by hand.


admin-api node settings​

The Node Information panel of the admin-api node: the "Execute" button and the "Name", "Type", "Query parameters", and "Request body" fields.

1. Name​

The node name.
It appears in the workspace and helps you identify the node.
If you leave it empty, the node is named admin-api.

Example:

  • Node name: Create Payment Session

2. Type​

The API operation the node calls when a message passes through it. This is a searchable dropdown. Operations are grouped by API section, and their names come from the node's API description in the interface language. If no translation exists for that language, the names appear in the original language.

The available operations depend on the OneEntry version, so check the Type dropdown for the exact list. Operations cover:

  • pages and products: for example, "Page object update", "Searching for all product page objects with pagination and filters.", and retrieving multiple products by ID;
  • users: including user search;
  • attribute values: including updating attribute values of several entities at once;
  • orders: changing an order's status, applying a status trigger, and returns;
  • payment sessions: for example, "Payment session creation" and "Payment session update";
  • bonus balance: manually adjusting a user's balance;
  • collection records: for example, "Retrieving all records belonging to a collection.".

When you select an operation, the Query parameters and Request body fields are filled with an example from the API description. Replace its values with your own.


3. Query parameters​

The request parameters. The node takes the path and HTTP method from the selected operation automatically; you can't edit them in the form. Path parameter values (for example, a record ID) go in this same field, along with the URL query parameters.

The field uses Mustache syntax, so you can insert values from msg with {{variable}}.

Example (for the "Retrieving all records belonging to a collection." operation):

{
"entityType": "orders",
"entityId": "{{orderId}}",
"langCode": "en_US",
"offset": 0,
"limit": 1,
"marker": "delivery"
}

4. Request body​

The request body in JSON. The field appears only for operations that use the POST, PUT, or PATCH method. It supports Mustache for inserting data from msg.

Example (for the "Payment session creation" operation):

{
"orderId": {{orderId}},
"type": "session"
}

5. Input Schema​

The Input Schema block in the node settings shows the structure of the data that comes from the previous node in the stream. The schema is shown as key/type pairs and reflects how objects are nested.

If a schema field is in the API description, its text description appears next to it. The code editor also shows these descriptions as hints when you write Mustache templates.

Example of how Input Schema is displayed:

payload
└── order
├── id (integer) — Order ID
├── status (string) — Current status
└── totalPrice (number) — Total amount

6. Execute button​

The Execute button lets you call the API request from the node editing form without running the whole stream.

How it works:

  • The server runs the stream from its start up to this node, passing data along the chain according to the last published state of the stream.
  • If a function node along the way doesn't pass data on but has the Output Example (JSON) field filled in, that data is used as test data.
  • If the request succeeds, the API response is passed to the next node as its schema.
  • If the request returns an error, no schema is passed to the next node.
info

Before you use the Execute button, make sure the stream is published. The server runs the chain as of the last publish.

Effect on the schema:

Initially, the admin-api node has the response schema from the API description. When you click Execute, the actual API response overwrites the schema. Fields that match the API description keep their text descriptions.


7. Automatic calls for read-only requests​

All admin-api nodes that make read-only (GET) requests are called automatically:

  • when you open the Integrations page,
  • when you update the stream with the Publish button.

This keeps the data schema in the next node up to date without a manual run.


Usage examples​

Example 1: Creating a payment session​

Node settings:

  • Type: Payment session creation
  • Request body:
    {
    "orderId": {{orderEvent.order.id}},
    "type": "session"
    }

Result:
The node creates a payment session with the orderId from the incoming message and passes the new session's data to the next node.


Example 2: Updating an order's status​

Node settings:

  • Type: Updating the status of an order belonging to the order storage object
  • Query parameters:
    {
    "id": {{orderId}}
    }
  • Request body:
    {
    "status": "{{newStatus}}"
    }

Result:
The node updates the order's status using data from the incoming message.


Example 3: Retrieving collection records​

Node settings:

  • Type: Retrieving all records belonging to a collection.
  • Query parameters:
    {
    "entityType": "delivery",
    "entityId": "{{payload.id}}",
    "langCode": "en_US",
    "offset": 0,
    "limit": 10
    }

Result:
The node returns a list of collection records. Because this is a read-only request, the response schema loads automatically when you open the page.