# Thanh toán Web Payment

## Giới thiệu dịch vụ <a href="#gioi-thieu-dich-vu" id="gioi-thieu-dich-vu"></a>

Là giải pháp hỗ trợ các đơn vị kinh doanh, đối tác có sở hữu website.

Khách hàng mua hàng tại website của đối tác, chọn VinID Pay là phương thức thanh toán, hệ thống sẽ điều hướng khách hàng sang cổng thanh toán VinID Pay.

Tại đây, khách hàng có quyền lựa chọn giữa 2 hình thức thanh toán sau:

* Sử dụng tài khoản VinID của khách hàng để đăng nhập trên cổng thanh toán và tiến hành thanh toán mà không cần mở ứng dụng VinID.
* Dùng tính năng quét mã trên ứng dụng VinID để quét mã QR hóa đơn được tạo trên cổng thanh toán để tiến hành thanh toán như các hình thức khác.

## Hướng dẫn người dùng sử dụng dịch vụ <a href="#luong-nguoi-dung-su-dung-dich-vu" id="luong-nguoi-dung-su-dung-dich-vu"></a>

![](/files/-MFUNapeOMSlwFqpiJPG)

## Trải nghiệm tính năng thanh toán&#x20;

Trải nghiệm tính năng thanh toán Web Payment bằng ví điện tử VinID tại[ ](https://demo.vinid.net/)[đây](https://demo.vinid.net)

## Sequence diagram <a href="#so-do-xu-ly-ky-thuat" id="so-do-xu-ly-ky-thuat"></a>

![](/files/-M9MTmfo_6ygvBFdbx3e)

## APIs <a href="#apis" id="apis"></a>

## Create order&#x20;

<mark style="color:green;">`POST`</mark> `{API-HOST}/merchant-integration/v1/orders/web-payment`

API to request payment via Payment Web

#### Request Body

| Name                 | Type   | Description                                                                                                                           |
| -------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------- |
| callback\_url        | string | Merchant's backend URL to receive IPN (Instant Payment Notification) from VinIB backend                                               |
| redirect\_url        | string | Merchant's frontend URL to redirect user from VinID Payment Website after payment process.                                            |
| expired\_in          | number | <p>Order timeout in minute. Can be set from <code>3</code> to <code>15</code>.<br>Default value is <code>15</code> if not defined</p> |
| description          | string | Description of order.                                                                                                                 |
| extra\_data          | object | Addition information of order. Merchant can add more data in JSON string format here for their business                               |
| order\_amount        | number | The amount which the user must to pay. Value must be large than 0.                                                                    |
| order\_currency      | string | Currency code. Currently only support `VND`                                                                                           |
| order\_reference\_id | string | <p>Order id from merchant system.<br>Maximum 35 characters length and need to be unique to refund and reconcile.</p>                  |
| pos\_code            | string | Merchant's terminal code registered in VinID system                                                                                   |
| service\_type        | string | Currently only support `PURCHASE`                                                                                                     |
| store\_code          | string | Merchant's store code registered in VinID system                                                                                      |

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

```
{
  "data": {
    "expiration": 0,//expiration time in timestamp
    "order_id": "string"
    "payment_url": "string"//Payment Web URL 
    "qr_code": "string",
    "qr_data": "string",
    "qr_url": "string"
  },
  "meta": {
    "code": 0,
    "message": "string"
  },
}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
Khi điều hướng người dùng v&#x1EC1;**`redirect_url`**&#x63;ủa merchant, VinID sẽ đính kèm thêm các tham số vào URL có định dạng như sau

*`return_url`?order\_id=`string`\&order\_reference\_id=`string`\&pay\_status=`string`*

Merchant có thể dựa vào các tham số này để tiếp tục nghiệp vụ sau thanh toán của mình
{% endhint %}

Thông tin thêm:

* [API Host](/tai-lieu-tich-hop/moi-truong-tich-hop.md#api-host)
* [Request Header](/tai-lieu-tich-hop/quy-tac-ket-noi/request-header.md)
* [Extra Data](/tai-lieu-tich-hop/quy-tac-ket-noi/extra-data.md)
* [Callback](/tai-lieu-tich-hop/dich-vu-thanh-toan-vinid-pay/callback-ipn.md)

## Thông tin mã lỗi

Tham khảo [Mã lỗi chung](/tai-lieu-tich-hop/bang-ma-loi.md)


---

# 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://developers.vinid.net/tai-lieu-tich-hop/dich-vu-thanh-toan-vinid-pay/loai-hinh-dich-vu-web-payment.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.
