1. v1
Tourwell Open APIs
  • Tổng quan
  • Hướng dẫn xác thực
  • API Zalo Mini App (Beta)
  • API Changelog
  • Error Response
  • Khách hàng
    • v1
      • Get by id
      • Get all customer
      • Create customer
      • Update customer
      • Get order history
      • Get destinations
      • Get guests
      • Get by id care history
      • Create company
      • Get all care history
      • Get all company
  • Đơn hàng
    • v1
      • Get by id
      • Get all order
      • Get Passengers Order
      • Create order tour
      • Create order product
      • Create order hotel
      • Create order flight
      • Confirm payment order
      • Cancel order
      • Import Order Flight
      • Get cost order
      • Create cost order
      • Update cost order
      • Delete cost order
      • Transfer operator
      • Create order multiple services
      • Add services to order.
      • Change order status
      • Add Passengers Order
      • Update Passenger Order
      • Delete Passenger Order
  • Điều hành
    • v1
      • Overview
      • Get row cost
      • Create row cost
      • Update row cost
      • Delete row cost
    • Phiếu đặt dịch vụ NCC
      • Get all
      • Get by id
  • Sản phẩm
    • v1
      • Create product
      • Get by id
      • Calendar pricing
      • Get all product
      • Get schedule by id
      • Update product
  • Chiết tinh giá
    • v1
  • Nhà cung cấp
    • v1
      • Get all suppliers
      • Get suppliers products
      • Get all tour guides
      • Create Supplier & Hotel
      • Create Prices Suppliers products
      • Append Prices Hotel
  • Lịch khởi hành
    • v1
      • Get all tour
      • Create tour
      • Get tour detail
      • Get tour orders
  • Lead (Cơ hội)
    • Overview
    • Update History
    • v1
      • Get all lead
      • Get by id
      • Create lead
      • Update lead
  • Báo giá
    • v1
      • Get all
      • Update schedules
      • Update policy
  • Khách sạn
    • v1
      • Get all hotel
      • Get by id
  • Kế toán
    • Phiếu thu
      • v1
        • Get all receipt
        • Create receipt
        • Cancel receipt
        • Update receipt
        • Confirm Receipt Success
    • Phiếu chi
      • v1
        • Get all payment
          GET
        • Confirm Payment
          POST
        • Get by id
          GET
        • Create payment
          POST
        • Get billing categories
          GET
    • Hóa đơn bán ra
      • Update invoice
      • Issue Invoice
      • Get by id
      • Cancel invoice
      • Get all invoice
    • Hóa đơn mua vào
      • Import
      • Get all
    • Thu hộ/Chi hộ
  • Phê duyệt
    • v1
      • Overview
      • Summary
      • Approvals
  • Cấu hình
    • Zalo ZNS
      • Danh sách Tag
      • Get token
    • Địa điểm
      • Search
    • Nhân sự nội bộ
      • Search
    • Webhook
      • Hướng dẫn cài đặt
    • Trạng thái khách hàng
      • Get All
    • Hạng thành viên
      • Get All
    • Loại dịch vụ
      • Get All
    • Mã sân bay
      • Get All Airport
    • Phương thức thanh toán
      • Get All
    • Nguồn bán hàng
      • Get All
    • Phễu chuyển đổi lead
      • Trạng thái lead
      • Trạng thái báo giá
    • Chi nhánh
      • Get all branch offices
    • Lý do hủy
      • Get all cancel reasons
  • Hướng dẫn tích hợp
    • Hướng dẫn tích hợp thanh toán trực tuyến qua Website và Tourwell
    • Hướng dẫn tích hợp thanh toán trực tuyến qua Website, Cổng thanh toán và Tourwell
    • Kết nối hệ thống báo giá, chốt đơn nội bộ với Tourwell
    • Hướng dẫn đẩy lead và đơn hàng về Tourwell
  • MCP
    • Kết nối Claude với TourWell (dành cho nhân viên)
    • Kết nối Claude với TourWell (dành cho quản trị viên)
  • Schemas
    • ErrorResponse
  1. v1

Create payment

