> For the complete documentation index, see [llms.txt](https://docs.dmall.com.vn/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.dmall.com.vn/api-dang-ky-goi-cuoc-vien-thong.md).

# API đăng ký gói cước viễn thông

## API lấy mã OTP&#x20;

## API dùng để lấy mã OTP đăng ký gói cước viễn thông

<mark style="color:green;">`POST`</mark> `https://api.dmall.com.vn/api-customer/public/order/partner/get-otp`

#### Headers

| Name                                      | Type   | Description                 |
| ----------------------------------------- | ------ | --------------------------- |
| api-key<mark style="color:red;">\*</mark> | String | Mã api-key dùng để xác thực |

#### Request Body

| Name                                          | Type   | Description                                            |
| --------------------------------------------- | ------ | ------------------------------------------------------ |
| phone<mark style="color:red;">\*</mark>       | String | Số thuê bao đăng ký gói cước                           |
| utmSource                                     | String |                                                        |
| utmMedium                                     | String |                                                        |
| utmContent                                    | String |                                                        |
| utmCampaign                                   | String |                                                        |
| productCode<mark style="color:red;">\*</mark> | Double | Mã gói cước nhà mạng cung cấp. Ví dụ **V200B**         |
| telcoCode<mark style="color:red;">\*</mark>   | String | Mã nhà mạng. Hiện tại hỗ trợ **VIETTEL**, **MOBIFONE** |

{% tabs %}
{% tab title="200: OK Tạo giao dịch thành công" %}

```json
{
	"data": {
		"orderCode": "DG20231113172059456724",
		"telcoTransId": "102996904"
	},
	"errorCode": 200,
	"message": "Tạo giao dịch thành công",
	"success": true,

}
```

{% endtab %}
{% endtabs %}

### Ví dụ&#x20;

{% tabs %}
{% tab title="RequestBody" %}

```json
{
	"telcoCode": "MOBIFONE",
	"productCode": "6C120",
	"phone": "0936004420",
	"utmCampaign": "",
	"utmContent": "",
	"utmMedium": "",
	"utmSource": ""
}
```

{% endtab %}

{% tab title="cURL" %}

```json
curl --location 'https://api.dmall.com.vn/api-customer/public/order/partner/get-otp'
--header 'api-key: 6vZNjMXffyBXCqqSw3dMULc5OZgSxZnN'
--header 'Content-Type: application/json'
--data '{ "telcoCode": "VIETTEL", "productCode": "MP5X", "phone": "0337880699", "utmCampaign": "", "utmContent": "", "utmMedium": "", "utmSource": "" }'
```

{% endtab %}
{% endtabs %}

## API đăng ký gói cước với OTP

## API dùng để đăng ký gói cước viễn thông qua OTP

<mark style="color:green;">`POST`</mark> `https://api.dmall.com.vn/api-customer/public/order/partner/register_with_otp`

#### Headers

| Name                                      | Type   | Description                 |
| ----------------------------------------- | ------ | --------------------------- |
| api-key<mark style="color:red;">\*</mark> | String | Mã api-key dùng để xác thực |

#### Request Body

| Name                                        | Type   | Description                                         |
| ------------------------------------------- | ------ | --------------------------------------------------- |
| otp<mark style="color:red;">\*</mark>       | String | Mã OTP nhận được ở tin nhắn gửi về                  |
| orderCode<mark style="color:red;">\*</mark> | String | Mã giao dịch nhận được khi tạo giao dịch thành công |

{% tabs %}
{% tab title="200: OK Đăng ký thành công" %}

```json
{
	"success": true,
	"errorCode": 200,
	"message": "Đăng ký gói cước thành công",
	"data": {
		"type": "CALL/SMS",
		"code": "MP5X",
	}
}
```

{% endtab %}
{% endtabs %}

### Ví dụ

{% tabs %}
{% tab title="RequestBody" %}

```json
{
	"orderCode": "DG20231113172847592599",
	"otp": "246595"
}
```

{% endtab %}

{% tab title="cURL" %}

```json
curl --location 'https://api.dmall.com.vn/api-customer/public/order/partner/register_with_otp' \
--header 'api-key: 6vZNjMXffyBXCqqSw3dMULc5OZgSxZnN' \
--header 'Content-Type: application/json' \
--data '{
    "orderCode": "DG20231113172847592599",
    "otp": "246595"
}'
```

{% endtab %}
{% endtabs %}

```json
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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.dmall.com.vn/api-dang-ky-goi-cuoc-vien-thong.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.
