# Haravan

## 1. Tạo app

Bước 1: Truy cập <https://developers.haravan.com/apps> để đăng nhập tạo app

Bước 2: Sau khi đăng nhập ấn “Create App”\ <br>

<figure><img src="https://wiki.getfly.vn/public/img/images/mAI/Untitled%20(7).png" alt=""><figcaption></figcaption></figure>

<figure><img src="https://wiki.getfly.vn/public/img/images/mAI/Untitled%20(6).png" alt=""><figcaption></figcaption></figure>

\
\
&#x20;

Bước 3: Nhập tên app và redirect url

* Thêm 2 redirect url có dạng sau: **https\://{{domain}}/api/haravan/login** và **https\://{{domain}}/api/haravan/grandservice**

* {{domain}} là domain của CRM\
  Ví dụ Domain Getfly của anh/chị là: phienbanmoi.getflycrm.com \
  \=> <https://phienbanmoi.getflycrm.com/api/haravan/login\\>
  và <https://phienbanmoi.getflycrm.com/api/haravan/grandservice><br>

  <figure><img src="https://wiki.getfly.vn/public/img/images/mAI/Untitled%20(8).png" alt=""><figcaption></figcaption></figure>

* Tích chọn "Hybrid"

![](https://wiki.getfly.vn/public/img/images/Chinh/Chinh%202s/v/v.png)

* Sau đó ấn “Create” để tạo app \
  &#x20;

  ## 2.  Đăng ký webhook

  Bước 1: Click vào chi tiết app vừa tạo ⇒ Chọn webhook ⇒ Register \ <br>

  <figure><img src="https://wiki.getfly.vn/public/img/images/mAI/Untitled%20(9).png" alt=""><figcaption></figcaption></figure>

Bước 2: Nhập thông tin

* Callback URL có dạng: [https://{{domain}}/webhook/haravan](https://2020.getflycrm.com/webhook/haravan)
* Verify token: Api key lấy từ phần tích hợp của CRM

Bước 3: Đăng ký các sự kiện nhận webhook:

* Tạo đơn hàng\
  \- Thông tin đơn hàng đổ về bao gồm: tên khách hàng, sđt, email, địa chỉ, thông tin sản phẩm, nguồn đơn hàng

  \- Auto có áp dụng cho khách hàng, đơn hàng đổ về từ Haravan\
  \- Chỉ ghi nhận nguồn đơn hàng theo nguồn được chọn khi lên đơn hàng (nguồn đơn hàng tương ứng vs kênh bán hàng trên Haravan)&#x20;

  <br>

  <figure><img src="https://wiki.getfly.vn/public/img/images/mAI/Untitled%20(10).png" alt=""><figcaption></figcaption></figure>

* Tạo khách hàng&#x20;

\- Thông tin khách hàng đổ về bao gồm: tên khách hàng, sđt, email, giới tính, mô tả, sinh nhật, địa chỉ, tỉnh tp, quận huyện

\- Cơ chế check trùng khách hàng đã tồn tại trên Getfly:  Hệ thống bắt buộc mở cả kiểm tra trùng và không cho phép trùng đối với sdt, email thì khi có khách hàng về từ Haravan mới kiểm tra trùng được.\
\- Automation có áp dụng cho khách hàng, đơn hàng đổ về từ Haravan\
\- Nguồn khách hàng hiển thị là haravan

![](https://wiki.getfly.vn/public/img/images/mAI/Untitled%20\(11\).png)

#### &#x20;<br>

<figure><img src="https://wiki.getfly.vn/public/img/images/wiki/mai%203/Screenshot_38.png" alt=""><figcaption></figcaption></figure>

####

## 3. Cập nhật scope

![](https://wiki.getfly.vn/public/img/images/1/th%E1%BA%A3o/1.png)

![](https://wiki.getfly.vn/public/img/images/1/th%E1%BA%A3o/2.png)

## 4. Lấy thông tin tích hợp vào CRM

Bước 1: Click vào chi tiết app vừa tạo ở trên \ <br>

<figure><img src="https://wiki.getfly.vn/public/img/images/mAI/Untitled%20(12).png" alt=""><figcaption></figcaption></figure>

<figure><img src="https://wiki.getfly.vn/public/img/images/mAI/Untitled%20(13).png" alt=""><figcaption></figcaption></figure>

\
\
Copy Client ID và Client Secret để tích hợp vào CRM \ <br>

<figure><img src="https://wiki.getfly.vn/public/img/images/mai/Untitled%20(14).png" alt=""><figcaption></figcaption></figure>

\
Nhập thông tin vừa copy vào ô input tương ứng và ấn “Kết nối” ⇒ “Đồng ý” ⇒ “Đồng ý”<br>

<figure><img src="https://wiki.getfly.vn/public/img/images/mai/Untitled%20(15).png" alt=""><figcaption></figcaption></figure>

Sau khi kết nối thành công ấn “Đăng ký webhook” để nhận webhook khi tạo đơn hàng và khách hàng trên Haravan&#x20;

<figure><img src="https://wiki.getfly.vn/public/img/images/mai/Untitled%20(16).png" alt=""><figcaption></figcaption></figure>

\
\
Nếu đơn hàng đã thanh toán, khi tạo đơn hàng trên Haravan chọn “Đã thanh toán” => Đơn hàng đổ về Getfly sẽ hiển thị log thanh toán trực tiếp ở bảng log thanh toán trong đơn hàng\
\ <br>

<figure><img src="https://wiki.getfly.vn/public/img/images/mai/Untitled%20(17).png" alt=""><figcaption></figcaption></figure>

\
\
Nếu đơn hàng chưa thanh toán, khi tạo đơn hàng trên Haravan chọn Thanh toán sau  => đơn hàng đổ về Getfly sẽ ghi nhận là chưa thanh toán\ <br>

<figure><img src="https://wiki.getfly.vn/public/img/images/mai/Screenshot_687.png" alt=""><figcaption></figcaption></figure>

<figure><img src="https://wiki.getfly.vn/public/img/images/mai/Untitled%20(17).png" alt=""><figcaption></figcaption></figure>

* Webhook tạo khách hàng không trả về thông tin người dùng nên người phụ trách sẽ lấy theo cài đặt trên CRM.
* Người thực hiện đơn hàng sẽ check theo email, nếu email người dùng trên CRM trùng với email người dùng trên Haravan thì sẽ lấy người đó là người thực hiện đơn hàng.
* Khách hàng tạo từ webhook tạo mới đơn hàng sẽ lấy người thực hiện đơn hàng là người phụ trách.

### 5. Video hướng dẫn

{% embed url="<https://youtu.be/PSbcqFncR4Y?si=tCRp-44y3Z4pu1FY>" %}


---

# 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://helpdesk4.getfly.vn/huong-dan-su-dung/doi-tac-ket-noi/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.
