# Thanh toán App to App

## Giới thiệu dịch vụ

Loại hình dịch vụ App to App là giải pháp thanh toán áp dụng cho đối tác có ứng dụng di dộng (Android/iOS) muốn hỗ trợ thanh toán trực tiếp qua ứng dụng VinID.

Khách hàng mua hàng trên ứng dụng của đối tác và chọn VinID Pay là phương thức thanh toán. Hệ thống sẽ tự động kết nối với ví VinID Pay và tiến hành thanh toán cho giao dịch của khách hàng.

Quá trình thanh toán sẽ diễn ra liên tục mà khách hàng không cần phải tự mở nhiều ứng dụng cùng lúc.

## Sơ đồ luồng trải nghiệm người dùng

![](/files/-M8is7S7nPVzrDlrTfCf)

## Sequence diagram

![Luồng xử lý hệ thống](/files/-M4Xq5TZzlbFODeGIEm1)

## APIs

## Create Order

<mark style="color:green;">`POST`</mark> `{API-HOST}/merchant-integration/v1/qr/create-transaction-order`

API to create new order

#### Request Body

| Name                 | Type   | Description                                             |
| -------------------- | ------ | ------------------------------------------------------- |
| extra\_data          | string | Thông tin thêm cho đơn hàng                             |
| order\_reference\_id | string | Mã đơn hàng của đối tác. Sử dụng để refund và đối soát. |
| order\_currency      | string | Mã tiền tệ ( VND )                                      |
| store\_code          | string | Mã cửa hàng                                             |
| description          | string | Thông tin mô tả đơn hàng                                |
| callback\_url        | string | Callback URL của đối tác                                |
| pos\_code            | string | Mã POS                                                  |
| order\_amount        | number | Số tiền thanh toán                                      |
| service\_type        | string | Giá trị mặc định = **PURCHASE**                         |
| user\_id             | string | User ID của đối tác                                     |

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

```
{
    "meta": {
        "code": 200,
        "message": "OK"
    },
    "data": {
        "signature": "",
        "order_id": "20190101T00300000001",
        "expired_at": 0
    }
}
```

{% endtab %}
{% endtabs %}

## &#x20;Query Order Status

<mark style="color:blue;">`GET`</mark> `{API-HOST}/merchant-integration/v1/qr/query/{order_id}`

API to check current order status

#### Path Parameters

| Name      | Type   | Description |
| --------- | ------ | ----------- |
| order\_id | string | Order ID    |

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

```
{
  "data": {
    "created_at": 0,
    "merchant_user_id": "string",
    "order_amount": 0,
    "order_id": "string",
    "pay_status": "string",
    "point_amount": 0,
    "transaction_id": "string",
    "updated_at": 0,
    "vnd_amount": 0
  },
  "meta": {
    "code": 0,
    "message": "string"
  }
}
```

{% endtab %}
{% endtabs %}

Thông tin thêm:

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

## Bảng mã lỗi

Tham khảo [Bảng mã lỗi](/tai-lieu-tich-hop/bang-ma-loi.md)&#x20;

## Mobile SDK

|                                                               iOS                                                               |                                                                 Android                                                                 |
| :-----------------------------------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------: |
| <img src="/files/-M1AQKOUkfc5Q-ENc7Hl" alt="" data-size="line"> [iOS Mobile SDK](https://github.com/VinID-lab/vinidpay-ios-sdk) | <img src="/files/-M1AQRdnVco69HsMGuDv" alt="" data-size="line"> [Android Mobile SDK](https://github.com/VinID-lab/vinidpay-android-sdk) |


---

# 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-app-to-app.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.
