Skip to main content

Node admin-api

This node allows interaction with various APIs, which is useful for integration with external services.


Settings for the admin-api node

IMG2

1. Name

A field for specifying the name of the node.
The name is displayed in the workspace and helps to easily identify the node.
If left empty, the node will be called admin-api.

Example:

  • Node name: Create Payment Session

2. Type

Here, you select the API method that will be used to send the request. Available methods:

  • "Update page object":

  • "Search all objects on product pages with pagination for the selected category":

  • "Changing the status of the product page":

  • "Product page update":

  • "User object update - admin":

  • "Update one user object":

  • "Updating the value of one entity attribute":

  • "Receiving all orders belonging to the order storage object":

  • "Updating the status of an order belonging to the order storage object":

  • "Payment session update":

  • "Receiving one payment session object by its identifier":

  • "Creating a payment session":

  • "Receiving all records belonging to the collection":

  • "Creating a record in the collection":

  • "Changing a record in the collection":

  • "Deleting an object from the collection record":


3. Query parameters

This field uses the Mustache template to form request data in JSON format.
You can use data from the msg message to substitute values into the template.

Template example (for the method "Receiving all records belonging to the collection"):

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

In this example, the value of orderId will be substituted from the msg message.
When using Mustache templates, you can pass complex data and parameters necessary for interacting with the API.


4. Request body

This field uses the Mustache template to form request data in JSON format.
You can use data from the msg message to substitute values into the template.

Template example (for the method "Creating a payment session"):

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

In this example, the value of orderId will be substituted from the msg message.
When using Mustache templates, you can pass complex data and parameters necessary for interacting with the API.


Request Examples

Example 1: Creating a payment session

Node settings:

  • Type: Creating a payment session
  • Request body:
    {
    "orderId": {{orderEvent.order.id}},
    "type": "session"
    }

Result:
The node will send a request to create a payment session with the data from the message. As a result, information about the new payment session will be received.


Example 2: Updating a payment session

Node settings:

  • Type: Payment session update
  • Query parameters:
    {
    "id": {{paymentSessionId}}
    }
  • Request body:
    {
    "status": "{{status}}"
    }

Result:
The node will send a request to update the status of the payment session, using the provided values paymentSessionId and status.