# Haravan

Haravan node allows developers to extend the platform's integration features, allowing partners to read and write merchant data, and interact with other systems and platforms. Along with that, Haravan admin accounts are used to read and write data about commerce stores, products, orders, etc. For Haravan partner accounts are used to access the data found in the **Partner Dashboard**. This access enables Partners to effectively scale their business by automating their front and back office operations, freeing up time to focus on delivering value to Haravan merchants.

On this page, you'll find a list of operations the Haravan node supports and links to more resources.

{% hint style="info" %}
**Authentication and authorization:** Refer to [Haravan Authentication](https://docs.haravan.com/docs/tutorials/authentication/authentication-and-authorization) for guidance on setting up authentication and authorization.
{% endhint %}

## Basic Operations&#x20;

* Customer
  * Retrieve a list of customers
  * Search for customers that match a supplied query&#x20;
  * Retrieve detail of a customer
  * Retrieve the count of customers
  * Create customer
  * Delete a customer
  * Update customer
* Inventory&#x20;
  * Retrieve a list of inventory adjustments&#x20;
  * Retrieve a count of the inventory adjustments
  * Retrieve a single inventory adjustment
  * Create an inventory adjustment
* Order
  * Retrieve a list of all checkouts
  * Retrieve a count of all checkouts
  * Retrieve a list of orders
  * Retrieve a count of the orders
  * Retrieve a single order
  * Retrieves a list of refunds for an order
  * Retrieves a single refund for an order
  * Retrieves a list of transactions of an order
  * Retrieves a single transaction of an order by ID
  * Update order
  * Create an order
* Products
  * Retrieve a list of collects
  * Retrieve a count of all collects
  * Retrieve detail of a collect
  * Retrieve a list of products
  * Retrieve a count of the products
  * Retrieves single the product
  * Create a new product
  * Delete a product along with all its variants and images
  * Update a product
  * Delete a collect
  * Create a new collect
* Shipping and fulfillment
  * Retrieves a list of fulfillments for an order
  * Retrieves the count of fulfillments for an order
  * Retrieves a single fulfillment for an order
  * Create a new fulfillment
  * Update an existing fulfillment
* Location
  * Retrieve a list of locations
  * Retrieve a single location

## Example Usage

This workflow allows you can create an account for a customer. This example usage workflow would use the following nodes. - [Start](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.start/) – Haravan 2.0.

<figure><img src="/files/JxKZ1KxouJtCFiyQwvIK" alt=""><figcaption><p>Workflow if user have an access token</p></figcaption></figure>

If you don't have an access token yet. Your workflow is. - [Start](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.start/) – Haravan Authentication – Haravan 2.0.

<figure><img src="/files/knBc5D1PWdsiydnZ7F3b" alt=""><figcaption><p>Workflow if the user doesn't have an access token yet</p></figcaption></figure>

### 1. Start node

&#x20; The start node exists by default when you create a new workflow.

### 2. Haravan Authentication node

**note**: If you have an **access token** please skip this section and move to section *3. Haravan Node*

To use Haravan Authentication node, register a partner account and create an app at <https://accounts.haravan.com/Account/Login>.&#x20;

Instructions are available at <https://docs.haravan.com/docs/get-started/create-app/>.

When you create app successfully please go to **Commerce** section in the navigation bar.

![](/files/Auwhb29CAi5iTviG1Mn1)

After that, you scroll to scopes section and choose scopes like in image.

<figure><img src="/files/Pm8JE7kxViLshsATQLcx" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/Q3Cvpy0LogpgoeqGETJx" alt=""><figcaption></figcaption></figure>

Save your change and back to n8n app.

You will use the Haravan Authentication node to get an **access token** to use other actions in the Haravan 2.0 node. Before that, you had to create new credentials to get the **code**.

* Click on the Add node or drag to connect button and enter Haravan Authentication in the search nodes box.
* Select **Create new credential** at **Credential to connect with** field.

<figure><img src="/files/KQjQej1f5WVfJzibo2If" alt=""><figcaption><p>Create your new credentials</p></figcaption></figure>

The screenshots below are required fields for your connect information needed to get the **code**.

<figure><img src="/files/DlsI4H7yJSWaImaDHgov" alt=""><figcaption></figcaption></figure>

After providing your Client **ID, Client Secret** choose **Grant Type** and **Redirect URI** and clicking **Connect my account** button the permissions window appears and show the permissions for your app. You can continue to get code by click **"YES"**

<figure><img src="/files/CBvFdH6H1AxXntzPWoOF" alt=""><figcaption></figcaption></figure>

After pressing the **"YES"** button, the browser will redirect to your **Redirect URI** attached to the **code**. Your code is the string after the equals operator. You can copy it to use in the next step.

<figure><img src="/files/tpz79U1y4rIsTfPBvtEL" alt=""><figcaption><p>get code window</p></figcaption></figure>

After getting a **code** you can close the **get code window** and back to the credential screen. Now you can turn off it and just click close when **Close without connecting** popup appears because Haravan doesn't have Authorization server support OAuth 2.0 protocol. This will not affect the further processes.

<figure><img src="/files/U8S8DTdRYxpmRcE2VpuQ" alt=""><figcaption></figcaption></figure>

Next, you will paste code provided to Code field. After that, you will click the **Execute node** button to get **access Token.**

<figure><img src="/files/GLALLSn84HgJMFRd3TJ3" alt=""><figcaption></figcaption></figure>

After executing Haravan Authentication node:

**note:** The AccessToken will be valid within 24 hours of receiving the code, as you can see in the photo below, the value of expires\_in attribute is 86400 by default. It means 86400 seconds is equivalent to 24 hours.

<figure><img src="/files/oVIYCLz29YNwzxq8q7B4" alt=""><figcaption><p>Haravan Authentication document about the expiry of AccessToken</p></figcaption></figure>

The expiry is returned with AccessToken in response after executing the Haravan Authentication node:

<figure><img src="/files/SEBwvDTHcskFN91E9zx5" alt=""><figcaption></figcaption></figure>

### 3. Haravan node

You will use the create customer action in the Haravan node to set the values for information on the customer and create a customer account that includes the information you just entered.

* Click on the Add node or drag to connect button and enter Haravan in the search nodes box.
* Search **Create customer** in the search Haravan Actions box.
* Select **Create new credential** at **Credential to connect with** field.

<figure><img src="/files/L20u5ZlokeTDP7MPxOMB" alt=""><figcaption></figcaption></figure>

* Enter **Access Token** of your app in the Access Token field

**note:** If you not get an access token from Haravan Authentication node, follow this link to get an access token [(How to get token of your app ?)](https://docs.haravan.com/docs/tutorials/authentication/authentication-and-authorization). On the contrary you will have to take the access\_token you received from Haravan Authentication node in order to enter Access Token field. After that, you can click save to finish creating credentials.

<figure><img src="/files/NBIfXVsz1LA383SGEqT4" alt=""><figcaption></figcaption></figure>

Now you can start creating a new customer.

* Enter the value of fields that you want to set customer account information.
* Click *Execute node to run a node.*

The screenshots below are some examples of some input fields for customer account information when creating a new customer account.

<figure><img src="/files/usuQwYkXJoCb1GzZNdvT" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/dv8fJokHJtayzN1XQhuo" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/J1UUEbp3BTk8v7cMyr38" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/C9UZCjDDBYX35Tt3vcPV" alt=""><figcaption></figcaption></figure>

After executing create customer action of Haravan node:&#x20;

<figure><img src="/files/H98Q2IqpIjJ8niGcTdwX" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs-tech.n8n.vn/haravan.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