POST
/api/v1/billings/payments
Tạo phiếu chi (đề nghị thanh toán). Phiếu tạo ra ở trạng thái Chưa duyệt / Chưa thanh toán, giống phiếu lập tay trên màn quản trị.
Sau khi chuyển tiền, gọi Confirm payment (POST /billings/payments/{id}/confirm-payment) để xác nhận đã chi.
Chọn 1 trong 4 cách dùng:
Cách dùngTruyền gìKết quả
Chi nhà cung cấp theo tourpayee (supplier) + allocations với ref_type = tourPhiếu loại DNTT dịch vụ, tính vào số đã chi của NCC trong tour
Chi theo phiếu đặt dịch vụallocations với ref_type = book_serviceNhư trên, có gắn phiếu đặt dịch vụ. Không cần payee, hệ thống lấy NCC của phiếu đặt
Chi khác theo đơn hàngtransaction_type = pay_other + allocations với ref_type = orderPhiếu Chi khác gắn đơn. Không truyền payee thì người nhận là khách của đơn
Chi ngoài theo hạng mụcbilling_category_id (lấy từ Get billing categories)Phiếu chi văn phòng, lương… không gắn tour/đơn
Không truyền allocations và billing_category_id → phiếu DNTT dịch vụ không tham chiếu.
Quy tắc:
allocations: một phiếu chỉ dùng một loại ref_type; tổng amount phải bằng total_amount.
billing_category_id không dùng cùng transaction_type hoặc allocations.
Phiếu ngoại tệ: truyền currency + exchange_rate; total_amount và amount tính theo ngoại tệ.
signature_flow_id: ID luồng duyệt phiếu chi. Không truyền → phiếu không có luồng duyệt
(trừ khi hạng mục chi đã gắn sẵn luồng duyệt).
Nếu doanh nghiệp bật chặn chi vượt, phiếu làm tổng đã chi + đang đề nghị của NCC trong tour
vượt số phải trả sẽ bị từ chối với 422 và message nêu rõ số vượt.
Chống tạo trùng: truyền external_ref (kèm external_source nếu có). Gửi lại cùng mã → trả 200
với phiếu đã tạo và duplicated = true, không tạo phiếu mới. Có thể thử lại khi timeout.
Chưa hỗ trợ qua API: hoàn tiền khách, đặt cọc, ứng tiền tour, chi hoa hồng, đính kèm file.

Request

Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
Header Params

Body Params application/json

Examples
{
    "total_amount": 15000000,
    "description": "Thanh toán tiền ăn đoàn TD123924102026",
    "payee": {
        "type": "supplier",
        "id": 13
    },
    "bank_account": {
        "bank_name": "Vietcombank",
        "account_holder": "NGUYEN VAN A",
        "account_number": "0011001234567"
    },
    "allocations": [
        {
            "ref_type": "tour",
            "ref_code": "TD123924102026",
            "amount": 15000000
        }
    ],
    "payment_date": "05/12/2026",
    "signature_flow_id": 3,
    "external_ref": "PAY-2026-0001",
    "external_source": "erp"
}

Request Code Samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
cURL
curl --location 'https://demo.tourwell.net/api/v1/billings/payments' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
    "total_amount": 15000000,
    "description": "Thanh toán tiền ăn đoàn TD123924102026",
    "payee": {
        "type": "supplier",
        "id": 13
    },
    "bank_account": {
        "bank_name": "Vietcombank",
        "account_holder": "NGUYEN VAN A",
        "account_number": "0011001234567"
    },
    "allocations": [
        {
            "ref_type": "tour",
            "ref_code": "TD123924102026",
            "amount": 15000000
        }
    ],
    "payment_date": "05/12/2026",
    "signature_flow_id": 3,
    "external_ref": "PAY-2026-0001",
    "external_source": "erp"
}'

Responses

🟢200Đã tồn tại
application/json
Gửi lại cùng external_ref - trả phiếu đã tạo, không tạo mới
Bodyapplication/json

Example
{
    "success": true,
    "message": "Payment voucher already exists",
    "data": {
        "id": 1357,
        "code": "PC1155",
        "description": "Thanh toán tiền ăn đoàn TD123924102026",
        "is_canceled": false,
        "external_source": "erp",
        "external_ref": "PAY-2026-0001",
        "duplicated": true
    }
}
🟢201Tạo thành công
🟠400Body rỗng
🟠401Chưa xác thực
🟠409Trùng mã ngoài
🟠415Sai Content-Type
🟠422Sai dữ liệu
Modified at 2026-12-03 01:48:43
Previous
Get by id
Next
Get billing categories
Built with