> For the complete documentation index, see [llms.txt](https://docs.etelecom.vn/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.etelecom.vn/tich-hop-api/zalo-cloud/zalo-cloud-api/khoi-tao-journey-token.md).

# Khởi tạo Journey Token

{% hint style="info" %}
**Lưu ý:**

* Đối với các API sử dụng cho Shop thì API\_KEY: [`<api_key>`](https://docs.etelecom.vn/tich-hop-api/shop/tai-khoan#api-key).Thông tin base\_url của [Shop](https://docs.etelecom.vn/tich-hop-api/shop/tai-khoan)
* Đối với các API sử dụng cho Partner thì API\_KEY: [`<shop_key>`](https://docs.etelecom.vn/tich-hop-api/partner/su-dung#ket-noi-lan-thu-hai-tro-di).Thông tin base\_url của [Partner](https://docs.etelecom.vn/tich-hop-api/partner/tai-khoan)
  {% endhint %}

{% openapi src="/files/yEC15i0shc48jxOVJGdy" path="$BASE\_URL.Zalo/CreateJourney" method="post" %}
[swagger (4).json](https://4211996220-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9CUTEBoYNqJaZqxNp3Eh%2Fuploads%2Fgit-blob-5e0edddf00255b233738981a3a16be5c3dc0881a%2Fswagger%20\(4\).json?alt=media)
{% endopenapi %}

**Request:**

```json
curl --location '$BASE_URL.Zalo/CreateJourney' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer $API_KEY' \
--data '{
    "oa_id": "<int64>",
    "phone": "<string>",
    "token_type": "unknown"
}'
```

**Response:**

```json
{
  "created_at": "2019-08-24T14:15:22Z",
  "error_code": 0,
  "error_message": "string",
  "expired_at": "2019-08-24T14:15:22Z",
  "id": "string",
  "is_charged": true,
  "journey_id": "string",
  "journey_token": "string",
  "phone": "string",
  "status": "Z",
  "updated_at": "2019-08-24T14:15:22Z"
}
```

**Cấu trúc body của request**

<table><thead><tr><th width="175.33333333333331">Tham số</th><th width="191">Kiểu dữ liệu</th><th>Mô tả</th></tr></thead><tbody><tr><td>oa_id<br><mark style="color:red;">require</mark></td><td>int64</td><td>ID của OA</td></tr><tr><td>phone<br><mark style="color:red;">require</mark></td><td>string</td><td><p>Số điện thoại của người nhận.</p><p>Lưu ý: SĐT phải được liên kết với tài khoản Zalo</p></td></tr><tr><td>token_type</td><td>string (uqTokenType) Enum</td><td><mark style="color:red;"><strong>"<code>unknown</code>" "<code>token_logistics_7</code>" "<code>token_logistics_30</code>" "<code>token_coach_bus_7</code>" "<code>token_coach_bus_30</code>"</strong></mark><br>Nếu không truyền token_type mặc định là <mark style="color:red;"><strong><code>token_logistics_7</code></strong></mark></td></tr></tbody></table>

**Cấu trúc thuộc tính dữ liệu trả về**

<table><thead><tr><th width="161.33333333333331">Tham số</th><th width="210">Kiểu dữ liệu</th><th>Mô tả</th></tr></thead><tbody><tr><td>id</td><td>int64</td><td>ID của journey trên hệ thống của eTelecom</td></tr><tr><td>journey_id</td><td>string</td><td>ID của journey</td></tr><tr><td>journey_token</td><td>string</td><td>Mã hành trình được kích hoạt</td></tr><tr><td>expires_at</td><td>string&#x3C;date-time></td><td>Thời gian hết hạn</td></tr><tr><td>phone</td><td>string</td><td>Số điện thoại người nhận</td></tr><tr><td>status</td><td>string</td><td>Trạng thái<br><mark style="color:red;"><strong><code>Z</code></strong></mark>: Mới tạo<br><mark style="color:red;"><strong><code>P</code></strong></mark>: Enable<br><mark style="color:red;"><strong><code>N</code></strong></mark>: Disable</td></tr><tr><td>error_code</td><td>int</td><td>Mã lỗi</td></tr><tr><td>error_message</td><td>string</td><td>Thông tin lỗi</td></tr><tr><td>is_charged</td><td>bool</td><td>Tính phí hay không tính phí</td></tr><tr><td>updated_at</td><td>string&#x3C;date-time></td><td>Thời gian cập nhật</td></tr><tr><td>created_at</td><td>string&#x3C;date-time></td><td>Thời gian tạo</td></tr></tbody></table>
